Building AI Systems
November 15, 2026•9 min read

How to Add & Configure MCP in Windsurf: Complete Cascade Setup Guide [2026]

Master Model Context Protocol in Codeium Windsurf. Step-by-step configuration of mcp_config.json, connecting Cascade to local databases, and fixing stdio errors.

AIStoreHub
AIStoreHub
Open AI Registry & Developer Platform
Executive Blueprint & Summary (BLUF)

Codeium's Windsurf editor integrates the Model Context Protocol (MCP) directly into its Cascade collaborative agent flow, granting the AI real-time visibility into local file systems, databases, web scrapers, and terminal tools. However, configuration file paths and stdio transport parameters differ subtly from Cursor and Claude Desktop. This guide details the exact mcp_config.json locations across Windows, macOS, and Linux, demonstrates how to connect verified servers, solves the top connection drop issues, and shows how to automate installation using the AIStoreHub CLI.

1-Click Install via AIStoreHub CLI
$ aihub mcp install community/postgres-mcp --client cursor
Requires: pip install aistorehubCLI Docs

Codeium's Windsurf IDE has emerged as one of the premier agentic development environments of 2026. At the core of Windsurf's capabilities is Cascade—an autonomous collaborative agent that doesn't just autocomplete code, but actively reasons over repository architecture, proposes multi-file diffs, and interacts with developer tools.

To unlock Cascade's full potential, Windsurf natively supports the Model Context Protocol (MCP). Through MCP, Cascade can inspect live PostgreSQL schemas, query local SQLite analytics, trigger headless browser tests via Puppeteer, and query private documentation vector stores.

However, many developers transitioning from Cursor or Claude Desktop stumble when configuring Windsurf. Config file locations, property naming conventions, and environment variable inheritance differ between editors.

In this guide, we break down how Windsurf's MCP subsystem functions, provide exact configuration schemas for Windows, macOS, and Linux, solve common connection drops, and show how to manage your toolchain with 1 command.


Registry Shortcut: Want pre-verified MCP servers for Windsurf? Explore the AIStoreHub MCP Catalog for over 250+ community-tested tools with automated configuration support.


Why MCP Supercharges Windsurf's Cascade Agent

Without MCP, Cascade is limited to the files currently open in your workspace. When you ask questions like "Why did this background webhook fail in staging?" or "What foreign keys relate to user_billing?", Cascade has to guess.

With MCP servers attached:

  1. Live State Inspection: Cascade calls MCP tools to query your database, inspecting live schemas and indexes before drafting migrations.
  2. Deterministic Web Research: Through search servers like Brave Search MCP, Cascade fetches breaking library changes and official API docs without hallucinating outdated methods.
  3. Automated Verification: Cascade can run test suites in isolated sandboxes and read formatted test outputs directly through MCP tool returns.

Windsurf Config Architecture & File Locations

Windsurf manages MCP configurations through a dedicated JSON file named mcp_config.json.

OS Configuration File Paths

  • Windows:

    text
    %USERPROFILE%\.codeium\windsurf\mcp_config.json

    (e.g., C:\Users\<Username>\.codeium\windsurf\mcp_config.json)

  • macOS:

    text
    ~/.codeium/windsurf/mcp_config.json
  • Linux:

    text
    ~/.codeium/windsurf/mcp_config.json

Step-by-Step: Adding an MCP Server in Windsurf

Windsurf uses the standard mcpServers root object. Here is a complete, working configuration file demonstrating both Node.js (via npx) and Python (via uvx) transports:

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "C:\\Projects\\my-app"]
    },
    "postgres-inspector": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_URL": "postgresql://postgres:password@localhost:5432/production_replica"
      }
    },
    "git-manager": {
      "command": "uvx",
      "args": ["mcp-server-git"]
    }
  }
}

Activating the Servers in Windsurf:

  1. Open Windsurf.
  2. Open the Windsurf Settings (gear icon or Ctrl+, / Cmd+,).
  3. Navigate to Cascade > Model Context Protocol (MCP).
  4. Click Reload Servers.
  5. When configured properly, each server will display an active status with a list of available tools.

Top Windsurf MCP Errors & How to Fix Them

1. or

  • Cause: Windsurf launched from a desktop shortcut or taskbar does not always inherit your shell's customized $PATH (especially if Node or uv is installed via nvm, fnm, or local user directories).
  • Fix: Specify the absolute path to the executable:
    • On Windows: "C:\\Program Files\\nodejs\\npx.cmd" or "C:\\Users\\<User>\\.local\\bin\\uvx.exe"
    • On macOS/Linux: "/usr/local/bin/npx" or "/Users/<User>/.cargo/bin/uvx"

2. Connection Closed (Exit Code 1)

  • Cause: Missing environment variables or uninstalled runtime packages cause the process to crash immediately on launch.
  • Fix: Run the command manually in your terminal first to verify it boots without error before adding it to mcp_config.json.

3. Stdio Stream Contamination

  • Cause: Custom scripts printing log statements (print("Connected") or console.log("Starting server")) into stdout will corrupt the JSON-RPC wire protocol.
  • Fix: Always redirect logs in custom servers to stderr (console.error or sys.stderr.write).

1-Click Installation with AIStoreHub CLI

Rather than manually managing JSON syntax and tracking executable paths, use the universal open-source AIStoreHub CLI:

bash
# 1. Install or update the CLI
pip install -U aistorehub

# 2. Search for verified tools
aihub search "postgres"

# 3. Inject into Windsurf automatically
aihub mcp install community/postgres-mcp --client windsurf

The CLI automatically locates your Windsurf config file across Windows, macOS, and Linux, validates the JSON schema, creates a timestamped backup, and injects the verified server configuration.


Top 5 MCP Servers for Windsurf Developers

  1. Omniroute MCP: High-performance multi-agent router for terminal execution and complex DAG flows.
  2. Postgres Inspector: Allows Cascade to inspect tables, view constraints, and validate migrations.
  3. Filesystem Server: Enhances Cascade's ability to search large codebases across project boundaries.
  4. Brave Web Search: Gives Cascade live access to official documentation and breaking API releases.
  5. Git Graph MCP: Enables Cascade to review diffs and generate conventional git commit messages.
Interactive Registry Preview

Featured Systems in the AIStoreHub Registry

Verified packages installable directly via terminal into Cursor, Claude Desktop, and Python runtimes.

Browse all 143 systems
MCP Server
PostgreSQL & SQLite Inspector

Inspect schema, explain queries, and generate zero-downtime migrations in Cursor.

Autonomous Agent
Harvey 24/7 AI Sales Agent

Autonomous prospecting, cold emails, and meeting booking with zero API token bills.

Claude Skill
Day Trader Skills: 11 Claude Skills

Scan charts, calculate risk/reward brackets, and backtest setups via Claude Code.

Frequently Asked Questions

Essential clarifications for developers and engineering teams building and operating AI systems.

On Windows, Windsurf stores its MCP configuration in %USERPROFILE%\.codeium\windsurf\mcp_config.json. You can open it via Win+R by entering notepad %USERPROFILE%\.codeium\windsurf\mcp_config.json.
AIStoreHub
Written by AIStoreHub
Open AI Registry & Developer Platform

AIStoreHub is the open registry and 1-click CLI for discovering, running, and installing production-grade AI systems, Model Context Protocol (MCP) servers, and autonomous agents.

Topics:#Windsurf#Codeium#MCP#Cascade#Developer Tools#AI Code Editor#CLI
Sponsored AdvertisementAds by Google

Related Engineering Guides

Continue learning how to build, monetize, and operate AI systems effectively.