The official Rust SDK for the Model Context Protocol
This report presents the forensic synthetic code analysis of modelcontextprotocol/rust-sdk, a Rust project with 3,628 GitHub stars. SynthScan v2.0 examined 82,303 lines of code across 253 source files, recording 244 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 4.0 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 244 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/rmcp/tests/test_sse_concurrent_streams.rs | 1 | #![cfg(not(feature = "local"))] | COMMENT |
| LOW | crates/rmcp/tests/test_task_support_validation.rs | 1 | #![cfg(not(feature = "local"))] | COMMENT |
| LOW | crates/rmcp/tests/test_streamable_http_session_store.rs | 241 | .await; | COMMENT |
| LOW | crates/rmcp/src/error.rs | 21 | #[derive(Debug, thiserror::Error)] | 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 futures::FutureExt; | COMMENT |
| LOW | crates/rmcp/src/service.rs | 761 | /// This method cancels the service, waits for the background task to finish | COMMENT |
| LOW | crates/rmcp/src/model.rs | 321 | #[serde(transparent)] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 501 | COMMENT | |
| LOW | crates/rmcp/src/model.rs | 581 | Self::new(ErrorCode::INVALID_PARAMS, message, data) | COMMENT |
| LOW | crates/rmcp/src/model.rs | 801 | /// This notification can be sent by either side to indicate that it is cancelling a previously-issued request. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 841 | .map(|params| serde_json::from_value(params.clone())) | COMMENT |
| LOW | crates/rmcp/src/model.rs | 881 | const_string!(InitializeResultMethod = "initialize"); | COMMENT |
| LOW | crates/rmcp/src/model.rs | 941 | /// | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1021 | /// Icon themes supported by the MCP specification | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1041 | /// - image/webp - WebP images (modern, efficient format) | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1281 | #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1361 | #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1421 | pub type ReadResourceRequestParam = ReadResourceRequestParams; | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1601 | paginated_result!(ListPromptsResult { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1681 | /// Notification sent when the list of available prompts changes | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1821 | #[serde(rename_all = "camelCase")] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 1981 | /// This represents a single message in a conversation flow, used primarily | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2121 | fn try_from(content: ContentBlock) -> Result<Self, Self::Error> { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2141 | #[serde(rename = "thisServer")] | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2161 | pub struct CreateMessageRequestParams { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2361 | /// Deprecated: Use [`CreateMessageRequestParams`] instead (SEP-1319 compliance). | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2461 | // ============================================================================= | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2861 | const_string!(ElicitationCreateRequestMethod = "elicitation/create"); | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2941 | message, | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2961 | /// meta: None, | COMMENT |
| LOW | crates/rmcp/src/model.rs | 2981 | tag = "mode", | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3041 | COMMENT | |
| LOW | crates/rmcp/src/model.rs | 3101 | /// The result of a tool call operation. | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3181 | } | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3201 | /// error makes the server itself unusable | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3221 | /// if rows.is_empty() { | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3241 | /// Create a successful tool result with structured content | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3261 | meta: None, | COMMENT |
| LOW | crates/rmcp/src/model.rs | 3341 | /// the tool operation. | COMMENT |
| LOW | crates/rmcp/src/handler/client.rs | 101 | } | COMMENT |
| LOW | crates/rmcp/src/handler/client.rs | 121 | /// The user's response including action (accept/decline/cancel) and optional data | COMMENT |
| LOW | crates/rmcp/src/handler/client.rs | 141 | /// context: RequestContext<RoleClient>, | COMMENT |
| LOW | crates/rmcp/src/handler/server.rs | 301 | /// MCP distinguishes two failure modes; the API forces you to pick | COMMENT |
| LOW | crates/rmcp/src/handler/server/tool_name_validation.rs | 1 | //! Tool name validation utilities according to SEP: Specify Format for Tool Names | COMMENT |
| LOW | crates/rmcp/src/handler/server/wrapper/parameters.rs | 1 | use schemars::JsonSchema; | COMMENT |
| LOW | crates/rmcp/src/handler/server/wrapper/parameters.rs | 21 | /// # use serde::{Deserialize, Serialize}; | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 1 | //! Tools for MCP servers. | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 21 | //! struct AddOutput { | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 41 | //! Using the macro-based code pattern above is suitable for small MCP servers with simple interfaces. | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 61 | //! #[derive(Deserialize, schemars::JsonSchema, Default)] | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 81 | //! # unimplemented!() | COMMENT |
| LOW | crates/rmcp/src/handler/server/router/tool.rs | 101 | //! } | COMMENT |
| LOW | crates/rmcp/src/transport/child_process.rs | 241 | /// without a fully-qualified path. | COMMENT |
| LOW | crates/rmcp/src/transport/auth.rs | 301 | .field("pkce_verifier", &"[REDACTED]") | COMMENT |
| LOW | crates/rmcp/src/transport/auth.rs | 321 | /// | COMMENT |
| LOW | crates/rmcp/src/transport/auth.rs | 621 | // add type aliases for oauth2 types | COMMENT |
| LOW | crates/rmcp/src/transport/async_rw.rs | 121 | } | COMMENT |
| 131 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 | 277 | // ── Notifier tests ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | scripts/triage-new-issues.sh | 88 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/triage-new-issues.sh | 90 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/triage-new-issues.sh | 96 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/triage-new-issues.sh | 98 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 2 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 20 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 32 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 34 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 57 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 59 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 157 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 159 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 234 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 236 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 282 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 284 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 295 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 297 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 345 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 347 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 382 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/triage-new-issues.sh | 384 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 14 | // ─── Context parsed from MCP_CONFORMANCE_CONTEXT ──────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 36 | // ─── Client handlers ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 179 | // ─── OAuth helpers ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 720 | // ─── Helpers ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 785 | // ─── Non-auth scenarios ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 935 | // ─── Main ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | conformance/src/bin/server.rs | 52 | // ─── 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 | 761 | "default": "John Doe" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | crates/rmcp-macros/src/lib.rs | 218 | /// #[prompt(name = "code_review", description = "Reviews code for best practices")] | COMMENT |
| MEDIUM | conformance/src/bin/client.rs | 699 | // More robust: parse ASN.1. But for conformance testing this suffices. | 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 | 41 | # 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 |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/triage-new-issues.sh | 321 | # Check if already triaged | COMMENT |