
Socraticode
Brings local codebase intelligence to Claude through hybrid semantic and BM25 search, AST-aware dependency graphs, and symbol-level impact analysis across 18 languages. Runs entirely in Docker with Qdrant, indexing projects up to 40M+ lines with automatic file watching and resumable checkpoints. Exposes tools for querying code structure, tracing call flows, and analyzing blast radius without leaving your machine. Particularly strong on multi-repo setups where you need cross-project search or want to visualize circular dependencies. The indexer automatically picks up database schemas, API specs, and infra configs as searchable artifacts. If you're tired of grep or want smaller models to handle architectural questions, this gives them the precomputed context to do it.
- GitHub stars
- 3.4K
- tools
- 25
- auth
- Secret needed
- transport
- STDIO
- env vars
- 17
- last updated
- Nov 5, 2026
Install
From registry metadata$ npx add-mcp socraticode --name socraticode --env 'OPENAI_API_KEY=${OPENAI_API_KEY}' --env 'GOOGLE_API_KEY=${GOOGLE_API_KEY}' --env 'OLLAMA_API_KEY=${OLLAMA_API_KEY}' --env 'LMSTUDIO_API_KEY=${LMSTUDIO_API_KEY}' --env 'LITELLM_API_KEY=${LITELLM_API_KEY}' --env 'QDRANT_API_KEY=${QDRANT_API_KEY}'Run in your terminal. add-mcp asks which agents to add it to, then asks for each value it needs. Add -g to install it for every project.
Review the command, arguments and environment values before installing. MCP servers run with your local permissions.
Other ways
Claude Code
$ claude mcp add socraticode --env EMBEDDING_PROVIDER=YOUR_EMBEDDING_PROVIDER --env OPENAI_API_KEY=YOUR_OPENAI_API_KEY --env GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY --env OLLAMA_URL=YOUR_OLLAMA_URL --env EMBEDDING_MODEL=YOUR_EMBEDDING_MODEL --env EMBEDDING_DIMENSIONS=YOUR_EMBEDDING_DIMENSIONS --env OLLAMA_MODE=YOUR_OLLAMA_MODE --env OLLAMA_API_KEY=YOUR_OLLAMA_API_KEY --env LMSTUDIO_URL=YOUR_LMSTUDIO_URL --env LMSTUDIO_API_KEY=YOUR_LMSTUDIO_API_KEY --env LMSTUDIO_ALLOW_MISSING_MODEL_LISTING=YOUR_LMSTUDIO_ALLOW_MISSING_MODEL_LISTING --env LITELLM_URL=YOUR_LITELLM_URL --env LITELLM_API_KEY=YOUR_LITELLM_API_KEY --env LITELLM_SEND_DIMENSIONS=YOUR_LITELLM_SEND_DIMENSIONS --env QDRANT_MODE=YOUR_QDRANT_MODE --env QDRANT_URL=YOUR_QDRANT_URL --env QDRANT_API_KEY=YOUR_QDRANT_API_KEY -- npx -y socraticodeRun in your terminal. Replace YOUR_* placeholders with real values; add --scope user to install for every project.
Tools
Verified live · 25 toolsVerified live against the running server on Jun 10, 2026.
codebase_indexStart indexing a codebase in the background. Returns immediately. Call codebase_status to poll progress until 100%. Do NOT search until indexing is complete. If already indexing, returns current progress.2 params
Start indexing a codebase in the background. Returns immediately. Call codebase_status to poll progress until 100%. Do NOT search until indexing is complete. If already indexing, returns current progress.
extraExtensionsstringprojectPathstringcodebase_updateIncrementally update an existing codebase index. Only re-indexes changed files. Runs synchronously. Usually not needed if file watcher is active.2 params
Incrementally update an existing codebase index. Only re-indexes changed files. Runs synchronously. Usually not needed if file watcher is active.
extraExtensionsstringprojectPathstringcodebase_removeRemove a project's codebase index entirely from the vector database. Safely stops the file watcher, cancels any in-progress indexing/update (with drain), and waits for any in-flight graph build before deleting.1 params
Remove a project's codebase index entirely from the vector database. Safely stops the file watcher, cancels any in-progress indexing/update (with drain), and waits for any in-flight graph build before deleting.
projectPath*stringcodebase_stopGracefully stop an in-progress indexing operation. The current batch will finish and checkpoint, preserving all progress. Re-run codebase_index to resume from where it left off.1 params
Gracefully stop an in-progress indexing operation. The current batch will finish and checkpoint, preserving all progress. Re-run codebase_index to resume from where it left off.
projectPathstringcodebase_watchStart/stop watching a project directory for file changes and automatically update the index. When starting, first runs an incremental update to catch any changes made since the last session, then keeps the index up to date via debounced file system watching.2 params
Start/stop watching a project directory for file changes and automatically update the index. When starting, first runs an incremental update to catch any changes made since the last session, then keeps the index up to date via debounced file system watching.
action*stringstart · stop · statusprojectPathstringcodebase_searchSemantic search across an indexed codebase. Only use after codebase_index is complete (check codebase_status first). Returns relevant code chunks matching a natural language query.7 params
Semantic search across an indexed codebase. Only use after codebase_index is complete (check codebase_status first). Returns relevant code chunks matching a natural language query.
fileFilterstringincludeLinkedbooleanlanguageFilterstringlimitnumberminScorenumberprojectPathstringquery*stringcodebase_statusCheck index status: chunk count, indexing progress (%), last completed operation, file watcher state. Call after codebase_index to poll until 100% complete.1 params
Check index status: chunk count, indexing progress (%), last completed operation, file watcher state. Call after codebase_index to poll until 100% complete.
projectPathstringcodebase_graph_buildBuild a dependency graph of the codebase using static analysis (ast-grep). Maps import/require/export relationships between files. Runs in the background — call codebase_graph_status to poll progress until complete.2 params
Build a dependency graph of the codebase using static analysis (ast-grep). Maps import/require/export relationships between files. Runs in the background — call codebase_graph_status to poll progress until complete.
extraExtensionsstringprojectPathstringcodebase_graph_queryQuery the code dependency graph for a specific file. Returns what the file imports and what files depend on it.2 params
Query the code dependency graph for a specific file. Returns what the file imports and what files depend on it.
filePath*stringprojectPathstringcodebase_graph_statsGet statistics about the code dependency graph: total files, edges, most connected files, orphan files, circular dependencies.1 params
Get statistics about the code dependency graph: total files, edges, most connected files, orphan files, circular dependencies.
projectPathstringcodebase_graph_circularFind circular dependencies in the codebase.1 params
Find circular dependencies in the codebase.
projectPathstringcodebase_graph_visualizeVisualise the code dependency graph. Two modes: • mode="mermaid" (default) — returns a Mermaid diagram (text) colour-coded by language, circular deps highlighted. Best for inline rendering inside chat, GitHub, or editors that render Mermaid. • mode="interactive" — writes a sel...3 params
Visualise the code dependency graph. Two modes: • mode="mermaid" (default) — returns a Mermaid diagram (text) colour-coded by language, circular deps highlighted. Best for inline rendering inside chat, GitHub, or editors that render Mermaid. • mode="interactive" — writes a sel...
modestringmermaid · interactiveopenbooleanprojectPathstringcodebase_graph_removeRemove a project's persisted code graph. Waits for any in-flight graph build to finish first. The graph can be rebuilt with codebase_graph_build or will be rebuilt automatically on the next codebase_index.1 params
Remove a project's persisted code graph. Waits for any in-flight graph build to finish first. The graph can be rebuilt with codebase_graph_build or will be rebuilt automatically on the next codebase_index.
projectPath*stringcodebase_graph_statusCheck the status of the code dependency graph: build progress (if building), node/edge count, when it was last built, whether it's cached in memory. Use this to poll progress after calling codebase_graph_build.1 params
Check the status of the code dependency graph: build progress (if building), node/edge count, when it was last built, whether it's cached in memory. Use this to poll progress after calling codebase_graph_build.
projectPathstringcodebase_impactImpact Analysis — return the BLAST RADIUS for a file or symbol. Lists every file (and, where helpful, function) that could break if you change the target. Polymorphic on target: a path-like string ('src/foo.ts') triggers file-mode; a name-like string ('validateUser') triggers...3 params
Impact Analysis — return the BLAST RADIUS for a file or symbol. Lists every file (and, where helpful, function) that could break if you change the target. Polymorphic on target: a path-like string ('src/foo.ts') triggers file-mode; a name-like string ('validateUser') triggers...
depthnumberprojectPathstringtarget*stringcodebase_flowTrace the EXECUTION FLOW forward from an entry point — what does this code call into? With NO args, returns a ranked list of auto-detected entry points (orphans with outgoing calls, conventional names like main(), framework routes, tests). With an entrypoint argument, returns...4 params
Trace the EXECUTION FLOW forward from an entry point — what does this code call into? With NO args, returns a ranked list of auto-detected entry points (orphans with outgoing calls, conventional names like main(), framework routes, tests). With an entrypoint argument, returns...
depthnumberentrypointstringfilestringprojectPathstringcodebase_symbol360° view of a symbol: definition, kind, callers, callees, confidence levels. Use to understand a function or class before changing it.3 params
360° view of a symbol: definition, kind, callers, callees, confidence levels. Use to understand a function or class before changing it.
filestringname*stringprojectPathstringcodebase_symbolsList symbols in a file, or search by name across the project. Use to discover what exists before drilling into a single symbol with codebase_symbol.4 params
List symbols in a file, or search by name across the project. Use to discover what exists before drilling into a single symbol with codebase_symbol.
filestringlimitnumberprojectPathstringquerystringcodebase_contextList all context artifacts defined in .socraticodecontextartifacts.json — database schemas, API specs, infra configs, architecture docs, etc. Shows each artifact's name, description, path, and index status. Use this to discover what project knowledge is available beyond source...1 params
List all context artifacts defined in .socraticodecontextartifacts.json — database schemas, API specs, infra configs, architecture docs, etc. Shows each artifact's name, description, path, and index status. Use this to discover what project knowledge is available beyond source...
projectPathstringcodebase_context_searchSemantic search across context artifacts (database schemas, API specs, infra configs, etc.) defined in .socraticodecontextartifacts.json. Auto-indexes on first use and auto-detects stale artifacts. Use this to find relevant infrastructure or domain knowledge.5 params
Semantic search across context artifacts (database schemas, API specs, infra configs, etc.) defined in .socraticodecontextartifacts.json. Auto-indexes on first use and auto-detects stale artifacts. Use this to find relevant infrastructure or domain knowledge.
artifactNamestringlimitnumberminScorenumberprojectPathstringquery*stringcodebase_context_indexIndex or re-index all context artifacts defined in .socraticodecontextartifacts.json. Chunks and embeds artifact content into the vector database for semantic search. Usually not needed — codebase_context_search auto-indexes on first use.1 params
Index or re-index all context artifacts defined in .socraticodecontextartifacts.json. Chunks and embeds artifact content into the vector database for semantic search. Usually not needed — codebase_context_search auto-indexes on first use.
projectPathstringcodebase_context_removeRemove all indexed context artifacts for a project from the vector database. Blocked while indexing is in progress — use codebase_stop or wait for the operation to finish first.1 params
Remove all indexed context artifacts for a project from the vector database. Blocked while indexing is in progress — use codebase_stop or wait for the operation to finish first.
projectPath*stringcodebase_healthCheck the health of all infrastructure: Docker, Qdrant container, Ollama, and embedding model. Use this to diagnose setup issues.
Check the health of all infrastructure: Docker, Qdrant container, Ollama, and embedding model. Use this to diagnose setup issues.
No parameters. Call it with no arguments.
codebase_list_projectsList all projects that have been indexed (have collections in Qdrant).
List all projects that have been indexed (have collections in Qdrant).
No parameters. Call it with no arguments.
codebase_aboutDisplay information about SocratiCode — what it is, its tools and how to use it. Use this to get a quick overview of the MCP tools and their purpose.
Display information about SocratiCode — what it is, its tools and how to use it. Use this to get a quick overview of the MCP tools and their purpose.
No parameters. Call it with no arguments.
Sponsors
Configuration
EMBEDDING_PROVIDEREmbedding provider to use: ollama (default), openai, google, lmstudio, or litellm
OPENAI_API_KEYsecretAPI key for OpenAI embeddings (required only when EMBEDDING_PROVIDER=openai)
GOOGLE_API_KEYsecretAPI key for Google embeddings (required only when EMBEDDING_PROVIDER=google)
OLLAMA_URLURL of the Ollama server (default: auto-detected; Docker-managed or http://localhost:11434)
EMBEDDING_MODELEmbedding model name (defaults per provider; required for lmstudio and litellm)
EMBEDDING_DIMENSIONSEmbedding vector dimensions (defaults per provider; required for lmstudio and litellm)
OLLAMA_MODEOllama mode: auto (default), docker, or external
OLLAMA_API_KEYsecretOptional API key for authenticated Ollama proxies. Remote endpoints require HTTPS; loopback HTTP is supported.
LMSTUDIO_URLLM Studio OpenAI-compatible base URL (default: http://localhost:1234/v1)
LMSTUDIO_API_KEYsecretOptional API key when LM Studio authentication is enabled
LMSTUDIO_ALLOW_MISSING_MODEL_LISTINGAllow compatible embedding servers without a models endpoint to be probed directly
LITELLM_URLLiteLLM OpenAI-compatible base URL (default: http://localhost:4000/v1)
LITELLM_API_KEYsecretLiteLLM master or virtual API key (required when EMBEDDING_PROVIDER=litellm)
LITELLM_SEND_DIMENSIONSForward the dimensions parameter through LiteLLM when explicitly enabled
QDRANT_MODEQdrant mode: managed (default, Docker-managed) or external (user-provided instance)
QDRANT_URLFull URL for remote/cloud Qdrant (e.g. https://xyz.cloud.qdrant.io:6333). Only needed when QDRANT_MODE=external
QDRANT_API_KEYsecretAPI key for remote Qdrant instance. Only needed when QDRANT_MODE=external
Readme
Details
- Repository
- github.com/giancarloerra/socraticode
- Category
- Search & Web Crawling
- Package
socraticode- Transport
- STDIO
- Auth
- Required
- Registry
- MCP registry, active
- Tools verified
- Jun 10, 2026