Skip to content

Feature request: MCP server event handler #6562

Open

Description

@ran-isenberg

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

Activity

  1. added and removed
    triagePending triage from maintainers
    on Apr 25, 2025
  2. dreamorosi commented on Apr 25, 2025

    @dreamorosi
    Contributor

    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.

  3. ran-isenberg commented on Apr 25, 2025

    @ran-isenberg
    ContributorAuthor

    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 :)

  4. walmsles commented on Apr 30, 2025

    @walmsles
    Contributor

    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.

  5. ran-isenberg commented on Apr 30, 2025

    @ran-isenberg
    ContributorAuthor

    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.

    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

  6. dreamorosi commented on May 1, 2025

    @dreamorosi
    Contributor

    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.

  7. ran-isenberg commented on May 1, 2025

    @ran-isenberg
    ContributorAuthor

    two weeks from now should be fine, talk to me on discord next week, it's a holiday now :)

  8. ShahNewazKhan commented on Jun 7, 2025

    @ShahNewazKhan

    Following along to get updates from this thread.

  9. andormarkus commented on Jun 7, 2025

    @andormarkus
  10. 7 remaining items

  11. ran-isenberg commented on Jun 12, 2025

    @ran-isenberg
    ContributorAuthor
  12. dreamorosi commented on Jun 12, 2025

    @dreamorosi
    Contributor

    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.

  13. ran-isenberg commented on Jun 13, 2025

    @ran-isenberg
    ContributorAuthor

    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.

    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!

  14. leandrodamascena commented on Jul 3, 2025

    @leandrodamascena
    Contributor

    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.

  15. dreamorosi commented on Jul 4, 2025

    @dreamorosi
    Contributor

    I'll temporarily re-add the triage label so it's picked up on our next planning meeting.

  16. dreamorosi commented on Jul 7, 2025

    @dreamorosi
    Contributor

    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.

  17. tb102122 commented on Sep 24, 2025

    @tb102122

    @dreamorosi is there planned timeline for this feature?

  18. dreamorosi commented on Sep 29, 2025

    @dreamorosi
    Contributor

    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.

  19. added
    revisit-in-3-monthsRequires more customers feedback before making or revisiting a decision
    on Sep 29, 2025
  20. danielnyari-seon commented on Apr 16, 2026

    @danielnyari-seon

    Any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions