instagit — Claude Code MCP server: what it does, how to install
An MCP server that lets a coding agent read and query any Git repository through one tool, ask_repo. Useful when you need to understand a dependency or plan an upgrade.
claude mcp add instagit -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagitWhat instagit does
The server exposes a single tool called ask_repo. It takes repo (a URL, a public Git address or the short owner/repo form), prompt with the question about the code, and an optional ref for a branch, commit or tag. Leave ref out and the analysis follows the repository's default branch.
Answers come back tied to real files with line numbers, so the agent works from what the maintainers wrote. That matters when you ask how authentication is wired in an SDK or what changed between two major releases of a library.
Node.js 18 or newer is required. You do not have to supply an API key: on first run the server registers an anonymous token and saves it to ~/.instagit/token.json. Anonymous calls hit tighter rate limits, so a key from instagit.com pays off once you query often. A separate endpoint can be set with INSTAGIT_API_URL.
What it helps with
- map the architecture of an unfamiliar library from its source
- audit how an SDK implements authentication
- draft a migration plan between two dependency versions
- trace a bug that crosses into a third-party repository
- compare two libraries before adding one to a project
Example prompts for the agent
- Analyze
owner/repoand explain how its authentication works - Compare
mainagainst tagv2.0.0inowner/repoand list the breaking changes - Show me how
owner/repoadds a new API endpoint, following its existing patterns
How to install instagit
Platform CLI
claude mcp add instagit -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagitReplace <…> with your own values
Platform CLI
codex mcp add instagit --env INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagitReplace <…> with your own values
Config file
{
"mcpServers": {
"instagit": {
"command": "npx",
"args": [
"-y",
"instagit"
],
"env": {
"INSTAGIT_API_KEY": "<INSTAGIT_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"instagit": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"instagit"
],
"env": {
"INSTAGIT_API_KEY": "<INSTAGIT_API_KEY>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> instagit npx -y instagitReplace <…> 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 instagit
How do I install instagit in Claude Code?
Run claude mcp add instagit -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagit. The key is optional; without it the server creates an anonymous token.
What does instagit do?
It is an MCP server with one tool, ask_repo, which hands your agent context pulled from a chosen Git repository so the answers rest on actual code.
Does it need an API key?
No. With no INSTAGIT_API_KEY set, an anonymous token is registered and stored in ~/.instagit/token.json. A key from instagit.com raises rate limits and speeds up analysis.