Add selected tool name in header - required for rate limit
Closed this issue · 1 comments
Is your feature request related to a problem? Please describe.
Our company has mesh config which helps in rate limit incoming requests. It is added as sidecar in k8 env.
Now I was looking way to add rate limit at each tool level. Traditionally we throttle request based on route/controller, MCP use case is first time we had to look for tool level (ie. parse payload body). It is not ideal to parse body at runtime
Describe the solution you'd like
Can we add new header x-tool-name for every tool call? This way we can rate limit based on each tool.
Describe alternatives you've considered
There is no alternative. We are rate limiting based on route, looking to change to tool if this fix is available.
Additional context
Add any other context or screenshots about the feature request here.
I see where you're coming from, and I think it could be a good idea. However, this is a spec-level proposition, not something just one SDK should implement. If only implemented here, and you find yourself talking to a server built on, say, the Kotlin SDK, it would not recognise this header.
What you want is to change the spec, and then have all SDKs implement that change. For that to happen, you need to create a Specification Enhancement Proposal (SEP).
Specifically, this would be a StreamableHttp transport enhancement, since it is based upon the presence of an HTTP header added dynamically during a session. If, for instance, the Websockets transport SEP were to be accepted, your proposal would not apply to that transport because while webSockets leverage HTTP headers during the initial handshake phase to establish the connection, they do not use custom headers during the subsequent data transfer phase.