# codeindex MCP server

> Provides structural code intelligence including symbol definitions, callers, imports, and dependency analysis for over 40 programming languages.

- Repository: https://github.com/munhq/codeindex
- Page: https://hostedmcp.org/servers/munhq/codeindex
- Transport: stdio
- Stars: 3
- License: MIT
- Latest version: 0.6.8

## Install

### Claude Code

```sh
claude mcp add codeindex -- npx -y @munhq/codeindex
```

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

```json
{
  "mcpServers": {
    "codeindex": {
      "command": "npx",
      "args": [
        "-y",
        "@munhq/codeindex"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "codeindex": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@munhq/codeindex"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "codeindex": {
      "command": "npx",
      "args": [
        "-y",
        "@munhq/codeindex"
      ]
    }
  }
}
```

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

```toml
[mcp_servers.codeindex]
command = "npx"
args = ["-y", "@munhq/codeindex"]
```

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

```json
{
  "mcpServers": {
    "codeindex": {
      "command": "npx",
      "args": [
        "-y",
        "@munhq/codeindex"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CODEINDEX_DAEMON_IDLE_SECS` | no | no | Seconds with no session attached before the shared daemon exits and returns its memory. Default 900. Set 0 to keep it resident. |
| `CODEINDEX_NO_DAEMON` | no | no | Set to 1 to keep the index inside this server process. By default every session on one repository shares a single background daemon that parses and watches the tree once, and each session is a thin relay onto it. Turn that off for a sandbox with no writable runtime directory. |
| `CODEINDEX_PROJECT_ID` | no | no |  |
| `CODEINDEX_WORKSPACE` | no | no | Directory to index. Defaults to the enclosing project root of wherever the client starts the server, which is the right answer for every editor and agent that launches it inside a repository. Set it only when the server runs somewhere other than the code. |

## Tools (38)

- `status`
- `search`
- `find_symbol`
- `find_word`
- `find_callers`
- `get_outline`
- `get_tree`
- `get_imports`
- `get_imported_by`
- `get_change_impact`
- `plan_change`
- `get_hot_files`
- `read_file`
- `read_symbol`
- `index_workspace`
- `analyze`
- `security`
- `dead_code`
- `unwrap_audit`
- `test_coverage`
- `architecture`
- `crossref`
- `type_drift`
- `db_schema`
- `migration_parity`
- `manifest_compliance`
- `literal_scan`
- `coupling`
- `cycles`
- `duplication`
- `clones`
- `spawn_scan`
- `deps`
- `leak_shapes`
- `logic_shapes`
- `call_cost`
- `field_contention`
- `health`

## FAQ

### What languages does codeindex support?

It supports over 40 languages via tree-sitter, including Rust, Python, TypeScript, Go, Zig, C++, Java, and many others.

### How does codeindex help AI coding agents?

It allows agents to answer structural questions like symbol outlines, definitions, and dependency chains using a few hundred tokens instead of reading entire files.

### Can I run codeindex using Docker?

Yes, you can run it via Docker by bind-mounting your workspace read-only.
