MCP2Lambda is a bridge that enables AI models to interact with AWS Lambda functions as tools without code changes. By implementing the Model Context Protocol (MCP), it allows large language models to access and invoke Lambda functions, extending their capabilities to interact with AWS services, private networks, and the internet.
The simplest way to install MCP2Lambda for Claude Desktop is via Smithery:
npx -y @smithery/cli install @danilop/MCP2Lambda --client claude
Clone the repository:
git clone https://github.com/yourusername/mcp2lambda.git
cd mcp2lambda
Configure AWS credentials:
aws configure
MCP2Lambda includes sample functions to demonstrate its capabilities:
Install the AWS SAM CLI from the official documentation
Deploy the sample functions:
cd sample_functions
sam build
sam deploy
The sample functions will be deployed with the prefix mcp2lambda-
and include:
MCP2Lambda supports two operational modes:
Control this behavior with:
# Disable pre-discovery mode via environment variable
export PRE_DISCOVERY=false
python main.py
# Or using CLI flag
python main.py --no-pre-discovery
Add MCP2Lambda to your Claude Desktop configuration file:
{
"mcpServers": {
"mcp2lambda": {
"command": "uv",
"args": [
"--directory",
"<full path to the mcp2lambda directory>",
"run",
"main.py"
]
}
}
}
Add to your Claude personal preferences:
Use the AWS Lambda tools to improve your answers.
MCP2Lambda works with Amazon Bedrock's Converse API:
Navigate to the client directory:
cd mcp_client_bedrock
Install dependencies:
uv pip install -e .
Run the client:
python main.py
You can configure different Bedrock models by modifying the model_id
in main.py
:
model_id = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
#model_id = "us.amazon.nova-pro-v1:0"
Start the MCP server locally:
cd mcp2lambda
uv run main.py
By default, only Lambda functions whose names start with mcp2lambda-
will be available to the model.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.