The Lambda Performance MCP Server is a Node.js-based tool that provides comprehensive analysis, monitoring, and optimization of AWS Lambda functions. It enables you to:
Analyze performance metrics including cold starts, duration, memory usage, error rates, and invocation counts for individual functions
Track cold start patterns and frequency to identify optimization opportunities
Get targeted optimization recommendations for cold start performance, memory allocation, execution duration, and cost reduction
Compare performance metrics (duration, cold starts, errors, invocations, cost) across multiple Lambda functions over specified time ranges
List all Lambda functions in your AWS account with optional basic performance metrics
Analyze memory utilization and provide right-sizing recommendations to optimize resource allocation
Perform cost analysis for individual functions or across your entire account to identify cost optimization opportunities
Monitor real-time performance metrics and receive alerts for ongoing Lambda function monitoring
Provides comprehensive performance analysis, cold start tracking, memory utilization monitoring, cost analysis, and optimization recommendations for AWS Lambda functions through CloudWatch metrics and logs
Lambda Performance MCP Server (Node.js)
A comprehensive Model Context Protocol (MCP) server for analyzing AWS Lambda performance, tracking cold starts, and providing optimization recommendations. Built with Node.js and the AWS SDK v3.
Features
Performance Analysis
- Comprehensive Metrics: Duration, memory usage, error rates, invocation counts
- Cold Start Tracking: Detailed analysis of cold start patterns and frequency
- Real-time Monitoring: Live performance metrics and alerts
- Cost Analysis: Detailed cost breakdown and optimization opportunities
Advanced Analytics
- Percentile Analysis: P50, P90, P95, P99 duration metrics
- Memory Utilization: Right-sizing recommendations based on actual usage
- Error Pattern Analysis: Identify and categorize error types
- Trend Analysis: Performance trends over time
Optimization Recommendations
- Cold Start Optimization: Provisioned concurrency, package size, initialization
- Memory Right-sizing: Optimal memory allocation based on usage patterns
- Cost Optimization: ARM architecture, duration optimization, resource efficiency
- Performance Tuning: Code optimization, connection pooling, caching strategies
Comparative Analysis
- Multi-function Comparison: Compare performance across multiple Lambda functions
- Benchmarking: Identify best and worst performers
- Resource Utilization: Compare memory, duration, and cost metrics
Installation
- Clone the repository:
- Install dependencies:
- Configure environment:
- Set up AWS credentials:
Required AWS Permissions
The MCP server requires the following AWS permissions:
Usage
Running the MCP Server
Available Tools
1. Analyze Lambda Performance
2. Track Cold Starts
3. Get Optimization Recommendations
4. Compare Lambda Performance
5. List Lambda Functions
6. Analyze Memory Utilization
7. Get Cost Analysis
8. Monitor Real-time Performance
Configuration with MCP Clients
To use this MCP server with MCP clients, add it to your MCP configuration:
Workspace Configuration (.mcp/settings/mcp.json
)
Global Configuration (~/.mcp/settings/mcp.json
)
Key Features Explained
Cold Start Analysis
- Pattern Detection: Identifies when and why cold starts occur
- Duration Analysis: Tracks initialization times and optimization opportunities
- Trigger Identification: Determines what causes cold starts (idle time, scaling, deployments)
- Timeline Visualization: Shows cold start frequency over time
Performance Optimization
- Memory Right-sizing: Analyzes actual memory usage vs. allocated memory
- Duration Optimization: Identifies performance bottlenecks and optimization opportunities
- Cost Optimization: Provides recommendations to reduce Lambda costs
- Architecture Recommendations: Suggests ARM vs x86 based on workload compatibility
Real-time Monitoring
- Live Metrics: Current invocation rates, duration, and error rates
- Performance Alerts: Automatic detection of performance issues
- Activity Tracking: Recent invocation history and patterns
Example Outputs
Performance Analysis
Optimization Recommendations
Troubleshooting
Common Issues
- Permission Errors
- Ensure AWS credentials have required permissions
- Check CloudWatch Logs access for cold start analysis
- No Data Available
- Verify function name is correct
- Check if function has been invoked in the specified time range
- Ensure CloudWatch logging is enabled
- Connection Timeouts
- Check AWS region configuration
- Verify network connectivity to AWS services
Debug Mode
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues and questions:
- Check the troubleshooting section
- Review AWS permissions
- Verify environment configuration
- Check CloudWatch Logs for detailed error messages
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Enables comprehensive analysis of AWS Lambda performance including cold start tracking, memory utilization monitoring, cost analysis, and optimization recommendations. Provides real-time metrics, comparative analysis across multiple functions, and actionable insights to improve Lambda performance and reduce costs.
Related MCP Servers
- AsecurityAlicenseAqualityEnables AI models to interact with AWS Lambda functions via the MCP protocol, allowing access to private resources, real-time data, and custom computation in a secure environment.Last updated -2108MIT License
- AsecurityAlicenseAqualityA command-line interface and API that allows users to analyze and visualize AWS cloud spending data by enabling Claude to query AWS Cost Explorer through natural language conversations.Last updated -4122MIT License
- AsecurityAlicenseAqualityA server that enables LLMs like Claude to query AWS DynamoDB databases through natural language requests, supporting table management, data querying, and schema analysis.Last updated -729MIT License
- -securityAlicense-qualityA Node.js package providing Model Context Protocol server infrastructure for AWS Lambda functions with streaming response capabilities through Server-Sent Events.Last updated -11212MIT License