feat: add FastMCP Lambda template for MCP server scaffolding#420
Open
aidandaly24 wants to merge 2 commits intoaws:feat/gateway-integrationfrom
Open
feat: add FastMCP Lambda template for MCP server scaffolding#420aidandaly24 wants to merge 2 commits intoaws:feat/gateway-integrationfrom
aidandaly24 wants to merge 2 commits intoaws:feat/gateway-integrationfrom
Conversation
tejaskash
reviewed
Feb 24, 2026
Add python-fastmcp-lambda template for scaffolding MCP servers that run on AWS Lambda with function URLs. Uses FastMCP for tool definitions and Mangum as the ASGI-to-Lambda adapter. Template includes sample HTTP tools (lookup_ip, get_random_user, fetch_post) matching the existing python/ template patterns. Updates GatewayTargetRenderer to select this template when the compute host is Lambda.
The CLI writes handler: 'handler.lambda_handler' in compute config. The template must export lambda_handler, not handler.
9421691 to
6ea432f
Compare
notgitika
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a FastMCP Lambda template for scaffolding MCP servers that run on AWS Lambda with function URLs.
Currently, the
python-lambdatemplate uses a raw stdlib handler designed for Lambda gateway targets. This PR adds a newpython-fastmcp-lambdatemplate that uses the FastMCP library — a proper MCP server that speaks MCP protocol and is designed to sit behind an AgentCore gateway'smcpServertarget type.The template uses Mangum as the ASGI-to-Lambda adapter, wrapping FastMCP's SSE app for Lambda function URL invocation. It includes the same sample HTTP tools (lookup_ip, get_random_user, fetch_post) as the existing
python/template for consistency.Changes:
src/assets/mcp/python-fastmcp-lambda/template directory (handler.py, pyproject.toml, README.md)GatewayTargetRenderer.tsto select the new template when compute host is LambdaThis template is used by the scaffolding flow added in a subsequent PR (Task 14).
Related Issue
Part of the MCP Gateway Phase 1 integration (gateway-integration branch). Task 13.
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist