Repository Analysis

modelcontextprotocol/python-sdk

The official Python SDK for Model Context Protocol servers and clients

32.3 Strong AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of modelcontextprotocol/python-sdk, a Python project with 23,608 GitHub stars. SynthScan v2.0 examined 159,645 lines of code across 977 source files, recording 4032 pattern matches distributed across 20 syntactic categories. The overall adjusted score of 32.3 places this repository in the Strong AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

32.3
Adjusted Score
32.3
Raw Score
100%
Time Factor
2026-07-10
Last Push
23.6K
Stars
Python
Language
159.6K
Lines of Code
977
Files
4.0K
Pattern Hits
2026-07-14
Scan Date
0.28
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 270MEDIUM 161LOW 3601

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 4032 distinct pattern matches across 20 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers2788 hits · 2657 pts
SeverityFileLineSnippetContext
LOWtests/test_examples.py51async def test_direct_call_tool_result_return():CODE
LOWtests/test_types.py67async def test_method_initialization():CODE
LOWtests/test_types.py152async def test_sampling_message_with_user_role():CODE
LOWtests/test_types.py175async def test_sampling_message_with_assistant_role():CODE
LOWtests/test_types.py205async def test_sampling_message_backward_compatibility():CODE
LOWtests/test_types.py232async def test_create_message_request_params_with_tools():CODE
LOWtests/test_types.py255async def test_create_message_result_with_tool_use():CODE
LOWtests/test_types.py278async def test_create_message_result_basic():CODE
LOWtests/test_types.py297async def test_client_capabilities_with_sampling_tools():CODE
LOWtests/test_types.py383def test_concrete_wire_results_always_dump_result_type_complete():CODE
LOWtests/test_types.py404def test_cacheable_results_default_to_immediately_stale_private():CODE
LOWtests/test_types.py429def test_empty_result_dumps_no_fields_by_default():CODE
LOWtests/test_types.py434def test_empty_result_dumps_result_type_only_when_explicitly_tagged():CODE
LOWtests/test_types.py438def test_input_required_result_dumps_its_discriminating_tag():CODE
LOWtests/test_types.py444def test_input_required_result_requires_at_least_one_of_input_requests_or_request_state():CODE
LOWtests/types/test_version.py26def test_is_version_at_least_ordering(version: str, minimum: str, expected: bool) -> None:CODE
LOWtests/types/test_version.py32def test_is_version_at_least_unknown_version_is_false(version: str) -> None:CODE
LOWtests/types/test_version.py37def test_is_version_at_least_unknown_minimum_raises() -> None:CODE
LOWtests/types/test_version.py46def test_is_version_at_least_matches_lexicographic_for_known_versions(version: str, minimum: str) -> None:CODE
LOWtests/types/test_version.py52def test_supported_versions_are_known() -> None:CODE
LOWtests/types/test_version.py58def test_known_versions_are_strictly_ordered() -> None:CODE
LOWtests/types/test_methods.py551def test_cacheable_methods_mirror_the_cacheable_method_literal():CODE
LOWtests/types/test_methods.py556def test_input_required_methods_mirror_the_monolith_input_required_arms():CODE
LOWtests/types/test_methods.py561def test_is_input_required_matches_typed_and_wire_shapes():CODE
LOWtests/types/test_methods.py571def test_minimal_request_bodies_parse_through_every_request_row():CODE
LOWtests/types/test_methods.py580def test_minimal_notification_bodies_parse_through_every_notification_row():CODE
LOWtests/types/test_methods.py589def test_minimal_result_bodies_parse_through_every_result_row():CODE
LOWtests/types/test_methods.py598def test_non_file_root_uri_passes_the_surface_step_and_rejects_at_the_monolith_step():CODE
LOWtests/types/test_methods.py743def test_extension_map_rows_parse_through_the_same_functions():CODE
LOWtests/types/test_methods.py753def test_inconsistent_extension_maps_raise_runtime_error_after_the_surface_hit():CODE
LOWtests/types/test_methods.py760def test_input_required_unions_discriminate_identically_in_both_arm_orders():CODE
LOWtests/types/test_methods.py913def test_serialize_server_result_preserves_arbitrary_meta_value_identically(version: str):CODE
LOWtests/types/test_methods.py920def test_serialize_server_result_preserves_open_type_extras():CODE
LOWtests/types/test_methods.py930def test_serialize_server_result_drops_an_unknown_nested_tool_field():CODE
LOWtests/types/test_methods.py936def test_serialize_server_result_raises_key_error_for_an_absent_row_and_value_error_for_an_unknown_version():CODE
LOWtests/types/test_methods.py943def test_importing_the_module_builds_no_adapters_and_identical_rows_share_one():CODE
LOWtests/types/test_methods.py421def test_maps_define_exactly_the_expected_methods_for_every_known_version():CODE
LOWtests/types/test_methods.py437def test_spec_client_method_sets_are_the_client_direction_projection_of_the_surface_maps():CODE
LOWtests/types/test_methods.py445def test_elicit_result_surface_accepts_null_content_values_at_every_version_that_defines_it():CODE
LOWtests/types/test_methods.py463def test_elicit_request_surface_accepts_loose_property_schemas():CODE
LOWtests/types/test_methods.py476def test_response_map_keys_mirror_the_request_map_keys():CODE
LOWtests/types/test_methods.py481def test_response_row_values_match_the_pinned_classes_and_unions():CODE
LOWtests/types/test_methods.py501def test_surface_keys_agree_with_their_classes_and_the_monolith_maps():CODE
LOWtests/types/test_methods.py532def test_built_in_maps_are_immutable():CODE
LOWtests/types/test_methods.py621def test_absent_map_keys_raise_key_error_for_every_gate_shape():CODE
LOWtests/types/test_methods.py636def test_unknown_version_strings_raise_value_error_on_every_parse_function():CODE
LOWtests/types/test_methods.py671def test_empty_result_body_parses_at_versions_that_define_it():CODE
LOWtests/types/test_methods.py687def test_embedded_input_request_entries_without_method_reject_at_the_surface_step():CODE
LOWtests/types/test_methods.py724def test_none_params_omit_the_key_so_required_params_reject():CODE
LOWtests/types/test_methods.py731def test_snake_case_spellings_of_required_aliased_fields_reject_as_missing():CODE
LOWtests/types/test_methods.py792def test_sampling_union_keeps_the_complete_arm_first_because_order_is_load_bearing():CODE
LOWtests/types/test_methods.py815def test_validate_functions_accept_reject_and_gate_like_their_parse_siblings():CODE
LOWtests/types/test_methods.py879def test_dumped_monolith_results_round_trip_through_serialize_server_result(method: str, version: str):CODE
LOWtests/types/test_request_name_param.py18def test_request_base_declares_no_name_param() -> None:CODE
LOWtests/types/test_request_name_param.py22def test_core_request_types_inherit_none() -> None:CODE
LOWtests/types/test_request_name_param.py27def test_subclass_overrides_by_bare_assignment() -> None:CODE
LOWtests/types/test_request_name_param.py33def test_name_param_is_not_a_pydantic_field() -> None:CODE
LOWtests/types/test_parity.py180def test_monolith_is_superset_of_surface_fields(CODE
LOWtests/types/test_parity.py197def test_every_public_monolith_model_is_exported_from_mcp_types() -> None:CODE
LOWtests/types/test_parity.py211def test_every_surface_class_is_accounted_for() -> None:CODE
2728 more matches not shown…
Cross-File Repetition238 hits · 1190 pts
SeverityFileLineSnippetContext
HIGHtests/transports/stdio/test_windows.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/server/test_streamable_http_modern.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/shared/test_jsonrpc_dispatcher.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/docs_src/test_subscriptions.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/client/test_input_required.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/interaction/lowlevel/test_timeouts.py0opt out of the shared per-module event loop: this module parametrizes `anyio_backend`.STRING
HIGHtests/server/test_session.py0a spec-method result that fails the per-version surface schema raises `validationerror` even when the caller's `result_tSTRING
HIGHtests/server/test_connection.py0a spec-method result that fails the per-version surface schema raises `validationerror` even when the caller's `result_tSTRING
HIGHtests/client/test_session.py0a spec-method result that fails the per-version surface schema raises `validationerror` even when the caller's `result_tSTRING
HIGHtests/server/test_session.py0peer results validate alias-only; a snake_case key from the wire is ignored as extra, not populated by python field nameSTRING
HIGHtests/server/test_connection.py0peer results validate alias-only; a snake_case key from the wire is ignored as extra, not populated by python field nameSTRING
HIGHtests/shared/test_peer.py0peer results validate alias-only; a snake_case key from the wire is ignored as extra, not populated by python field nameSTRING
HIGH…s/server/mcpserver/resources/test_resource_template.py0sync prompt functions must run in a worker thread, not the event loop.STRING
HIGH…/server/mcpserver/resources/test_function_resources.py0sync prompt functions must run in a worker thread, not the event loop.STRING
HIGHtests/server/mcpserver/prompts/test_base.py0sync prompt functions must run in a worker thread, not the event loop.STRING
HIGHtests/interaction/transports/test_hosting_http.py0registered so the logging capability is advertised; the client never sets a level.STRING
HIGHtests/interaction/transports/_stdio_server.py0registered so the logging capability is advertised; the client never sets a level.STRING
HIGHtests/interaction/lowlevel/test_logging.py0registered so the logging capability is advertised; the client never sets a level.STRING
HIGHtests/interaction/lowlevel/test_flows.py0registered so the logging capability is advertised; the client never sets a level.STRING
HIGHtests/interaction/transports/test_hosting_http.py0registered so the resources capability is advertised; the client never lists resources.STRING
HIGHtests/interaction/lowlevel/test_resources.py0registered so the resources capability is advertised; the client never lists resources.STRING
HIGHtests/interaction/lowlevel/test_list_changed.py0registered so the resources capability is advertised; the client never lists resources.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0a progress token, used to associate progress notifications with the original request.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0a progress token, used to associate progress notifications with the original request.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0a progress token, used to associate progress notifications with the original request.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0the sender or recipient of messages and data in a conversation.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0the sender or recipient of messages and data in a conversation.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0the sender or recipient of messages and data in a conversation.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0if specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link proSTRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0if specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link proSTRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0if specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link proSTRING
HIGHsrc/mcp-types/mcp_types/_types.py0an opaque token representing the current pagination position. if provided, the server should return results starting aftSTRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0an opaque token representing the current pagination position. if provided, the server should return results starting aftSTRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0an opaque token representing the current pagination position. if provided, the server should return results starting aftSTRING
HIGHsrc/mcp-types/mcp_types/_types.py0an opaque token representing the pagination position after the last returned result. if present, there may be more resulSTRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0an opaque token representing the pagination position after the last returned result. if present, there may be more resulSTRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0an opaque token representing the pagination position after the last returned result. if present, there may be more resulSTRING
HIGHsrc/mcp-types/mcp_types/_types.py0intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present).STRING
HIGHsrc/mcp-types/mcp_types/_types.py0intended for ui and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar wSTRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0intended for ui and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar wSTRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0intended for ui and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar wSTRING
HIGHsrc/mcp-types/mcp_types/_types.py0an optional url of the website for this implementation.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0an optional url of the website for this implementation.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0an optional url of the website for this implementation.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0experimental, non-standard capabilities that the client supports.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0experimental, non-standard capabilities that the client supports.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0experimental, non-standard capabilities that the client supports.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0whether this server supports notifications for changes to the prompt list.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0whether this server supports notifications for changes to the prompt list.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0whether this server supports notifications for changes to the prompt list.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0whether this server supports subscribing to resource updates.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0whether this server supports subscribing to resource updates.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0whether this server supports subscribing to resource updates.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0whether this server supports notifications for changes to the resource list.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0whether this server supports notifications for changes to the resource list.STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py0whether this server supports notifications for changes to the resource list.STRING
HIGHsrc/mcp-types/mcp_types/_types.py0whether this server supports notifications for changes to the tool list.STRING
HIGHsrc/mcp-types/mcp_types/v2025_11_25/__init__.py0whether this server supports notifications for changes to the tool list.STRING
178 more matches not shown…
Unused Imports432 hits · 306 pts
SeverityFileLineSnippetContext
LOWtests/types/test_parity.py3CODE
LOWtests/shared/test_streamable_http.py7CODE
LOWtests/shared/test_otel.py1CODE
LOWtests/examples/conftest.py13CODE
LOWtests/examples/test_stories.py3CODE
LOWtests/examples/test_stories_smoke.py17CODE
LOWtests/examples/test_story_shape.py8CODE
LOWtests/client/test_probe.py14CODE
LOWtests/client/test_probe.py39CODE
LOWtests/client/test_session.py1CODE
LOWtests/client/test_client.py3CODE
LOWtests/interaction/transports/__init__.py7CODE
LOWexamples/snippets/clients/url_elicitation_client.py23CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py1CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py8CODE
LOWexamples/stories/_hosting.py8CODE
LOWexamples/stories/_hosting.py12CODE
LOWexamples/stories/_harness.py9CODE
LOWexamples/stories/_harness.py25CODE
LOWexamples/stories/_harness.py27CODE
LOWexamples/stories/_harness.py28CODE
LOWexamples/stories/_shared/auth.py6CODE
LOWscripts/gen_surface_types.py11CODE
LOWscripts/docs/llms_txt.py23CODE
LOWscripts/docs/gen_ref_pages.py13CODE
LOWscripts/docs/build_config.py13CODE
LOWscripts/docs/check_crossrefs.py29CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
LOWsrc/mcp/__init__.py1CODE
372 more matches not shown…
Self-Referential Comments62 hits · 197 pts
SeverityFileLineSnippetContext
MEDIUMtests/server/test_lifespan.py43 # Create a tool that accesses lifespan contextCOMMENT
MEDIUMtests/server/auth/test_protected_resource.py18 # Create the protected resource routesCOMMENT
MEDIUMtests/server/auth/middleware/test_auth_context.py53 # Create an authenticated userCOMMENT
MEDIUMtests/server/auth/middleware/test_bearer_auth.py333 # Create a user with read/write scopes but not adminCOMMENT
MEDIUMtests/server/auth/middleware/test_bearer_auth.py362 # Create a user with read/write scopesCOMMENT
MEDIUMtests/server/auth/middleware/test_bearer_auth.py390 # Create a user with read/write scopesCOMMENT
MEDIUMtests/server/auth/middleware/test_bearer_auth.py415 # Create a user with read/write scopesCOMMENT
MEDIUMtests/server/auth/middleware/test_bearer_auth.py440 # Create a user with read/write scopesCOMMENT
MEDIUMtests/server/mcpserver/test_func_metadata.py334 # Create a copy of the actual schema to normalizeCOMMENT
MEDIUMtests/server/mcpserver/test_server.py457 # Create a test imageCOMMENT
MEDIUMtests/server/mcpserver/test_server.py461 # Create a test audioCOMMENT
MEDIUMtests/server/mcpserver/test_server.py353 # Create a test imageCOMMENT
MEDIUMtests/server/mcpserver/test_server.py373 # Create a test audioCOMMENT
MEDIUMtests/server/mcpserver/test_server.py409 # Create a test audio file with the specific extensionCOMMENT
MEDIUMtests/server/mcpserver/test_server.py819 # Create a text fileCOMMENT
MEDIUMtests/server/mcpserver/test_server.py835 # Create a binary fileCOMMENT
MEDIUMtests/server/mcpserver/test_elicitation.py67 # Create a custom handler for elicitation requestsCOMMENT
MEDIUMtests/server/mcpserver/auth/test_auth_integration.py107 # Create a RefreshToken object that matches what is expected in later codeCOMMENT
MEDIUMtests/server/mcpserver/auth/test_auth_integration.py368 # Create an auth code for the registered clientCOMMENT
MEDIUMtests/server/mcpserver/auth/test_auth_integration.py834 # Create a test client with the tokenCOMMENT
MEDIUM…s/server/mcpserver/resources/test_resource_template.py404 # Create a resource from the templateCOMMENT
MEDIUM…s/server/mcpserver/resources/test_resource_template.py454 # Create a resource from the templateCOMMENT
MEDIUMtests/shared/test_streamable_http.py1616 # Create a mock SSE event with empty data (keep-alive ping)COMMENT
MEDIUMtests/shared/test_streamable_http.py1619 # Create a context-aware stream writer (matches StreamWriter type alias)COMMENT
MEDIUMtests/shared/test_streamable_http.py1641 # Create a transport with an event storeCOMMENT
MEDIUMtests/shared/test_streamable_http.py1647 # Create a mock message and requestCOMMENT
MEDIUMtests/shared/test_streamable_http.py1074 # Create a new response with 204 status code but same headersCOMMENT
MEDIUMtests/shared/test_streamable_http.py2085 # Create a client with custom headersCOMMENT
MEDIUMtests/issues/test_152_resource_mime_type.py25 # Create a small test image as bytesCOMMENT
MEDIUMtests/issues/test_152_resource_mime_type.py70 # Create a small test image as bytesCOMMENT
MEDIUMtests/issues/test_355_type_error.py20# Create a named serverCOMMENT
MEDIUM…sts/issues/test_1363_race_condition_streamable_http.py77 # Create a new event loop for this threadCOMMENT
MEDIUMtests/client/test_auth.py410 # Create a test requestCOMMENT
MEDIUMtests/client/test_auth.py1084 # Create a test requestCOMMENT
MEDIUMtests/client/test_auth.py1109 # Create a test requestCOMMENT
MEDIUMtests/client/test_auth.py1262 # Create a test requestCOMMENT
MEDIUMtests/client/test_auth.py1861 # Create a test requestCOMMENT
MEDIUMtests/client/test_session.py124 # Create a message handler to catch exceptionsCOMMENT
MEDIUMtests/client/test_logging_callback.py28 # Create a simple test toolCOMMENT
MEDIUMtests/client/test_logging_callback.py34 # Create a function that can send a log notificationCOMMENT
MEDIUMtests/client/test_logging_callback.py57 # Create a message handler to catch exceptionsCOMMENT
MEDIUMexamples/snippets/clients/streamable_basic.py14 # Create a session using the client streamsCOMMENT
MEDIUM…s/snippets/servers/streamable_http_multiple_servers.py31# Create a combined lifespan to manage both session managersCOMMENT
MEDIUM…les/snippets/servers/streamable_http_basic_mounting.py24# Create a lifespan context manager to run the session managerCOMMENT
MEDIUM…ples/snippets/servers/streamable_http_host_mounting.py24# Create a lifespan context manager to run the session managerCOMMENT
MEDIUMexamples/snippets/servers/streamable_starlette_mount.py12# Create the Echo serverCOMMENT
MEDIUMexamples/snippets/servers/streamable_starlette_mount.py22# Create the Math serverCOMMENT
MEDIUMexamples/snippets/servers/streamable_starlette_mount.py32# Create a combined lifespan to manage both session managersCOMMENT
MEDIUMexamples/snippets/servers/streamable_starlette_mount.py41# Create the Starlette app and mount the MCP serversCOMMENT
MEDIUMexamples/snippets/servers/mcpserver_quickstart.py9# Create an MCP serverCOMMENT
MEDIUM…amples/snippets/servers/streamable_http_path_config.py12# Create a simple MCPServer serverCOMMENT
MEDIUMexamples/mcpserver/readme-quickstart.py3# Create an MCP serverCOMMENT
MEDIUMsrc/mcp/server/models.py1"""This module provides simplified types to use with the server for managing promptsSTRING
MEDIUMsrc/mcp/server/sse.py7 # Create an SSE transport at an endpointSTRING
MEDIUMsrc/mcp/server/streamable_http.py706 # Create a standalone message stream for server-initiated messagesCOMMENT
MEDIUMsrc/mcp/server/streamable_http.py883 # Define an async callback for sending eventsCOMMENT
MEDIUMsrc/mcp/server/streamable_http.py965 # Create the memory streams for this connectionCOMMENT
MEDIUMsrc/mcp/server/streamable_http.py978 # Create a message router that distributes messages to request streamsCOMMENT
MEDIUMsrc/mcp/server/streamable_http_manager.py294 # Define the server runnerCOMMENT
MEDIUMsrc/mcp/server/auth/middleware/auth_context.py8# Create a contextvar to store the authenticated userCOMMENT
2 more matches not shown…
Decorative Section Separators63 hits · 138 pts
SeverityFileLineSnippetContext
MEDIUMtests/client/test_stdio.py55# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_stdio.py57# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_stdio.py980# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_stdio.py982# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_stdio.py1113# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_stdio.py1115# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/client/test_client.py717# ── SEP-2322 multi-round-trip auto-loop ────────────────────────────────────────COMMENT
MEDIUMtests/interaction/_requirements.py171 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py173 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py467 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py469 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py802 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py804 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py944 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py946 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1078 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1080 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1109 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1111 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1290 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1292 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1332 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1334 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1398 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1400 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1438 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1440 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1484 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1486 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1545 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1547 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1752 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py1754 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2001 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2003 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2078 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2080 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2130 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2132 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2151 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2153 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2480 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2482 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2543 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2545 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2654 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2656 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2767 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2769 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2951 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py2953 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3024 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3026 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3305 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3307 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3549 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3551 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3900 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3902 # ═══════════════════════════════════════════════════════════════════════════COMMENT
MEDIUMtests/interaction/_requirements.py3952 # ═══════════════════════════════════════════════════════════════════════════COMMENT
3 more matches not shown…
Excessive Try-Catch Wrapping113 hits · 121 pts
SeverityFileLineSnippetContext
LOWtests/shared/test_streamable_http.py1596 except Exception:CODE
LOWtests/interaction/transports/_bridge.py148 except Exception as exc: # The bridge is the application's outermost boundary: a crashCODE
MEDIUMdocs/migration.md424 print(f"Error: {e.error.message}")CODE
MEDIUMdocs/migration.md435 print(f"Error: {e.message}")CODE
LOWdocs/migration.md1132 except Exception as e:CODE
MEDIUMdocs/migration.md1129def handle_call_tool(ctx, params) -> CallToolResult:CODE
MEDIUMexamples/snippets/clients/url_elicitation_client.py79 print("Error: No URL provided in elicitation request")CODE
LOWexamples/snippets/clients/url_elicitation_client.py120 except Exception as e:CODE
LOWexamples/snippets/clients/url_elicitation_client.py134 except Exception:CODE
LOWexamples/snippets/clients/url_elicitation_client.py307 except Exception as e:CODE
MEDIUMexamples/snippets/clients/parsing_tool_results.py54 print(f"Error: {content.text}")CODE
MEDIUMexamples/snippets/servers/__init__.py36 print(f"Error: Server '{server_name}' not found")CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py93 except Exception as e:CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py152 except Exception as e:CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py169 except Exception as e:CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py282 except Exception as e:CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py322 except Exception as e:CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py338 except Exception as e:CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py243 except Exception as e:CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py284 except Exception as e:CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py304 except Exception as e:CODE
LOWexamples/stories/_harness.py198 except Exception:CODE
LOW…vers/everything-server/mcp_everything_server/server.py210 except Exception as e:CODE
LOW…vers/everything-server/mcp_everything_server/server.py232 except Exception as e:CODE
LOW…vers/everything-server/mcp_everything_server/server.py264 except Exception as e:CODE
LOW…vers/everything-server/mcp_everything_server/server.py323 except Exception as e:CODE
LOWexamples/servers/simple-auth/mcp_simple_auth/server.py155 except Exception:CODE
LOW…/servers/simple-auth/mcp_simple_auth/token_verifier.py81 except Exception as e:CODE
LOWscripts/update_readme_snippets.py91 except Exception as e:CODE
MEDIUMscripts/update_readme_snippets.py92 print(f"Error processing {file_path}: {e}")CODE
MEDIUMscripts/update_readme_snippets.py107 print(f"Error: README file not found: {readme_path}")CODE
LOW.github/actions/conformance/client.py337 except Exception:CODE
LOW.github/actions/conformance/client.py365 except Exception:CODE
LOW.github/actions/conformance/client.py582 except Exception as e:CODE
LOWsrc/mcp/server/_otel.py56 except Exception as e:CODE
LOWsrc/mcp/server/runner.py130 except Exception:CODE
LOWsrc/mcp/server/runner.py284 except Exception:CODE
LOWsrc/mcp/server/runner.py645 except Exception as exc:CODE
LOWsrc/mcp/server/_streamable_http_modern.py136 except Exception as exc:CODE
LOWsrc/mcp/server/_streamable_http_modern.py251 except Exception:CODE
LOWsrc/mcp/server/request_state.py318 except Exception: # deny-on-error: a raising principal binding must fail closedCODE
LOWsrc/mcp/server/request_state.py374 except Exception: # deny-on-error: a buggy custom codec must fail closedCODE
LOWsrc/mcp/server/request_state.py452 except Exception: # deny-on-error: a raising custom codec must not leak its failureCODE
LOWsrc/mcp/server/subscriptions.py113 except Exception: # fan-out boundary: isolate listeners from each otherCODE
LOWsrc/mcp/server/subscriptions.py137 except Exception: # fan-out boundary: a raising bus must not skip stream cleanupCODE
MEDIUMsrc/mcp/server/streamable_http.py704def standalone_sse_writer():CODE
MEDIUMsrc/mcp/server/streamable_http.py880def replay_sender():CODE
MEDIUMsrc/mcp/server/streamable_http.py979def message_router():CODE
LOWsrc/mcp/server/streamable_http.py321 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py400 except Exception: # pragma: no coverCODE
LOWsrc/mcp/server/streamable_http.py589 except Exception: # pragma: no coverCODE
LOWsrc/mcp/server/streamable_http.py635 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py642 except Exception as err:CODE
LOWsrc/mcp/server/streamable_http.py727 except Exception:CODE
LOWsrc/mcp/server/streamable_http.py743 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py800 except Exception as e: # pragma: no coverCODE
LOWsrc/mcp/server/streamable_http.py922 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py934 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py940 except Exception: # pragma: lax no coverCODE
LOWsrc/mcp/server/streamable_http.py1029 except Exception: # pragma: lax no coverCODE
53 more matches not shown…
Modern Structural Boilerplate113 hits · 113 pts
SeverityFileLineSnippetContext
LOWtests/server/test_runner.py719 async def set_level(ctx: Ctx, params: SetLevelRequestParams) -> None:CODE
LOWtests/server/test_sse_security.py26logger = logging.getLogger(__name__)CODE
LOWtests/shared/conftest.py61__all__ = ["PairFactory", "direct_pair", "jsonrpc_pair"]CODE
LOWtests/cli/test_utils.py12def _set_mcp_version(monkeypatch: pytest.MonkeyPatch, version: str) -> None:CODE
LOWtests/cli/test_claude.py13def _set_mcp_version(monkeypatch: pytest.MonkeyPatch, version: str) -> None:CODE
LOWtests/client/test_auth.py56 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWtests/client/test_auth.py62 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWtests/client/test_session.py796def _set_negotiated_version(session: ClientSession, version: str) -> None:CODE
LOWtests/client/test_scope_bug_1630.py32 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWtests/client/test_scope_bug_1630.py38 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWtests/client/auth/extensions/test_client_credentials.py36 async def set_tokens(self, tokens: OAuthToken) -> None: # pragma: no coverCODE
LOWtests/client/auth/extensions/test_client_credentials.py42 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None: # pragma: no coverCODE
LOWtests/client/auth/extensions/test_identity_assertion.py32 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWtests/client/auth/extensions/test_identity_assertion.py38 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWtests/interaction/auth/_harness.py119 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWtests/interaction/auth/_harness.py125 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWtests/interaction/transports/__init__.py9__all__ = ["StreamingASGITransport"]CODE
LOWexamples/snippets/clients/oauth_client.py32 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWexamples/snippets/clients/oauth_client.py40 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWexamples/snippets/clients/identity_assertion_client.py37 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWexamples/snippets/clients/identity_assertion_client.py43 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py40 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py46 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWexamples/stories/serve_one/server.py28__all__ = ["SingleExchangeContext", "build_server", "handle_one"]CODE
LOWexamples/stories/_shared/auth.py41 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWexamples/stories/_shared/auth.py47 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOW…vers/everything-server/mcp_everything_server/server.py50logger = logging.getLogger(__name__)CODE
LOW…ple-streamablehttp/mcp_simple_streamablehttp/server.py13logger = logging.getLogger(__name__)CODE
LOW…treamablehttp/mcp_simple_streamablehttp/event_store.py15logger = logging.getLogger(__name__)CODE
LOW…tateless/mcp_simple_streamablehttp_stateless/server.py10logger = logging.getLogger(__name__)CODE
LOWexamples/servers/simple-auth/mcp_simple_auth/server.py23logger = logging.getLogger(__name__)CODE
LOW…les/servers/simple-auth/mcp_simple_auth/auth_server.py29logger = logging.getLogger(__name__)CODE
LOW…ervers/simple-auth/mcp_simple_auth/legacy_as_server.py26logger = logging.getLogger(__name__)CODE
LOW…/servers/simple-auth/mcp_simple_auth/token_verifier.py9logger = logging.getLogger(__name__)CODE
LOW…ervers/sse-polling-demo/mcp_sse_polling_demo/server.py25logger = logging.getLogger(__name__)CODE
LOW…s/sse-polling-demo/mcp_sse_polling_demo/event_store.py15logger = logging.getLogger(__name__)CODE
LOW.github/actions/conformance/client.py65logger = logging.getLogger(__name__)CODE
LOW.github/actions/conformance/client.py130 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOW.github/actions/conformance/client.py136 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWdocs_src/middleware/tutorial001.py16logger = logging.getLogger(__name__)CODE
LOWdocs_src/extensions/tutorial005.py10logger = logging.getLogger(__name__)CODE
LOWdocs_src/oauth_clients/tutorial002.py17 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWdocs_src/oauth_clients/tutorial002.py23 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWdocs_src/oauth_clients/tutorial001.py20 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWdocs_src/oauth_clients/tutorial001.py26 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWdocs_src/identity_assertion/tutorial001.py23 async def set_tokens(self, tokens: OAuthToken) -> None:CODE
LOWdocs_src/identity_assertion/tutorial001.py29 async def set_client_info(self, client_info: OAuthClientInformationFull) -> None:CODE
LOWdocs_src/logging/tutorial001.py5logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/__init__.py71__all__ = [CODE
LOWsrc/mcp/server/runner.py69__all__ = [CODE
LOWsrc/mcp/server/runner.py81logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/server/_streamable_http_modern.py72logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/server/transport_security.py9logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/server/request_state.py34__all__ = [CODE
LOWsrc/mcp/server/request_state.py43logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/server/subscriptions.py57__all__ = [CODE
LOWsrc/mcp/server/subscriptions.py69logger = logging.getLogger(__name__)CODE
LOWsrc/mcp/server/session.py22__all__ = ["ServerSession"]CODE
LOWsrc/mcp/server/__init__.py7__all__ = ["CacheHint", "Server", "ServerRequestContext", "MCPServer", "NotificationOptions", "InitializationOptions"]CODE
LOWsrc/mcp/server/sse.py61logger = logging.getLogger(__name__)CODE
53 more matches not shown…
Docstring Block Structure18 hits · 90 pts
SeverityFileLineSnippetContext
HIGH…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py35Load server configuration from JSON file. Args: file_path: Path to the JSON configuration file. STRING
HIGH…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py126Execute a tool with retry mechanism. Args: tool_name: Name of the tool to execute. arguSTRING
HIGH…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py224Get a response from the LLM. Args: messages: A list of message dictionaries. Returns: STRING
HIGHsrc/mcp/server/session.py211Send a sampling/create_message request. Args: messages: The conversation messages to send. STRING
HIGHsrc/mcp/server/session.py312Send a form mode elicitation/create request. Args: message: The message to present to the user. STRING
HIGHsrc/mcp/server/session.py344Send a URL mode elicitation/create request. This directs the user to an external URL for out-of-band interactioSTRING
HIGHsrc/mcp/server/auth/provider.py165Handle the /authorize endpoint and return a URL that the client will be redirected to. Many MCP implemeSTRING
HIGHsrc/mcp/server/auth/provider.py224Exchanges an authorization code for an access token and refresh token. Args: client: The client excSTRING
HIGHsrc/mcp/server/auth/provider.py256Exchanges a refresh token for an access token and refresh token. Implementations SHOULD rotate both the access STRING
HIGHsrc/mcp/server/auth/provider.py304Exchanges an Identity Assertion Authorization Grant (ID-JAG) for an access token. This is leg 2 of SEP-990: theSTRING
HIGHsrc/mcp/server/auth/middleware/client_auth.py40Authenticate a client from an HTTP request. Extracts client credentials from the appropriate location based on STRING
HIGHsrc/mcp/server/mcpserver/context.py153Read a resource by URI. This is a content reader: an `InputRequiredResult` returned by a resource templSTRING
HIGHsrc/mcp/shared/path_security.py122Join path components onto a base, rejecting escapes. Resolves the joined path and verifies it remains within ``baseSTRING
HIGHsrc/mcp/shared/uri_template.py401Expand the template by substituting variable values. String values are percent-encoded according to their operaSTRING
HIGHsrc/mcp/client/client.py617Read a resource from the server. If the server returns an `InputRequiredResult`, the embedded input reqSTRING
HIGHsrc/mcp/client/client.py746Call a tool on the server. If the server returns an `InputRequiredResult`, the embedded input requests STRING
HIGHsrc/mcp/client/client.py835Get a prompt from the server. If the server returns an `InputRequiredResult`, the embedded input requesSTRING
HIGHsrc/mcp/client/auth/utils.py400Parse and validate a token response. Parses token response JSON. Callers should check response.status_code before cSTRING
Cross-Language Confusion14 hits · 74 pts
SeverityFileLineSnippetContext
HIGHtests/server/test_request_state.py427 '["client-123",null,null]',CODE
HIGHtests/server/test_request_state.py432 '["client-123",null,"alice"]',CODE
HIGHtests/server/test_sse_security.py238 body = b'{"jsonrpc": "2.0", "id": 1, "method": "ping", "params": null}'CODE
HIGHtests/server/mcpserver/test_func_metadata.py151 "my_model_b": '{"how_many_shrimp": 5, "ok": {"x": 1}, "y": null}',CODE
HIGHtests/server/mcpserver/test_tool_manager.py312 {"tank": '{"x": null, "shrimp": [{"name": "rex"}, {"name": "gertrude"}]}'},CODE
HIGHtests/shared/test_sse.py358 json_message = '{"jsonrpc": "2.0", "id": "123", "method": "ping", "params": null}'CODE
HIGHtests/shared/test_sse.py362 json_message = '{"jsonrpc": "2.0", "id": 123, "method": "ping", "params": null}'CODE
HIGHtests/shared/test_jsonrpc_dispatcher.py1915 """Parse-error responses (id=null) have no waiter; they're dropped and the read loop stays healthy."""STRING
HIGHtests/client/test_auth.py132 b'"scopes_supported": null}'CODE
HIGHexamples/snippets/clients/url_elicitation_client.py290 print("(Start server with: cd examples/snippets && uv run server elicitation sse)")CODE
HIGHexamples/snippets/clients/url_elicitation_client.py306 print(" cd examples/snippets && uv run server elicitation sse")CODE
HIGHsrc/mcp/shared/uri_template.py233 (RFC 6570 §2.3); if all are undefined, the expression contributesSTRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py2645 This can be any JSON value (object, array, string, number, boolean, or null).STRING
HIGHsrc/mcp-types/mcp_types/v2026_07_28/__init__.py2699 This can be any JSON value (object, array, string, number, boolean, or null)STRING
AI Slop Vocabulary21 hits · 66 pts
SeverityFileLineSnippetContext
MEDIUMtests/interaction/transports/test_streamable_http.py163 # Bounded because a harness regression here historically meant deadlock, not failure.COMMENT
MEDIUMexamples/stories/manifest.toml84# A per-client fresh target over a real ASGI transport is harness machinery, not userCOMMENT
MEDIUM.github/workflows/conformance.yml17 # Pinned conformance harness package spec (passed verbatim to `npx --yes`).COMMENT
MEDIUM.github/workflows/conformance.yml83 # shipped with the pinned harness — including the extension-taggedCOMMENT
MEDIUM.github/workflows/conformance.yml89 # of silent exclusions, and stays robust to scenarios moving betweenCOMMENT
MEDIUM.github/workflows/conformance.yml90 # harness suite lists across pin bumps. `--suite pending` would coverCOMMENT
MEDIUM.github/workflows/conformance.yml139 # The harness runs all scenarios via unbounded Promise.all; with 40COMMENT
MEDIUM.github/actions/conformance/run-client.sh28# If the harness's summary wording changes, the list comes up empty and theCOMMENT
MEDIUM.github/actions/conformance/client.py67#: Spec version the harness is running this scenario at (e.g. "2025-11-25",COMMENT
MEDIUM.github/actions/conformance/client.py68#: "2026-07-28"). The harness always sets this (when --spec-version is omittedCOMMENT
MEDIUM.github/actions/conformance/client.py71#: outside the harness.COMMENT
MEDIUM.github/actions/conformance/client.py485 # The harness does not put the issuer in context, so for conformance weCOMMENT
MEDIUM.github/actions/conformance/client.py486 # learn it from the harness's PRM document (RFC 9728); productionCOMMENT
MEDIUM…b/actions/conformance/expected-failures.2026-07-28.yml13# Baseline established against the harness pinned via CONFORMANCE_PKG inCOMMENT
MEDIUM.github/actions/conformance/expected-failures.yml4# Baseline established against the harness pinned via CONFORMANCE_PKG inCOMMENT
MEDIUM.github/actions/conformance/expected-failures.yml22 # `tasks-status-notifications` is intentionally NOT listed: the harnessCOMMENT
LOWsrc/mcp/server/auth/handlers/authorize.py115 # if the redirect URI is invalid, ignore it & just return theCOMMENT
LOWsrc/mcp/server/auth/handlers/revoke.py74 # if token is not found, just return HTTP 200 per the RFCCOMMENT
LOWsrc/mcp/server/mcpserver/utilities/func_metadata.py235 # This raise could perhaps be skipped, and we (MCPServer) just callCOMMENT
LOWsrc/mcp/cli/cli.py53 return "npx" # On Unix-like systems, just use npxCODE
MEDIUMsrc/mcp/client/session_group.py312 # Create read and write streams that facilitate io with the server.COMMENT
Deep Nesting47 hits · 44 pts
SeverityFileLineSnippetContext
LOWtests/transports/stdio/test_windows.py45CODE
LOWtests/server/test_streamable_http_manager.py105CODE
LOWtests/server/test_streamable_http_manager.py161CODE
LOWtests/server/test_streamable_http_manager.py354CODE
LOWtests/server/mcpserver/test_integration.py66CODE
LOWtests/shared/test_streamable_http.py209CODE
LOWtests/shared/test_uri_template.py934CODE
LOWtests/examples/test_story_shape.py39CODE
LOWtests/client/test_session_group.py320CODE
LOWexamples/snippets/clients/url_elicitation_client.py237CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py285CODE
LOW…ples/clients/simple-chatbot/mcp_simple_chatbot/main.py332CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py267CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py287CODE
LOW…ents/simple-auth-client/mcp_simple_auth_client/main.py307CODE
LOW…ervers/sse-polling-demo/mcp_sse_polling_demo/server.py60CODE
LOWscripts/update_readme_snippets.py31CODE
LOWscripts/docs/llms_txt.py123CODE
LOWsrc/mcp/server/_streamable_http_modern.py205CODE
LOWsrc/mcp/server/_streamable_http_modern.py304CODE
LOWsrc/mcp/server/streamable_http.py465CODE
LOWsrc/mcp/server/streamable_http.py855CODE
LOWsrc/mcp/server/streamable_http.py880CODE
LOWsrc/mcp/server/auth/handlers/authorize.py70CODE
LOWsrc/mcp/server/mcpserver/resolve.py516CODE
LOWsrc/mcp/server/mcpserver/resources/types.py58CODE
LOWsrc/mcp/server/mcpserver/utilities/func_metadata.py366CODE
LOWsrc/mcp/server/mcpserver/utilities/context_injection.py13CODE
LOWsrc/mcp/server/mcpserver/prompts/base.py141CODE
LOWsrc/mcp/shared/jsonrpc_dispatcher.py690CODE
LOWsrc/mcp/shared/uri_template.py228CODE
LOWsrc/mcp/shared/uri_template.py611CODE
LOWsrc/mcp/shared/uri_template.py878CODE
LOWsrc/mcp/shared/uri_template.py924CODE
LOWsrc/mcp/shared/uri_template.py969CODE
LOWsrc/mcp/shared/uri_template.py459CODE
LOWsrc/mcp/shared/inbound.py119CODE
LOWsrc/mcp/shared/direct_dispatcher.py230CODE
LOWsrc/mcp/cli/cli.py119CODE
LOWsrc/mcp/cli/cli.py361CODE
LOWsrc/mcp/client/streamable_http.py316CODE
LOWsrc/mcp/client/streamable_http.py536CODE
LOWsrc/mcp/client/_probe.py47CODE
LOWsrc/mcp/client/stdio.py114CODE
LOWsrc/mcp/client/stdio.py141CODE
LOWsrc/mcp/client/auth/oauth2.py530CODE
LOWsrc/mcp/client/auth/extensions/identity_assertion.py162CODE
Redundant / Tautological Comments21 hits · 36 pts
SeverityFileLineSnippetContext
LOWtests/server/mcpserver/auth/test_auth_integration.py124 # Check if refresh token existsCOMMENT
LOWtests/server/mcpserver/auth/test_auth_integration.py129 # Check if the access token existsCOMMENT
LOWtests/server/mcpserver/auth/test_auth_integration.py132 # Check if the token was issued to this clientCOMMENT
LOWtests/server/mcpserver/auth/test_auth_integration.py167 # Check if token is expiredCOMMENT
LOWexamples/snippets/clients/url_elicitation_client.py156 # Check if the tool returned an error in the resultCOMMENT
LOWexamples/snippets/clients/url_elicitation_client.py164 # Check if this is a URL elicitation required errorCOMMENT
LOWexamples/snippets/clients/pagination_client.py30 # Check if there are more pagesCOMMENT
LOWexamples/snippets/servers/elicitation.py35 # Check if date is availableCOMMENT
LOW…rs/simple-auth/mcp_simple_auth/simple_auth_provider.py248 # Check if expiredCOMMENT
LOWsrc/mcp/server/transport_security.py58 # Check if the actual host starts with base host and has a portCOMMENT
LOWsrc/mcp/server/transport_security.py80 # Check if the actual origin starts with base origin and has a portCOMMENT
LOWsrc/mcp/server/streamable_http.py505 # Check if this is an initialization requestCOMMENT
LOWsrc/mcp/server/streamable_http.py509 # Check if the server already has an established sessionCOMMENT
LOWsrc/mcp/server/streamable_http.py511 # Check if request has a session IDCOMMENT
LOWsrc/mcp/server/streamable_http.py692 # Check if we already have an active GET streamCOMMENT
LOWsrc/mcp/server/streamable_http.py985 # Check if this is a response with a known request id.COMMENT
LOWsrc/mcp/server/mcpserver/server.py658 # Check if user passed function directly instead of calling decoratorCOMMENT
LOWsrc/mcp/server/mcpserver/server.py791 # Check if user passed function directly instead of calling decoratorCOMMENT
LOWsrc/mcp/server/mcpserver/server.py949 # Check if user passed function directly instead of calling decoratorCOMMENT
LOWsrc/mcp/server/mcpserver/utilities/func_metadata.py253 # Check if the parameter name conflicts with BaseModel attributesCOMMENT
LOWsrc/mcp/client/streamable_http.py559 # Check if this is a resumption requestCOMMENT
Structural Annotation Overuse18 hits · 32 pts
SeverityFileLineSnippetContext
LOWtests/server/mcpserver/auth/test_auth_integration.py557 # Step 1: First, let's create a token and refresh token at the current timeCOMMENT
LOWtests/server/mcpserver/auth/test_auth_integration.py576 # Step 2: Time travel forward 4 hours (tokens expire in 1 hour by default)COMMENT
LOW.claude/commands/review-pr.md5## Step 1: Resolve the PRCOMMENT
LOW.claude/commands/review-pr.md20## Step 2: Gather the diffCOMMENT
LOW.claude/commands/review-pr.md30## Step 3: Collect PR discussion contextCOMMENT
LOW.claude/commands/review-pr.md47## Step 4: Find and read linked issuesCOMMENT
LOW.claude/commands/review-pr.md63## Step 5: Analyze and validateCOMMENT
LOW.claude/commands/review-pr.md75## Step 6: Produce the review summaryCOMMENT
LOWexamples/servers/simple-auth/README.md9### Step 1: Start Authorization ServerCOMMENT
LOWexamples/servers/simple-auth/README.md27### Step 2: Start Resource Server (MCP Server)COMMENT
LOWexamples/servers/simple-auth/README.md41### Step 3: Test with ClientCOMMENT
LOWsrc/mcp/client/auth/oauth2.py640 # Step 3: Apply scope selection strategyCOMMENT
LOWsrc/mcp/client/auth/oauth2.py648 # Step 4: Register client or use URL-based client ID (CIMD)COMMENT
LOWsrc/mcp/client/auth/oauth2.py694 # Step 5: Perform authorization and complete token exchangeCOMMENT
LOWsrc/mcp/client/auth/oauth2.py705 # Step 1: Extract error field from WWW-Authenticate headerCOMMENT
LOWsrc/mcp/client/auth/oauth2.py708 # Step 2: Check if we need to step-up authorizationCOMMENT
LOWsrc/mcp/client/auth/oauth2.py559 # Step 1: Discover protected resource metadata (SEP-985 with fallback support)COMMENT
LOWsrc/mcp/client/auth/oauth2.py606 # Step 2: Discover OAuth Authorization Server Metadata (OASM) (with fallback for legacy servers)COMMENT
AI Structural Patterns31 hits · 30 pts
SeverityFileLineSnippetContext
LOWtests/client/test_stdio.py138CODE
LOWtests/client/test_caching.py303CODE
LOWtests/interaction/_connect.py80CODE
LOWtests/interaction/_connect.py115CODE
LOWtests/interaction/_connect.py177CODE
LOWtests/interaction/_connect.py356CODE
LOWtests/interaction/_connect.py63CODE
LOWtests/interaction/auth/_harness.py405CODE
LOWsrc/mcp/server/session.py137CODE
LOWsrc/mcp/server/session.py157CODE
LOWsrc/mcp/server/session.py177CODE
LOWsrc/mcp/server/session.py196CODE
LOWsrc/mcp/server/lowlevel/server.py134CODE
LOWsrc/mcp/server/lowlevel/server.py217CODE
LOWsrc/mcp/server/lowlevel/server.py309CODE
LOWsrc/mcp/server/lowlevel/server.py708CODE
LOWsrc/mcp/server/mcpserver/server.py160CODE
LOWsrc/mcp/server/mcpserver/server.py361CODE
LOWsrc/mcp/server/mcpserver/server.py720CODE
LOWsrc/mcp/server/mcpserver/server.py1043CODE
LOWsrc/mcp/server/mcpserver/resolve.py131CODE
LOWsrc/mcp/server/mcpserver/tools/base.py58CODE
LOWsrc/mcp/server/mcpserver/resources/resource_manager.py60CODE
LOWsrc/mcp/server/mcpserver/resources/templates.py125CODE
LOWsrc/mcp/shared/peer.py89CODE
LOWsrc/mcp/shared/peer.py107CODE
LOWsrc/mcp/shared/peer.py125CODE
LOWsrc/mcp/shared/peer.py142CODE
LOWsrc/mcp/client/session.py325CODE
LOWsrc/mcp/client/session.py893CODE
LOWsrc/mcp/client/session.py952CODE
Verbosity Indicators10 hits · 20 pts
SeverityFileLineSnippetContext
LOWtests/server/mcpserver/auth/test_auth_integration.py557 # Step 1: First, let's create a token and refresh token at the current timeCOMMENT
LOWtests/server/mcpserver/auth/test_auth_integration.py576 # Step 2: Time travel forward 4 hours (tokens expire in 1 hour by default)COMMENT
LOWsrc/mcp/server/auth/middleware/client_auth.py88 # form_data.get() can return an UploadFile or None, so we need to check if it's a stringCOMMENT
LOWsrc/mcp/client/auth/oauth2.py640 # Step 3: Apply scope selection strategyCOMMENT
LOWsrc/mcp/client/auth/oauth2.py648 # Step 4: Register client or use URL-based client ID (CIMD)COMMENT
LOWsrc/mcp/client/auth/oauth2.py694 # Step 5: Perform authorization and complete token exchangeCOMMENT
LOWsrc/mcp/client/auth/oauth2.py705 # Step 1: Extract error field from WWW-Authenticate headerCOMMENT
LOWsrc/mcp/client/auth/oauth2.py708 # Step 2: Check if we need to step-up authorizationCOMMENT
LOWsrc/mcp/client/auth/oauth2.py559 # Step 1: Discover protected resource metadata (SEP-985 with fallback support)COMMENT
LOWsrc/mcp/client/auth/oauth2.py606 # Step 2: Discover OAuth Authorization Server Metadata (OASM) (with fallback for legacy servers)COMMENT
Over-Commented Block20 hits · 19 pts
SeverityFileLineSnippetContext
LOWpyproject.toml81 # MkDocs plugins or hooks, so the API reference (formerly gen-files +COMMENT
LOWtests/shared/test_uri_template.py681 ("file://{+path}", "http://x"),COMMENT
LOWtests/shared/test_uri_template.py881# The two tests below generate template strings instead of enumeratingCOMMENT
LOWtests/interaction/transports/_stdio_server.py61COMMENT
LOWexamples/snippets/servers/streamable_config.py21 mcp.run(transport="streamable-http", stateless_http=True, json_response=True)COMMENT
LOWscripts/build-docs.sh1#!/usr/bin/env bashCOMMENT
LOWscripts/serve-docs.sh1#!/usr/bin/env bashCOMMENT
LOWscripts/docs/llms_txt.py41 "mcp-types API reference",COMMENT
LOWscripts/docs/llms_txt.py61# Block HTML comments are inert in rendered output: python-markdown passesCOMMENT
LOWscripts/docs/build.sh1#!/usr/bin/env bashCOMMENT
LOW.github/workflows/shared.yml141COMMENT
LOW.github/workflows/conformance.yml81 - name: Run server conformance (all suite, extension scenarios)COMMENT
LOW.github/workflows/docs-preview.yml1name: Docs PreviewCOMMENT
LOW…b/actions/conformance/expected-failures.2026-07-28.yml1# Expected failures for the carried-forward 2026-07-28 legsCOMMENT
LOW.github/actions/conformance/expected-failures.yml1# Conformance scenarios not yet passing against the Python SDK on main.COMMENT
LOWsrc/mcp/server/runner.py181 # so malformed params are INVALID_PARAMS even with no handlerCOMMENT
LOWsrc/mcp/server/runner.py221 # Dump and serialize inside the chain so the OpenTelemetry span (theCOMMENT
LOWsrc/mcp/server/auth/handlers/authorize.py81 error_description: str | None,COMMENT
LOWsrc/mcp/shared/uri_template.py1081 if atom.ifemp:COMMENT
LOWsrc/mcp/shared/inbound.py81field to compare against), so both ends agree on the field by construction.COMMENT
Fake / Example Data9 hits · 9 pts
SeverityFileLineSnippetContext
LOWtests/server/mcpserver/test_func_metadata.py997 return PersonWithAddress(name="Jack", address=Address(street="123 Main St", city="Anytown", zipcode="12345"))CODE
LOWtests/server/mcpserver/test_server.py534 assert result.structured_content == {"name": "John Doe", "age": 30, "active": True}CODE
LOWtests/server/mcpserver/test_server.py538 assert '"name": "John Doe"' in result.content[0].textCODE
LOWtests/server/mcpserver/test_server.py516 return UserOutput(name="John Doe", age=30)CODE
LOWtests/server/mcpserver/test_elicitation.py166 {"required_name": "John Doe", "optional_age": 30, "optional_email": "john@example.com", "subscribe": True},CODE
LOWtests/client/auth/extensions/test_client_credentials.py146 "name": "John Doe",CODE
LOWtests/client/auth/extensions/test_client_credentials.py178 assert claims["name"] == "John Doe"CODE
LOWtests/client/auth/extensions/test_client_credentials.py296 client_id="placeholder",CODE
LOW…vers/everything-server/mcp_everything_server/server.py239 name: str = Field(default="John Doe", description="User name")CODE
Slop Phrases6 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMexamples/servers/simple-auth/mcp_simple_auth/server.py6NOTE: this is a simplified example for demonstration purposes.STRING
MEDIUM…rs/simple-auth/mcp_simple_auth/simple_auth_provider.py4for demonstration purposes. No external authentication provider is required.STRING
MEDIUM…rs/simple-auth/mcp_simple_auth/simple_auth_provider.py6NOTE: this is a simplified example for demonstration purposes.STRING
MEDIUM…les/servers/simple-auth/mcp_simple_auth/auth_server.py6NOTE: this is a simplified example for demonstration purposes.STRING
MEDIUM…ervers/simple-auth/mcp_simple_auth/legacy_as_server.py6NOTE: this is a simplified example for demonstration purposes.STRING
MEDIUM…/servers/simple-auth/mcp_simple_auth/token_verifier.py15 This is a simple example implementation for demonstration purposes.STRING
Overly Generic Function Names5 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/server/mcpserver/test_tool_manager.py630 def process_data(input_data: str) -> str: # pragma: no coverCODE
LOWexamples/snippets/servers/notifications.py7async def process_data(data: str, ctx: Context) -> str:CODE
LOW…amples/snippets/servers/streamable_http_path_config.py17def process_data(data: str) -> str:CODE
LOWsrc/mcp/server/streamable_http.py407 async def handle_request(self, scope: Scope, receive: Receive, send: Send) -> None:CODE
LOWsrc/mcp/server/streamable_http_manager.py157 async def handle_request(self, scope: Scope, receive: Receive, send: Send) -> None:CODE
Example Usage Blocks3 hits · 4 pts
SeverityFileLineSnippetContext
LOWscripts/build-docs.sh16# Usage:COMMENT
LOWscripts/serve-docs.sh9# Usage:COMMENT
LOWscripts/docs/build.sh13# Usage:COMMENT