nduc99911/repo-context-mcp

View on GitHub ↗

MCP server: repo map, code search, and token-aware context packs for AI coding agents

104 ★91 forksTypeScriptUpdated 23d ago

What you need to know

Small stdio MCP server that helps coding agents understand a repository — repo_map tree, search_code substring hits, and token-budgeted pack_context — without dumping the whole monorepo into the prompt.

Install

git clone https://github.com/nduc99911/repo-context-mcp.git && cd repo-context-mcp && npm install && npm run build
npx -y repo-context-mcp

Usage

  • Configure in Claude Desktop / Claude Code / Cursor with REPO_CONTEXT_ROOT set to your repo's absolute path (or pass an explicit root per tool).
  • Use repo_map for a tree + entrypoints, search_code for path:line hits, and pack_context for a token-budgeted markdown pack.
  • Run standalone without an MCP client: node dist/cli.js map . or node dist/cli.js pack . --focus auth --max-tokens 8000.

Key features

  • Three focused tools (repo_map, search_code, pack_context) with per-tool root override and max-depth/max-entries/max-tokens knobs.
  • Skips node_modules/.git/dist and respects .gitignore; reads only under the requested root and doesn't execute project code.
  • Local-only: no cloud, no telemetry, stdio transport.
  • Library API (buildRepoMap/searchCode/packContext) plus a GitHub Action to pack context on each PR.

Best for

Coding agents (Codex, Claude Code, Cursor, Cline) that need fast repo orientation without context-window blowout.

Caveats

  • Early stage (v0.1.1): optional ripgrep backend, tree-sitter symbol index, and configurable ignore file are on the roadmap, not yet shipped.
  • Requires Node.js 18+.
  • README advises pointing it only at repositories you trust.
Platforms: LocalClients: Codex · Claude Code · Cursor · Cline · Claude Desktop

Reviewed 2026-08-18

Topics

ai-agentclaudecodexcursormcpmodel-context-protocoltypescript
Stars
104★
Forks
91
Language
TypeScript
License
MIT
Created
2026-08-12
Last push
2026-08-12