Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"SemanticCodeSearch": {
"args": [
"run",
"--rm",
"-i",
"-e",
"ELASTICSEARCH_CLOUD_ID=<your_cloud_id>",
"-e",
"ELASTICSEARCH_API_KEY=<your_api_key>",
"-e",
"ELASTICSEARCH_INDEX=<your_index>",
"simianhacker/semantic-code-search-mcp-server",
"node",
"dist/src/mcp_server/bin.js",
"stdio"
],
"command": "docker"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
This project includes a Model Context Protocol (MCP) server that exposes the indexed data through a standardized set of tools. This allows AI coding agents to interact with the indexed codebase in a structured way.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'github' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked github against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools / search
Web and local search using Brave Search API
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Production ready MCP server with real-time search, extract, map & crawl.
MCP Security Weekly
Get CVE alerts and security updates for Semantic Code Search Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
This project includes a Model Context Protocol (MCP) server that exposes the indexed data through a standardized set of tools. This allows AI coding agents to interact with the indexed codebase in a structured way.
You must index your code base with the Semantic Code Search Indexer found here: https://github.com/elastic/semantic-code-search-indexer
This MCP server expects the locations-first index model from indexer PR elastic/semantic-code-search-indexer#135:
<index> stores content-deduplicated chunk documents (semantic search + metadata).<index>_locations stores one document per chunk occurrence (file path + line ranges + directory/git metadata) and references chunks by chunk_id.Several tools query <index>_locations and join back to <index> via chunk_id (typically using mget).
The easiest way to run the MCP server is with Docker. The server is available on Docker Hub as simianhacker/semantic-code-search-mcp-server.
To ensure you have the latest version of the image, run the following command before running the server:
docker pull simianhacker/semantic-code-search-mcp-server
This mode is useful for running the server in a containerized environment where it needs to be accessible over the network.
docker run --rm -p 3000:3000 \
-e ELASTICSEARCH_ENDPOINT=<your_elasticsearch_endpoint> \
simianhacker/semantic-code-search-mcp-server
Replace <your_elasticsearch_endpoint> with the actual endpoint of your Elasticsearch instance.
This mode is useful for running the server as a local process that an agent can communicate with over stdin and stdout.
With Elasticsearch Endpoint:
docker run -i --rm \
-e ELASTICSEARCH_ENDPOINT=<your_elasticsearch_endpoint> \
simianhacker/semantic-code-search-mcp-server \
node dist/src/mcp_server/bin.js stdio
With Elastic Cloud ID:
docker run -i --rm \
-e ELASTICSEARCH_CLOUD_ID=<your_cloud_id> \
-e ELASTICSEARCH_API_KEY=<your_api_key> \
simianhacker/semantic-code-search-mcp-server \
node dist/src/mcp_server/bin.js stdio
The -i flag is important as it tells Docker to run the container in interactive mode, which is necessary for the server to receive input from stdin.
You can connect a coding agent to the server in either HTTP or STDIO mode.
HTTP Mode:
For agents that connect over HTTP, like the Gemini CLI, you can add the following to your ~/.gemini/settings.json file:
{
"mcpServers": {
"Semantic Code Search": {
"trust": true,
"httpUrl": "http://localhost:3000/mcp/",
}
}
}
STDIO Mode:
For agents that connect over STDIO, you need to configure them to run the Docker command directly. Here's an example for the Gemini CLI in your ~/.gemini/settings.json file:
{
"mcpServers": {
"SemanticCodeSearch": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e", "ELASTICSEARCH_CLOUD_ID=<your_cloud_id>",
"-e", "ELASTICSEARCH_API_KEY=<your_api_key>",
"-e", "ELASTICSEARCH_INDEX=<your_index>",
"simianhacker/semantic-code-search-mcp-server",
"node", "dist/src/mcp_server/bin.js", "stdio"
]
}
}
}
Remember to replace the placeholder values for your Cloud ID, API key, and index name.
git clone <repository-url>
cd semantic-code-search-mcp-server
npm install
Copy the .env.example file and update it with your Elasticsearch credentials.
cp .env.example .env
``
... [View full README on GitHub](https://github.com/elastic/semantic-code-search-mcp-server#readme)