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

# Connect to Windsurf

> Add V5 Gateway as an MCP server in Codeium Windsurf

## Prerequisites

* Windsurf installed (codeium.com/windsurf)
* A V5 bearer token — get one from `POST /admin/tokens/issue` or ask Mishaal

## Setup

<Steps>
  <Step title="Open Windsurf MCP settings">
    In Windsurf, open **Settings** → **MCP Servers** (or edit `.windsurf/mcp.json` in your project).
  </Step>

  <Step title="Add the V5 server">
    ```json .windsurf/mcp.json theme={null}
    {
      "mcpServers": {
        "ascend": {
          "serverUrl": "https://ascend-gateway-v5.ascendgtm.workers.dev/mcp",
          "headers": {
            "Authorization": "Bearer <your-token>"
          }
        }
      }
    }
    ```

    Or via environment variable:

    ```json .windsurf/mcp.json theme={null}
    {
      "mcpServers": {
        "ascend": {
          "serverUrl": "https://ascend-gateway-v5.ascendgtm.workers.dev/mcp",
          "headers": {
            "Authorization": "Bearer ${ASCEND_GATEWAY_TOKEN}"
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Set your token">
    ```bash theme={null}
    export ASCEND_GATEWAY_TOKEN=<your-token>
    ```

    Add to `~/.zprofile` or `~/.bashrc` to persist.
  </Step>

  <Step title="Verify in Cascade">
    Open Cascade (Windsurf's AI panel) and ask: *"How many HubSpot contacts do I have?"*

    Cascade should call `hubspot_crm` and return a count.
  </Step>
</Steps>

## Troubleshooting

**Tools not showing in Cascade** — Restart Windsurf after editing `.windsurf/mcp.json`. Windsurf loads MCP servers at startup.

**AUTH\_FAILED** — Token is invalid or expired. Issue a new one at `/admin/tokens/issue`.

**Tools show but calls fail** — Verify the HubSpot/Google/Salesforce OAuth token for your tenant is present in KV. Run `search_knowledge` with `query: "token status"` to check.
