docs/sf/guides/mcp/setup.md
This guide provides instructions for setting up and running the Serverless MCP Server.
The method for connecting a host application to the MCP Server depends on the specific host application you're using. Here are some common examples:
Cursor supports the Model Context Protocol (MCP). You can connect using either stdio or SSE transport:
Open Cursor Settings > MCP
Click "Add new global MCP server" and configure the Serverless MCP Server:
{
"mcpServers": {
"serverless": {
"command": "serverless",
"args": ["mcp"]
}
}
}
Save the configuration and restart Cursor if needed
Start the MCP server with SSE transport manually:
serverless mcp --transport sse
Open Cursor Settings > MCP
Click "Add new global MCP server" and configure the Serverless MCP Server:
{
"mcpServers": {
"serverless": {
"url": "http://localhost:3001/sse"
}
}
}
For more details, see the Cursor MCP documentation
Windsurf has built-in support for the Model Context Protocol. You can connect using either stdio or SSE transport:
Open Windsurf Settings > General
Scroll to the Cascade section and click "Add Server"
Click "Add custom server +" and configure the Serverless MCP Server:
{
"mcpServers": {
"serverless": {
"command": "serverless",
"args": ["mcp"]
}
}
}
Save the configuration and restart Windsurf if needed
Start the MCP server with SSE transport manually:
serverless mcp --transport sse
Open Windsurf Settings > General
Scroll to the Cascade section and click "Add Server"
Click "Add custom server +" and configure the Serverless MCP Server:
{
"mcpServers": {
"serverless": {
"url": "http://localhost:3001/sse"
}
}
}
Save the configuration and restart Windsurf if needed
For more details, see the Windsurf MCP documentation
If you're building a custom integration, you can connect to the MCP Server using:
http://localhost:3001 (or your custom port)You can use the MCP Server with any MCP client, including the official MCP client library. Here's an example of how to connect to the server programmatically:
const { createClient } = require('@mcp/client')
// Create a client that connects to the server
const client = createClient({
url: 'http://localhost:3001',
})
// Call the list-resources tool
client
.callTool('list-resources', {
serviceName: 'my-service',
serviceType: 'serverless-framework',
})
.then((result) => {
console.log('Resources:', result)
})
.catch((error) => {
console.error('Error:', error)
})
This approach allows you to integrate the MCP Server with your own applications and workflows.
Now that you have set up the MCP Server, you can start using it with your AI assistant. Check out the following resources: