Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Addition of client request headers to MCP tools #674

Copy link
Copy link
Open
@rusenbb

Description

@rusenbb
Issue body actions

Is your feature request related to a problem? Please describe.
Currently, the MCP Python SDK does not expose client request headers to MCP tools. This makes it difficult to implement user-specific access controls or contextual logic within a single server, especially for database queries where permissions are critical. As a result, we’re forced to consider inefficient solutions like deploying separate MCP instances for different clients.

Describe the solution you'd like
Expose client request headers to MCP tools (through the Context object maybe?) so that logic can be adjusted based on user context (e.g., access tokens, roles, tenant IDs). This would allow a single MCP server to securely handle multiple clients and enforce proper access control directly within the tools.

Describe alternatives you've considered

  • Running separate MCP servers per client (inefficient and hard to scale).
  • Passing user data through request bodies (insecure because of LLM interference risk).
  • Adding custom middleware outside of MCP (adds unnecessary complexity, and still not accessible within tools).

Additional context
This feature would improve multi-tenant support and align with standard API practices for handling authentication and authorization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.