codebase-synapse

io.github.iwiels由 GitHub 帳號 iwiels 發布v0.1.13更新於 Oct 25, 2026

Indexes codebase into a local knowledge graph with 40+ AI tools and codebase-guard.

發布方自己的服務:Codebase

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讀取預先建立的程式碼庫 SQLite 知識圖譜,讓助理搜尋程式碼、追蹤呼叫鏈並分析改動影響。

可以做什麼
搜尋與探索程式碼:語意搜尋、全文搜尋、符號搜尋、混合搜尋,以及結構相似度與跨專案符號定位。瀏覽知識圖譜:呼叫者與被呼叫者、匯入與相依方、最短路徑、死程式碼、PageRank 和類 Cypher 圖查詢。檢視架構:專案概觀、檔案結構、路由對應、模組邊界與叢集。分析 git 歷史:檔案考古、熱點、變更耦合和近期語意變更。維護記憶與上下文:持久與工作階段筆記、為編輯準備的預算上下文、工作集以及架構決策記錄。
適用情境
當助理需要針對大型程式碼庫給出有結構依據的答案而非猜測時適用,例如呼叫鏈、編輯前的相依影響、架構熱點或某個檔案的歷史。適合已在本機程式碼庫上使用支援 MCP 的程式設計客戶端的開發者。
執行需求
透過 npx 以 stdio 在本機執行(npm 套件,附 Windows、macOS 和 Linux 預編譯二進位檔)。需先用獨立的 CLI 指令為程式碼庫建立索引,索引寫入使用者家目錄下的本機 SQLite 資料庫。無需 Docker、雲端服務、API 金鑰或帳號,嵌入模型在本機執行。
安裝前請注意
伺服器本身只讀取已建好的索引,但獨立的索引指令會在使用者家目錄寫入資料庫檔案,並讀取程式碼庫及其 git 歷史。選用的 codebase-guard 鉤子會在執行影響分析前阻擋對高影響檔案的寫入,因而改變助理的編輯行為。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 codebase-synapse,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🧠 Codebase Synapse

Give your AI agent a deep understanding of your entire codebase.

An MCP server that indexes your codebase into a local knowledge graph with 52 AI tools — semantic search, call-graph traversal, git archaeology, blast-radius analysis, and more.


[Codebase Synapse — Knowledge graph visualization]

Works with Claude Code · Cursor · Windsurf · Zed · Any MCP client

[CI] [npm version] [License: Apache-2.0] [MCP Registry]


The Problem

AI coding agents (Claude, Cursor, etc.) are powerful — but they work with limited context. They can only see the files you open or feed them. Ask about call chains, architectural patterns, or blast-radius impact, and they guess.

Codebase Synapse fixes this. It indexes your entire repo into a local knowledge graph stored in SQLite, giving your AI agent real answers backed by structural analysis — not hallucinations.

How it works

mermaid
graph LR    A["📁 Your Codebase"] -->|Tree-sitter| B["🧩 Parser"]    B -->|Symbols & Edges| C["🕸️ Knowledge Graph"]    C -->|SQLite| D["💾 Local DB"]    D -->|52 MCP Tools| E["🤖 AI Agent"]        style A fill:#1a1b26,stroke:#7aa2f7,color:#c0caf5    style B fill:#1a1b26,stroke:#bb9af7,color:#c0caf5    style C fill:#1a1b26,stroke:#9ece6a,color:#c0caf5    style D fill:#1a1b26,stroke:#e0af68,color:#c0caf5    style E fill:#1a1b26,stroke:#f7768e,color:#c0caf5

⚡ Quick Start

1. Index your project (CLI, Zoekt-style)

bash
codebase-synapse index /path/to/your/repo

Indexing runs as a separate CLI command and writes into ~/.codebase-synapse/codebase.db. The first index is the slow one; re-running it only re-indexes changed files. The MCP server never indexes — it only reads the pre-built index.

2. Start the MCP server

bash
npx codebase-synapse

That's it. No Docker. No database setup. No cloud. The server starts via stdio and serves the pre-built index to your MCP client.

Configure your client

Claude Code / Claude Desktop

Add to your claude_desktop_config.json or mcp_servers.json:

json
{  "mcpServers": {    "codebase-synapse": {      "command": "npx",      "args": ["-y", "codebase-synapse"]    }  }}
Cursor

Add to your .cursor/mcp.json:

json
{  "mcpServers": {    "codebase-synapse": {      "command": "npx",      "args": ["-y", "codebase-synapse"]    }  }}
Other MCP clients

Any MCP client that supports stdio transport works. Just point it at:

bash
npx -y codebase-synapse

✨ What It Does

🔍 Search & Discovery

ToolDescription
semantic_searchVector similarity search using local embeddings (all-MiniLM-L6-v2)
search_codeFull-text search across code (FTS5 + BM25 ranking)
search_symbolFind functions, classes, types by name or pattern
hybrid_searchCombined semantic + lexical search with RRF fusion
find_similarFind structurally similar code using MinHash + LSH
find_symbol_everywhereLocate a symbol across all indexed projects

🕸️ Knowledge Graph

ToolDescription
get_callers / get_calleesNavigate the call graph in either direction
get_imports / get_dependentsTrace dependency chains
impact_analysisCompute blast radius before editing a file
find_pathFind the shortest connection between two symbols
find_dead_codeDetect unreachable functions and unused exports
get_pagerankIdentify the most critical nodes in your architecture
query_graphRun Cypher-like queries against the knowledge graph

🏗️ Architecture

ToolDescription
get_architectureFull project architecture overview (languages, entry points, hotspots)
get_file_structureDirectory tree with symbol annotations
project_overviewHigh-level summary with key metrics
get_route_mapExtract HTTP routes and their handler mappings
suggest_boundariesDetect module boundaries via Leiden clustering
check_boundariesValidate cross-module dependencies against defined boundaries
get_clustersCommunity detection across the codebase

🔬 Git Archaeology

ToolDescription
git_archaeologyDeep history analysis of a file (authors, churn, evolution)
get_hotspotsFiles with highest complexity × change frequency
detect_change_couplingFiles that always change together
get_recent_semantic_changesSemantically meaningful recent changes
index_git_historyBuild temporal analysis from git log

🧠 Memory & Context

ToolDescription
memory_store / memory_search / memory_listPersistent notes, facts, and decisions across sessions
session_remember / session_recallShort-term memory within a session
get_contextBudgeted context preparation for AI agents
get_edit_contextFocused context for a specific file edit
get_working_setRecently accessed and modified files
manage_adrArchitecture Decision Records management

🛡️ Codebase Guard

Included as a bonus: codebase-guard is a PreToolUse hook for Claude Code that blocks writes to high-impact files until the agent runs impact_analysis first.

It uses PageRank scores and blast-radius data from the knowledge graph to identify architectural hubs. No more accidental edits to core files.

🔧 Technical Details

LanguageRust (compiled native binary)
TransportMCP stdio (JSON-RPC)
StorageSQLite (WAL mode, zero config)
Embeddingsall-MiniLM-L6-v2 via Candle (offline, local, lazy-loaded)
ParsingTree-sitter (10 languages)
Distributionnpm with prebuilt binaries (Windows, macOS, Linux × x64, arm64)

Supported Languages

Rust · Python · TypeScript · JavaScript · Go · Java · C# · PHP · C · C++

Architecture

src/├── parser/       # Tree-sitter parsing & entity extraction├── graph/        # Knowledge graph, PageRank, Leiden clustering├── indexer/      # Repository indexing pipeline├── search/       # BM25 full-text + vector cosine + hybrid RRF├── embedding/    # Candle-based local embeddings (feature-gated)├── memory/       # Persistent & session memory stores├── mcp/          # MCP protocol transport + 52 tool handlers├── git/          # Git archaeology, intent classification, hotspots├── context/      # Budgeted context preparation for AI├── cypher/       # Nom-based Cypher parser → SQL CTE planner├── similarity/   # MinHash + LSH structural similarity├── semantic/     # Multi-signal scoring (tokens, directory, AST)└── cli/          # Interactive TUI installer + artifact export/import

🤝 Contributing

Contributions are welcome! The project uses standard Rust tooling:

bash
# Run testscargo test
# Lintcargo clippy -- -D warnings
# Formatcargo fmt --all

📄 License

Apache-2.0

來源:README.md,提交 41a965b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.13最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Codebase 整合