# Trail-Code MCP server

> Provides coding agents with a shared codebase map and team learnings to reduce tool calls and improve task completion.

- Repository: https://github.com/trailhq/Trail-Code
- Page: https://hostedmcp.org/servers/trailhq/trail-code
- Transport: stdio
- Stars: 11265
- License: MIT

## Install

### Claude Code

```sh
claude mcp add trail-code -- npx -y @nanonets/graft
```

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

```json
{
  "mcpServers": {
    "trail-code": {
      "command": "npx",
      "args": [
        "-y",
        "@nanonets/graft"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "trail-code": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@nanonets/graft"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"trail-code","type":"stdio","command":"npx","args":["-y","@nanonets/graft"]}'
```

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

```json
{
  "mcpServers": {
    "trail-code": {
      "command": "npx",
      "args": [
        "-y",
        "@nanonets/graft"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add trail-code -- npx -y @nanonets/graft
```

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

```toml
[mcp_servers.trail-code]
command = "npx"
args = ["-y", "@nanonets/graft"]
```

### Gemini CLI

```sh
gemini mcp add -s user trail-code npx -- -y @nanonets/graft
```

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

```json
{
  "mcpServers": {
    "trail-code": {
      "command": "npx",
      "args": [
        "-y",
        "@nanonets/graft"
      ]
    }
  }
}
```

## FAQ

### What is the graft map?

The graft map is an index of your code, including every function and its callers, parsed using tree-sitter to help agents find the right files.

### Does Trail-Code require an API key or a model to build the code map?

No, the graft map is built using tree-sitter on your machine without using a model or an API key.

### What are 'Learnings' in Trail-Code?

Learnings are decisions and knowledge captured from your conversations and team discussions that agents can use to pick up where others left off.
