Skip to content

how to get http request headers in mcp tools logic when i use streamable http mode to run mcp server ? #750

@kelify

Description

@kelify

i want to create a mcp server base on streamablehttp_stateless running mode(https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/servers/simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless/server.py example code), but i can not find any mothed to get http request msg in the tools logic. so how can i get the http request headers msg in the tools define function ?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurefeature requestRequest for a new feature that's not currently supportedready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions