SocratiCode
Lets your AI agent search and understand a whole codebase with semantic search, dependency graphs and impact analysis.
3.4k stars on GitHubby Giancarlo ErraLicense AGPL-3.0Updated 19 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add socraticode -- npx -y socraticode
What to fill in
| Name | What it is | Required |
|---|---|---|
EMBEDDING_PROVIDER | Embedding provider to use: ollama (default), openai, google, lmstudio, or litellm | No |
OPENAI_API_KEY | API key for OpenAI embeddings (required only when EMBEDDING_PROVIDER=openai) | No |
GOOGLE_API_KEY | API key for Google embeddings (required only when EMBEDDING_PROVIDER=google) | No |
OLLAMA_URL | URL of the Ollama server (default: auto-detected; Docker-managed or http://localhost:11434) | No |
EMBEDDING_MODEL | Embedding model name (defaults per provider; required for lmstudio and litellm) | No |
EMBEDDING_DIMENSIONS | Embedding vector dimensions (defaults per provider; required for lmstudio and litellm) | No |
OLLAMA_MODE | Ollama mode: auto (default), docker, or external | No |
OLLAMA_API_KEY | Optional API key for authenticated Ollama proxies | No |
LMSTUDIO_URL | LM Studio OpenAI-compatible base URL (default: http://localhost:1234/v1) | No |
LMSTUDIO_API_KEY | Optional API key when LM Studio authentication is enabled | No |
LMSTUDIO_ALLOW_MISSING_MODEL_LISTING | Allow compatible embedding servers without a models endpoint to be probed directly | No |
LITELLM_URL | LiteLLM OpenAI-compatible base URL (default: http://localhost:4000/v1) | No |
LITELLM_API_KEY | LiteLLM master or virtual API key (required when EMBEDDING_PROVIDER=litellm) | No |
LITELLM_SEND_DIMENSIONS | Forward the dimensions parameter through LiteLLM when explicitly enabled | No |
QDRANT_MODE | Qdrant mode: managed (default, Docker-managed) or external (user-provided instance) | No |
QDRANT_URL | Full URL for remote/cloud Qdrant (e.g. https://xyz.cloud.qdrant.io:6333). Only needed when QDRANT_MODE=external | No |
QDRANT_API_KEY | API key for remote Qdrant instance. Only needed when QDRANT_MODE=external | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Index this codebase.
What would break if I change the signature of this function?
What it is
SocratiCode indexes your codebase locally and gives your agent deep knowledge of it. It offers hybrid semantic and keyword search, dependency graphs, symbol-level impact analysis and searchable files such as database schemas and API specs. It is private and local by default, with the index kept up to date as files change.
What it can do
- Hybrid semantic and keyword search across the code
- Dependency graphs, including circular dependency views
- Symbol-level impact analysis and call-flow tracing
- Context artifacts such as database schemas, API specs and infra configs
codebase_update: refresh the indexcodebase_watch: start or restart the file watcher
When to use
- βΊWhen you work in a large codebase and grep is too slow or noisy.
- βΊWhen you want to know what a change might break before making it.
- βΊWhen several agents work on the same repo and should share one index.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
codegraphHelps your agent analyze an indexed codebase through its call graph, dependencies, dead code, hotspots and semantic search.sql-object-impact-analysisShows where a database item (table, column) is used before changing it. It helps understand the impact of changes across the entire system and code.graph-queryLets your agent query a code dependency graph to find callers, related components and the impact of a change before the code is edited.Frequently asked questions
Is it free and open source?
Yes. The readme calls it open source and completely free. A hosted Cloud version is in private beta.
Does my code leave my machine?
Not by default. Docker handles everything locally with no API keys. Cloud embeddings from OpenAI or Google Gemini are optional.
What does it need?
Node.js 18.17 or newer and Docker running.
How big a codebase can it handle?
The readme says it was tested on repositories up to and over about 40 million lines of code.
How long does first indexing take?
The readme says a few seconds to a few minutes depending on size, and under 10 minutes for over 3 million lines on a MacBook Pro M4.
Which tools can use it?
Any MCP host with local stdio servers, plus plugins for Claude Code, VS Code, Cursor and others.
If it does not work
- βΊMake sure Docker is running before you start, since the default setup uses it.
- βΊRestart your host after adding the server so it pulls images and starts Qdrant.
- βΊIf tools seem old, restart or reconnect the server so npx fetches the latest release.
5 new skills a week. 1 minute to read.