
mikegc-aws/lambda-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
mikegc-aws/lambda-mcp-server は、https://github.com/mikegc-aws/lambda-mcp-server. からインポートされたMCPサーバー候補です。
概要
mikegc-aws/lambda-mcp-server は、https://github.com/mikegc-aws/lambda-mcp-server. からインポートされたMCPサーバー候補です。
概要(AI 翻訳)
** ⚠️ 重要:Lambda MCPサーバーのモジュールコードは管理されていますが、このリポジトリには含まれていません。現在はawslabs/mcp-lambda-handlerでホストおよびメンテナンスされています。このリポジトリはモジュールの使い方のサンプルコードとして残っています。**
Lambda MCPサーバーを使用するには、PyPIから直接パッケージをインストールしてください:
このサーバーはStreamable HTTP(SSEではなく)をサポートするクライアントを必要とします。現在、Streamable HTTPをサポートするMCPクライアントはいくつか存在し、その中にはMCP Inspectorも含まれています。このリポジトリにはStreamable HTTPクライアントとして、Strands Agentsというビルドも含まれています。
このプロジェクトは、AWS Lambdaを用いてサーバーレスMCP(モデルコンテキストプロトコル)ツールを作成する強力かつ開発者に優しい方法を示しています。最小限のボイラープレートで優れた開発者体験を提供するステートレス・サーバーレスMCPサーバーの構築方法を紹介します。
the_context()
the_contextのエピソードで、ティファニー・ソウテルとマイクはMCP向けのストリーミング可能なHTTPや、このプロジェクトの(古いバージョン)の運営について話しました。
例
以下はAWS Lambda関数でMCPサーバーを動かすための最小限のコードです:
セッション州管理
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Lambda MCP Server Demo (Streamable HTTP)
⚠️ IMPORTANT: The Lambda MCP Server module code IS maintained, just not in this repository. It is now hosted and maintained at awslabs/mcp-lambda-handler. This repository remains as sample code of how to use the module.
To use the Lambda MCP Server, install the package directly from PyPI:
pip install awslabs.mcp_lambda_handler # or, if using uv: uv add awslabs.mcp_lambda_handler
This server requires a client that supports Streamable HTTP (not SSE). There are a few MCP clients that currently support Streamable HTTP including the MCP Inspector. There is also as a Streamable HTTP client included in this repo, built Strands Agents.
This project demonstrates a powerful and developer-friendly way to create serverless MCP (Model Context Protocol) tools using AWS Lambda. It showcases how to build a stateless, serverless MCP server with minimal boilerplate and an excellent developer experience.
the_context()
In an episode of the_context, Tiffany Souterre and Mike discussed streamable HTTP for MCP as well as running (an older version of) this project:
Example
Here is the minimal code to get an MCP server running in an AWS Lambda function:
from awslabs.mcp_lambda_handler import MCPLambdaHandler
mcp_server = MCPLambdaHandler(name="mcp-lambda-server", version="1.0.0")
@mcp_server.tool()
def get_time() -> str:
from datetime import datetime, UTC
return datetime.now(UTC).isoformat()
def lambda_handler(event, context):
return mcp_server.handle_request(event, context)
Session State Management
The Lambda MCP Server includes built-in session state management that persists across tool invocations within the same conversation. This is particularly useful for tools that need to maintain context or share data between calls.
Session data is stored in a DynamoDB table against a sessionId key. This is all managed for you.
Here’s an example of how to use session state:
from lambda_mcp.lambda_mcp import LambdaMCPServer
session_table = os.environ.get('MCP_SESSION_TABLE', 'mcp_sessions')
mcp_server = LambdaMCPServer(name="mcp-lambda-server", version="1.0.0", session_store=session_table)
@mcp_server.tool()
def increment_counter() -> int:
"""Increment a session-based counter."""
# Get the current counter value from session state, default to 0 if not set
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →