RepoLens — Claude Code MCP server: architecture docs from a repo
Scans a repository and builds architecture documentation: overview, modules, API surface, routes, dependency graph. Useful when the docs have drifted from the code.
claude mcp add --env REPOLENS_WORKSPACE=<REPOLENS_WORKSPACE> --transport stdio repolens -- npx -y @chappibunny/repolensWhat RepoLens does
RepoLens reads your source tree and produces a set of documents, from engineer-facing to readable without code context. That covers an architecture overview, a module catalog, the API surface, a route map, a dependency graph and a change impact report. Seventeen document types in total, split across three audiences.
Two modes are available. The deterministic one costs nothing and needs no keys. AI enhancement is optional and hooks into GitHub Models, OpenAI, Anthropic, Google, Azure or Ollama. Output goes to Notion, Confluence, GitHub Wiki, Obsidian or Markdown. Obsidian wants obsidian.vault set in .repolens.yml and takes no API key; Notion and Confluence read their tokens from .env.
Node.js 18+ is required. Install the package with npm install @chappibunny/repolens, then npx @chappibunny/repolens init writes the config and a GitHub Actions workflow. Coming from v0.3.0 or earlier, run npx @chappibunny/repolens migrate — skip it and your existing workflow files stay untouched.
What it helps with
- generate an architecture overview without writing it by hand
- pull a module catalog and API surface out of the code
- map the dependency graph of a repository
- give non-engineers a readable system overview
- keep docs current on every push
Example prompts for the agent
- Scan this repository and generate the architecture overview
- Show me the module catalog and API surface for this project
- Publish the generated docs to Markdown
How to install RepoLens
Platform CLI
claude mcp add --env REPOLENS_WORKSPACE=<REPOLENS_WORKSPACE> --transport stdio repolens -- npx -y @chappibunny/repolensReplace <…> with your own values
Platform CLI
codex mcp add repolens --env REPOLENS_WORKSPACE=<REPOLENS_WORKSPACE> -- npx -y @chappibunny/repolensReplace <…> with your own values
Config file
{
"mcpServers": {
"repolens": {
"command": "npx",
"args": [
"-y",
"@chappibunny/repolens"
],
"env": {
"REPOLENS_WORKSPACE": "<REPOLENS_WORKSPACE>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"repolens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@chappibunny/repolens"
],
"env": {
"REPOLENS_WORKSPACE": "<REPOLENS_WORKSPACE>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e REPOLENS_WORKSPACE=<REPOLENS_WORKSPACE> repolens npx -y @chappibunny/repolensReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about RepoLens
How do I install RepoLens in Claude Code?
Run claude mcp add repolens -- npx -y @chappibunny/repolens. To point it at a workspace, use the env variant: claude mcp add --env REPOLENS_WORKSPACE=<REPOLENS_WORKSPACE> --transport stdio repolens -- npx -y @chappibunny/repolens.
What does RepoLens do?
It scans a repository and generates architecture documentation: system overview, modules, API surface, routes, dependency graph, change impact. Results publish to Notion, Confluence, GitHub Wiki, Obsidian or Markdown.
Does RepoLens need API keys?
No — the deterministic mode runs without keys. AI enhancement is optional and works through GitHub Models, OpenAI, Anthropic, Google, Azure or Ollama. Tokens are only needed for Notion and Confluence publishing.