repo-context-mcp
MCP server that helps AI coding agents understand a repository — without dumping the entire monorepo into the prompt.
Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดWorks with Codex, Claude Code, Cursor, Cline, and any client that speaks Model Context Protocol.
AI agents waste tokens re-walking node_modules, missing entrypoints, or pasting random files. repo-context-mcp exposes three focused tools:
Local-only. No cloud. No telemetry. Stdio transport.
# run from source
git clone https://github.com/nduc99911/repo-context-mcp.git
cd repo-context-mcp
npm install
npm run build
# or via npx (after publish)
npx -y repo-context-mcp
Requires Node.js 18+.
npm run build
# repository map
node dist/cli.js map .
node dist/cli.js map examples/sample-repo
# search
node dist/cli.js search login examples/sample-repo
# token-aware pack
node dist/cli.js pack . --focus auth,api --max-tokens 8000
# JSON for scripts / CI
node dist/cli.js map . --json
node dist/cli.js pack . --focus src --json
After global install / npx:
npx repo-context-mcp map .
npx repo-context-mcp pack . --focus auth
{
"mcpServers": {
"repo-context": {
"command": "npx",
"args": ["-y", "repo-context-mcp"],
"env": {
"REPO_CONTEXT_ROOT": "/absolute/path/to/your/repo"
}
}
}
}
Settings → MCP → add server with command npx and args ["-y", "repo-context-mcp"].
REPO_CONTEXT_ROOT=/path/to/repo node /path/to/repo-context-mcp/dist/server.js
From this repository after build:
npm run build
node dist/cli.js serve
# or: node dist/server.js
See also examples/mcp-config.claude.json and examples/mcp-config.local.json.
Optional env:
Each tool also accepts an explicit root argument.
repo_maproot?: string
max_depth?: number # default 6
max_entries?: number # default 400
Returns a markdown tree, file count, and likely entrypoints (package.json, README.md, src/index.ts, AGENTS.md, …). Skips node_modules, .git, dist, etc.
search_codequery: string
root?: string
max_results?: number # default 50
case_sensitive?: boolean
Substring search across source-like extensions.
pack_contextroot?: string
focus?: string[] # keywords / path fragments to prioritize
max_tokens?: number # default 12000 (approx)
max_files?: number # default 40
Ranks files (entrypoints + focus matches), respects a rough token budget (~4 chars/token), and returns a single markdown document ready to paste into an agent prompt or PR review.
You can use the core without MCP:
import {
buildRepoMap,
formatRepoMap,
searchCode,
packContext,
} from "repo-context-mcp";
const map = buildRepoMap({ root: process.cwd() });
console.log(formatRepoMap(map));
const hits = searchCode({ root: process.cwd(), query: "TODO" });
const pack = packContext({
root: process.cwd(),
focus: ["auth"],
maxTokens: 8000,
});
console.log(pack.markdown);
npm install
npm test
npm run build
# map the sample tree
node --input-type=module -e "import { buildRepoMap, formatRepoMap } from './dist/index.js'; console.log(formatRepoMap(buildRepoMap({ root: 'examples/sample-repo' })));"
root.See SECURITY.md.
v0.1.1 — MCP server + CLI + gitignore + PR Action.
Roadmap:
.gitignore respectmap / search / pack) + --jsonfind_symbol.repo-contextignore)See CONTRIBUTING.md.
npm install
npm test
npm run lint
npm run build
MIT © Nguyen Duc
Built as a real maintainer / agent-tooling utility for the MCP ecosystem — not a placeholder repo. Issues and PRs welcome.
MCP server: repo map, code search, and token-aware context packs for AI coding agents
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Repo Context ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-05 MCP server: repo map, code search, and token-aware context packs for AI coding agents