Skip to main content

ActValue Lambda MCP Server

A Python library for creating MCP (Model Context Protocol) servers that run on AWS Lambda.

Installation

pip install actvalue.lambda-mcp-server

Quick Start

from lambda_mcp import LambdaMCPServer

# Create a server instance
server = LambdaMCPServer(
    name="my-mcp-server",
    version="1.0.0",
    instructions="A sample MCP server running on Lambda"
)

# Register tools using the decorator
@server.tool()
def hello_world(name: str) -> str:
    """Say hello to someone"""
    return f"Hello, {name}!"

# Lambda handler
def lambda_handler(event, context):
    return server.handle_request(event, context)

Features

  • AWS Lambda Integration: Designed specifically for serverless deployment
  • Session Management: Built-in Redis-based session storage
  • Tool Registration: Easy decorator-based tool registration
  • MCP Protocol: Full MCP protocol compliance
  • Type Safety: Complete type annotations for better development experience

Configuration

Basic Configuration

server = LambdaMCPServer(
    name="my-server",
    version="1.0.0",
    instructions="Server description",
    cache_prefix="my_sessions",  # Redis key prefix
    redis_url="redis://localhost:6379/0"
)

Environment Variables

  • REDIS_URL: Redis connection URL
  • LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR)

Session Management

Access and modify session data within your tools:

@server.tool()
def store_data(key: str, value: str) -> str:
    session = server.get_session()
    if session:
        session.data[key] = value
        return f"Stored {key} = {value}"
    return "No active session"

@server.tool()
def get_data(key: str) -> str:
    session = server.get_session()
    if session and key in session.data:
        return str(session.data[key])
    return "Key not found"

Develpment and test

Create and activate virtual environment

python -m venv .venv
source .venv/bin/activate

Install package in development mode

pip install -e .

See examples and their README.md file.

Metadata

Release files for actvalue.lambda-mcp-server 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actvalue.lambda-mcp-server 2.0.0
File Size Uploaded
actvalue_lambda_mcp_server-2.0.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for actvalue.lambda-mcp-server 2.0.0
File Interpreter ABI Platform
actvalue_lambda_mcp_server-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.4 kB

Release files / actvalue_lambda_mcp_server-2.0.0.tar.gz

Download URL actvalue_lambda_mcp_server-2.0.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
480e51906ed9f28561daa3dda3e6f5efbd81bd68209a2f30968d6231e211c750
BLAKE2b-256 checksum
How to use checksums
237f66c7450739fdb837bf56231c74a64d332aef044fd0dcd541e264c03d4a14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / actvalue_lambda_mcp_server-2.0.0-py3-none-any.whl

Download URL actvalue_lambda_mcp_server-2.0.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cc84a36e72f2b833c1c94e598e40ed3859d86f52d5772b9063aa16ef5b7cd22
BLAKE2b-256 checksum
How to use checksums
82fcc6b1eff2011754f176fb9f58efdbc49318226d539157e22949837d00d502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page