code-knowledge
Drops two local, zero-egress MCP servers (Serena for LSP and CodeGraph for call/import graph) into Claude Code, enabling code navigation and analysis without API keys or data leaving the machine.
README
code-knowledge
Drop the Serena + CodeGraph code-intelligence MCP layer into Claude Code — in any repo,
in seconds. Two local, zero-egress servers (no API keys, nothing leaves the machine), configured
to auto-track @latest and auto-start everywhere.
- Serena — LSP: symbols, definitions, references, rename-safe edits. Live language server, so
it's always fresh (no stored index). Needs
uvon PATH. - CodeGraph — tree-sitter → SQLite call/import graph + symbol search. Returns verbatim source with callers + blast-radius. Self-syncing — a file watcher re-indexes on every save.
Self-contained: zero dependencies, plain Node ≥20, runs from any working directory.
Two ways to install (use both)
1. Personal — every repo, automatically (user scope)
Registers both servers at Claude Code user scope, so they auto-start in every project you
open — no per-repo config. Run once per machine. Also adds .codegraph/ + .serena/ to your
global gitignore so no repo needs its own entry.
node code-knowledge.js global
2. Team-shareable — per repo (checked-in .mcp.json)
Run inside a repo. Writes/merges .mcp.json (preserving any other servers), gitignores the index
dirs, pre-builds the CodeGraph index, and appends a short "query these before grep" note to
CLAUDE.md. Commit .mcp.json + CLAUDE.md and your teammates inherit it on clone.
cd /path/to/other-repo
node /path/to/code-knowledge.js repo # flags: --no-index, --no-claude-md
Both at once
node code-knowledge.js both
Check your environment
node code-knowledge.js doctor
After any install: RESTART Claude Code, then run
/mcp. MCP servers attach on restart, not mid-session. Project scope (.mcp.json) also prompts once to trust the repo's servers; user scope is trusted once.
Reuse it from anywhere
Published at https://github.com/bhanutejaI4E/code-knowledge — run from any repo, no clone:
npx -y github:bhanutejaI4E/code-knowledge doctor # check environment
npx -y github:bhanutejaI4E/code-knowledge repo # set up the current repo
npx -y github:bhanutejaI4E/code-knowledge global # user scope (once per machine)
Or copy this folder next to your projects and call it by path (examples above). Forking it? Swap the handle for your own GitHub username.
The @latest policy (and its cost)
Both servers deliberately track the newest release:
- CodeGraph →
@colbymchenry/codegraph@latest— npx re-checks npm on each start. - Serena →
uvx --refresh …— uvx re-resolves the git source on each start.
Trade-off: each launch does a quick upstream check (a little startup latency + needs network), and
an occasional CodeGraph version bump may want a fresh init if its index schema changes. If a bad
release ever lands, pin a server to an exact version in lib/servers.js (e.g.
@colbymchenry/codegraph@1.1.6, or a Serena git tag) and re-run the installer.
Files
| File | Role |
|---|---|
| code-knowledge.js | CLI entry / command dispatch |
| lib/servers.js | Single source of truth for both server definitions |
| lib/commands/global.js | User-scope registration + global gitignore |
| lib/commands/repo.js | Per-repo .mcp.json / gitignore / index / CLAUDE.md |
| lib/commands/doctor.js | Prerequisite + registration report |
| lib/prereqs.js, lib/util.js | Shared helpers |
| templates/claude-snippet.md | The CLAUDE.md guidance block |
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。