> ## 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.

# Windsurf

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

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

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

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

<Note>
  Windsurf uses `serverUrl` instead of `url` in its MCP config — make sure to use the correct field name.
</Note>

## 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 **Windsurf Settings** > **Cascade** > **MCP Servers** (or click the **MCPs** icon in the Cascade panel)
    2. Click **Configure** to add a new server
    3. Set the URL to `https://api.trilo.chat/mcp`
    4. Add the Authorization header with your PAT

    **Option B — Config file:**

    Edit `~/.codeium/windsurf/mcp_config.json`:

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

    Replace `YOUR_TOKEN_HERE` with the PAT you copied.

    <Tip>
      You can use environment variables in the config: `"Authorization": "Bearer ${env:TRILO_PAT}"` to avoid hardcoding your token.
    </Tip>
  </Step>

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

    ```
    List my Trilo workspaces
    ```

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

## 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 Windsurf after adding the MCP server. Verify you used `serverUrl` (not `url`) in the config, and that 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. Windsurf usually reconnects automatically. If not, restart the editor.
  </Accordion>
</AccordionGroup>
