SocratiCode

Local semantic code search, dependency graphs and impact analysis over your own repositories

By Giancarlo Erra (individual) TypeScript Local · stdio Developer toolsDatabases

79 popularity score ★ 3.4k ↓ 3.6k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add socraticode -- npx -y --prefer-online socraticode@latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "socraticode": {
      "command": "npx",
      "args": [
        "-y",
        "--prefer-online",
        "socraticode@latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "socraticode": {
      "command": "npx",
      "args": [
        "-y",
        "--prefer-online",
        "socraticode@latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "socraticode": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "--prefer-online",
        "socraticode@latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.socraticode]
command = "npx"
args = ["-y", "--prefer-online", "socraticode@latest"]
Gemini CLITerminal
gemini mcp add --scope user socraticode npx -- -y --prefer-online socraticode@latest
Local (from source)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
git clone https://github.com/giancarloerra/socraticode.git
cd socraticode
npm install
npm run build
Claude CodeTerminal
claude mcp add socraticode -- node '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "socraticode": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "socraticode": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "socraticode": {
      "type": "stdio",
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.socraticode]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"]
Gemini CLITerminal
gemini mcp add --scope user socraticode node -- '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'

Settings 12

EMBEDDING_PROVIDER Optional: Embedding backend: ollama, openai, google, lmstudio or litellm. litellm also needs LITELLM_API_KEY. Default ollama.
EMBEDDING_MODEL Optional: Embedding model name, with a default per provider. lmstudio and litellm need it set, along with EMBEDDING_DIMENSIONS.
OPENAI_API_KEY secret Optional: OpenAI key, needed only when EMBEDDING_PROVIDER=openai.
GOOGLE_API_KEY secret Optional: Google key, needed only when EMBEDDING_PROVIDER=google.
SOCRATICODE_WATCHER Optional: Index refresh policy: auto, manual, off or git. Default auto.
Set together: ollama
OLLAMA_MODE Optional: auto (native Ollama if found, else Docker), docker, or external. Default auto.
OLLAMA_URL Optional: Address of the Ollama API. Defaults to localhost port 11434, or 11435 in docker mode.
OLLAMA_HOST Optional: Base address for managed Ollama readiness checks. With OLLAMA_API_KEY and no OLLAMA_URL it is also used for embeddings. Default http://localhost:11435.
OLLAMA_API_KEY secret Optional: Key for an authenticated Ollama proxy, sent as a bearer token. Remote addresses must be https.
Set together: qdrant
QDRANT_MODE Optional: managed (local Docker container) or external. Default managed.
QDRANT_URL Optional: Address of a remote or Qdrant Cloud instance in external mode.
QDRANT_API_KEY secret Optional: Key for an authenticated Qdrant deployment such as Qdrant Cloud.

What it does

SocratiCode builds a searchable index of a codebase on your own machine and exposes it to an assistant over stdio. It splits source files into chunks along their syntax tree, embeds them, and stores them in a Qdrant vector database, so a query runs both a meaning-based search and a BM25 keyword search and merges the two result lists. Indexing runs in the background in batches with checkpoints, so an interrupted run picks up where it stopped, and a file watcher (or, optionally, a refresh on git branch changes) keeps the index current.

On top of the search index it builds two graphs. The first maps which files import which, finds circular dependencies and can draw the result as a Mermaid diagram or a standalone HTML page that opens in the browser. The second maps which functions call which, so the assistant can ask what would be affected by changing a symbol, trace execution forward from an entry point, or list a symbol's callers and callees. Full support covers about twenty languages, including TypeScript, Python, Java, Go, Rust, C#, PHP and Swift; other text formats are indexed for search only.

It can also index 'context artifacts' you list in a .socraticodecontextartifacts.json file, such as database schemas, API specs or infrastructure configs, and search them alongside the code. Several projects can be linked for cross-project search, and git worktrees or branches can share or separate an index.

By default it starts its own Qdrant container and uses Ollama for embeddings, so nothing leaves the machine. OpenAI, Google Gemini, LM Studio or a LiteLLM proxy can be used for embeddings instead, and an external or Qdrant Cloud instance can replace the local database. Besides the plain MCP server, its makers ship plugins for Claude Code, OpenAI Codex, VS Code and Cursor that bundle the same engine. A hosted team version, SocratiCode Cloud, is in private beta and separate from this server.

What it needs

RuntimeNode.js 18.17+Docker
Runs onmacOS, Windows, Linux
Also
  • Docker running in the default managed mode
  • An embedding backend: Ollama (default), or an OpenAI, Google, LM Studio or LiteLLM endpoint

Node.js 18.17 or newer with npx on the PATH, and an MCP host that runs local stdio servers. In the default setup Docker must be running: it hosts the managed Qdrant database and, unless a native Ollama install is found, the Ollama embedding container. First start downloads the images and an embedding model (around five minutes). Docker is optional only with an external Qdrant plus native Ollama or a cloud embedding provider, which then needs its own API key. On Alpine Linux ARM64, run apk add --no-cache gcompat first so the bundled Swift parser can load.

Limits

  • Not covered The call graph is static analysis without type inference. Calls through dynamic dispatch, reflection, eval, macros or dependency injection are missed
  • Platform Docker on macOS and Windows has no GPU access, so the default Ollama container is slow on larger repositories. Native Ollama or OpenAI is suggested there
  • Size cap Files over 5 MB are skipped by default, changeable with MAX_FILE_SIZE_MB
  • Limit A new embedding provider or model only applies after the existing index is removed and rebuilt
  • Limit External Qdrant must be v1.15.2 or later for hybrid search
  • Limit With OLLAMA_API_KEY set, plain http is refused unless the host is loopback, and a URL with credentials in it is refused (src/services/provider-ollama.ts)
  • Rate limit Opens at most 4 connections to Ollama at once by default, set by OLLAMA_MAX_CONNECTIONS, a setting the README does not list (src/services/embedding-config.ts)

The call graph comes from static analysis with no type inference: calls made through dynamic dispatch, reflection, eval, macros or framework dependency injection do not show up, so 'zero callers' can be wrong on DI-heavy code. Docker on macOS and Windows has no GPU access, so the default embedding container is slow on medium or large repositories; its makers suggest native Ollama or OpenAI embeddings there. Files over 5 MB are skipped by default. Changing the embedding provider or model does not apply to an existing index until it is removed and rebuilt. External Qdrant must be v1.15.2 or later for hybrid search.

Who it suits

Suits developers working on large or many-language repositories who want an assistant to search by meaning and check the impact of a change before refactoring, while keeping code on their own machine. It is a heavier install than grep-style tools: it needs Docker or an external Qdrant and an embedding model, plus an initial indexing pass. For small repositories or lookups of exact names, its own docs say plain grep can be as good. Teams wanting a shared, hosted index would look at the makers' separate SocratiCode Cloud instead. It is a community project, not tied to any vendor, and its AGPL-3.0 licence matters if you modify it and offer it as a network service.

Tools 26

15 only read, 7 change things, 4 can delete or overwrite. A ? marks an optional parameter.

codebase_index changes
Starts indexing a project in the backgroundprojectPath?: stringextraExtensions?: string
codebase_stop changes
Stops a running indexing job after the current batch is checkpointedprojectPath?: string
codebase_update changes
Re-indexes only the files that changedprojectPath?: stringextraExtensions?: string
codebase_remove deletes
Deletes a project's indexprojectPath: string
codebase_prune deletes
Lists stored project identities and deletes one after explicit confirmationapply?: booleanidentity?: stringconfirmationToken?: stringacknowledgeNoRemoteWriters?: boolean
codebase_watch changes
Starts or stops the file watcher that keeps the index currentprojectPath?: stringaction: enum
codebase_search
Runs combined semantic and keyword search, with path, language and linked-project filtersquery: stringprojectPath?: stringlimit?: numberfileFilter?: stringlanguageFilter?: stringminScore?: numberincludeLinked?: boolean
codebase_status
Reports indexing progress and chunk countprojectPath?: string
codebase_graph_build changes
Builds the file dependency graph in the backgroundprojectPath?: stringextraExtensions?: string
codebase_graph_query
Shows what a file imports and what depends on itprojectPath?: stringfilePath: string
codebase_graph_stats
Gives graph statistics such as most-connected and orphan filesprojectPath?: string
codebase_graph_circular
Finds circular dependenciesprojectPath?: string
codebase_graph_visualize changes
Draws the graph as Mermaid or writes an interactive HTML page and opens it in the browserprojectPath?: stringmode?: enumopen?: boolean
codebase_graph_status
Reports graph build progress and graph quality metadataprojectPath?: string
codebase_graph_remove deletes
Deletes a project's stored dependency graphprojectPath: string
codebase_impact
Lists files affected by changing a file or functionprojectPath?: stringtarget?: stringfile?: stringsymbolId?: stringdepth?: numberlimit?: integer
codebase_flow
Traces execution forward from an entry point, or lists entry pointsprojectPath?: stringentrypoint?: stringfile?: stringdepth?: numberlimit?: integer
codebase_symbol
Shows one symbol's definition, callers and calleesprojectPath?: stringname: stringfile?: stringlimit?: integer
codebase_symbols
Lists symbols in a file or finds them by nameprojectPath?: stringfile?: stringquery?: stringlimit?: number
codebase_health
Checks Docker, Qdrant and the embedding provider
codebase_list_projects
Lists indexed projects with paths and metadata
codebase_about
Shows information about the server
codebase_context
Lists the context artifacts defined for the project and their index stateprojectPath?: string
codebase_context_search
Searches indexed context artifacts such as schemas and API specsquery: stringprojectPath?: stringartifactName?: stringlimit?: numberminScore?: number
codebase_context_index changes
Indexes or re-indexes all context artifactsprojectPath?: string
codebase_context_remove deletes
Deletes a project's indexed context artifactsprojectPath: string

Similar servers