I’m using “GitHub - elastic/mcp-server-elasticsearch”
- 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"
}
}
- 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"]
},