MCPcopy
hub / github.com/giancarloerra/SocratiCode

github.com/giancarloerra/SocratiCode @v1.8.18 sqlite

repository ↗ · DeepWiki ↗ · release v1.8.18 ↗
1,264 symbols 4,002 edges 110 files 280 documented · 22%
README

SocratiCode logo

SocratiCode

CI License: AGPL-3.0 npm version Node.js >= 18 GitHub stars Discord

Install Claude Code Plugin VS Code Marketplace Open VSX Install in VS Code Install in VS Code Insiders Install in Cursor

"There is only one good, knowledge, and one evil, ignorance." — Socrates

Your AI reads code. SocratiCode understands it.

The open-source codebase context engine: give any AI instant automated knowledge of your entire codebase (and infrastructure) — at scale, zero configuration, fully private, completely free.

Kindly sponsored by Altaire Limited

🛡️ Need MCP governance together with codebase context? See our sibling project JanuScope — the local-first MCP policy proxy: tool blocking, SQL-mutation gate, PII redaction, audit, rate-limit.

If SocratiCode has been useful to you, please ⭐ star this repo — it helps others discover it — and share it with your dev team and fellow developers!

💬 Questions or just want to chat? Join us on Discord.

☁️ SocratiCode Cloud (private beta) — Hosted, shared team index built on the same engine as the open-source version, plus SSO, audit logs, branch-aware indexing, and VPC / air-gapped deployment options. The open-source core remains free forever. Request early access →

One thing, done well: deep codebase intelligence — zero setup, no bloat, fully automatic. SocratiCode gives AI assistants deep semantic understanding of your codebase — hybrid search, cross-project search, polyglot code dependency graphs, symbol-level impact analysis and flow, interactive HTML graph explorer for visual navigation, and searchable context artifacts (database schemas, API specs, infra configs, architecture docs). Zero configuration — add it to any MCP host, or install the Native Plugin for Claude Code, Cursor, VS Code Copilot, Codex or Gemini CLI. It manages everything automatically.

Production-ready, battle-tested on enterprise-level large repositories (up to and over ~40 million lines of code). Batched, automatic resumable indexing checkpoints progress — pauses, crashes, restarts, and interruptions don't lose work. The file watcher keeps the index automatically updated at every file change and across sessions. Multi-branch, multi-repo and multi-agent ready — multiple AI agents can work on the same codebase simultaneously, sharing a single index with automatic coordination and zero configuration.

Private and local by default — Docker handles everything, no API keys required, no data leaves your machine. Cloud ready for embeddings (OpenAI, Google Gemini) and Qdrant, and a full suite of configuration options are all available when you need them.

Code intelligence that belongs to you, AI and host agnostic — your codebase's understanding lives with the code, not locked to any one assistant, IDE or model. And because SocratiCode pre-computes the hard parts (blast radius, call-flow, dependency traversal), smaller models can handle architectural complex tasks that would otherwise need top-tier reasoning, saving even more on token cost.

The first Qdrant‑based MCP/Claude Plugin/Skill that pairs auto‑managed, zero‑config local Docker deployment with AST‑aware code chunking, hybrid semantic + BM25 (RRF‑fused) code search, polyglot dependency graphs with circular‑dependency visualisation, symbol‑level Impact Analysis (blast‑radius & call‑flow tracing across 18 languages), and searchable infra/API/database artifacts in a single focused, zero-config and easy to use code intelligence engine.

Benchmarked on VS Code (2.45M lines): SocratiCode uses 61% less context, 84% fewer tool calls, and is 37x faster than grep‑based exploration — tested live with Claude Opus 4.6. See the full benchmark →

Star History Chart

Contents


Quick Start

Only Docker (running) required.

One-click install — Claude Code, VS Code and Cursor:

Install Claude Code Plugin Install in VS Code Install in VS Code Insiders Install in Cursor

All MCP hosts — add the following to your mcpServers (Claude Desktop, Windsurf, Cline, Roo Code) or servers (VS Code project-local .vscode/mcp.json) config:

"socraticode": {
  "command": "npx",
  "args": ["-y", "socraticode"]
}

Claude Code — install the plugin (recommended, includes workflow skills for best results):

From your shell:

claude plugin marketplace add giancarloerra/socraticode
claude plugin install socraticode@socraticode

Or from within Claude Code:

/plugin marketplace add giancarloerra/socraticode
/plugin install socraticode@socraticode

Auto-updates: After installing, enable automatic updates by opening /plugin → Marketplaces → select socraticode → Enable auto-update.

Or as MCP only (without skills):

claude mcp add socraticode -- npx -y socraticode

Updating: npx caches the package after the first run. To get the latest version, clear the cache and restart your MCP host: rm -rf ~/.npm/_npx && claude mcp restart socraticode. Alternatively, use npx -y socraticode@latest in your config to always check for updates on startup (slightly slower).

OpenCode — add to your opencode.json (or opencode.jsonc):

{
  "mcp": {
    "socraticode": {
      "type": "local",
      "command": ["npx", "-y", "socraticode"],
      "enabled": true
    }
  }
}

OpenAI Codex CLI — add to ~/.codex/config.toml:

[mcp_servers.socraticode]
command = "npx"
args = ["-y", "socraticode"]

Restart your host. On first use SocratiCode automatically pulls Docker images, starts its own Qdrant and Ollama containers, and downloads the embedding model — one-time setup, ~5 minutes depending on your connection. After that, it starts in seconds.

First time on a project — ask your AI: "Index this codebase". Indexing runs in the background; ask "What is the codebase index status?" to monitor progress. Depending on codebase size and whether you're using GPU-accelerated Ollama or cloud embeddings, first-time indexing can take anywhere from a few seconds to a few minutes (it takes under 10 minutes to first-index +3 million lines of code on a Macbook Pro M4). Once complete it doesn't need to be run again, you can search, explore the dependency graph, and query context artifacts.

Every time after that — just use the tools (search, graph, etc.). On server startup SocratiCode automatically detects previously indexed projects, restarts the file watcher, and runs an incremental update to catch any changes made while the server was down. If indexing was interrupted, it resumes automatically from the last checkpoint. You can also explicitly start or restart the watcher with codebase_watch { action: "start" }.

macOS / Windows on large codebases: Docker containers can't use the GPU. For medium-to-large repos, install native Ollama (auto-detected, no config change needed) for Metal/CUDA acceleration, or use OpenAI embeddings for speed without a local install. Full details.

Recommended: For best results, add the Agent Instructions to your AI assistant's system prompt or project instructions file (CLAUDE.md, AGENTS.md, etc.). The key principle — search before reading — helps your AI use SocratiCode's tools effectively and avoid unnecessary file reads.

Claude Code users: If you installed the SocratiCode plugin, the Agent Instructions are included automatically as skills — no need to add them to your CLAUDE.md. The plugin also bundles the MCP server, so you don't need a separate claude mcp add.

Advanced: cloud embeddings (OpenAI / Google), external Qdrant, remote Ollama, native Ollama, and dozens of tuning options are all available. See Configuration below.

Plugins

SocratiCode is available as a native plugin on multiple AI coding platforms. Plugins bundle the MCP server with workflow skills and agent instructions — one install gives you everything.

Platform Install method
Claude Code claude plugin marketplace add giancarloerra/socraticode && claude plugin install socraticode@socraticodefull instructions
VS Code / Cursor / VSCodium / Gitpod / code-server / Theia / Antigravity / Particle Workbench (extension) Search SocratiCode in the Extensions panel (VS Code Marketplace or Open VSX). The extension auto-registers the MCP server in Copilot agent mode, Cline, Continue and Roo Code, and adds a sidebar, interactive graph webview, and onboarding walkthrough. Source: extension/.
Cursor /add-plugin https://github.com/giancarloerra/socraticode (plugin format with skills). Also listed in the Cursor Marketpla

Extension points exported contracts — how you extend this code

EmbeddingProvider (Interface)
(no doc) [10 implementers]
src/services/embedding-types.ts
SocratiCodeConfig (Interface)
* Shape of `.socraticode.json`. * * Fields are typed as their intended shape; runtime validators in the * consumers t
src/config.ts
ProjectItem (Interface)
* Sidebar TreeView showing indexed projects discovered from the engine's * temp directory. The engine writes interactiv
extension/src/sidebar.ts
FileChunk (Interface)
(no doc)
src/types.ts
FixtureProject (Interface)
(no doc)
tests/helpers/fixtures.ts
TempProject (Interface)
(no doc)
tests/unit/graph-resolution.test.ts
AstGrepLangModule (Interface)
Module export shape exposed by `@ast-grep/lang-*` packages.
src/services/code-graph.ts
SocratiCodeSettings (Interface)
(no doc)
extension/src/settings.ts

Core symbols most depended-on inside this repo

has
called by 211
src/services/symbol-graph-cache.ts
get
called by 162
src/services/symbol-graph-cache.ts
set
called by 125
src/services/symbol-graph-cache.ts
resolveImport
called by 86
src/services/graph-resolution.ts
projectIdFromPath
called by 82
src/config.ts
onProgress
called by 55
src/tools/index-tools.ts
delete
called by 51
src/services/symbol-graph-cache.ts
loadEmbeddingConfig
called by 49
src/services/embedding-config.ts

Shape

Function 1,134
Method 57
Interface 53
Class 20

Languages

TypeScript100%

Modules by API surface

src/assets/dagre.min.js357 symbols
src/assets/cytoscape.min.js350 symbols
src/services/graph-symbols.ts35 symbols
src/services/qdrant.ts32 symbols
src/services/indexer.ts30 symbols
src/services/symbol-graph-cache.ts27 symbols
src/services/symbol-graph-store.ts24 symbols
src/services/code-graph.ts24 symbols
src/assets/viewer-app.js24 symbols
src/services/docker.ts18 symbols
src/services/provider-ollama.ts17 symbols
src/config.ts17 symbols

Dependencies from manifests, versioned

@ast-grep/lang-bash0.0.7 · 1×
@ast-grep/lang-c0.0.5 · 1×
@ast-grep/lang-cpp0.0.5 · 1×
@ast-grep/lang-csharp0.0.5 · 1×
@ast-grep/lang-dart0.0.7 · 1×
@ast-grep/lang-go0.0.5 · 1×
@ast-grep/lang-java0.0.6 · 1×
@ast-grep/lang-kotlin0.0.6 · 1×
@ast-grep/lang-lua0.0.7 · 1×
@ast-grep/lang-php0.0.6 · 1×
@ast-grep/lang-python0.0.5 · 1×
@ast-grep/lang-ruby0.0.6 · 1×

For agents

$ claude mcp add SocratiCode \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact