Description
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.