Connect Windsurf to an MCP Server
This guide explains how to connect an MCP server to Windsurf, allowing you to interact with your API using natural language directly within the Windsurf interface.
Interactive Configuration Generator
🛠️ Configuration Generator
Select your authentication type and fill in your details to generate a personalized configuration:
Generated Configuration
{
"mcpServers": {
"my-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://your-mcp-server.com",
"--header",
"API_Key: ${API_KEY}"
],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}
Before You Start
Before connecting Windsurf to your MCP server, make sure you have:
- Access to the Windsurf code editor.
- One of the following:
- A local MCP server generated with liblab CLI.
- A publicly deployed MCP server URL generated on your liblab dashboard.
To learn more about how MCP works, visit the MCP Concept page.
Connect Windsurf to a Remote MCP Server
Use this method if your MCP server is deployed and accessible over the internet through an URL. If you generated your MCP server using the liblab hosting service, use this option.
- Open Windsurf.
- Use the interactive configurator above to generate your configuration with proper authentication.
- In the Windsurf chat, click the MCP servers button (hammer icon), then click Configure. This will open the Manage plugins tab.
- Click View raw config to open the
mcp_config.json
file and paste your generated configuration. - Back in the Manage plugins tab, click Refresh to connect Windsurf to your MCP server and fetch the available tools.
- Once connected, you can query your API using natural language in any Windsurf prompt or chat.
Connect Windsurf to a Local MCP Server
Use this method if you’re running the MCP server locally, generated from an OpenAPI spec using liblab CLI.
If you haven’t yet generated your MCP server, follow the Generate an MCP Server with liblab CLI guide.
After generating the server using the liblab CLI, navigate to the output folder and run:
cd output/mcp
npm run setup
Now, you need to update Windsurf's plugins settings:
-
Open Windsurf.
-
In the Windsurf chat, click the MCP servers button (hammer icon), then click Configure. The Manage plugins tab will appear.
-
Click View raw config to open the
mcp_config.json
file. -
Add your local MCP server configuration. Update the path and environment values accordingly, then save the file.
mcp_config.json{
"mcpServers": {
"your-local-api": {
"command": "node",
"args": [
"<path-to-liblab-generated-mcp-server>/output/mcp/dist/index.js"
],
"env": {
"YOUR_API_KEY": "<your-api-key>"
}
}
}
}MCP server authenticationMake sure to use the correct environment variable name expected by your API.
-
In the Manage plugins tab or directly within the Windsurf chat, click Refresh to load and activate your local MCP server.
-
Once connected, you can query your local API using natural language.
Next Steps
To continue working with MCP and Windsurf, explore these resources: