# GitHits MCP server

> Lets AI coding agents search open-source code, docs, packages, and vulnerabilities with cited evidence.

- Repository: https://github.com/githits-com/githits-cli
- Page: https://hostedmcp.org/servers/githits-com/githits-cli
- Official: yes
- Transport: stdio, remote
- Stars: 136
- License: Apache-2.0
- Latest version: 0.40.3

## Install

### Claude Code

```sh
claude mcp add githits-cli -- npx -y githits
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "githits-cli": {
      "command": "npx",
      "args": [
        "-y",
        "githits"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "githits-cli": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "githits"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"githits-cli","type":"stdio","command":"npx","args":["-y","githits"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "githits-cli": {
      "command": "npx",
      "args": [
        "-y",
        "githits"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add githits-cli -- npx -y githits
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.githits-cli]
command = "npx"
args = ["-y", "githits"]
```

### Gemini CLI

```sh
gemini mcp add -s user githits-cli npx -- -y githits
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "githits-cli": {
      "command": "npx",
      "args": [
        "-y",
        "githits"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GITHITS_AUTH_STORAGE` | no | no |  |

## FAQ

### What can GitHits MCP search?

It searches indexed package and repository source, documentation, symbols, code examples, package metadata, vulnerabilities, and changelogs.

### Which package registries does GitHits support?

Package inspection covers npm, PyPI, Hex, Crates, NuGet, Maven, Packagist, RubyGems, Go, Swift, Pub, vcpkg, and Zig. Advisory data is missing for vcpkg and Zig.

### How do I authenticate GitHits?

Run the init command for automatic setup or login manually; browser OAuth is recommended, and CI environments can use a GITHITS_API_TOKEN.

### Can GitHits read and grep a dependency's source without cloning it?

Yes, the read and grep tools and CLI commands let you list files, read line ranges, and grep paths inside a package target.

### Does GitHits support license filtering for code examples?

Yes, example search accepts strict, custom, or yolo license modes, with strict filtering copyleft and undeclared licenses by default.
