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

# Connect HasMCP MCP Servers to Windsurf

> How to connect HasMCP servers to the Windsurf editor.

# Using MCP in Windsurf

Windsurf, the AI-powered IDE from Codeium, features native support for the Model Context Protocol (MCP). This allows the Windsurf agent to leverage tools and context from your HasMCP servers to assist with coding tasks.

## 1. Setup via Settings UI

<Steps>
  <Step title="Open Settings">
    Open **Windsurf Settings** (Shortcut: `Cmd + ,` on macOS or `Ctrl + ,` on Windows) and navigate to the **MCP** section in the sidebar.
  </Step>

  <Step title="Add New Server">
    Click **Add New Server** and configure the following:

    * **Name**: A descriptive name for your server (e.g., `hasmcp-api`).
    * **Type**: Choose `sse` (Server-Sent Events) for remote HasMCP connections.
    * **URL**: Your HasMCP server endpoint (e.g., `https://app.hasmcp.com/mcp/<SERVER_ID>`).
  </Step>
</Steps>

## 2. Setup via `mcp_config.json` (Manual)

If you prefer manual configuration, you can edit the Windsurf MCP configuration file directly.

### Configuration Paths

* **macOS/Linux**: `~/.codeium/windsurf/mcp_config.json`
* **Windows**: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`

### Example Configuration

Add your HasMCP server to the `mcpServers` object. Be sure to include your token as `?token=` query string:

```json theme={null}
{
  "mcpServers": {
    "hasmcp-server": {
      "serverUrl": "https://app.hasmcp.com/mcp/<SERVER_ID>?token=<YOUR_ACCESS_TOKEN>"
    }
  }
}
```

## Verifying the Connection

* **Status Indicators**: After adding a server, check the MCP settings panel. A green status indicates a successful connection.
* **Tool Discovery**: You can click on the server entry to see which tools Windsurf has successfully discovered and made available to the AI agent.
* **Using Tools**: Simply prompt the Windsurf agent (e.g., in the chat or through the "Cascade" feature) to use a specific tool (e.g., "List the current projects using the project-manager tool").

## Troubleshooting

<AccordionGroup>
  <Accordion title="Token Refresh">
    If tools stop responding, check the HasMCP dashboard to ensure your token
    hasn't expired. Replace it in your configuration if necessary.
  </Accordion>

  <Accordion title="Restarting">
    If the UI doesn't reflect changes made to `mcp_config.json`, try restarting
    Windsurf.
  </Accordion>
</AccordionGroup>
