How to Add & Configure MCP in Cursor: Complete mcp.json Setup Guide [2026]
Learn how to connect any Model Context Protocol server to Cursor IDE, fix common mcp.json syntax errors, and automate tool injection using the 1-click AIStoreHub CLI.
Master Model Context Protocol in Codeium Windsurf. Step-by-step configuration of mcp_config.json, connecting Cascade to local databases, and fixing stdio errors.
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.
$ aihub mcp install community/postgres-mcp --client cursorpip install aistorehubCLI DocsCodeium'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.
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:
Windsurf manages MCP configurations through a dedicated JSON file named mcp_config.json.
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
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"] } } }
Ctrl+, / Cmd+,).$PATH (especially if Node or uv is installed via nvm, fnm, or local user directories)."C:\\Program Files\\nodejs\\npx.cmd" or "C:\\Users\\<User>\\.local\\bin\\uvx.exe""/usr/local/bin/npx" or "/Users/<User>/.cargo/bin/uvx"mcp_config.json.print("Connected") or console.log("Starting server")) into stdout will corrupt the JSON-RPC wire protocol.stderr (console.error or sys.stderr.write).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.
Verified packages installable directly via terminal into Cursor, Claude Desktop, and Python runtimes.
Inspect schema, explain queries, and generate zero-downtime migrations in Cursor.
Autonomous prospecting, cold emails, and meeting booking with zero API token bills.
Scan charts, calculate risk/reward brackets, and backtest setups via Claude Code.
Essential clarifications for developers and engineering teams building and operating AI systems.
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.
Continue learning how to build, monetize, and operate AI systems effectively.
Learn how to connect any Model Context Protocol server to Cursor IDE, fix common mcp.json syntax errors, and automate tool injection using the 1-click AIStoreHub CLI.
Learn how to find claude_desktop_config.json across Windows and macOS, solve spawn ENOENT path errors, pass API tokens securely, and automate tool installation with AIStoreHub CLI.
Discover the top 10 essential open-source Model Context Protocol (MCP) servers in 2026 for database querying, browser automation, Git intelligence, and memory retention.
Diagnose and fix the top 5 MCP server failure modes: MCP Error -32000 Connection closed, Exit code 1, spawn ENOENT, and unhandled JSON-RPC parse exceptions.