Setting Up the MCP Server
This guide provides instructions for setting up and running the Serverless MCP Server.
Basic Setup
Connecting a Host Application
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
Cursor supports the Model Context Protocol (MCP). You can connect using either stdio or SSE transport:
Option 1: Stdio 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
Option 2: SSE Transport
-
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
Windsurf has built-in support for the Model Context Protocol. You can connect using either stdio or SSE transport:
Option 1: Stdio 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
Option 2: SSE Transport
-
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
Custom Integration
If you're building a custom integration, you can connect to the MCP Server using:
- For HTTP/SSE transport: Connect to
http://localhost:3001(or your custom port) - For stdio transport: Use standard input/output streams for communication
Programmatic Integration
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.
Next Steps
Now that you have set up the MCP Server, you can start using it with your AI assistant. Check out the following resources:
- Available Tools - Learn about the tools available in the MCP Server
- AWS Integration - Configure AWS credentials for the MCP Server