The official Rust SDK for the Model Context Protocol
This report summarizes scanner evidence for modelcontextprotocol/rust-sdk, a Rust project with 4,077 GitHub stars. SynthScan examined 121,455 lines of code across 293 source files, recording 287 pattern matches distributed across 7 syntactic categories. The legacy adjusted pattern signal is 2.7 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 257 finding(s).
Are imports declared and package/API names verified? 8 finding(s).
Are wrappers, guards, and repeated structures necessary? 22 finding(s).
Which changes need focused human review? 287 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 287 distinct pattern matches across 7 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …es/rmcp/tests/test_streamable_http_protocol_version.rs | 541 | // --------------------------------------------------------------------------- | COMMENT |
| LOW | crates/rmcp/tests/test_sep_2260_stream_enforcement.rs | 1 | //! SEP-2260 follow-up (#1033): stream-based receive-side enforcement. | COMMENT |
| LOW | crates/rmcp/tests/test_sse_concurrent_streams.rs | 1 | #![cfg(not(feature = "local"))] | COMMENT |
| LOW | crates/rmcp/tests/test_abandoned_request_cancel.rs | 21 | use serde_json::json; | COMMENT |
| LOW | crates/rmcp/src/transport.rs | 1 | //! # Transport | COMMENT |
| LOW | crates/rmcp/src/transport.rs | 21 | //! This transport is used to create a transport from a byte stream which implemented [`tokio::io::AsyncRead`] and [`tok | COMMENT |
| LOW | crates/rmcp/src/transport.rs | 41 | //! ```rust | COMMENT |
| LOW | crates/rmcp/src/service.rs | 1 | use std::{borrow::Cow, sync::OnceLock}; | COMMENT |
| LOW | crates/rmcp/src/service.rs | 181 | COMMENT | |
| LOW | crates/rmcp/src/service.rs | 241 | } | COMMENT |
| LOW | crates/rmcp/src/service.rs | 1101 | /// This will block until the service loop terminates (either due to | COMMENT |
| LOW | crates/rmcp/src/service.rs | 1121 | /// # Example | COMMENT |
| LOW | crates/rmcp/src/task_manager.rs | 1 | //! Server-side runtime for the MCP Tasks extension (SEP-2663, | COMMENT |
| LOW | crates/rmcp/src/task_manager.rs | 281 | /// aborted), and terminal tasks are evicted after being retained for one | COMMENT |
| LOW | crates/rmcp/src/task_manager.rs | 441 | /// does **not** abort the underlying future or force a terminal state. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 181 | /// First protocol version that replaced the `initialize` handshake with | COMMENT |
| LOW | crates/rmcp/src/model.rs | 221 | /// lifecycle into per-request `_meta`. Unknown versions are compared | COMMENT |
| LOW | crates/rmcp/src/model.rs | 241 | /// The result borrows from [`Self::KNOWN_VERSIONS`], so call it directly | COMMENT |
| LOW | crates/rmcp/src/model.rs | 421 | /// Type alias for request identifiers used in JSON-RPC communication. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 441 | /// - `method`: The name of the method being called | COMMENT |
| LOW | crates/rmcp/src/model.rs | 761 | hasher.write(b"rmcp transport-closed marker"); | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1141 | /// This notification indicates that the result will be unused, so any associated processing SHOULD cease. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1181 | } | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1221 | /// This request is sent from the client to the server when it first connects, asking it to begin initialization. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1321 | pub fn with_protocol_version(mut self, protocol_version: ProtocolVersion) -> Self { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1341 | /// assert!(config.capabilities.tools.is_some()); | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1361 | /// assert!(config.capabilities.elicitation.is_some()); | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1381 | /// Information negotiated about a server peer. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1621 | /// Indicates the icon is designed to be used with a light background | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1841 | pub type ProgressNotification = Notification<ProgressNotificationMethod, ProgressNotificationParam>; | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1861 | /// | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1901 | #[expect(clippy::exhaustive_structs, reason = "intentionally exhaustive")] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2061 | /// Result type discriminator (SEP-2322). Required by the [spec schema] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2241 | #[serde(rename_all = "camelCase")] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2841 | // ============================================================================= | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2861 | /// An AI assistant or server providing a response | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3161 | #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3181 | /// | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3201 | /// System prompt to guide the model's behavior | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3381 | } | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3661 | Ok(()) | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3901 | COMMENT | |
| LOW | crates/rmcp/src/model.rs | 3981 | } | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4001 | /// .build() | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4021 | FormElicitationParams { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4121 | COMMENT | |
| LOW | crates/rmcp/src/model.rs | 4141 | /// for servers implementing protocol version `2026-07-28`, but optional | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4161 | #[serde(skip_serializing_if = "Option::is_none")] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4261 | /// rows, an external API returned 500, the user's input is plausible | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4281 | /// // as -32602 invalid_params: | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4301 | result_type: Some(ResultType::COMPLETE), | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4321 | /// ``` | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4401 | } | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4541 | /// for servers implementing protocol version `2026-07-28`, but optional | COMMENT |
| LOW | crates/rmcp/src/model.rs | 4621 | COMMENT | |
| LOW | crates/rmcp/src/model.rs | 5041 | /// Empty `tasks/update` / `tasks/cancel` acknowledgement carrying the | COMMENT |
| LOW | crates/rmcp/src/model.rs | 5081 | }; | COMMENT |
| LOW | crates/rmcp/src/model.rs | 5101 | /// use rmcp::model::{CacheScope, ListResourcesResult, ServerResult}; | COMMENT |
| LOW | crates/rmcp/src/handler/client.rs | 121 | /// * `request` - The elicitation request with message and schema | COMMENT |
| LOW | crates/rmcp/src/handler/client.rs | 141 | /// | COMMENT |
| 194 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 34 | // ─── Test server ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 72 | // ─── Helpers ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 204 | // ─── Tests: Shadow stream creation ────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 260 | // ─── Tests: Dead primary replacement ──────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 357 | // ─── Tests: Notification routing ──────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 394 | // ─── Tests: Resume with Last-Event-ID ─────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 491 | // ─── Tests: Mixed scenarios ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 569 | // ─── Tests: Edge cases ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 695 | // ─── Tests: Cache replay on dead primary replacement ───────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_sse_concurrent_streams.rs | 738 | // ─── Tests: Shadow stream limits ───────────────────────────────────────────── | COMMENT |
| MEDIUM | crates/rmcp/tests/test_tool_routers.rs | 271 | // ── Notifier tests ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/keycloak-oauth-fixture.sh | 2 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/keycloak-oauth-fixture.sh | 16 | # ============================================================================= | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 25 | // ─── Context parsed from MCP_CONFORMANCE_CONTEXT ──────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 67 | // ─── Client handlers ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 210 | // ─── OAuth helpers ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 852 | // ─── Helpers ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 917 | // ─── Non-auth scenarios ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 1096 | // ─── Main ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/server.rs | 83 | // ─── SEP-2640 Skills extension fixtures ───────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/server.rs | 211 | // ─── SEP-2663 Tasks extension fixtures ────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/server.rs | 297 | // ─── SEP-2322 MRTR (InputRequiredResult) helpers ──────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/rmcp/tests/test_elicitation.rs | 102 | .with_content(json!({"email": "user@example.com"})); | CODE |
| LOW | crates/rmcp/tests/test_elicitation.rs | 107 | "content": {"email": "user@example.com"} | CODE |
| LOW | crates/rmcp/tests/test_elicitation.rs | 843 | ElicitResult::new(ElicitationAction::Accept).with_content(json!("John Doe")), | CODE |
| LOW | crates/rmcp/tests/test_elicitation.rs | 850 | assert_eq!(result.content, Some(json!("John Doe"))); | CODE |
| LOW | examples/servers/src/completion_stdio.rs | 377 | vec!["'John Doe'", "'jane@example.com'", "123", "NOW()"] | CODE |
| LOW | conformance/src/bin/server.rs | 1398 | "default": "John Doe" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | crates/rmcp-macros/src/lib.rs | 249 | /// #[prompt(name = "code_review", description = "Reviews code for best practices")] | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | examples/servers/src/simple_auth_streamhttp.rs | 49 | // For demonstration purposes, use more secure token management in production | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release-plz.yml | 40 | # Create a PR with the new versions and changelog, preparing the next release. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/rmcp/tests/test_with_python/client.py | 1 | CODE | |
| LOW | crates/rmcp/tests/test_with_python/client.py | 1 | CODE |