Skip to main content
Configure the Greptile MCP server in your IDE to access code review tools and custom context.
Prerequisite: Get your API key from app.greptile.com/settings/api

Setup by IDE

1

Add Greptile MCP Server

Run the following command in your terminal:
claude mcp add --transport http greptile https://api.greptile.com/mcp \
  --header "Authorization: Bearer YOUR_GREPTILE_API_KEY"
Replace YOUR_GREPTILE_API_KEY with your actual API key.
2

Verify Installation

Check that the server was added:
claude mcp list
You should see:
greptile: https://api.greptile.com/mcp (HTTP) - ✓ Connected
3

Start Using

Open Claude Code. The Greptile MCP tools are now available automatically.

Project-Level Configuration

For team-shared configuration, create a .mcp.json file in your project root:
{
  "servers": {
    "greptile": {
      "transport": "http",
      "url": "https://api.greptile.com/mcp",
      "headers": {
        "Authorization": "Bearer ${GREPTILE_API_KEY}"
      }
    }
  }
}
Then set the environment variable:
export GREPTILE_API_KEY=your-api-key-here

Verify Connection

Test your setup with curl:
curl -X POST https://api.greptile.com/mcp \
  -H "Authorization: Bearer YOUR_GREPTILE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"ping"}'
Expected response:
{"jsonrpc":"2.0","id":1,"result":{}}

Troubleshooting

Check:
  • API key is correct and hasn’t expired
  • URL is exactly https://api.greptile.com/mcp
  • Authorization header format: Bearer YOUR_API_KEY (with Bearer prefix)
Fix: Restart your IDE after making configuration changes.
Verify:
  • API key was copied without extra spaces
  • Your account has access to the repositories you’re querying
  • API key hasn’t been revoked
Test: Use the curl command in the “Verify Connection” section above to verify your API key works.
Solutions:
  1. Restart your IDE completely
  2. Check server shows “Connected” or “Running” status
  3. Verify MCP is enabled in IDE settings
Check:
  • You have repositories indexed with Greptile
  • Your API key has access to those repositories
  • There are actual Greptile comments on your PRs
Check:
  • Token hasn’t expired
  • Token was copied without extra spaces or missing characters
  • Token has required scopes for the repositories you’re accessing
Fix: Generate a new token at github.com/settings/tokens
Check:
  • Both GREPTILE_API_KEY and GITHUB_TOKEN are set in the config
  • The greptile-mcp-server package can be accessed via npx
Fix: Verify your config file syntax is valid JSON

Configuration File Locations

IDEConfig File
Claude Code~/.mcp.json or project .mcp.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
CursorSet via UI (Settings → Tools & MCP)
VS Code~/.config/Code/User/mcp.json (Linux)
~/Library/Application Support/Code/User/mcp.json (macOS)
Codex CLI~/.codex/config.toml or project .codex/config.toml

Next Steps