repo-map-marketplace
A containerized, tree-sitter based repo-map MCP server — in the spirit of
Aider's repo-map and inspired by
pdavis68/RepoMapper — packaged as
a single plugin repo that installs into both Claude Code and GitHub
Copilot CLI. One get_repo_map tool returns a ranked map of
classes/functions/signatures for a repository, so an agent can orient itself
without reading every file.
Verified against Claude Code 2.1.201 and GitHub Copilot CLI 1.0.68.
What's in here
repo-map-marketplace/
├── .claude-plugin/
│ └── marketplace.json # marketplace catalog — read by both tools
├── plugins/repo-map-plugin/
│ ├── .claude-plugin/plugin.json # Claude Code's plugin manifest
│ ├── .mcp.json # Claude Code's MCP config (${CLAUDE_PLUGIN_ROOT})
│ ├── plugin.json # Copilot CLI's plugin manifest (higher precedence)
│ ├── mcp-copilot.json # Copilot CLI's MCP config (${PLUGIN_ROOT})
│ ├── scripts/run-repomap.sh # shared docker-run wrapper, used by both configs
│ └── skills/repo-map/SKILL.md # tells the model when to call the tool
├── server/
│ ├── Dockerfile
│ ├── repomap_server.py
│ └── requirements.txt
└── .github/workflows/publish-image.yml
Why two plugin.json / two mcp config files
Claude Code and Copilot CLI share the marketplace format (.claude-plugin/marketplace.json
works for both), but their plugin-root variables differ:
${CLAUDE_PLUGIN_ROOT} vs ${PLUGIN_ROOT}. Neither tool tolerates an
unresolved ${VAR} it doesn't recognize in a JSON it's asked to parse, so a
single shared .mcp.json referencing both variables would break one of the
two tools. Instead each tool reads its own manifest and its own MCP config
file (both point at the same scripts/run-repomap.sh):
- Claude Code:
.claude-plugin/plugin.json → .mcp.json
- Copilot CLI:
plugin.json (root — matches first in Copilot's manifest
search order, so it never even looks at .claude-plugin/plugin.json) →
mcp-copilot.json
The project-directory problem, and what actually works today
The container needs the real repository mounted read-only at /repo. That
means the wrapper script needs to know the host path of the repo being
analyzed — not the plugin's own install directory. We tested both a
${...}-substitution approach and an environment-variable approach against
real installs of both CLIs:
-
Claude Code: ${CLAUDE_PROJECT_DIR} substitutes directly in
plugin-provided .mcp.json (confirmed working), and Claude Code also
exports CLAUDE_PROJECT_DIR into the spawned server's own environment
regardless. scripts/run-repomap.sh reads it from the environment, so
no setup is needed — install the plugin and it just works.
-
Copilot CLI: there is no equivalent variable. Worse, Copilot CLI pins
the MCP server's cwd to the plugin's own install directory
(~/.copilot/installed-plugins/...), so even a $PWD fallback resolves
to the wrong place — we verified this by dumping the actual subprocess
environment. You must export REPOMAP_PROJECT_DIR yourself before
invoking copilot, e.g.:
export REPOMAP_PROJECT_DIR="$(pwd)"
copilot
We confirmed a shell-exported REPOMAP_PROJECT_DIR does propagate into
the plugin's MCP subprocess environment. Put the export in your shell
profile, or an alias, if you use Copilot CLI on multiple repos.
scripts/run-repomap.sh resolves the project directory in this order:
REPOMAP_PROJECT_DIR → CLAUDE_PROJECT_DIR → $PWD.
Known Copilot CLI caveat
Copilot CLI has had recurring bugs where a plugin's declared MCP servers
don't get registered into ~/.copilot/mcp-config.json on install
(github/copilot-cli#2709,
#4004). We did not hit
this on 1.0.68 during testing, but if copilot mcp list doesn't show
repo-map after installing, that's the known cause — the workaround is to
add the server entry to ~/.copilot/mcp-config.json by hand (copy it from
plugins/repo-map-plugin/mcp-copilot.json, with command pointed at your
installed plugin's scripts/run-repomap.sh).
Install
Claude Code
/plugin marketplace add YOUR-ORG/repo-map-marketplace
/plugin install repo-map-plugin@repo-map-marketplace
(or non-interactively: claude plugin marketplace add YOUR-ORG/repo-map-marketplace && claude plugin install repo-map-plugin@repo-map-marketplace)
Local testing before publishing:
claude plugin marketplace add /absolute/path/to/repo-map-marketplace
claude plugin install repo-map-plugin@repo-map-marketplace
GitHub Copilot CLI
copilot plugin marketplace add YOUR-ORG/repo-map-marketplace
copilot plugin install repo-map-plugin@repo-map-marketplace
Local testing before publishing: