# instagit

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 20
- Author: InstalabsAI
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/InstalabsAI/instagit
- Updated: 2026-02-13
- HTML: https://affpapa.org/en/nevibecode/mcp/instagit

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `INSTAGIT_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add instagit -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagit
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add instagit --env INSTAGIT_API_KEY=<INSTAGIT_API_KEY> -- npx -y instagit
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "instagit": {
            "command": "npx",
            "args": [
                "-y",
                "instagit"
            ],
            "env": {
                "INSTAGIT_API_KEY": "<INSTAGIT_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "instagit": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "instagit"
            ],
            "env": {
                "INSTAGIT_API_KEY": "<INSTAGIT_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e INSTAGIT_API_KEY=<INSTAGIT_API_KEY> instagit npx -y instagit
```
Replace <…> with your own values

## When to use it
- 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
- Analyze `owner/repo` and explain how its authentication works
- Compare `main` against tag `v2.0.0` in `owner/repo` and list the breaking changes
- Show me how `owner/repo` adds a new API endpoint, following its existing patterns

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
