代码上下文MCP服务

为AI编程代理提供代码库持久记忆与冲刺流程管理的MCP服务器,通过SQLite索引和实时仪表盘减少令牌消耗、提升开发效率。

  • by VelimirMueller
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 VelimirMueller/vlm-code-context-mcp

使用说明



# Requires Node.js 22 or newer. Node.js 24 LTS is recommended.
npm install vlm-code-context-mcp

# The code index (default): 6 tools
npx code-context-reindex . --db ./context.db
claude mcp add code-context -- npx code-context ./context.db

# Or the sprint process instead: setup installs code-context-sprint, /kickoff, the dashboard
npx code-context-mcp setup .
npx code-context-dashboard ./context.db   # optional: live dashboard on :3333
# override the watch directory (4th argument)
npx code-context-dashboard ./context.db 3333 .
/kickoff

search_files("auth middleware")       → find the right file
get_file_context("src/auth.ts")      → understand role, exports, dependents
Read("src/auth.ts")                  → only now read the actual code

# Simulated (no model, no cost)
pnpm run bench

# Agent (real model, real tokens; needs ZAI_API_KEY or DEEPSEEK_API_KEY)
pnpm run bench:live --provider glm

# Publish the run to the bench-results branch (rebuilds the site)
pnpm run bench:publish
# The code index (default), after npm install
claude mcp add code-context -- npx code-context ./context.db

# Or the sprint process instead (same server name, same context.db; includes the code tools)
claude mcp add code-context -- npx code-context-sprint ./context.db

# Without a local install (the index)
claude mcp add code-context -- npx -y vlm-code-context-mcp ./context.db

# Add globally (the index; dist/server/sprint.js for the sprint process)
claude mcp add --scope user code-context node /path/to/node_modules/vlm-code-context-mcp/dist/server/index.js ./context.db

# Remove
claude mcp remove code-context
# Profiles (default: code, 6 tools)
CODE_CONTEXT_PROFILE=full     # 97 tools: the sprint process (setup writes it)
CODE_CONTEXT_PROFILE=all      # 103 tools
CODE_CONTEXT_TOOLSETS=scrum   # add toolsets: code-admin, scrum, fun, stream

# Output
OVERDRIVE_FLAIR=0              # flair off (1 forces it on)
CODE_CONTEXT_TIMESTAMPS=1      # add modified/indexed timestamps
CODE_CONTEXT_ABSOLUTE_PATHS=1  # absolute paths

# Skills
CODE_CONTEXT_SKILLS_AUTOSYNC=1 # sync skills from upstream at boot
# Contributors use pnpm (pnpm-lock.yaml); install once
pnpm install

# MCP server
pnpm run dev

# Dashboard (Vite dev server with HMR)
pnpm run dashboard:dev

# Tests
pnpm test          # backend
pnpm run test:all  # backend + frontend

# Maintainers: publish to the npm registry (runs prepublishOnly = pnpm run build)
pnpm publish