repo-context-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@repo-context-mcpMap the repo and pack context for the auth module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 |
| Lightweight tree + manifests/entrypoints |
| Fast substring search with path:line hits |
| Token-budgeted markdown pack for LLM prompts |
Local-only. No cloud. No telemetry. Stdio transport.
Related MCP server: codeweave-mcp
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-mcpRequires Node.js 18+.
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.jsFrom this repository after build:
npm run build
node dist/server.jsOptional env:
Variable | Meaning |
| Default repository root when tools omit |
Each tool also accepts an explicit root argument.
Tools
repo_map
root?: string
max_depth?: number # default 6
max_entries?: number # default 400Returns 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?: booleanSubstring 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 40Ranks 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.0 — usable MCP server + library.
Roadmap:
Optional ripgrep backend for large monorepos
.gitignorenative respect (beyond default ignore list)SARIF / JSON machine output modes
GitHub Action: pack context on each PR
Baseline symbol index (tree-sitter) for
find_symbol
Contributing
See CONTRIBUTING.md.
npm install
npm test
npm run lint
npm run buildLicense
MIT © Nguyen Duc
Built as a real maintainer / agent-tooling utility for the MCP ecosystem — not a placeholder repo. Issues and PRs welcome.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Alicense-qualityCmaintenanceAn MCP server for semantic code search & navigation that helps AI agents work efficiently without burning through costly tokens. Instead of reading entire files, agents can search conceptually and jump directly to the specific functions, classes, and code chunks they need.118MIT
- Alicense-qualityBmaintenanceAn MCP server that gives AI agents structured code understanding and precise code intelligence via local indexing of AST, call graphs, and semantic search.434Apache 2.0
- AlicenseAqualityBmaintenanceAn MCP server that helps AI agents comprehend a codebase by providing tools for navigating, searching, and understanding code structure and history.10MIT
- Alicense-qualityCmaintenanceUniversal MCP server that analyzes any codebase and provides structured context to AI assistants. Dynamic, accurate, and token-efficient.19MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nduc99911/repo-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server