New PolicyLayer is now the system of record for AI agent authority. Never answer your agent twice
Home / Integrations / Windsurf

Windsurf MCP setup: the complete config reference

Where Windsurf’s MCP config lives, what goes in it, the marketplace and raw-config paths, and how to fix the common failures — plus how to put a policy gate in front of every tool call.

QUICK ANSWERQuick answer: ~/.codeium/windsurf/mcp_config.json (the legacy Codeium directory survived the rebrand). Top-level key is mcpServers.

Where Windsurf keeps its MCP config.

ScopePathNotes
Global ~/.codeium/windsurf/mcp_config.json One global file for all projects. On Windows, ~ is %USERPROFILE%.

Servers can also be managed without touching the file: the MCPs icon in the Cascade panel, or Windsurf Settings → Cascade → MCP Servers.

The config format, key by key.

A top-level mcpServers object, one entry per server. Local servers declare a command; remote servers declare a serverUrl.

KeyWhat it does
command Executable for a stdio server. Use an absolute path if PATH resolution fails.
args Array of arguments passed to the command.
env Environment variables for the server process.
serverUrl Endpoint for a remote server (streamable HTTP or SSE). Plain url is also accepted.
headers HTTP headers for remote servers — where auth tokens go.
~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${env:GITHUB_TOKEN}"
      }
    }
  }
}

REMOTE SERVER (HTTP):

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "my-http-server": {
      "serverUrl": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:TOKEN}"
      }
    }
  }
}

Windsurf interpolates ${env:VAR} and ${file:/path/to/file} inside command, args, env, serverUrl and headers — keep raw secrets out of the file.

What Windsurf speaks.

TransportStatusHow to declare it
stdio Supported Declare command + args.
Streamable HTTP Supported Declare serverUrl ending in /mcp. Teams/Enterprise admins must enable remote transports.
SSE Supported Declare serverUrl pointing at the SSE endpoint. Same admin gating on Teams plans.

Adding a server, three ways.

01 MCP Marketplace

Click the MCPs icon at the top of the Cascade panel and browse the marketplace — Windsurf writes the config for you.

02 Edit the raw config

For servers not in the marketplace, edit ~/.codeium/windsurf/mcp_config.json directly and add an entry under mcpServers.

03 Settings UI

Windsurf Settings → Cascade → MCP Servers manages the same list — enable, disable, and toggle individual tools per server.

Check it's actually connected.

  1. Open the MCP settings page via the MCPs icon in the Cascade panel — a working server lists its discovered tools, each with its own on/off toggle.
  2. Ask Cascade to use one of the tools to confirm the round trip.

When it doesn't work.

New server not appearing

Recheck the JSON in mcp_config.json — a syntax error drops the whole file silently — and confirm you edited ~/.codeium/windsurf/mcp_config.json rather than another client’s config. Then reopen the MCP settings page.

Hitting the 100-tool ceiling

Cascade allows at most 100 active tools at a time. Toggle off unneeded tools per server in the MCP settings — or route through a gateway that exposes a curated subset.

Remote server blocked on a Teams/Enterprise plan

HTTP and SSE transports are admin-gated for managed plans — an admin must enable remote MCP in the org settings.

Secrets sitting in plain text

Use ${env:VAR} or ${file:/path} interpolation instead of pasting tokens into the config.

Command not found on launch

GUI-launched apps don’t always inherit your shell PATH — use an absolute path for command.

Put a policy gate in front of it.

A standard Postgres MCP wired into Windsurf. Every query hits the database directly, with no audit trail and no statement-level controls.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"],
      "env": {}
    }
  }
}

Register the Postgres MCP in PolicyLayer, mint a grant, point Windsurf at the proxy URL. PolicyLayer evaluates every call against the grant’s policy before it reaches the database.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "postgres": {
      "serverUrl": "https://proxy.policylayer.com/mcp/<server-uuid>/",
      "headers": {
        "Authorization": "Bearer <grant-token>"
      }
    }
  }
}

The <server-uuid> appears on each server's detail page. The <grant-token> shows once at mint time. See the Quick start for the full setup walk-through — and if you operate under SOC 2, HIPAA, GDPR or similar, the compliance hub maps how gateway-mediated MCP traffic evidences each framework.

What the gateway adds.

Rate limits
Cap tool calls per minute, hour, or day, per grant or shared across the team.
Access controls
Allow, deny, or conditionally gate any tool against the call's arguments.
Spend caps
Increment a counter by the call's amount; deny when the daily total exceeds your budget.
Audit logs
Every call records the grant, tool, argument keys, and the rule that decided.

A policy in practice.

Allow list_tables. Allow queries, but deny any statement containing DROP, TRUNCATE or DELETE.

policy.json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "query": {
      "deny_if": [
        {
          "conditions": [
            { "path": "args.sql", "op": "regex", "value": "(?i)(DROP|TRUNCATE|DELETE)\\s" }
          ]
        }
      ]
    },
    "list_tables": {}
  }
}

See Writing policies for the policy format, operators, and quota shapes.

Windsurf MCP questions.

Where is the Windsurf MCP config file?+

At ~/.codeium/windsurf/mcp_config.json — the directory kept its Codeium name after the rebrand. Servers can also be managed from the MCPs icon in the Cascade panel or Windsurf Settings → Cascade → MCP Servers.

Why isn’t my new MCP server showing up in Windsurf?+

Usually a config problem: a JSON syntax error drops the whole mcp_config.json silently, or the entry went into another client’s config file. On Teams and Enterprise plans, remote (HTTP/SSE) servers also stay hidden until an admin enables them.

What is the Windsurf MCP tool limit?+

Cascade caps active tools at 100 across all servers. Beyond that, toggle individual tools off on each server’s MCP settings page, or expose a smaller curated set through a gateway.

Does Windsurf support remote MCP servers?+

Yes — declare a serverUrl for streamable HTTP or SSE endpoints, with auth in headers. On Teams and Enterprise plans, remote transports are off until an admin enables them.

How do I keep API keys out of mcp_config.json?+

Use Windsurf’s interpolation: ${env:VAR} reads an environment variable and ${file:/path} reads a file at launch. Both work in env, headers, serverUrl, command and args.

Take your agents live. Without losing control.

Route your MCP traffic through PolicyLayer. Every tool call is checked against your policy before it runs: allow, deny, or require approval. Per-identity grants. Full audit log. Live in minutes.

Instant setup, no code required.

46,500+ MCP servers and 515,000+ tools scanned and risk-classified.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.