Repo Context MCP Server
MCP server: repo map, code search, and token-aware context packs for AI coding agents
Repo Context Mcp scores 41 (Fair), licensed MIT and written in TypeScript. It installs as a local process. It declares 3 tools. Filed under Search, Version control. GitHub shows 103 stars. Package registries report about 54 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
41 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
71/100 for listing completeness. Lost points: 3 of 3 tools barely described, short summary.
How quality is graded
Where the 41 comes from
0 + 10 + 7 + 10 + 4 + 10 = 41. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 10 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 7 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "nduc99911-repo-context-mcp": { "command": "npx", "args": [ "-y", "repo-context-mcp@0.1.1" ] } }}
Environment variables
This server does not declare environment variables.
Tools3Tool docs quality grade F
All capabilitiespack_contexttoolrepo_maptoolsearch_codetool
About
repo-context-mcp
MCP server that helps AI coding agents understand a repository — without dumping the entire monorepo into the prompt.
Works with Codex, Claude Code, Cursor, Cline, and any client that speaks Model Context Protocol.
Why
AI agents waste tokens re-walking node_modules, missing entrypoints, or pasting random files. repo-context-mcp exposes three focused tools:
| Tool | Purpose |
|---|---|
repo_map | Lightweight tree + manifests/entrypoints |
search_code | Fast substring search with path:line hits |
pack_context | Token-budgeted markdown pack for LLM prompts |
Local-only. No cloud. No telemetry. Stdio transport.
Install
# 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+.
CLI (no MCP client)
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
MCP client config
Claude Desktop / Claude Code
{
"mcpServers": {
"repo-context": {
"command": "npx",
"args": ["-y", "repo-context-mcp"],
"env": {
"REPO_CONTEXT_ROOT": "/absolute/path/to/your/repo"
}
}
}
}
Cursor
Settings → MCP → add server with command npx and args ["-y", "repo-context-mcp"].
Codex / generic stdio
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:
| Variable | Meaning |
|---|---|
REPO_CONTEXT_ROOT | Default repository root when tools omit root |
Each tool also accepts an explicit root argument.
Tools
repo_map
root?: 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_code
query: string
root?: string
max_results?: number # default 50
case_sensitive?: boolean
Substring search across source-like extensions.
pack_context
root?: 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.
Library API
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);
Demo (no MCP client)
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' })));"
Security
- Reads files only under the requested
root. - Does not execute project code.
- Skips common vendor dirs and obvious binaries.
- Still: only point it at repositories you trust.
See SECURITY.md.
Project status
v0.1.1 — MCP server + CLI + gitignore + PR Action.
Roadmap:
-
.gitignorerespect - CLI (
map/search/pack) +--json - GitHub Action: pack context on each PR
- Optional ripgrep backend for large monorepos
- Baseline symbol index (tree-sitter) for
find_symbol - Configurable ignore file (
.repo-contextignore)
Contributing
See CONTRIBUTING.md.
npm install
npm test
npm run lint
npm run build
License
MIT © Nguyen Duc
Built as a real maintainer / agent-tooling utility for the MCP ecosystem — not a placeholder repo. Issues and PRs welcome.
Frequently asked questions
What is Repo Context MCP Server?
MCP server: repo map, code search, and token-aware context packs for AI coding agents
How do I install Repo Context MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. Repo Context MCP Server runs locally from the npm package repo-context-mcp with the command npx -y repo-context-mcp@0.1.1.
Is Repo Context MCP Server free and open source?
Yes. Repo Context MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does Repo Context MCP Server support remote (HTTP) connections?
No remote endpoint is listed for Repo Context MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does Repo Context MCP Server provide?
Repo Context MCP Server provides 3 tools: pack_context, repo_map, and search_code. See the full tool list for descriptions and parameters.
How is Repo Context MCP Server's trust score calculated?
Repo Context MCP Server scores 41 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.