modelcontextprotocol / modelcontextprotocol/rust-sdk
Feature request: native Rate Limiting (MCP spec compliance)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.9k
- Forks
- 645
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 36
Description
Problem
The MCP specification requires rate limiting across multiple message types.
Required (MUST/SHOULD):
Progressnotifications: "Both parties SHOULD implement rate limiting to prevent flooding"Completionrequests: "MUST implement appropriate rate limiting"Samplingrequests: "Clients SHOULD implement rate limiting"Loggingmessages: "Servers SHOULD rate limit log messages"Elicitationrequests: "Clients SHOULD implement rate limiting"
Proposed Architecture
Transport Layer Rate Limiting (token bucket algorithm)
Why Transport Layer:
- Universal Coverage: All message types, all transports (stdio/SSE/HTTP/WebSocket)
- Single Integration Point: All messages flow through
Transport::send() - Existing Patterns: Following established decorator pattern (
SinkStreamTransport) - Performance: Early filtering, concurrent-safe
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the transport layer and trace how messages pass through Transport::send(), then read the existing SinkStreamTransport decorator pattern. Define how a concurrent-safe token bucket applies to Progress, Completion, Sampling, Logging, and Elicitation messages across stdio, SSE, HTTP, and WebSocket transports. Done means all listed message types receive the required transport-level rate limiting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100