What ILoveMyJay/repocontext does
The ILoveMyJay/repocontext MCP server turns a repository into context that coding agents can inspect without receiving every line of every file. Its AST-based mapping preserves symbols such as interfaces, types, functions, and documentation while producing a smaller representation of source files. The project describes typical compression of roughly 70% to 85%, with the map workflow targeting 75% or more token reduction.
The server also supports task-oriented context selection. An agent can provide a coding request, such as fixing authentication expiry, and the relevance workflow ranks and returns files related to that request. Source reads can apply credential masking, and the CLI includes scanning and redaction for items such as API keys, tokens, JWTs, and database connection URIs.
How it works
RepoContext is distributed as an npm package and can be run with npx, so a separate local build is not required for the documented quick-start flow. Its MCP entry point is the mcp subcommand. A client starts that command as a standard MCP process and communicates with the exposed tools.
The context workflow forms four levels of detail:
- A repository-wide AST symbol map for a compact structural view.
- Semantically ranked context for a specific task prompt.
- A compressed outline for one file, including signatures and documentation.
- Exact file content, optionally limited to a line range.
Packing is also available outside MCP. The CLI can create Markdown, XML, or JSON output, set a token ceiling, copy results to the clipboard, and estimate token usage and costs for listed model families.
Setup and configuration
Install nothing permanently by invoking the package through npx:
{
"mcpServers": {
"repocontext": {
"command": "npx",
"args": ["-y", "repocontext", "mcp"]
}
}
}
Place this entry in the MCP configuration used by a supported client, such as Claude Desktop, Cursor, or Windsurf. The repository also documents global installation with npm install -g repocontext. After global installation, the CLI commands are available directly as repocontext pack, repocontext map, and repocontext analyze ..
No environment variables are documented as required. The main CLI settings are command options, including packing mode, a relevance query, output format and path, maximum tokens, clipboard copying, and the option to disable security redaction.
Tools and capabilities
The ILoveMyJay/repocontext MCP server exposes these tools:
get_codebase_map creates a token-efficient AST symbol outline for the repository.
extract_relevant_context ranks and selects files using a task prompt.
read_file_outline returns a compressed AST skeleton for an individual file.
read_file_content reads source text and supports optional startLine and endLine slicing, with credential masking.
The standalone pack command supports full, ast, relevant, and hybrid modes. It writes Markdown by default, with XML and JSON also available. The map command generates a lightweight codebase map, while analyze reports token distribution without writing a packed file.
Limitations and notes
The documented server operates on the repository available to the MCP process; the supplied material does not describe remote repository hosting, language coverage, ignore-file behavior, or persistent indexing. Security redaction is enabled by default for packing, but the CLI provides --no-security to turn it off, so disabling that option removes the documented masking safeguard.
Token savings are described as approximate rather than guaranteed for every project. Cost analytics cover GPT-4o, GPT-5, Claude 3.5 Sonnet, and Gemini 1.5 Pro in the README, but these estimates do not indicate that the MCP server calls those models. The package is MIT licensed.