Skip to main content
RapidDev - Software Development Agency
mcp-tutorial

How to connect MCP servers to Windsurf

Connect MCP servers to Windsurf by editing ~/.codeium/windsurf/mcp_config.json with a mcpServers object. Windsurf has a hard limit of 100 tools across all connected servers, so choose servers carefully. Restart Windsurf after saving the config. Tools become available in Windsurf's Cascade AI assistant for chat and autonomous coding tasks.

What you'll learn

  • How to locate and edit Windsurf's MCP config file
  • The 100-tool limit in Windsurf and how to work within it
  • How to configure stdio and HTTP-based MCP servers
  • How to verify connections and use MCP tools in Cascade
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read5 minWindsurf (latest version), any MCP serverMarch 2026RapidDev Engineering Team
TL;DR

Connect MCP servers to Windsurf by editing ~/.codeium/windsurf/mcp_config.json with a mcpServers object. Windsurf has a hard limit of 100 tools across all connected servers, so choose servers carefully. Restart Windsurf after saving the config. Tools become available in Windsurf's Cascade AI assistant for chat and autonomous coding tasks.

Configure MCP Servers in Windsurf

Windsurf (by Codeium) supports MCP servers through a global configuration file at ~/.codeium/windsurf/mcp_config.json. The configuration format uses the same 'mcpServers' key as Claude Desktop and Cursor. The key limitation to know about is Windsurf's 100-tool hard limit across all connected servers — if your servers collectively expose more than 100 tools, some will be unavailable. This tutorial covers setup, configuration, and working within Windsurf's constraints.

Prerequisites

  • Windsurf installed (latest version)
  • An MCP server to connect (npm package, local server, or Docker image)
  • A text editor to modify JSON files

Step-by-step guide

1

Locate the Windsurf MCP configuration file

Windsurf stores MCP configuration in a global file at ~/.codeium/windsurf/mcp_config.json. Unlike Cursor and VS Code, Windsurf does not support project-level MCP configuration — all servers are configured globally. If the file does not exist, create it along with the parent directories.

typescript
1# macOS/Linux create the directory and file if they do not exist
2mkdir -p ~/.codeium/windsurf
3touch ~/.codeium/windsurf/mcp_config.json
4
5# Open in your default editor
6open ~/.codeium/windsurf/mcp_config.json

Expected result: The mcp_config.json file exists at ~/.codeium/windsurf/ and is open in your editor.

2

Add MCP servers to the configuration

Add a mcpServers object (same key as Claude Desktop and Cursor). Each server entry has a unique name, a command to execute, args for command-line arguments, and optional env for environment variables. Start with one or two servers and verify they work before adding more.

typescript
1// ~/.codeium/windsurf/mcp_config.json
2{
3 "mcpServers": {
4 "filesystem": {
5 "command": "npx",
6 "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
7 },
8 "memory": {
9 "command": "npx",
10 "args": ["-y", "@modelcontextprotocol/server-memory"]
11 }
12 }
13}

Expected result: The config file has servers defined using the mcpServers key.

3

Add servers with environment variables

Use the env field for API keys and secrets. This works identically to Claude Desktop and Cursor configurations. Be mindful of the 100-tool limit when adding servers that expose many tools (like the GitHub server which exposes 20+ tools).

typescript
1{
2 "mcpServers": {
3 "filesystem": {
4 "command": "npx",
5 "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
6 },
7 "brave-search": {
8 "command": "npx",
9 "args": ["-y", "@modelcontextprotocol/server-brave-search"],
10 "env": {
11 "BRAVE_API_KEY": "your-brave-api-key"
12 }
13 },
14 "github": {
15 "command": "docker",
16 "args": ["run", "-i", "--rm",
17 "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
18 "ghcr.io/github/github-mcp-server"],
19 "env": {
20 "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
21 }
22 }
23 }
24}

Expected result: Multiple servers configured with API keys passed via environment variables.

4

Plan around the 100-tool limit

Windsurf enforces a hard limit of 100 tools across all connected MCP servers. If your servers collectively expose more than 100 tools, the excess tools are silently dropped. To work within this limit: check how many tools each server exposes (use MCP Inspector), prioritize the most useful servers, and consider building custom servers that expose only the tools you need instead of connecting large general-purpose servers.

typescript
1// Typical tool counts for popular MCP servers:
2// Filesystem: ~11 tools
3// GitHub: ~20+ tools
4// Brave Search: ~2 tools
5// Memory: ~5 tools
6// PostgreSQL: ~5 tools
7// Puppeteer: ~10 tools
8//
9// Total if all connected: ~53 tools — well within the 100 limit
10// Be careful adding many servers — it adds up fast

Expected result: You have a plan for which servers to connect that stays within the 100-tool limit.

5

Restart Windsurf and verify connections

After saving mcp_config.json, fully restart Windsurf. Open Cascade (Windsurf's AI assistant) and check for available MCP tools. You can verify connections by asking Cascade to use a tool from one of your configured servers.

Expected result: Windsurf recognizes the configured MCP servers and their tools are available in Cascade.

6

Test MCP tools in Cascade

Open Cascade and ask a question that requires an MCP tool. For example, with the filesystem server connected, ask about files in your project directory. Cascade will use the MCP tools autonomously as part of its response, similar to how Claude Desktop and Cursor handle tool calls.

Expected result: Cascade successfully calls MCP tools and uses the results to answer your questions.

Complete working example

mcp_config.json
1{
2 "mcpServers": {
3 "filesystem": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "@modelcontextprotocol/server-filesystem",
8 "/Users/you/projects"
9 ]
10 },
11 "brave-search": {
12 "command": "npx",
13 "args": ["-y", "@modelcontextprotocol/server-brave-search"],
14 "env": {
15 "BRAVE_API_KEY": "your-brave-api-key"
16 }
17 },
18 "github": {
19 "command": "docker",
20 "args": [
21 "run", "-i", "--rm",
22 "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
23 "ghcr.io/github/github-mcp-server"
24 ],
25 "env": {
26 "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
27 }
28 },
29 "memory": {
30 "command": "npx",
31 "args": ["-y", "@modelcontextprotocol/server-memory"]
32 },
33 "custom-server": {
34 "command": "npx",
35 "args": ["-y", "tsx", "/absolute/path/to/server/src/index.ts"],
36 "env": {
37 "API_KEY": "your-api-key"
38 }
39 }
40 }
41}

Common mistakes when connecting MCP servers to Windsurf

Why it's a problem: Creating a project-level config file

How to avoid: Windsurf only reads the global config at ~/.codeium/windsurf/mcp_config.json. Unlike Cursor and VS Code, Windsurf does not support project-level MCP configuration files.

Why it's a problem: Exceeding the 100-tool limit

How to avoid: Windsurf silently drops tools beyond the 100-tool limit. Use MCP Inspector to count tools per server and stay within the limit. Prioritize essential servers and remove unused ones.

Why it's a problem: Using 'servers' instead of 'mcpServers'

How to avoid: Windsurf uses the 'mcpServers' key (like Claude Desktop and Cursor), not 'servers' (which is VS Code's format).

Why it's a problem: Wrong config file path

How to avoid: The file must be at ~/.codeium/windsurf/mcp_config.json exactly. Common mistakes: putting it in ~/.windsurf/, ~/.config/windsurf/, or the project directory.

Best practices

  • Check tool counts before adding servers — stay under Windsurf's 100-tool limit
  • Use absolute paths for all directory arguments and server file paths
  • Pass secrets via the env field, never as command-line arguments
  • Always include -y in npx commands to prevent installation prompts from hanging
  • Test servers with MCP Inspector before adding them to Windsurf
  • Keep a documented list of which servers are configured and their tool counts
  • Consider building focused custom servers with only the tools you need instead of using large general-purpose servers
  • Restart Windsurf fully after config changes — reloading the window may not be sufficient

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

Show me how to configure MCP servers in Windsurf. I know the config file is at ~/.codeium/windsurf/mcp_config.json and there is a 100-tool limit. Show a complete config with filesystem, Brave Search, and GitHub servers, including tool count planning.

MCP Prompt

Help me set up MCP servers in Windsurf. I want to connect filesystem and Brave Search servers. Show the mcp_config.json contents, where to put the file, and how to verify the connection in Cascade.

Frequently asked questions

Where is the Windsurf MCP config file?

~/.codeium/windsurf/mcp_config.json. This is a global file — Windsurf does not support project-level MCP configuration.

What happens when I exceed the 100-tool limit?

Windsurf silently drops tools beyond the limit. You will not see an error, but some tools simply will not be available to Cascade. Use MCP Inspector to audit tool counts per server.

Can I use the same config file for Windsurf and Claude Desktop?

The format is compatible (both use mcpServers key), but the file locations are different. You could copy the file, but each tool reads from its own specific path.

Does Windsurf support remote MCP servers?

Yes. Use a url field instead of command/args to connect to remote servers via Streamable HTTP transport, just like Claude Desktop.

Can RapidDev help optimize our Windsurf MCP setup?

Yes. RapidDev helps teams build focused custom MCP servers optimized for Windsurf's 100-tool limit, ensuring you get the most valuable tools within the constraint. We also help with multi-editor MCP setups across Windsurf, Cursor, and Claude Desktop.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.