Skip to main content

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

1

Open Settings

Open Windsurf Settings (Shortcut: Cmd + , on macOS or Ctrl + , on Windows) and navigate to the MCP section in the sidebar.
2

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

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:
{
  "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

If tools stop responding, check the HasMCP dashboard to ensure your token hasn’t expired. Replace it in your configuration if necessary.
If the UI doesn’t reflect changes made to mcp_config.json, try restarting Windsurf.