> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trilo.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Set up Trilo's MCP server in Cursor with Personal Access Token authentication

<img className="dark:hidden" src="https://mintcdn.com/trilo/Sn4xCqXfS0z4bBRK/images/mcp/cursor.svg?fit=max&auto=format&n=Sn4xCqXfS0z4bBRK&q=85&s=d5c1c299177b200d32c18108145c14f7" alt="Cursor" width="48" noZoom data-path="images/mcp/cursor.svg" />

<img className="dark:block hidden" src="https://mintcdn.com/trilo/Sn4xCqXfS0z4bBRK/images/mcp/cursor-dark.svg?fit=max&auto=format&n=Sn4xCqXfS0z4bBRK&q=85&s=eb10829385a44ba17795f4881bd1b0df" alt="Cursor" width="48" noZoom data-path="images/mcp/cursor-dark.svg" />

[Cursor](https://cursor.com) is an AI-powered code editor. Connect it to Trilo via MCP to manage your workspace directly from the editor.

## Setup

<Steps>
  <Step title="Create a Personal Access Token">
    In Trilo, go to **Profile Settings** > **API** > **Create Token**. Select the scopes you need (`mcp:read`, `mcp:write`) and copy the token.
  </Step>

  <Step title="Add the MCP server">
    Choose one of these options:

    **Option A — Settings UI:**

    1. Open **Cursor Settings** > **MCP**
    2. Click **Add MCP Server**
    3. Set the URL to `https://api.trilo.chat/mcp`
    4. Add the Authorization header with your PAT

    **Option B — Config file (project-level):**

    Create or edit `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "trilo": {
          "url": "https://api.trilo.chat/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_TOKEN_HERE"
          }
        }
      }
    }
    ```

    Replace `YOUR_TOKEN_HERE` with the PAT you copied.
  </Step>

  <Step title="Verify the connection">
    In Cursor's AI chat, ask:

    ```
    List my Trilo workspaces
    ```

    If it returns your workspace data, you're connected.
  </Step>
</Steps>

<Tip>
  Using `.cursor/mcp.json` in the project root scopes the MCP connection to that project. For access across **all projects**, add the config to `~/.cursor/mcp.json` instead. Either way, add the file to your `.gitignore` to keep your token out of version control.
</Tip>

## Options

Append query parameters to the MCP URL for additional control:

| Parameter      | Description                      | Example                                           |
| -------------- | -------------------------------- | ------------------------------------------------- |
| `workspace_id` | Restrict to a specific workspace | `https://api.trilo.chat/mcp?workspace_id=abc-123` |
| `read_only`    | Force read-only mode             | `https://api.trilo.chat/mcp?read_only=true`       |

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    * Verify your token starts with `trilo_pat_`
    * Check the `Authorization` header uses the `Bearer` prefix
    * Confirm the token hasn't been revoked in **Profile Settings** > **API**
  </Accordion>

  <Accordion title="Tools not appearing">
    Restart Cursor after adding the MCP server. Verify the URL is exactly `https://api.trilo.chat/mcp` with no trailing slash.
  </Accordion>

  <Accordion title="Session expired (error -32002)">
    MCP sessions expire after 30 minutes of inactivity. Cursor usually reconnects automatically. If not, restart the editor.
  </Accordion>
</AccordionGroup>
