How to configure elasticsearch MCP for cody in vscode?

I’m using “GitHub - elastic/mcp-server-elasticsearch

  1. For github copilot, I configured next in mcp.json, and it works:
  "elasticsearch-mcp-server_local": {
      "command": "node",
      "args": [
        "C:/work/mcp-server-elasticsearch/dist/index.js"
      ],
      "env": {
        "ES_URL": "http://10.192.225.32:9200",
        "ES_USERNAME": "xxx",
        "ES_PASSWORD": "xxx",
        "OTEL_LOG_LEVEL": "none",
        "ES_VERSION": "8.12.1",
        "ES_SSL_SKIP_VERIFY": "true"
      }
    }
  1. For cody, I configured next in settings.json:
    "https://openctx.org/npm/@openctx/provider-modelcontextprotocol?elasticsearch": {
        "nodeCommand": "node",
        "mcp.provider.uri": "file:///work/mcp-server-elasticsearch/dist/index.js",
        "env": {
          "ES_URL": "http://10.192.225.32:9200",
          "ES_USERNAME": "xxx",
          "ES_PASSWORD": "xxx",
          "OTEL_LOG_LEVEL": "none",
          "ES_VERSION": "8.12.1",
          "ES_SSL_SKIP_VERIFY": "true"
        }
      }

It can’t work, report next error:

OpenCtx error (from provider https://openctx.org/npm/@openctx/provider-modelcontextprotocol?elasticsearch): Error: MCP error -1: Connection closed (stack trace follows)
Error: MCP error -1: Connection closed
    at Client._onclose (cjs-string:https://openctx.org/npm/@openctx/provider-modelcontextprotocol?elasticsearch:4679:19)
    at StdioClientTransport._transport.onclose (cjs-string:https://openctx.org/npm/@openctx/provider-modelcontextprotocol?elasticsearch:4656:12)
    at ChildProcess.<anonymous> (cjs-string:https://openctx.org/npm/@openctx/provider-modelcontextprotocol?elasticsearch:5180:72)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)

What’s the correct way to configure this? And how we can debug it? With openctx, I don’t see any special error related to MCP server.

BTW, next postgresql configure for cody is good in my vscode:

https://openctx.org/npm/@openctx/provider-modelcontextprotocol?postgres_local": {
        "nodeCommand": "node",
        "mcp.provider.uri": "file:///work/servers-archived/src/postgres/dist/index.js",
        "mcp.provider.args": ["postgresql://xxx:xxx@10.192.244.104:5432/lavaserver"]
      },

Hey @atline Thank you for reporting the issue.
Since MCP servers are still in experimental stage, I suspect that because only the ‘tool’ calls are supported in the Cody MCP part and not the “resource” and “prompt-template” part it therefore crashes.

Hi, @PriNova , in fact my company purchased the cody service and deployed one instance internal. Besides using it for coding assistant, we’d also like to see if could use it for some data analysis. So do you have some draft roadmap for MCP support in Cody? This help us to better arrange our internal project. Thanks!