Repository navigation
Open
Labels
event_handlersfeature-requestfeature requestfeature requestrevisit-in-3-monthsRequires more customers feedback before making or revisiting a decisionRequires more customers feedback before making or revisiting a decision
Description
Use case
i'd like to be able to write serverless MCP servers with ease and integrate all my powertools capabilities:
swagger, event validation, event resolver, logger, tracing, metrics etc.
Solution/User Experience
I'd like to have UX like in https://docs.powertools.aws.dev/lambda/python/latest/core/event_handler/api_gateway/#response-auto-serialization but combined with the official python SDK for MCP server with all the right config to make it work on a lambda.
# server.py
from aws_lambda_powertools.event_handler import MCPResolver
mcp = MCPResolver('myMcp)
# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
"""Get a personalized greeting"""
return f"Hello, {name}!"
# You can continue to use other utilities just as before
@logger.inject_lambda_context()
@tracer.capture_lambda_handler
def lambda_handler(event: dict, context: LambdaContext) -> dict:
return mcp.resolve(event, context)Alternative solutions
use unknown open sources like MCPEngine and build my own wrappers for logging/tracer.. i want the powertools edition :)Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Reacted by Guy (MLGuy), John D. Pope, Nisarg Shah, Sebastian Hölscher, Travis Bickford, Wayne, Tobias Bruckert, Robert Egglestone and Minh Q. Le
Metadata
Metadata
Assignees
Labels
event_handlersfeature-requestfeature requestfeature requestrevisit-in-3-monthsRequires more customers feedback before making or revisiting a decisionRequires more customers feedback before making or revisiting a decision
Type
Projects
- StatusShow more project fieldsOn hold
Activity
dreamorosi commentedon Apr 25, 2025
Hi @ran-isenberg, thank you for opening this feature request.
Everyone is talking about MCPs these days so I am not surprised to see a feature request in this space finally arriving to our project.
I am wondering if you could share - either here or privately via email - whether there are specific use cases that you're considering at CyberArk that this MCP resolver would help with.
Also on a more technical level, I'm wondering if you had any opinions/suggestions on how we should handle authentication with this type of resolver, the spec for MCP is still very blurry around this type of concerns.
Finally, from a governance standpoint, before implementing this we'll have to discuss how to release this. The Powertools for AWS brand has certain commitments around stability and versioning (highlighted in our wiki) that I'm not sure would fit with a spec still very much in flux like MCP.
ran-isenberg commentedon Apr 25, 2025
We can talk over discord if you wish, but yeah I have some ideas and needs :)
As more auth/authz. When you place it behind API GW, you can use WAF, IAM auth/cognito/any JWT token authorization. See https://github.com/mikegc-aws/Lambda-MCP-Server - he added a custom authorizer.
Also MCPEngine added support for idp token validatioin.
I've been trying to build a proper cookbook for this with powertools but lack of official SDK support, and seeing lots of sh*tty implementations (that I cant recommend), and the fact that this is sooo new for serverless (protocol changed this week to support non streaming HTTP), leaves me wanting the Powertools treatment :)
walmsles commentedon Apr 30, 2025
Hey @ran-isenberg and @dreamorosi have you seen this from Mike Chambers: https://github.com/mikegc-aws/Lambda-MCP-Server
This might be of interest - I think this could be a good thing to import into Powertools, to be honest.
ran-isenberg commentedon Apr 30, 2025
I did, i dont want to offend anyone but it's a nice poc level code. I got it working with powertools.
However, i think i'd rather use official mcp python SDK to support http non streaming mode.
Waiting for this: https://github.com/modelcontextprotocol/python-sdk
dreamorosi commentedon May 1, 2025
Hey @walmsles & @ran-isenberg - would you two be available for a quick call in the next week or two?
I'd love to pick your brain on this topic. If we can manage to do it in one call it'd be amazing, but if time zones are a challenge I'm happy to also do one for each.
ran-isenberg commentedon May 1, 2025
two weeks from now should be fine, talk to me on discord next week, it's a holiday now :)
ShahNewazKhan commentedon Jun 7, 2025
Following along to get updates from this thread.
andormarkus commentedon Jun 7, 2025
Official was released 2 weeks ago: https://github.com/awslabs/mcp/tree/main/src/mcp-lambda-handler
7 remaining items
ran-isenberg commentedon Jun 12, 2025
@dreamorosi @leandrodamascena Ideally, i'd like pwoertools to own this module: https://github.com/ran-isenberg/aws-lambda-mcp-cookbook/tree/main/service/mcp_lambda_handler - that's the engine, event handler basically.
then the experience is like this:
https://github.com/ran-isenberg/aws-lambda-mcp-cookbook/blob/main/service/handlers/mcp.py
dreamorosi commentedon Jun 12, 2025
Let us talk about it internally - in the next 2 weeks we'll update our roadmap for the back half of the year, so it's a good time to discuss this.
ran-isenberg commentedon Jun 13, 2025
sure. I think the code is rather simple TBH. The only issue is keeping up with MCP protocol changes. The code is not using the latest changes (missing auth).
Also, the code could really use some refactors, moving to classes, reducing complexity etc, but it works!
leandrodamascena commentedon Jul 3, 2025
Just a quick feedback: we've had a few meetings about the roadmap for mid/late 2025 and discussed this issue a bit. While we don't have a decision yet, as we have a few other items to deal with, it's on our radar for a decision soon.
dreamorosi commentedon Jul 4, 2025
I'll temporarily re-add the
triagelabel so it's picked up on our next planning meeting.dreamorosi commentedon Jul 7, 2025
Hi, we have decided to postpone our decision and wait for the New York AWS Summit which will happen in the next 10 days.
Thank you for your patience.
tb102122 commentedon Sep 24, 2025
@dreamorosi is there planned timeline for this feature?
dreamorosi commentedon Sep 29, 2025
Hi @tb102122, no updates at this time.
At the moment we're focused on adding support for new Lambda managed runtimes as well as other items we'll share in the coming weeks.
In the next couple months we'll start creating the roadmap for 2026, so we'll reassess then.
danielnyari-seon commentedon Apr 16, 2026
Any news on this?