Skip to content

IDE Setup

Fresh

Step-by-step setup for Greptile MCP server in Cursor, Claude Code, VS Code, and Codex CLI. Access code review tools and custom context directly from your IDE.

Configure the Greptile MCP server in your IDE to access code review tools and custom context.

Note

Prerequisite: Get your API key from app.greptile.com/settings/organization/api (Settings > Organization > API Keys)

Setup by IDE

Cursor

Open Settings

    Click the 'Settings' icon or press `Ctrl + Shift + J` (Windows/Linux) or `Cmd + Shift + J` (macOS).

Go to Tools & MCP

    Click **Tools & MCP** in the left sidebar.

!Cursor Tools and MCP settings

Add Custom MCP

    Click **Add Custom MCP**.

!Add custom MCP button

Configure mcp.json

    Add the following configuration:

    ```json theme={}
    {
      "mcpServers": {
        "greptile": {
          "type": "http",
          "url": "https://api.greptile.com/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_GREPTILE_API_KEY"
          }
        }
      }
    }
    ```

    Replace `YOUR_GREPTILE_API_KEY` with your actual API key. Save the file.

Verify Connection

    Return to **Tools & MCP**. You should see Greptile with all 11 tools enabled.

!Greptile MCP enabled in Cursor

Claude Code (CLI)

Add Greptile MCP Server

    Run the following command in your terminal:

    ```bash theme={}
    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.

Verify Installation

    Check that the server was added:

    ```bash theme={}
    claude mcp list
    ```

    You should see:

    ```
    greptile: https://api.greptile.com/mcp (HTTP) - ✓ Connected
    ```

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:

```json theme={}
{
  "servers": {
    "greptile": {
      "transport": "http",
      "url": "https://api.greptile.com/mcp",
      "headers": {
        "Authorization": "Bearer ${GREPTILE_API_KEY}"
      }
    }
  }
}
```

Then set the environment variable:

```bash theme={}
export GREPTILE_API_KEY=your-api-key-here
```

VS Code

Open Command Palette

    Press `Ctrl + Shift + P` (Windows/Linux) or `Cmd + Shift + P` (macOS).

Add MCP Server

    Type `MCP` and select **MCP: Add Server**.

!Add MCP Server in VS Code

Select HTTP Type

    Choose **HTTP (HTTP or Server-Sent-Events)**.

!Select HTTP type

Enter URL

    Enter: `https://api.greptile.com/mcp`

Select Scope

    Choose **Global** or **Workspace**.

!Select scope

Add Authorization Header

    An `mcp.json` file will be created. Add the Authorization header:

    ```json theme={}
    {
      "servers": {
        "greptile": {
          "url": "https://api.greptile.com/mcp",
          "type": "http",
          "headers": {
            "Authorization": "Bearer YOUR_GREPTILE_API_KEY"
          }
        }
      }
    }
    ```

    Replace `YOUR_GREPTILE_API_KEY` with your actual API key.

Verify Installation

    Run **MCP: List Servers** from Command Palette. You should see Greptile with status **Running**.

!MCP server status

Codex (CLI)

Add Greptile MCP Server

    Run the following command in your terminal:

    ```bash theme={}
    codex mcp add greptile --url https://api.greptile.com/mcp \
      --bearer-token-env-var GREPTILE_API_KEY
    ```

    Then set your API key as an environment variable:

    ```bash theme={}
    export GREPTILE_API_KEY=your-api-key-here
    ```

Verify Installation

    Check that the server was added:

    ```bash theme={}
    codex mcp list
    ```

    You should see:

    ```
    Name      Url                           Bearer Token Env Var  Status   Auth
    greptile  https://api.greptile.com/mcp  GREPTILE_API_KEY      enabled  Bearer token
    ```

Start Using

    Open Codex. The Greptile MCP tools are available automatically.
  


### Project-Level Configuration

For team-shared configuration, create a `.codex/config.toml` file in your project root:

```toml theme={}
[mcp_servers.greptile]
url = "https://api.greptile.com/mcp"
bearer_token_env_var = "GREPTILE_API_KEY"
```

Then set the environment variable:

```bash theme={}
export GREPTILE_API_KEY=your-api-key-here
```

Verify Connection

Test your setup with curl:

bash
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:

json
{"jsonrpc":"2.0","id":1,"result":{}}

Troubleshooting

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)

**Fix:** Restart your IDE after making configuration changes.

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

**Test:** Use the curl command above to verify your API key works.

No tools available

**Solutions:**

1. Restart your IDE completely
2. Check server shows "Connected" or "Running" status
3. Verify MCP is enabled in IDE settings

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

Configuration File Locations

IDEConfig File
Claude Code~/.mcp.json or project .mcp.json
Cursor~/.cursor/mcp.json
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

Auto-Fix Workflow

Learn to resolve Greptile comments from your IDE

Tools Reference

Complete API documentation for all 11 tools

Source

Mirrored from the official Greptile documentation. Self-contained reference copy.