← Back to directory
S

SocratiCode

Community
Local, private codebase intelligence: hybrid semantic search and dependency-impact analysis for enterprise-scale repos
GitHub source repository ↗
★ 3.2k Stars Category · Dev Tools Very popular
67FMRS · C
Reliability
9/20
Security and permissions
14/20
Maintenance
13/20
Documentation
18/20
Setup experience
13/20

SocratiCode is a fairly comprehensive local codebase-intelligence MCP server offering hybrid semantic search, polyglot dependency graphs, and symbol-level impact analysis, running by default in local Docker containers with no API key required — well suited for deep exploration of large, multi-language repositories. Adopting it means accepting locally-run Docker containers, optional cloud API keys for alternate embedding providers, and AGPL-3.0 licensing terms; the documentation is explicit that its static-analysis call graph has blind spots around dynamic dispatch and framework magic, so impact-analysis results should be paired with manual review.

Read the FMRS scoring method →

SocratiCode is an open-source MCP server that gives AI assistants deep semantic understanding of a codebase. It runs hybrid semantic + BM25 (RRF-fused) search on top of Qdrant (vector database) and Ollama (local embeddings by default, switchable to OpenAI or Google), uses ast-grep for AST-aware chunking across 18+ languages, and builds a polyglot dependency graph with symbol-level impact analysis (blast radius), call-flow tracing, circular-dependency detection, and an interactive HTML graph viewer. It also supports cross-project and branch-aware search, and indexing of non-code knowledge such as database schemas, API specs, and infra configs. The README reports, from a benchmark on VS Code's 2.45M-line codebase, 61% less context, 84% fewer tool calls, and 37x faster responses versus grep-based exploration. By default everything runs locally via Docker with no API keys required and no code leaving the machine; cloud embedding providers and external Qdrant instances are optional. The project is licensed under AGPL-3.0 and also offers a separate paid cloud offering (SocratiCode Cloud) currently in private beta.

Tools

codebase_index
Starts a full background index of a codebase (chunking, embedding, and writing to Qdrant); poll codebase_status for progress.
codebase_stop
Gracefully stops an in-progress indexing operation — the current batch finishes and checkpoints so codebase_index can resume later.
codebase_update
Incremental update that only re-processes files changed since the last index.
codebase_remove
Removes a project's index, stopping its watcher and canceling any in-flight indexing/update operation first.
codebase_watch
Starts or stops file watching: on start it catches up on missed changes, then watches for future ones.
codebase_search
Hybrid semantic + keyword search (dense vector + BM25, RRF-fused) with optional file path/language filters and cross-project search via includeLinked.
codebase_status
Reports index status and chunk/file counts.
codebase_graph_build
Builds the polyglot dependency graph in the background; poll codebase_graph_status for progress.
codebase_graph_query
Returns the imports and dependents of a specific file.
codebase_graph_stats
Returns graph statistics such as most-connected files, orphans, and per-language breakdown.
codebase_graph_circular
Detects circular dependencies in the codebase.
codebase_graph_visualize
Generates a Mermaid diagram of the dependency graph, or an offline-capable interactive HTML graph explorer (file/symbol views, blast-radius overlay, live search, PNG export).
codebase_graph_status
Reports dependency-graph build progress or persisted graph metadata.
codebase_graph_remove
Removes a project's persisted dependency graph, waiting for any in-flight build to finish first.
codebase_impact
Symbol-level blast-radius analysis — BFS through reverse call edges to find what files break if a given file/function changes.
codebase_flow
Traces forward execution flow from an entry point; called with no arguments it auto-discovers candidate entry points (orphans, main(), framework routes, tests).
codebase_symbol
Gives a full view of one symbol: its definition, callers, and callees.
codebase_symbols
Lists symbols in a file or searches for symbols by name across the project.
codebase_context
Lists non-code knowledge artifacts available for the project (DB schemas, API specs, infra configs, architecture docs).
codebase_context_search
Searches indexed context artifacts for specific schemas, endpoints, or configuration.
codebase_context_index
Re-indexes/refreshes stale context artifacts.

Setup

1) Make sure Docker is installed and running, and Node.js 18+ is available. 2) Simplest route: add the npx launch command to your MCP client config — {"command":"npx","args":["-y","socraticode"]} under mcpServers (Claude Desktop, Windsurf, Cline, Roo Code) or servers (VS Code project-local .vscode/mcp.json). 3) Claude Code users are recommended to install the official plugin, which bundles workflow skills: run claude plugin marketplace add giancarloerra/socraticode then claude plugin install socraticode@socraticode (or the equivalent /plugin marketplace add and /plugin install slash commands inside Claude Code). 4) VS Code/Cursor users can also install the dedicated extension/plugin from the VS Code Marketplace, Open VSX, or Cursor Marketplace. 5) On first use the server automatically pulls Docker images and starts Qdrant and Ollama containers and downloads the embedding model — a one-time step taking roughly 5 minutes; subsequent starts take seconds. 6) For cloud embeddings (OpenAI/Google) or an external Qdrant instance, set env vars such as EMBEDDING_PROVIDER, OPENAI_API_KEY, GOOGLE_API_KEY, QDRANT_MODE, QDRANT_URL, and QDRANT_API_KEY in the client config. 7) On a project for the first time, ask the AI to 'index this codebase' to trigger codebase_index, then check progress with codebase_status.

claude_desktop_config.json
{"mcpServers":{"socraticode":{"command":"npx","args":["-y","socraticode"]}}}

Fit and risk

Best for

  • Large, long-lived, multi-language codebases (up to tens of millions of lines) where an AI assistant needs a durable code index
  • Privacy-conscious teams that want embeddings and index data to stay entirely on their own machine or infrastructure
  • Users of Claude Code, Cursor, VS Code Copilot, or Gemini CLI who want their AI to prefer semantic search and dependency graphs over raw file reads
  • Teams running multiple AI agents or collaborators against a shared, coordinated codebase index

Not for

  • Environments where Docker cannot be installed or run (e.g. locked-down machines or restricted CI)
  • Small projects (a few hundred lines) where the overhead of standing up Docker/Qdrant/Ollama outweighs the benefit
  • Teams needing a fully managed, production-ready shared cloud index today — SocratiCode Cloud is still in private beta, not generally available
  • Environments with strict approval requirements around new local containers, background file watchers, or third-party npm packages

Required permissions

  • Read access to the local project's file system for AST-based chunking and indexing
  • Ability to start and manage local Docker containers for Qdrant (vector DB) and Ollama (embeddings)
  • Local file system write access to persist indexes, graph data, and optional interactive HTML graph output
  • File system watch access to detect changes and keep the index incrementally updated
  • Outbound network access and API keys (OPENAI_API_KEY, GOOGLE_API_KEY, QDRANT_API_KEY) when cloud embeddings or an external Qdrant instance are configured

Risks and side effects

  • By default it automatically pulls and runs Docker images (Qdrant, Ollama) — requires trusting those images and their runtime behavior
  • Switching to OpenAI or Google cloud embeddings sends code snippets to a third-party API, breaking the 'fully local/private' guarantee — evaluate against code confidentiality requirements
  • API keys (OPENAI_API_KEY, GOOGLE_API_KEY, QDRANT_API_KEY) are configured as environment variables — protect config files and shell profiles from leaking them
  • Misconfigured external/remote Qdrant instances could expose indexed content, including code snippets or sensitive strings
  • The project is licensed AGPL-3.0, which has copyleft implications for integration with proprietary or closed-source software
  • Any connected MCP client gets full read/write/delete access to indexing, graph, and context-artifact operations — no fine-grained per-tool permission model is described
  • The call graph is static-analysis based and cannot see dynamic dispatch, reflection, or framework magic (e.g. dependency injection, decorator-based routing) — 'zero callers' results should be manually double-checked, not trusted blindly

Troubleshooting

  1. Confirm Docker is running — required for the default managed mode that runs Qdrant and Ollama containers
  2. If codebase_search returns no results, run codebase_status to check whether the project is indexed, and run codebase_index if not
  3. On macOS/Windows, Docker containers cannot access the GPU, slowing embedding for medium-to-large repos — install native Ollama or switch to OpenAI/Google cloud embeddings for speed
  4. npx caches the package after first run; to pick up updates, run `rm -rf ~/.npm/_npx` and restart the MCP host, or use `socraticode@latest` in the config
  5. If SocratiCode was previously added standalone via `claude mcp add`, remove it after installing the plugin (`claude mcp remove socraticode`) to avoid duplicate registrations
  6. For large codebases, have the AI call codebase_status roughly every 60 seconds during indexing to keep the host connection alive and avoid interrupting the background job
  7. When using an external Ollama or Qdrant instance, verify OLLAMA_MODE/OLLAMA_URL and QDRANT_MODE/QDRANT_URL/QDRANT_API_KEY point to a reachable instance

Use cases

Hybrid semantic + keyword search across very large (multi-million-line), multi-language enterprise codebases
Assessing blast radius with codebase_impact before refactoring, renaming, or deleting code
Tracing execution flow from an entry point with codebase_flow to understand unfamiliar code
Visualizing and inspecting module dependency graphs, including circular-dependency detection
Searching across multiple linked repositories or maintaining separate indexes per git branch
Retrieving non-code project knowledge such as database schemas, API specs, and infra configs

Supported clients

Claude CodeFull support
VS CodeFull support
CursorFull support
Gemini CLIFull support
Claude DesktopPartial support
WindsurfPartial support
ClinePartial support
Roo CodePartial support
ZedPartial support
OpenAI Codex CLIPartial support
OpenCodePartial support