Prerequisite: Get your API key from app.greptile.com/settings/api
Setup by IDE
- Claude Code (CLI)
- Cursor
- Claude Desktop
- VS Code
Add Greptile MCP Server
Run the following command in your terminal:Replace
YOUR_GREPTILE_API_KEY with your actual API key.Project-Level Configuration
For team-shared configuration, create a.mcp.json file in your project root:Verify Connection
Test your setup with curl:Troubleshooting
Server shows as disconnected
Server shows as disconnected
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)
Authentication failed
Authentication failed
Verify:
- API key was copied without extra spaces
- Your account has access to the repositories you’re querying
- API key hasn’t been revoked
No tools available
No tools available
Solutions:
- Restart your IDE completely
- Check server shows “Connected” or “Running” status
- Verify MCP is enabled in IDE settings
Tools return empty results
Tools return empty results
Check:
- You have repositories indexed with Greptile
- Your API key has access to those repositories
- There are actual Greptile comments on your PRs
Claude Desktop: GitHub token validation failed
Claude Desktop: GitHub token validation failed
Check:
- Token hasn’t expired
- Token was copied without extra spaces or missing characters
- Token has required scopes for the repositories you’re accessing
Claude Desktop: Failed to start server
Claude Desktop: Failed to start server
Check:
- Both
GREPTILE_API_KEYandGITHUB_TOKENare set in the config - The
greptile-mcp-serverpackage can be accessed via npx
Configuration File Locations
| IDE | Config File |
|---|---|
| Claude Code | ~/.mcp.json or project .mcp.json |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| Cursor | Set via UI (Settings → Tools & MCP) |
| VS Code | ~/.config/Code/User/mcp.json (Linux)~/Library/Application Support/Code/User/mcp.json (macOS) |














