Skip to content

Comments

feat: add FastMCP Lambda template for MCP server scaffolding#420

Open
aidandaly24 wants to merge 2 commits intoaws:feat/gateway-integrationfrom
aidandaly24:feat/batch-5-fastmcp-lambda-template
Open

feat: add FastMCP Lambda template for MCP server scaffolding#420
aidandaly24 wants to merge 2 commits intoaws:feat/gateway-integrationfrom
aidandaly24:feat/batch-5-fastmcp-lambda-template

Conversation

@aidandaly24
Copy link
Contributor

Description

Add a FastMCP Lambda template for scaffolding MCP servers that run on AWS Lambda with function URLs.

Currently, the python-lambda template uses a raw stdlib handler designed for Lambda gateway targets. This PR adds a new python-fastmcp-lambda template that uses the FastMCP library — a proper MCP server that speaks MCP protocol and is designed to sit behind an AgentCore gateway's mcpServer target 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:

  • New src/assets/mcp/python-fastmcp-lambda/ template directory (handler.py, pyproject.toml, README.md)
  • Updated GatewayTargetRenderer.ts to select the new template when compute host is Lambda
  • Updated asset snapshot

This 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

  • New feature

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Feb 24, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels 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.
@aidandaly24 aidandaly24 force-pushed the feat/batch-5-fastmcp-lambda-template branch from 9421691 to 6ea432f Compare February 24, 2026 23:02
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants