[RFC] Server-Side Filtering of Primitives based on Client Scopes (Governance & Security) #668
titoparizotto
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
[RFC] Server-Side Filtering of Primitives based on Client Scopes (Governance & Security)
Context
As a Technical Architect focusing on MCP governance, I’ve identified a gap in how discovery and authorization interact within the current protocol specification.
Currently, when an
McpClientconnects to anMcpServer, they exchange security information during authentication. Subsequently, the client calls discovery methods like{primitives}/list(e.g.,tools/list,resources/list) to understand the server's capabilities.The Problem
Today, the discovery process is largely "all or nothing." If a client is authenticated, the server typically returns the full list of available primitives. However, in enterprise environments with strict governance, we often face:
read-onlyvs.admin) connecting to the same server.Today, to ensure this security layer is applied, developers are forced to implement a custom orchestration or middleware layer between the Client and the Server to intercept and filter JSON-RPC responses.
Proposed Idea: Scope-Aware Discovery & Notifications
I propose that the MCP Specification formally supports Server-Side Filtering during the listing phase and targeted notifications. The server should validate the client's credential scopes against the required permissions of each primitive before including it in the
{primitives}/listresponse or triggering a change notification.Example Scenario
Client A has
readscope.Client B has
writescope.Client C has
read-writescope.Tool A requires
readpermission.Tool B requires
writepermission.Resulting behavior:
tools/listfor Client A returns only Tool A.tools/listfor Client B returns only Tool B.tools/listfor Client C returns both.Benefits
Implementation Thoughts
1. Capability Declaration (Server-Side)
Servers can declare their ability to handle scope-based visibility and notifications through a new capability flag:
{ "capabilities": { "tools": { "listChanged": true, "authRequired": true } } }2. Parameterized Listing (Client-Side)
To ensure this layer of security is applied directly at the MCPServer side, I propose adding parametrization to the listing call. This allows the server to explicitly validate the scope of the credential against the required permission of each primitive:
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": { "cursor": "optional-cursor-value", "credentials": "your-auth-token-or-scope-identifier" } }3. Scoped Notifications
When
authRequiredistrue, the server optimizes notifications. Thenotifications/tools/list_changedsignal is only sent to clients whose specific authorized view has changed. This avoids unnecessary refreshes for unauthorized clients and prevents information leakage.Conclusion
The goal is to ensure the
RequestContextin the SDKs carries the authenticated identity/scopes, allowing thelistandnotificationhandlers to prune results dynamically.I would love to hear the community's thoughts on standardizing
authRequiredand this listing parametrization to improve MCP's security posture for production environments.Scope
Beta Was this translation helpful? Give feedback.
All reactions