Public report of modelcontextprotocol/python-sdk, published 16 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 16 November 2026, 13:55 UTC · Survey ID cd_d92b15c686ea4991bf08108e3e21f804

modelcontextprotocol/python-sdk

Measured 16 November 2026, 13:55 UTC, at code version 77001c9

CAI score 73.9out of 100 Strong
CriticalWeakAdequateStrongExemplary
Up 2.5 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 41,859 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Production Readiness, 70.1

Findings by how serious they are

2 critical 189 serious 73 minor

11 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 13:55 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

51of 51 dimensions measured by tools.
253of 264 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
51dimensions across 6 lenses, read from 41,859 lines of product code in 2 projects.
Chapters

Executive summary

modelcontextprotocol/python-sdk meets our standard for production. It scores 73.9 out of 100 and is rated Strong, and both of its critical findings are security problems in its code.

Every lens scores high enough to be rated Strong, so no single lens holds the score back. The best first step is adding automated security scanning, worth about 3.2 points. Keeping a changelog comes next, worth about 2.7 points.

Two weaknesses in the code could be used by an attacker. Fixing the weaknesses the scanner points to would close this risk.

The product code is 41,859 lines, about €170,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 70.1 · counts for 46%Code Health 72.8 · counts for 25%Security and Compliance 77.4 · counts for 14%Maturity 79.0 · counts for 8%Architecture 86.2 · counts for 4%Performance 100.0 · counts for 2%

Every lens already scores high enough to be rated Strong, so no single lens holds the score back.

Code composition: what the lines of code are
Product code 36%Tests 64%
New since the last survey: 38 findings

These 38 critical or serious findings weren't in the previous survey, on 4 November 2026.

  • Code Duplication · Edited copy of a member (31 corresponding lines) docs_src/identity_assertion/tutorial002.py
  • Code Duplication · Edited copy of a member (34 corresponding lines) src/mcp/client/extensions/skills.py
  • Code Duplication · Edited copy of a member (14 corresponding lines) docs_src/deploy/tutorial002.py
  • Code Duplication · Edited copy of a member (20 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py
  • Code Duplication · Edited copy of a member (9 corresponding lines) docs_src/session_groups/tutorial003.py
  • Code Duplication · Edited copy of a member (10 corresponding lines) src/mcp/server/mcpserver/utilities/types.py
  • Code Duplication · Edited copy of a member (35 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py
  • Code Duplication · Edited copy of a member (19 corresponding lines) src/mcp/server/mcpserver/server.py
  • Code Duplication · Edited copy of a member (20 corresponding lines) src/mcp/server/transport_security.py
  • Code Duplication · Edited copy of a member (14 corresponding lines) src/mcp/server/mcpserver/server.py
  • Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) docs_src/subscriptions/tutorial004_anyio.py
  • Code Duplication · Edited copy of a member (8 corresponding lines) src/mcp/server/_streamable_http_modern.py
  • Code Duplication · Edited copy of a member (27 corresponding lines) src/mcp/client/session.py
  • Code Duplication · Edited copy of a member (6 corresponding lines) docs_src/lowlevel/tutorial004.py
  • Code Duplication · Edited copy of a member (15 corresponding lines) src/mcp/server/connection.py
  • Code Duplication · Edited copy of a member (4 corresponding lines) docs_src/extensions/tutorial004_client.py
  • Code Duplication · Edited copy of a member (3 corresponding lines) docs_src/header_parameters/tutorial002.py
  • Code Duplication · Edited copy of a member (5 corresponding lines) docs_src/dependencies/tutorial004.py
  • Code Duplication · Edited copy of a member (2 corresponding lines) docs_src/middleware/tutorial001.py
  • Code Duplication · Edited copy of a member (12 corresponding lines) src/mcp/client/session.py
  • Code Duplication · Edited copy of a member (2 corresponding lines) docs_src/extensions/tutorial004.py
  • Code Duplication · Edited copy of a member (3 corresponding lines) docs_src/client_transports/tutorial002.py
  • Code Duplication · Edited copy of a member (4 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py
  • Code Duplication · Edited copy of a member (51 corresponding lines) examples/stories/oauth_client_credentials/server.py
  • Code Duplication · Edited copies of one member (3 members, 32+ corresponding lines) examples/stories/bearer_auth/server_lowlevel.py
  • Code Duplication · Edited copy of a member (13 corresponding lines) examples/stories/reconnect/server_lowlevel.py
  • Code Duplication · Edited copy of a member (9 corresponding lines) examples/stories/lifespan/client.py
  • Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) examples/stories/dual_era/server_lowlevel.py
  • Code Duplication · Edited copy of a member (19 corresponding lines) examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py
  • Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) examples/servers/simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless/server.py
  • Code Duplication · Edited copy of a member (17 corresponding lines) examples/stories/identity_assertion/server.py
  • Code Duplication · Edited copy of a member (9 corresponding lines) examples/stories/middleware/client.py
  • Code Duplication · Edited copy of a member (18 corresponding lines) examples/servers/simple-auth/mcp_simple_auth/auth_server.py
  • Code Duplication · Edited copy of a member (6 corresponding lines) examples/stories/roots/client.py
  • Code Duplication · Edited copy of a member (17 corresponding lines) examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) examples/servers/everything-server/mcp_everything_server/server.py
  • Code Duplication · Edited copy of a member (11 corresponding lines) examples/servers/everything-server/mcp_everything_server/server.py
  • Dependency Vulnerabilities · REDACTED

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 10 findings

These 10 critical or serious findings were in the previous survey, on 4 November 2026, and are gone from this one.

  • Cyclomatic Complexity · translations.command_translate (cyclomatic 21) scripts/docs/translations.py
  • Cyclomatic Complexity · gen_ref_pages._compact_index (cyclomatic 20) scripts/docs/gen_ref_pages.py
  • Cognitive Complexity · gen_ref_pages._compact_index (cognitive 31) scripts/docs/gen_ref_pages.py
  • Cognitive Complexity · translations.command_translate (cognitive 27) scripts/docs/translations.py
  • Cognitive Complexity · gen_ref_pages.generate (cognitive 26) scripts/docs/gen_ref_pages.py
  • Cognitive Complexity · build_config.build_config (cognitive 24) scripts/docs/build_config.py
  • Cognitive Complexity · check_crossrefs.main (cognitive 19) scripts/docs/check_crossrefs.py
  • God Classes · FileTooLong: docs/translations.py scripts/docs/translations.py
  • Churn × Complexity Hotspots · Hotspot: src/mcp/client/client.py src/mcp/client/client.py
  • Churn × Complexity Hotspots · Hotspot: src/mcp/server/mcpserver/prompts/base.py src/mcp/server/mcpserver/prompts/base.py
Rebuild cost: about €170,000 · Estimate
Cost to rebuild€56,000 to €280,000, for 933 to 2,959 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×1.1 at a score of 74. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 41,859 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Raises the score by about 3.2 points · Medium effort · Security & performance tooling
2
Keep a changelog (e.g.
Keep-a-Changelog) recording what shipped in each release.
Raises the score by about 2.7 points · Medium effort · Release Hygiene
3
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.
Raises the score by about 1.1 points · Low effort · ADR Quality

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

If you do one thing first · First action
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing. Of all the actions in this report, it raises the score most for the work it takes: about 3.2 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch mcp mcp mcp-types mcp-types mcp->mcp-types

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

199 modules, with 106 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 159 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 docs_src.dependencies2 docs_src.extensions3 docs_src.structured_output4 scripts.docs.build_config5 src.mcp-types.mcp_types._wire_base6 src.mcp.client.session7 src.mcp.server.auth.settings8 src.mcp.server.mcpserver.prompts.base9 src.mcp.server.mcpserver.resources.base10 src.mcp.server.mcpserver.resources.templates11 src.mcp.server.streamable_http12 src.mcp.shared._httpx_utils13 src.mcp.shared.auth14 src.mcp.shared.dispatcher15 src.mcp.shared.skills16 src.mcp.shared.transport_context17 scripts.docs.translations18 src.mcp.client.auth.oauth219 src.mcp.client.client20 src.mcp.client.extension21 src.mcp.server.auth.middleware.client_auth22 src.mcp.server.auth.provider23 src.mcp.server.connection24 src.mcp.server.extension25 src.mcp.server.streamable_http_manager26 src.mcp.shared27 scripts.docs28 src.mcp.client29 src.mcp.client.auth.extensions.identity_assertion30 src.mcp.client.extensions.skills31 src.mcp.server.apps32 src.mcp.server.auth33 src.mcp.server.auth.middleware.bearer_auth34 src.mcp.server.lowlevel.server35 src.mcp.server.mcpserver36 src.mcp.server.mcpserver.server37 src.mcp.server.session38 src.mcp.server39 src.mcp.server.context40 src.mcp.server.mcpserver.context
1 docs_src.dependencies
2 docs_src.extensions
3 docs_src.structured_output
4 scripts.docs.build_config
5 src.mcp-types.mcp_types._wire_base
6 src.mcp.client.session
7 src.mcp.server.auth.settings
8 src.mcp.server.mcpserver.prompts.base
9 src.mcp.server.mcpserver.resources.base
10 src.mcp.server.mcpserver.resources.templates
11 src.mcp.server.streamable_http
12 src.mcp.shared._httpx_utils
13 src.mcp.shared.auth
14 src.mcp.shared.dispatcher
15 src.mcp.shared.skills
16 src.mcp.shared.transport_context
17 scripts.docs.translations3
18 src.mcp.client.auth.oauth216
19 src.mcp.client.client1
20 src.mcp.client.extension2
21 src.mcp.server.auth.middleware.client_auth1
22 src.mcp.server.auth.provider2
23 src.mcp.server.connection2
24 src.mcp.server.extension1
25 src.mcp.server.streamable_http_manager1
26 src.mcp.shared111
27 scripts.docs210
28 src.mcp.client41111
29 src.mcp.client.auth.extensions.identity_assertion11
30 src.mcp.client.extensions.skills211
31 src.mcp.server.apps11
32 src.mcp.server.auth211
33 src.mcp.server.auth.middleware.bearer_auth2
34 src.mcp.server.lowlevel.server1
35 src.mcp.server.mcpserver1
36 src.mcp.server.mcpserver.server11111
37 src.mcp.server.session1
38 src.mcp.server111
39 src.mcp.server.context11
40 src.mcp.server.mcpserver.context1
Uses a module listed above itPart of a loopThe module itself
1 docs_src.dependencies2 docs_src.extensions3 docs_src.structured_output4 scripts.docs.build_config5 src.mcp-types.mcp_types._wire_base6 src.mcp.client.session7 src.mcp.server.auth.settings8 src.mcp.server.mcpserver.prompts.base9 src.mcp.server.mcpserver.resources.base10 src.mcp.server.mcpserver.resources.templates11 src.mcp.server.streamable_http12 src.mcp.shared._httpx_utils13 src.mcp.shared.auth14 src.mcp.shared.dispatcher15 src.mcp.shared.skills16 src.mcp.shared.transport_context17 scripts.docs.translations18 src.mcp.client.auth.oauth219 src.mcp.client.client20 src.mcp.client.extension21 src.mcp.server.auth.middleware.client_auth22 src.mcp.server.auth.provider23 src.mcp.server.connection24 src.mcp.server.extension25 src.mcp.server.streamable_http_manager26 src.mcp.shared27 scripts.docs28 src.mcp.client29 src.mcp.client.auth.extensions.identity_assertion30 src.mcp.client.extensions.skills31 src.mcp.server.apps32 src.mcp.server.auth33 src.mcp.server.auth.middleware.bearer_auth34 src.mcp.server.lowlevel.server35 src.mcp.server.mcpserver36 src.mcp.server.mcpserver.server37 src.mcp.server.session38 src.mcp.server39 src.mcp.server.context40 src.mcp.server.mcpserver.contextdocs_src.dependencies1docs_src.extensions2docs_src.structured_output3scripts.docs.build_config4src.mcp-types.mcp_types._wire_base5src.mcp.client.session6src.mcp.server.auth.settings7src.mcp.server.mcpserver.prompts.base8src.mcp.server.mcpserver.resources.base9src.mcp.server.mcpserver.resources.templates10src.mcp.server.streamable_http11src.mcp.shared._httpx_utils12src.mcp.shared.auth13src.mcp.shared.dispatcher14src.mcp.shared.skills15src.mcp.shared.transport_context16scripts.docs.translations17src.mcp.client.auth.oauth218src.mcp.client.client19src.mcp.client.extension20src.mcp.server.auth.middleware.client_auth21src.mcp.server.auth.provider22src.mcp.server.connection23src.mcp.server.extension24src.mcp.server.streamable_http_manager25src.mcp.shared26scripts.docs27src.mcp.client28src.mcp.client.auth.extensions.identity_assertion29src.mcp.client.extensions.skills30src.mcp.server.apps31src.mcp.server.auth32src.mcp.server.auth.middleware.bearer_auth33src.mcp.server.lowlevel.server34src.mcp.server.mcpserver35src.mcp.server.mcpserver.server36src.mcp.server.session37src.mcp.server38src.mcp.server.context39src.mcp.server.mcpserver.context403161212211111210411111121111211211111111111111+159 more modules (most-connected shown)

At a glance — Code Health · 72.8 · Strong ·

At a glance — Architecture · 86.2 · Adequate · gated by D26 ·

At a glance — Maturity · 79.0 · Strong ·

At a glance — Readiness · 70.1 · Adequate · gated by P3 ·

At a glance — Security · 77.4 · Strong ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection7High / Critical
A03:2025 — Software Supply Chain Failures4Medium

Roadmap

Top priorities: Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing; Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release; Interpolated log message defeats structured logging.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+3.2 ptsMediumSecurity & performance tooling
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+2.7 ptsMediumRelease Hygiene
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.+1.1 ptsLowADR Quality
Interpolated log message defeats structured logging+2.0 ptsMediumStructured logging
Bring the 18 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with func_metadata.func_metadata (cyclomatic 34), OAuthClientProvider._auth_flow (cyclomatic 33), TokenHandler.handle (cyclomatic 28).+1.3 ptsHighCyclomatic Complexity
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.+0.6 ptsLowProject Cohesion
Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.+1.1 ptsMediumAccess Controls
Swallowed exception (caught, then discarded)+1.0 ptsMediumException handling

File quality

Per-file score 0–10 — a quality signature. Of 85 files carrying findings, judged against the Production bar: 0% slop · 52% mixed · 48% near-clean.

FileScoreBandWorst signal
src/mcp/server/mcpserver/utilities/func_metadata.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/auth/handlers/token.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/connection.py6.0MixedExplicit Debt: TodoComment
src/mcp/shared/jsonrpc_dispatcher.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/mcpserver/server.py6.0MixedExplicit Debt: TodoComment
src/mcp/client/streamable_http.py6.0MixedExplicit Debt: TodoComment
src/mcp/client/session.py6.0MixedExplicit Debt: TodoComment
src/mcp/client/client.py6.0MixedExplicit Debt: TodoComment
src/mcp/shared/inbound.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/lowlevel/server.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/runner.py6.0MixedExplicit Debt: TodoComment
src/mcp/server/transport_security.py6.0MixedExplicit Debt: TodoComment
examples/servers/everything-server/mcp_everything_server/server.py6.0MixedExplicit Debt: TodoComment
REDACTED6.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED6.4MixedStatic Analysis (SAST): Medium: REDACTED
examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py6.7MixedExplicit Debt: TodoComment
REDACTED7.1MixedCognitive Complexity: cli.install (cognitive 27)
src/mcp/shared/uri_template.py7.1MixedCyclomatic Complexity: uri_template._scan_suffix (cyclomatic 20)
src/mcp/server/mcpserver/resolve.py7.2MixedCyclomatic Complexity: resolve._fulfil (cyclomatic 17)
src/mcp/client/auth/extensions/client_credentials.py7.2MixedCode Duplication: Edited copy of a member (20 corresponding lines)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 2

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 189

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 73

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 11

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 51 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 51 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D19D20D26D28D29D30D34D35D36D37D43D44AX10AX3AX4AX6C2M1M2M3M4P1P10P2P3P4P6PF3X1X12X13X17X21X23X25X27X28X3X4

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 253 of 264 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1e4a4-3727-76da-97ad-5258595e98c7.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Python half could not be measured — the pytest suite could not be run in the analyzer image (its dependency install could not be served by 172.31.7.1 (pip: No matching distribution found for mcp-types==2.3.1.dev20+77001c96), so its suite was not run against dependencies it does not declare). Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`coverage run`) shows coverage is measured in your own CI.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 283 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .js) and this repository declares a Python test suite (repository root, 238 test files), but it was not re-run: its dependency install could not be served by 172.31.7.1 (pip: No matching distribution found for mcp-types==2.3.1.dev20+77001c96), so its suite was not run against dependencies it does not declare. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's 2 shipped Python distribution(s) across 2 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `src/mcp/client/sse.py`, `src/mcp/shared/jsonrpc_dispatcher.py` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 14 further occurrence(s) are not listed individually; the score already reflects all 54.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity7.7 / 10Strong✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.7 / 10 · rule-coverage 100% · ceiling Prevented

18 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was func_metadata.func_metadata at 34.

func_metadata.func_metadata (cyclomatic 34)src/mcp/server/mcpserver/utilities/func_metadata.py:287
OAuthClientProvider._auth_flow (cyclomatic 33)src/mcp/client/auth/oauth2.py:604
TokenHandler.handle (cyclomatic 28)src/mcp/server/auth/handlers/token.py:103
Connection.check_capability (cyclomatic 25)src/mcp/server/connection.py:453
JSONRPCDispatcher.send_raw_request (cyclomatic 23)src/mcp/shared/jsonrpc_dispatcher.py:319

+ 13 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 18 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with func_metadata.func_metadata (cyclomatic 34), OAuthClientProvider._auth_flow (cyclomatic 33), TokenHandler.handle (cyclomatic 28). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 18 together lifts Cyclomatic Complexity from 7.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.7 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.7 / 10 · rule-coverage 100% · ceiling Prevented

46 method(s) exceeded the cognitive complexity threshold of 15; the worst was OAuthClientProvider._auth_flow at 74.

OAuthClientProvider._auth_flow (cognitive 74)src/mcp/client/auth/oauth2.py:604
func_metadata.func_metadata (cognitive 54)src/mcp/server/mcpserver/utilities/func_metadata.py:287
TokenHandler.handle (cognitive 45)src/mcp/server/auth/handlers/token.py:103
uri_template._expand_expression (cognitive 45)src/mcp/shared/uri_template.py:228
_probe.negotiate_auto (cognitive 42)src/mcp/client/_probe.py:52

+ 41 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cognitive Complexity — start with OAuthClientProvider._auth_flow (cognitive 74). — Refactoring it lifts Cognitive Complexity from 5.7 to about 6.0/10.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes9.0 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Prevented

11 god class(es) detected.

FileTooLong: client/session.py · ×9src/mcp/client/session.py
TooManyMethods: ClientSession · ×2src/mcp/client/session.py:388

What to do

  1. Resolve the 9 FileTooLong finding(s) in God Classes — start with REDACTED (2), streamable_http.py (2), session.py. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 2 TooManyMethods finding(s) in God Classes — start with session.py, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication8.6 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.6 / 10 · rule-coverage 100% · ceiling Verified

24 duplicated block group(s) detected. 3.5 % of the production lines (1,475 of 41,859) are in a reported copy. A further 38 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 28 of the 62 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Edited copy of a member (9 corresponding lines) · ×3docs_src/session_groups/tutorial003.py:7
Duplicated block (8 lines × 2) · ×3src/mcp/client/auth/extensions/client_credentials.py:160
Duplicated block (10 lines × 2) · ×3docs_src/legacy_clients/tutorial001.py:16
Duplicated block (5 lines × 2) · ×3docs_src/client_callbacks/tutorial001.py:15
Edited copy of a member (14 corresponding lines) · ×2docs_src/deploy/tutorial002.py:13

+ 39 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 3 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with client.py (2), tutorial003.py. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 3 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with client_credentials.py, oauth2.py, types.py. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED, REDACTED, event_store.py. — One of this dimension's main actionable groups (3 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling6.0 / 10Adequate✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: mcp-types

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 73 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1 tests. Measured on the JavaScript/TypeScript suite only — at least 283 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 5 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 2 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (3 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 5 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/mcp/server/mcpserver/utilities/func_metadata.py (9×34=306); src/mcp/server/mcpserver/server.py (8×22=176); src/mcp/client/auth/oauth2.py (3×33=99)

Hotspot: src/mcp/server/mcpserver/utilities/func_metadata.py · ×5src/mcp/server/mcpserver/utilities/func_metadata.py:287

What to do

  1. Resolve the 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with func_metadata.py, REDACTED, oauth2.py. — One of this dimension's main actionable groups (5 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.3 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

6 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/mcp-types/mcp_types/methods.py. Counted over 88 of the 353 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 38 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

38 deducted task-comment markers across 41859 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×38tests/test_examples.py:2

What to do

  1. Resolve the 38 TodoComment finding(s) in Explicit Debt — start with REDACTED (5), jsonrpc_dispatcher.py (4), runner.py (4). — One of this dimension's main actionable groups (38 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 59 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundREDACTED:31

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 build units (Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionREDACTED:1

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)6.1 / 10Adequate✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 6.1 / 10 · rule-coverage 100% · ceiling Documented

7 finding(s): 0 critical, 2 high, 2 medium, 3 low. semgrep hit a parse error in 4 file(s) — `.github/actions/conformance/run-client.sh` (line 8, line 107), `.github/actions/conformance/run-server.sh` (line 50), `src/mcp/client/sse.py`, `src/mcp/shared/jsonrpc_dispatcher.py` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities9.8 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 0 high, 1 medium, 0 low.

REDACTED

What to do

  1. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

7 of 88 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/mcp/server/auth/handlers/authorize.py. Counted over 88 of the 353 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×7src/mcp/server/auth/handlers/authorize.py:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: sse.py↔stdio.py 60%

Change coupling: sse.py ↔ stdio.pysrc/mcp/server/sse.py:1

What to do

  1. Resolve the 1 Change coupling finding(s) in Change Coupling — start with sse.py. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

3/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
M1 · Documentation (README)8.5 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 10 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — .github/workflows/conformance.yml:6

What to do

  • Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `convert_result` is public, takes a document from its caller (line 198) and hands it to `_convert_to_content`, which calls itself at line 660 (`_convert_to_content`) with a piece of `result` — and nowhere in `_convert_to_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_convert_to_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/mcp/server/mcpserver/utilities/func_metadata.py:660

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.8 / 10Strong✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — src/mcp/server/mcpserver/resolve.py:211, src/mcp/client/auth/utils.py:336

What to do

  • Swallowed exception (caught, then discarded)
X4 · Structured logging4.7 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `warning` at line 107 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/shared/tool_name_validation.py:107
  • `warning` at line 109 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/shared/tool_name_validation.py:109
  • `debug` at line 135 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. (×2) — src/mcp/server/sse.py:135, src/mcp/client/sse.py:135
  • `debug` at line 160 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:160
  • `debug` at line 183 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:183
  • `debug` at line 186 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:186
  • `debug` at line 208 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:208
  • `debug` at line 247 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:247
  • `warning` at line 249 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:249
  • `warning` at line 255 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:255
  • `debug` at line 269 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:269
  • `debug` at line 273 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:273
  • `debug` at line 284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/sse.py:284
  • `debug` at line 663 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:663
  • `info` at line 855 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:855
  • `debug` at line 877 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:877
  • `debug` at line 1081 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:1081
  • `debug` at line 1093 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:1093
  • `debug` at line 1135 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http.py:1135
  • `info` at line 305 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http_manager.py:305
  • `info` at line 325 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http_manager.py:325
  • `info` at line 366 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http_manager.py:366
  • `exception` at line 368 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/streamable_http_manager.py:368
  • `warning` at line 69 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/transport_security.py:69
  • `warning` at line 91 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/server/transport_security.py:91
  • `warning` at line 1133 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/session.py:1133
  • `warning` at line 397 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/session_group.py:397
  • `warning` at line 407 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/session_group.py:407
  • `warning` at line 418 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/session_group.py:418
  • `debug` at line 66 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:66
  • `debug` at line 80 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:80
  • `debug` at line 84 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:84
  • `debug` at line 111 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:111
  • `warning` at line 120 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:120
  • `debug` at line 143 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:143
  • `debug` at line 166 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/sse.py:166
  • `info` at line 172 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/streamable_http.py:172
  • `debug` at line 191 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/streamable_http.py:191
  • `warning` at line 221 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/mcp/client/streamable_http.py:221

What to do

  • Interpolated log message defeats structured logging

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health72.8StrongSolid.
Architecture86.2Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity79.0StrongSolid.
Readiness70.1Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security77.4StrongSolid.
Performance100.0ExemplaryStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 63 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (5 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not included — the .py suite was found but not re-run
  • D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 2 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Python surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Python suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (179 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HTTP client call or construction in the JavaScript/TypeScript, Python source (service entry point: src/mcp/server/_streamable_http_modern.py:49 (from starlette))
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 2 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 189 finding(s)
D17 · Explicit Debt · TodoComment · ×38
  • TodoComment tests/test_examples.py:2 — # TODO(Marcelo): The `examples` directory needs to be importable as a package. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tests/server/mcpserver/test_integration.py:6 — # TODO(Marcelo): The `examples` package is not being imported as package. We need to solve this. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tests/client/test_session_group.py:298 — # TODO(Marcelo): This is horrible. We should drop this test. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/direct_dispatcher.py:69 — # TODO(maxisbey): remove for Context rework — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/jsonrpc_dispatcher.py:147 — # TODO(maxisbey): remove for Context rework — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/dispatcher.py:211 — # TODO(maxisbey): remove for context rework — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/inbound.py:307 — # -32603, and whether handler-origin errors get 5xx is an open S4 question — see TODO(L66). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/jsonrpc_dispatcher.py:384 — # TODO(maxisbey): move the otel span + inject into an outbound — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/jsonrpc_dispatcher.py:605 — # TODO(maxisbey): duplicate ids blind-overwrite (v1/TS parity); revisit — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/shared/jsonrpc_dispatcher.py:775 — # TODO(L58): code=0 pins existing-server compat; JSON-RPC says — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/connection.py:458 — # TODO(L53): redesign - mirrors v1 ServerSession.check_client_capability — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/context.py:185 — # TODO(maxisbey): once `_make_context` returns the (covariant) `Context[L]` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/runner.py:198 — # TODO(L29): the 2026-07-28 spec drops the handshake; this branch and — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/runner.py:234 — # TODO: this re-reads the wire `params`, so a middleware that rewrote — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/runner.py:311 — # TODO(L54): remove for Context rework. Reads the SHTTP per-request — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/runner.py:370 — # TODO(L56): reject extension resultType values unless the corresponding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/streamable_http_manager.py:187 — # TODO(L49): header-only era-routing for now; body-primary classification — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/streamable_http_manager.py:303 — # TODO(L62): Align error code once spec clarifies — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/transport_security.py:19 — # TODO(Marcelo): We should flatten these settings. To be fair, I don't think we should even have this middleware. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/transport_security.py:42 — # TODO(Marcelo): This should be a proper ASGI middleware. I'm sad to see this. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/mcpserver/context.py:70 — # TODO(maxisbey): Consider making request_context/mcp_server required, or refactor Context entirely. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/mcpserver/context.py:78 — # TODO(Marcelo): We should drop this kwargs parameter. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/mcpserver/server.py:230 — # TODO(Marcelo): It seems there's a type mismatch between the lifespan type from an MCPServer and Server. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/mcpserver/utilities/func_metadata.py:520 — # TODO: should we use the original annotation? We are losing any potential `Annotated` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/mcp/server/lowlevel/server.py:448 — # TODO(L54): provisional - signature and semantics may change in a 2.x — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 13 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×9
  • FileTooLong: client/session.py src/mcp/client/session.py — FileTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 480 over it, 1.96× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcpserver/server.py src/mcp/server/mcpserver/server.py — FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 347 over it, 1.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: server/streamable_http.py src/mcp/server/streamable_http.py — FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 165 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_types/_types.py src/mcp-types/mcp_types/_types.py — FileTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 111 over it, 1.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: client/client.py src/mcp/client/client.py — FileTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 70 over it, 1.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: shared/jsonrpc_dispatcher.py src/mcp/shared/jsonrpc_dispatcher.py — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: lowlevel/server.py src/mcp/server/lowlevel/server.py — FileTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 46 over it, 1.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: server/runner.py src/mcp/server/runner.py — FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: client/streamable_http.py src/mcp/client/streamable_http.py — FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 19 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • Hotspot: src/mcp/server/mcpserver/utilities/func_metadata.py src/mcp/server/mcpserver/utilities/func_metadata.py:287 — src/mcp/server/mcpserver/utilities/func_metadata.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in func_metadata.func_metadata at line 287. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:45:39 +01:00' --until='2026-11-05 11:45:39 +01:00' --full-history --no-merges -- src/mcp/server/mcpserver/utilities/func_metadata.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/mcp/server/mcpserver/server.py src/mcp/server/mcpserver/server.py:158 — src/mcp/server/mcpserver/server.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in MCPServer.__init__ at line 158. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:45:39 +01:00' --until='2026-11-05 11:45:39 +01:00' --full-history --no-merges -- src/mcp/server/mcpserver/server.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/mcp/client/auth/oauth2.py src/mcp/client/auth/oauth2.py:604 — src/mcp/client/auth/oauth2.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in OAuthClientProvider._auth_flow at line 604. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:45:39 +01:00' --until='2026-11-05 11:45:39 +01:00' --full-history --no-merges -- src/mcp/client/auth/oauth2.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/mcp/shared/jsonrpc_dispatcher.py src/mcp/shared/jsonrpc_dispatcher.py:319 — src/mcp/shared/jsonrpc_dispatcher.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in JSONRPCDispatcher.send_raw_request at line 319. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:45:39 +01:00' --until='2026-11-05 11:45:39 +01:00' --full-history --no-merges -- src/mcp/shared/jsonrpc_dispatcher.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/mcp/server/_streamable_http_modern.py src/mcp/server/_streamable_http_modern.py:365 — src/mcp/server/_streamable_http_modern.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in _streamable_http_modern.handle_modern_request at line 365. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:45:39 +01:00' --until='2026-11-05 11:45:39 +01:00' --full-history --no-merges -- src/mcp/server/_streamable_http_modern.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×3
  • Edited copy of a member (9 corresponding lines) docs_src/session_groups/tutorial003.py:7 — docs_src/session_groups/tutorial003.py:7-15 | docs_src/session_groups/tutorial004.py:12-21 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) examples/stories/lifespan/client.py:9 — examples/stories/lifespan/client.py:9-17 | examples/stories/stateless_legacy/client.py:12-32 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) examples/stories/middleware/client.py:8 — examples/stories/middleware/client.py:8-23 | examples/stories/oauth_client_credentials/client.py:35-43 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) src/mcp/client/auth/extensions/client_credentials.py:160 — src/mcp/client/auth/extensions/client_credentials.py:160-167 | src/mcp/client/auth/extensions/client_credentials.py:409-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) src/mcp/client/auth/oauth2.py:470 — src/mcp/client/auth/oauth2.py:470-477 | src/mcp/client/auth/oauth2.py:524-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) src/mcp/server/mcpserver/utilities/types.py:45 — src/mcp/server/mcpserver/utilities/types.py:45-52 | src/mcp/server/mcpserver/utilities/types.py:92-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) docs_src/legacy_clients/tutorial001.py:16 — docs_src/legacy_clients/tutorial001.py:16-25 | docs_src/legacy_clients/tutorial002.py:16-25 — before extracting anything, compare `docs_src/legacy_clients/tutorial001.py` and `docs_src/legacy_clients/tutorial002.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) examples/stories/oauth_client_credentials/server.py:49 — examples/stories/oauth_client_credentials/server.py:49-58 | examples/stories/oauth_client_credentials/server_lowlevel.py:47-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/stories/oauth_client_credentials/server.py:60` calls `custom_route` and `examples/stories/oauth_client_credentials/server_lowlevel.py:58` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:36 — examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:36-45 | examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py:36-45 — before extracting anything, compare `examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py` and `examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) docs_src/client_callbacks/tutorial001.py:15 — docs_src/client_callbacks/tutorial001.py:15-19 | docs_src/client_callbacks/tutorial003.py:16-20 — before extracting anything, compare `docs_src/client_callbacks/tutorial001.py` and `docs_src/client_callbacks/tutorial003.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) docs_src/troubleshooting/tutorial006.py:15 — docs_src/troubleshooting/tutorial006.py:15-19 | docs_src/troubleshooting/tutorial008.py:15-19 — before extracting anything, compare `docs_src/troubleshooting/tutorial006.py` and `docs_src/troubleshooting/tutorial008.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) examples/stories/oauth/server_lowlevel.py:36 — examples/stories/oauth/server_lowlevel.py:36-43 | examples/stories/oauth_client_credentials/server_lowlevel.py:38-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/stories/oauth/server_lowlevel.py:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `types.PaginatedRequestParams | None` in one and `types.CallToolRequestParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: ClientSession src/mcp/client/session.py:388 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MCPServer src/mcp/server/mcpserver/server.py:157 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) docs_src/deploy/tutorial002.py:13 — docs_src/deploy/tutorial002.py:13-26 | docs_src/deploy/tutorial003.py:13-26 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/mcp/server/mcpserver/server.py:551 — src/mcp/server/mcpserver/server.py:551-566 | src/mcp/server/mcpserver/server.py:569-582 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py:148 — src/mcp/client/auth/extensions/client_credentials.py:148-167 | src/mcp/client/auth/extensions/client_credentials.py:397-416 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/mcp/server/transport_security.py:51 — src/mcp/server/transport_security.py:51-70 | src/mcp/server/transport_security.py:73-92 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) src/mcp/server/mcpserver/server.py:1093 — src/mcp/server/mcpserver/server.py:1093-1111 | src/mcp/server/mcpserver/server.py:1128-1151 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py:207 — examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py:207-240 | examples/snippets/servers/identity_assertion_server.py:72-90 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) docs_src/lowlevel/tutorial004.py:32 — docs_src/lowlevel/tutorial004.py:32-38 | docs_src/lowlevel/tutorial003.py:32-37 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) examples/stories/roots/client.py:20 — examples/stories/roots/client.py:20-27 | examples/stories/sampling/client.py:20-25 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) docs_src/extensions/tutorial004_client.py:27 — docs_src/extensions/tutorial004_client.py:27-30 | docs_src/extensions/tutorial007_client.py:27-30 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py:135 — src/mcp/client/auth/extensions/client_credentials.py:135-138 | src/mcp/client/auth/oauth2.py:565-568 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) docs_src/header_parameters/tutorial002.py:30 — docs_src/header_parameters/tutorial002.py:30-32 | docs_src/header_parameters/tutorial003.py:34-36 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) docs_src/client_transports/tutorial002.py:5 — docs_src/client_transports/tutorial002.py:5-7 | docs_src/client_transports/tutorial004.py:11-13 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×2
  • Edited copy of a member (2 corresponding lines) docs_src/middleware/tutorial001.py:35 — docs_src/middleware/tutorial001.py:35-36 | docs_src/middleware/tutorial002.py:36-37 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) docs_src/extensions/tutorial004.py:24 — docs_src/extensions/tutorial004.py:24-25 | examples/stories/extensions/server.py:40-41 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×2
  • Duplicated block (11 lines × 2) docs_src/deploy/tutorial002.py:16 — docs_src/deploy/tutorial002.py:16-26 | docs_src/deploy/tutorial003.py:16-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) examples/stories/bearer_auth/client.py:34 — examples/stories/bearer_auth/client.py:34-44 | examples/stories/identity_assertion/client.py:55-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×2
  • Duplicated block (7 lines × 2) docs_src/lowlevel/tutorial001.py:23 — docs_src/lowlevel/tutorial001.py:23-29 | docs_src/lowlevel/tutorial006.py:26-44 — before extracting anything, compare `docs_src/lowlevel/tutorial001.py` and `docs_src/lowlevel/tutorial006.py` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) examples/stories/_harness.py:42 — examples/stories/_harness.py:42-48 | examples/stories/_hosting.py:32-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×2
  • Edited copy of a member (17 corresponding lines) examples/stories/identity_assertion/server.py:90 — examples/stories/identity_assertion/server.py:90-106 | examples/stories/oauth/server.py:20-36 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py:49 — examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py:49-68 | examples/snippets/servers/lowlevel/structured_output.py:43-59 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) src/mcp/server/mcpserver/resolve.py:211 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/mcp/client/auth/utils.py:336 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D1 · Cyclomatic Complexity · func_metadata.func_metadata (cyclomatic 34) · ×1
  • func_metadata.func_metadata (cyclomatic 34) src/mcp/server/mcpserver/utilities/func_metadata.py:287 — func_metadata.func_metadata has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OAuthClientProvider._auth_flow (cyclomatic 33) · ×1
  • OAuthClientProvider._auth_flow (cyclomatic 33) src/mcp/client/auth/oauth2.py:604 — OAuthClientProvider._auth_flow has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenHandler.handle (cyclomatic 28) · ×1
  • TokenHandler.handle (cyclomatic 28) src/mcp/server/auth/handlers/token.py:103 — TokenHandler.handle has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Connection.check_capability (cyclomatic 25) · ×1
  • Connection.check_capability (cyclomatic 25) src/mcp/server/connection.py:453 — Connection.check_capability has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JSONRPCDispatcher.send_raw_request (cyclomatic 23) · ×1
  • JSONRPCDispatcher.send_raw_request (cyclomatic 23) src/mcp/shared/jsonrpc_dispatcher.py:319 — JSONRPCDispatcher.send_raw_request has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MCPServer.__init__ (cyclomatic 22) · ×1
  • MCPServer.__init__ (cyclomatic 22) src/mcp/server/mcpserver/server.py:158 — MCPServer.__init__ has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _streamable_http_modern.handle_modern_request (cyclomatic 21) · ×1
  • _streamable_http_modern.handle_modern_request (cyclomatic 21) src/mcp/server/_streamable_http_modern.py:365 — _streamable_http_modern.handle_modern_request has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StreamableHTTPServerTransport._handle_post_request (cyclomatic 20) · ×1
  • StreamableHTTPServerTransport._handle_post_request (cyclomatic 20) src/mcp/server/streamable_http.py:558 — StreamableHTTPServerTransport._handle_post_request has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · uri_template._scan_suffix (cyclomatic 20) · ×1
  • uri_template._scan_suffix (cyclomatic 20) src/mcp/shared/uri_template.py:969 — uri_template._scan_suffix has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RequestStateBoundary._unseal (cyclomatic 19) · ×1
  • RequestStateBoundary._unseal (cyclomatic 19) src/mcp/server/request_state.py:364 — RequestStateBoundary._unseal has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _probe.negotiate_auto (cyclomatic 18) · ×1
  • _probe.negotiate_auto (cyclomatic 18) src/mcp/client/_probe.py:52 — _probe.negotiate_auto has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamableHTTPTransport._handle_post_request (cyclomatic 18) · ×1
  • StreamableHTTPTransport._handle_post_request (cyclomatic 18) src/mcp/client/streamable_http.py:363 — StreamableHTTPTransport._handle_post_request has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientAuthenticator.authenticate_request (cyclomatic 18) · ×1
  • ClientAuthenticator.authenticate_request (cyclomatic 18) src/mcp/server/auth/middleware/client_auth.py:39 — ClientAuthenticator.authenticate_request has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude.update_claude_config (cyclomatic 17) · ×1
  • claude.update_claude_config (cyclomatic 17) src/mcp/cli/claude.py:62 — claude.update_claude_config has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IdentityAssertionOAuthProvider._auth_flow (cyclomatic 17) · ×1
  • IdentityAssertionOAuthProvider._auth_flow (cyclomatic 17) src/mcp/client/auth/extensions/identity_assertion.py:163 — IdentityAssertionOAuthProvider._auth_flow has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolve._fulfil (cyclomatic 17) · ×1
  • resolve._fulfil (cyclomatic 17) src/mcp/server/mcpserver/resolve.py:570 — resolve._fulfil has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientSession.send_request (cyclomatic 16) · ×1
  • ClientSession.send_request (cyclomatic 16) src/mcp/client/session.py:540 — ClientSession.send_request has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RegistrationHandler.handle (cyclomatic 16) · ×1
  • RegistrationHandler.handle (cyclomatic 16) src/mcp/server/auth/handlers/register.py:32 — RegistrationHandler.handle has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OAuthClientProvider._auth_flow (cognitive 74) · ×1
  • OAuthClientProvider._auth_flow (cognitive 74) src/mcp/client/auth/oauth2.py:604 — OAuthClientProvider._auth_flow has cognitive complexity 74 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 10, loops 2 (6 pts), ternaries 2 (5 pts), error handling 1 (2 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · func_metadata.func_metadata (cognitive 54) · ×1
  • func_metadata.func_metadata (cognitive 54) src/mcp/server/mcpserver/utilities/func_metadata.py:287 — func_metadata.func_metadata has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 7, ternaries 2 (5 pts), error handling 3 (4 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenHandler.handle (cognitive 45) · ×1
  • TokenHandler.handle (cognitive 45) src/mcp/server/auth/handlers/token.py:103 — TokenHandler.handle has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 5 (8 pts), ternaries 4 (8 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uri_template._expand_expression (cognitive 45) · ×1
  • uri_template._expand_expression (cognitive 45) src/mcp/shared/uri_template.py:228 — uri_template._expand_expression has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 3 (14 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _probe.negotiate_auto (cognitive 42) · ×1
  • _probe.negotiate_auto (cognitive 42) src/mcp/client/_probe.py:52 — _probe.negotiate_auto has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (29 pts), error handling 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uri_template._scan_suffix (cognitive 42) · ×1
  • uri_template._scan_suffix (cognitive 42) src/mcp/shared/uri_template.py:969 — uri_template._scan_suffix has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connection.check_capability (cognitive 37) · ×1
  • Connection.check_capability (cognitive 37) src/mcp/server/connection.py:453 — Connection.check_capability has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamableHTTPTransport._handle_post_request (cognitive 36) · ×1
  • StreamableHTTPTransport._handle_post_request (cognitive 36) src/mcp/client/streamable_http.py:363 — StreamableHTTPTransport._handle_post_request has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (31 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONRPCDispatcher.send_raw_request (cognitive 30) · ×1
  • JSONRPCDispatcher.send_raw_request (cognitive 30) src/mcp/shared/jsonrpc_dispatcher.py:319 — JSONRPCDispatcher.send_raw_request has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, error handling 3, loops 1 (2 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · client._fold_extensions (cognitive 29) · ×1
  • client._fold_extensions (cognitive 29) src/mcp/client/client.py:211 — client._fold_extensions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (8 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.install (cognitive 27) · ×1
  • cli.install (cognitive 27) REDACTED:361 — cli.install has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 2 (6 pts), loops 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdentityAssertionOAuthProvider._auth_flow (cognitive 26) · ×1
  • IdentityAssertionOAuthProvider._auth_flow (cognitive 26) src/mcp/client/auth/extensions/identity_assertion.py:163 — IdentityAssertionOAuthProvider._auth_flow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve._fulfil (cognitive 26) · ×1
  • resolve._fulfil (cognitive 26) src/mcp/server/mcpserver/resolve.py:570 — resolve._fulfil has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 3 (7 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamableHTTPServerTransport._handle_post_request (cognitive 25) · ×1
  • StreamableHTTPServerTransport._handle_post_request (cognitive 25) src/mcp/server/streamable_http.py:558 — StreamableHTTPServerTransport._handle_post_request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 5 (7 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _streamable_http_modern.handle_modern_request (cognitive 24) · ×1
  • _streamable_http_modern.handle_modern_request (cognitive 24) src/mcp/server/_streamable_http_modern.py:365 — _streamable_http_modern.handle_modern_request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, error handling 4 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClientAuthenticator.authenticate_request (cognitive 24) · ×1
  • ClientAuthenticator.authenticate_request (cognitive 24) src/mcp/server/auth/middleware/client_auth.py:39 — ClientAuthenticator.authenticate_request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPServer.__init__ (cognitive 24) · ×1
  • MCPServer.__init__ (cognitive 24) src/mcp/server/mcpserver/server.py:158 — MCPServer.__init__ has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts), ternaries 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · inbound.validate_mcp_param_headers (cognitive 24) · ×1
  • inbound.validate_mcp_param_headers (cognitive 24) src/mcp/shared/inbound.py:526 — inbound.validate_mcp_param_headers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientSessionGroup.disconnect_from_server (cognitive 22) · ×1
  • ClientSessionGroup.disconnect_from_server (cognitive 22) src/mcp/client/session_group.py:254 — ClientSessionGroup.disconnect_from_server has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uri_template._scan_prefix (cognitive 22) · ×1
  • uri_template._scan_prefix (cognitive 22) src/mcp/shared/uri_template.py:1054 — uri_template._scan_prefix has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude.update_claude_config (cognitive 21) · ×1
  • claude.update_claude_config (cognitive 21) src/mcp/cli/claude.py:62 — claude.update_claude_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 2 (3 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StreamableHTTPTransport.handle_get_stream (cognitive 21) · ×1
  • StreamableHTTPTransport.handle_get_stream (cognitive 21) src/mcp/client/streamable_http.py:224 — StreamableHTTPTransport.handle_get_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve._require_capability (cognitive 21) · ×1
  • resolve._require_capability (cognitive 21) src/mcp/server/mcpserver/resolve.py:673 — resolve._require_capability has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inbound._walk_schema_positions (cognitive 20) · ×1
  • inbound._walk_schema_positions (cognitive 20) src/mcp/shared/inbound.py:120 — inbound._walk_schema_positions has cognitive complexity 20 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 2 (5 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONRPCDispatcher._dispatch_notification (cognitive 20) · ×1
  • JSONRPCDispatcher._dispatch_notification (cognitive 20) src/mcp/shared/jsonrpc_dispatcher.py:625 — JSONRPCDispatcher._dispatch_notification has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli._import_server (cognitive 19) · ×1
  • cli._import_server (cognitive 19) REDACTED:119 — cli._import_server has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Client.__post_init__ (cognitive 19) · ×1
  • Client.__post_init__ (cognitive 19) src/mcp/client/client.py:382 — Client.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientSession.send_request (cognitive 19) · ×1
  • ClientSession.send_request (cognitive 19) src/mcp/client/session.py:540 — ClientSession.send_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamableHTTPTransport._handle_sse_event (cognitive 19) · ×1
  • StreamableHTTPTransport._handle_sse_event (cognitive 19) src/mcp/client/streamable_http.py:174 — StreamableHTTPTransport._handle_sse_event has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.streamable_http_app (cognitive 19) · ×1
  • Server.streamable_http_app (cognitive 19) src/mcp/server/lowlevel/server.py:732 — Server.streamable_http_app has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResourceSecurity.validate (cognitive 19) · ×1
  • ResourceSecurity.validate (cognitive 19) src/mcp/server/mcpserver/resources/templates.py:61 — ResourceSecurity.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequestStateBoundary._unseal (cognitive 19) · ×1
  • RequestStateBoundary._unseal (cognitive 19) src/mcp/server/request_state.py:364 — RequestStateBoundary._unseal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClientSession.__init__ (cognitive 18) · ×1
  • ClientSession.__init__ (cognitive 18) src/mcp/client/session.py:404 — ClientSession.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), ternaries 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MCPServer.sse_app (cognitive 18) · ×1
  • MCPServer.sse_app (cognitive 18) src/mcp/server/mcpserver/server.py:1153 — MCPServer.sse_app has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validation.validate_tool_use_result_messages (cognitive 18) · ×1
  • validation.validate_tool_use_result_messages (cognitive 18) src/mcp/server/validation.py:54 — validation.validate_tool_use_result_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inbound.classify_inbound_request (cognitive 18) · ×1
  • inbound.classify_inbound_request (cognitive 18) src/mcp/shared/inbound.py:390 — inbound.classify_inbound_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConformanceOAuthCallbackHandler.handle_redirect (cognitive 17) · ×1
  • ConformanceOAuthCallbackHandler.handle_redirect (cognitive 17) .github/actions/conformance/client.py:152 — ConformanceOAuthCallbackHandler.handle_redirect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (8 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClientSession._absorb_tool_listing (cognitive 17) · ×1
  • ClientSession._absorb_tool_listing (cognitive 17) src/mcp/client/session.py:1291 — ClientSession._absorb_tool_listing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Prompt.render (cognitive 17) · ×1
  • Prompt.render (cognitive 17) src/mcp/server/mcpserver/prompts/base.py:158 — Prompt.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve._resolve (cognitive 17) · ×1
  • resolve._resolve (cognitive 17) src/mcp/server/mcpserver/resolve.py:516 — resolve._resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Tool.run (cognitive 17) · ×1
  • Tool.run (cognitive 17) src/mcp/server/mcpserver/tools/base.py:134 — Tool.run has cognitive complexity 17 (threshold 15). Drivers by points: error handling 7, if/else 5 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONRPCDispatcher._handle_request (cognitive 17) · ×1
  • JSONRPCDispatcher._handle_request (cognitive 17) src/mcp/shared/jsonrpc_dispatcher.py:721 — JSONRPCDispatcher._handle_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uri_template._flatten (cognitive 17) · ×1
  • uri_template._flatten (cognitive 17) src/mcp/shared/uri_template.py:878 — uri_template._flatten has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamableHTTPTransport._handle_reconnection (cognitive 16) · ×1
  • StreamableHTTPTransport._handle_reconnection (cognitive 16) src/mcp/client/streamable_http.py:536 — StreamableHTTPTransport._handle_reconnection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegistrationHandler.handle (cognitive 16) · ×1
  • RegistrationHandler.handle (cognitive 16) src/mcp/server/auth/handlers/register.py:32 — RegistrationHandler.handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 2, error handling 2, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · func_metadata._create_output_model (cognitive 16) · ×1
  • func_metadata._create_output_model (cognitive 16) src/mcp/server/mcpserver/utilities/func_metadata.py:493 — func_metadata._create_output_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: sse.py ↔ stdio.py src/mcp/server/sse.py:1 — `src/mcp/server/sse.py` and `src/mcp/server/stdio.py` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `cb07adec` docs: add code fences to `Example:` docstring blocks (#2104); `705497a5` fix: allow null id in JSONRPCError per JSON-RPC 2.0 spec (#2056); `f4672c50` Drop `RootModel` from `JSONRPCMessage` (#1908) — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) docs_src/identity_assertion/tutorial002.py:51 — docs_src/identity_assertion/tutorial002.py:51-82 | examples/stories/identity_assertion/server.py:56-86 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) src/mcp/client/extensions/skills.py:80 — src/mcp/client/extensions/skills.py:80-114 | src/mcp/client/extensions/skills.py:137-170 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) src/mcp/server/mcpserver/utilities/types.py:45 — src/mcp/server/mcpserver/utilities/types.py:45-54 | src/mcp/server/mcpserver/utilities/types.py:92-101 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) src/mcp/client/auth/extensions/client_credentials.py:98 — src/mcp/client/auth/extensions/client_credentials.py:98-132 | src/mcp/client/auth/extensions/client_credentials.py:331-367 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) docs_src/subscriptions/tutorial004_anyio.py:18 — docs_src/subscriptions/tutorial004_anyio.py:18-23 | docs_src/subscriptions/tutorial004_asyncio.py:18-23 | docs_src/subscriptions/tutorial004_trio.py:18-23 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×1
  • Edited copy of a member (8 corresponding lines) src/mcp/server/_streamable_http_modern.py:116 — src/mcp/server/_streamable_http_modern.py:116-123 | src/mcp/shared/jsonrpc_dispatcher.py:178-185 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) src/mcp/client/session.py:942 — src/mcp/client/session.py:942-968 | src/mcp/client/session.py:1227-1254 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) src/mcp/server/connection.py:425 — src/mcp/server/connection.py:425-439 | src/mcp/server/context.py:110-129 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) docs_src/dependencies/tutorial004.py:11 — docs_src/dependencies/tutorial004.py:11-15 | docs_src/sampling_and_roots/tutorial001.py:11-15 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) src/mcp/client/session.py:864 — src/mcp/client/session.py:864-875 | src/mcp/server/session.py:444-455 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) docs_src/identity_assertion/tutorial002.py:51 — docs_src/identity_assertion/tutorial002.py:51-66 | examples/stories/identity_assertion/server.py:57-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) src/mcp/server/mcpserver/server.py:1097 — src/mcp/server/mcpserver/server.py:1097-1111 | src/mcp/server/mcpserver/server.py:1137-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp/server/mcpserver/server.py:1097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) REDACTED:17 — REDACTED:17-69 | docs_src/oauth_clients/tutorial001.py:14-62 | docs_src/oauth_clients/tutorial002.py:11-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) examples/servers/simple-pagination/mcp_simple_pagination/server.py:153 — examples/servers/simple-pagination/mcp_simple_pagination/server.py:153-176 | examples/servers/simple-prompt/mcp_simple_prompt/server.py:79-98 | examples/servers/simple-resource/mcp_simple_resource/server.py:72-91 | examples/servers/simple-tool/mcp_simple_tool/server.py:62-81 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) examples/stories/oauth_client_credentials/server.py:30 — examples/stories/oauth_client_credentials/server.py:30-80 | examples/stories/oauth_client_credentials/server_lowlevel.py:27-85 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) examples/stories/bearer_auth/server_lowlevel.py:19 — examples/stories/bearer_auth/server_lowlevel.py:19-53 | examples/stories/identity_assertion/server_lowlevel.py:30-61 | examples/stories/oauth/server_lowlevel.py:23-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) examples/stories/reconnect/server_lowlevel.py:22 — examples/stories/reconnect/server_lowlevel.py:22-43 | examples/stories/serve_one/server.py:32-44 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) examples/stories/dual_era/server_lowlevel.py:19 — examples/stories/dual_era/server_lowlevel.py:19-45 | examples/stories/json_response/server_lowlevel.py:20-40 | examples/stories/stateless_legacy/server_lowlevel.py:20-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) examples/servers/simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless/server.py:90 — examples/servers/simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless/server.py:90-116 | examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/server.py:104-142 | examples/servers/sse-polling-demo/mcp_sse_polling_demo/server.py:135-156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) examples/servers/simple-auth/mcp_simple_auth/auth_server.py:159 — examples/servers/simple-auth/mcp_simple_auth/auth_server.py:159-181 | examples/servers/simple-auth/mcp_simple_auth/legacy_as_server.py:116-133 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) examples/servers/everything-server/mcp_everything_server/server.py:222 — examples/servers/everything-server/mcp_everything_server/server.py:222-235 | examples/servers/everything-server/mcp_everything_server/server.py:254-267 | examples/servers/everything-server/mcp_everything_server/server.py:313-326 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) examples/servers/everything-server/mcp_everything_server/server.py:460 — examples/servers/everything-server/mcp_everything_server/server.py:460-470 | examples/servers/everything-server/mcp_everything_server/server.py:537-549 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:48 — examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:48-66 | examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py:48-71 — before extracting anything, compare `examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py` and `examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:73 — examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py:73-93 | examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py:78-98 — before extracting anything, compare `examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py` and `examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–19 lines × 10) · ×1
  • Duplicated block (10–19 lines × 10) examples/stories/bearer_auth/server_lowlevel.py:19 — examples/stories/bearer_auth/server_lowlevel.py:19-33 | examples/stories/dual_era/server_lowlevel.py:19-32 | examples/stories/identity_assertion/server_lowlevel.py:32-47 | examples/stories/json_response/server_lowlevel.py:20-33 | examples/stories/middleware/server.py:26-40 | examples/stories/oauth/server_lowlevel.py:25-40 | examples/stories/roots/server_lowlevel.py:12-26 | examples/stories/sampling/server_lowlevel.py:12-30 | examples/stories/stateless_legacy/server_lowlevel.py:20-29 | examples/stories/streaming/server_lowlevel.py:20-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 10 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/stories/identity_assertion/server_lowlevel.py:30` calls `IdentityAssertionAuthorizationServer` and `examples/stories/json_response/server_lowlevel.py:19` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) examples/servers/simple-pagination/mcp_simple_pagination/server.py:161 — examples/servers/simple-pagination/mcp_simple_pagination/server.py:161-176 | examples/servers/simple-prompt/mcp_simple_prompt/server.py:83-98 | examples/servers/simple-resource/mcp_simple_resource/server.py:76-91 | examples/servers/simple-tool/mcp_simple_tool/server.py:66-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `examples/servers/simple-pagination/mcp_simple_pagination/server.py:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) examples/servers/simple-auth/mcp_simple_auth/auth_server.py:57 — examples/servers/simple-auth/mcp_simple_auth/auth_server.py:57-69 | examples/servers/simple-auth/mcp_simple_auth/legacy_as_server.py:49-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/servers/simple-auth/mcp_simple_auth/auth_server.py:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `server_settings` to `AuthServerSettings` in one and `ServerSettings` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) examples/stories/oauth_client_credentials/server.py:61 — examples/stories/oauth_client_credentials/server.py:61-78 | examples/stories/oauth_client_credentials/server_lowlevel.py:58-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/stories/oauth_client_credentials/server.py:60` calls `custom_route` and `examples/stories/oauth_client_credentials/server_lowlevel.py:56` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) examples/stories/middleware/client.py:8 — examples/stories/middleware/client.py:8-13 | examples/stories/oauth_client_credentials/client.py:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py:79 — examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py:79-85 | examples/snippets/servers/lowlevel/basic.py:53-59 | examples/snippets/servers/lowlevel/direct_call_tool_result.py:52-58 | examples/snippets/servers/lowlevel/lifespan.py:89-95 | examples/snippets/servers/lowlevel/structured_output.py:70-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: mcp-types — mcp-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap src/mcp/server/mcpserver/utilities/func_metadata.py:660 — `convert_result` is public, takes a document from its caller (line 198) and hands it to `_convert_to_content`, which calls itself at line 660 (`_convert_to_content`) with a piece of `result` — and nowhere in `_convert_to_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_convert_to_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 72 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging src/mcp/shared/tool_name_validation.py:107 — `warning` at line 107 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/shared/tool_name_validation.py:109 — `warning` at line 109 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:135 — `debug` at line 135 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:160 — `debug` at line 160 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:183 — `debug` at line 183 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:186 — `debug` at line 186 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:208 — `debug` at line 208 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:247 — `debug` at line 247 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:249 — `warning` at line 249 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:255 — `warning` at line 255 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:269 — `debug` at line 269 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:273 — `debug` at line 273 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/sse.py:284 — `debug` at line 284 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:663 — `debug` at line 663 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:855 — `info` at line 855 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:877 — `debug` at line 877 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:1081 — `debug` at line 1081 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:1093 — `debug` at line 1093 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http.py:1135 — `debug` at line 1135 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http_manager.py:305 — `info` at line 305 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http_manager.py:325 — `info` at line 325 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http_manager.py:366 — `info` at line 366 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/streamable_http_manager.py:368 — `exception` at line 368 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.exception("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.exception("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/transport_security.py:69 — `warning` at line 69 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging src/mcp/server/transport_security.py:91 — `warning` at line 91 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×10
  • Duplicated predicate .github/scripts/docs_preview.js:80 — `c.user?.login === BOT_LOGIN && c.body?.includes(MARKER)` appears character-identically in 2 files — .github/scripts/docs_preview.js, .github/scripts/pr_intake_gate.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/client/streamable_http.py:161 — `isinstance(message, JSONRPCRequest) and message.method == "initialize"` appears character-identically in 2 files — src/mcp/client/streamable_http.py, src/mcp/server/streamable_http.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docs_src/completions/tutorial002.py:27 — `isinstance(ref, PromptReference) and argument.name == "language"` appears character-identically in 2 files — docs_src/completions/tutorial002.py, docs_src/completions/tutorial003.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/cli/claude.py:137 — `len(file_spec) > 1 and file_spec[1] == ":"` appears character-identically in 2 files — src/mcp/cli/claude.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docs_src/mrtr/tutorial001.py:45 — `not isinstance(answer, ElicitResult) or answer.content is None` appears character-identically in 2 files — docs_src/mrtr/tutorial001.py, docs_src/mrtr/tutorial004.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/client/auth/extensions/identity_assertion.py:176 — `response.status_code == 403 and extract_field_from_www_auth(response, "error") == "insufficient_scope"` appears character-identically in 2 files — src/mcp/client/auth/extensions/identity_assertion.py, src/mcp/client/auth/oauth2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docs_src/troubleshooting/tutorial006.py:17 — `result.action == "accept" and result.data.confirm` appears character-identically in 2 files — docs_src/troubleshooting/tutorial006.py, docs_src/troubleshooting/tutorial008.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/client/extension.py:114 — `self.protocol_versions is not None and not self.protocol_versions` appears character-identically in 2 files — src/mcp/client/extension.py, src/mcp/server/extension.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/server/validation.py:31 — `tools is not None or tool_choice is not None` appears character-identically in 2 files — src/mcp/server/validation.py, src/mcp/shared/peer.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/mcp/server/lowlevel/server.py:753 — `transport_security is None and host in ("127.0.0.1", "localhost", "::1")` appears character-identically in 2 files — src/mcp/server/lowlevel/server.py, src/mcp/server/mcpserver/server.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D34 · Knowledge Freshness · Orphaned file · ×7
  • Orphaned file src/mcp/server/auth/handlers/authorize.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/server/auth/middleware/client_auth.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/shared/tool_name_validation.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/__init__.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/server/auth/handlers/revoke.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/shared/auth_utils.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/mcp/client/__main__.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: src/mcp-types/mcp_types/methods.py, src/mcp/shared/direct_dispatcher.py, src/mcp/server/subscriptions.py, src/mcp/server/caching.py, src/mcp/shared/_request_clock.py. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (6 single-owned of 88 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 88 of the 353 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/mcp/server/_otel.py.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found REDACTED:31 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 31).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (29600 LoC, 574 module-visible types across 67 directories) overshoots its size bounds. 1 of 2 build unit(s) (Python) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 7 of 88 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 88 of the 353 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/mcp/server/auth/handlers/authorize.py, src/mcp/server/auth/middleware/client_auth.py, src/mcp/shared/tool_name_validation.py, src/mcp/__init__.py, src/mcp/server/auth/handlers/revoke.py, src/mcp/shared/auth_utils.py, src/mcp/client/__main__.py. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST .github/workflows/conformance.yml:6 — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 10 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch examples/snippets/clients/url_elicitation_client.py:133 — `extract_domain` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 2 shipped distribution(s) across 2 manifest(s) (11 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-7e9d742d8ba0463c952a4d7a5a2cf698/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-7e9d742d8ba0463c952a4d7a5a2cf698/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=184" --report-format json --report-path /tmp/watchdog-gitleaks-7e9d742d8ba0463c952a4d7a5a2cf698/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-7e9d742d8ba0463c952a4d7a5a2cf698/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude src/mcp-types/mcp_types/_v2025_11_25 --exclude src/mcp-types/mcp_types/_v2026_07_28 .7artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .1artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 2 file(s) — `src/mcp/client/sse.py`, `src/mcp/shared/jsonrpc_dispatcher.py` — so the PII/GDPR sweep did not cover them at all.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1e4a4-3727-76da-97ad-5258595e98c7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md