The official Python SDK for Model Context Protocol servers and clients
2201 matches across 17 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_examples.py | 51 | async def test_direct_call_tool_result_return(): |
| LOW | tests/test_types.py | 53 | async def test_method_initialization(): |
| LOW | tests/test_types.py | 138 | async def test_sampling_message_with_user_role(): |
| LOW | tests/test_types.py | 161 | async def test_sampling_message_with_assistant_role(): |
| LOW | tests/test_types.py | 191 | async def test_sampling_message_backward_compatibility(): |
| LOW | tests/test_types.py | 218 | async def test_create_message_request_params_with_tools(): |
| LOW | tests/test_types.py | 241 | async def test_create_message_result_with_tool_use(): |
| LOW | tests/test_types.py | 264 | async def test_create_message_result_basic(): |
| LOW | tests/test_types.py | 283 | async def test_client_capabilities_with_sampling_tools(): |
| LOW | tests/experimental/tasks/test_capabilities.py | 27 | def test_required_requests_none_returns_true(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 33 | def test_client_requests_none_returns_false(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 39 | def test_elicitation_required_but_client_missing(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 47 | def test_elicitation_create_required_but_client_missing(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 61 | def test_elicitation_create_present(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 75 | def test_sampling_required_but_client_missing(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 81 | def test_sampling_create_message_required_but_client_missing(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 95 | def test_sampling_create_message_present(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 109 | def test_both_elicitation_and_sampling_present(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 125 | def test_elicitation_without_create_required(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 139 | def test_sampling_without_create_message_required(self) -> None: |
| LOW | tests/experimental/tasks/test_capabilities.py | 218 | def test_create_message_present(self) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 42 | async def test_dequeue_empty_returns_none(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 65 | async def test_separate_queues_per_task(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 77 | async def test_peek_does_not_remove(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 105 | async def test_clear_returns_all_messages(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 125 | async def test_notification_messages(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 147 | async def test_message_with_resolver(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 167 | async def test_cleanup_specific_task(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 189 | async def test_wait_for_message_returns_immediately_if_message_exists( |
| LOW | tests/experimental/tasks/test_message_queue.py | 201 | async def test_wait_for_message_blocks_until_message(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 226 | async def test_notify_message_available_wakes_waiter(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 251 | async def test_peek_empty_queue_returns_none(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 257 | async def test_wait_for_message_double_check_race_condition(self, queue: InMemoryTaskMessageQueue) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 297 | async def test_set_exception_and_wait(self) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 309 | async def test_set_result_when_already_completed_raises(self) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 318 | async def test_set_exception_when_already_completed_raises(self) -> None: |
| LOW | tests/experimental/tasks/test_message_queue.py | 327 | async def test_done_returns_false_before_completion(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 59 | def test_server_with_list_tasks_handler_declares_list_capability() -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 69 | def test_server_with_cancel_task_handler_declares_cancel_capability() -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 79 | def test_server_with_get_task_handler_declares_requests_tools_call_capability() -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 159 | def test_tool_execution_task_forbidden_rejects_task_augmented_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 163 | def test_tool_execution_task_absent_rejects_task_augmented_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 167 | def test_tool_execution_task_optional_accepts_normal_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 171 | def test_tool_execution_task_optional_accepts_task_augmented_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 175 | def test_tool_execution_task_required_rejects_normal_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 179 | def test_tool_execution_task_required_accepts_task_augmented_call(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 218 | def test_task_begins_in_working_status(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 222 | def test_working_to_completed_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 226 | def test_working_to_failed_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 230 | def test_working_to_cancelled_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 234 | def test_working_to_input_required_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 238 | def test_input_required_to_working_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 242 | def test_input_required_to_terminal_transition(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 246 | def test_terminal_state_no_further_transitions(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 250 | def test_completed_is_terminal(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 258 | def test_cancelled_is_terminal(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 290 | def test_task_augmented_request_returns_create_task_result(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 294 | def test_create_task_result_contains_task_id(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 298 | def test_create_task_result_contains_status_working(self) -> None: |
| LOW | tests/experimental/tasks/test_spec_compliance.py | 302 | def test_create_task_result_contains_created_at(self) -> None: |
| 1263 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | README.v2.md | 0 | example showing lifespan support for startup/shutdown with strong typing. |
| HIGH | README.md | 0 | example showing lifespan support for startup/shutdown with strong typing. |
| HIGH | examples/snippets/servers/lifespan_example.py | 0 | example showing lifespan support for startup/shutdown with strong typing. |
| HIGH | README.v2.md | 0 | manage application lifecycle with type-safe context. |
| HIGH | README.md | 0 | manage application lifecycle with type-safe context. |
| HIGH | examples/snippets/servers/lifespan_example.py | 0 | manage application lifecycle with type-safe context. |
| HIGH | README.v2.md | 0 | { "theme": "dark", "language": "en", "debug": false } |
| HIGH | README.md | 0 | { "theme": "dark", "language": "en", "debug": false } |
| HIGH | examples/snippets/servers/basic_resource.py | 0 | { "theme": "dark", "language": "en", "debug": false } |
| HIGH | README.v2.md | 0 | example showing direct calltoolresult return for advanced control. |
| HIGH | README.md | 0 | example showing direct calltoolresult return for advanced control. |
| HIGH | examples/snippets/servers/direct_call_tool_result.py | 0 | example showing direct calltoolresult return for advanced control. |
| HIGH | README.v2.md | 0 | return calltoolresult directly for full control including _meta field. |
| HIGH | README.md | 0 | return calltoolresult directly for full control including _meta field. |
| HIGH | examples/snippets/servers/direct_call_tool_result.py | 0 | return calltoolresult directly for full control including _meta field. |
| HIGH | README.v2.md | 0 | return calltoolresult with structured output validation. |
| HIGH | README.md | 0 | return calltoolresult with structured output validation. |
| HIGH | examples/snippets/servers/direct_call_tool_result.py | 0 | return calltoolresult with structured output validation. |
| HIGH | README.v2.md | 0 | for empty results, return calltoolresult with empty content. |
| HIGH | README.md | 0 | for empty results, return calltoolresult with empty content. |
| HIGH | examples/snippets/servers/direct_call_tool_result.py | 0 | for empty results, return calltoolresult with empty content. |
| HIGH | README.v2.md | 0 | this returns unstructured output - no schema generated |
| HIGH | README.md | 0 | this returns unstructured output - no schema generated |
| HIGH | examples/snippets/servers/structured_output.py | 0 | this returns unstructured output - no schema generated |
| HIGH | README.v2.md | 0 | cd to the `examples/snippets` directory and run: uv run completion-client |
| HIGH | README.md | 0 | cd to the `examples/snippets` directory and run: uv run completion-client |
| HIGH | examples/snippets/clients/completion_client.py | 0 | cd to the `examples/snippets` directory and run: uv run completion-client |
| HIGH | README.v2.md | 0 | elicitation examples demonstrating form and url mode elicitation. form mode elicitation collects structured, non-sensiti |
| HIGH | README.md | 0 | elicitation examples demonstrating form and url mode elicitation. form mode elicitation collects structured, non-sensiti |
| HIGH | examples/snippets/servers/elicitation.py | 0 | elicitation examples demonstrating form and url mode elicitation. form mode elicitation collects structured, non-sensiti |
| HIGH | README.v2.md | 0 | book a table with date availability check. this demonstrates form mode elicitation for collecting non-sensitive user inp |
| HIGH | README.md | 0 | book a table with date availability check. this demonstrates form mode elicitation for collecting non-sensitive user inp |
| HIGH | examples/snippets/servers/elicitation.py | 0 | book a table with date availability check. this demonstrates form mode elicitation for collecting non-sensitive user inp |
| HIGH | README.v2.md | 0 | process a secure payment requiring url confirmation. this demonstrates url mode elicitation using ctx.elicit_url() for o |
| HIGH | README.md | 0 | process a secure payment requiring url confirmation. this demonstrates url mode elicitation using ctx.elicit_url() for o |
| HIGH | examples/snippets/servers/elicitation.py | 0 | process a secure payment requiring url confirmation. this demonstrates url mode elicitation using ctx.elicit_url() for o |
| HIGH | README.v2.md | 0 | connect to a third-party service requiring oauth authorization. this demonstrates the "throw error" pattern using urleli |
| HIGH | README.md | 0 | connect to a third-party service requiring oauth authorization. this demonstrates the "throw error" pattern using urleli |
| HIGH | examples/snippets/servers/elicitation.py | 0 | connect to a third-party service requiring oauth authorization. this demonstrates the "throw error" pattern using urleli |
| HIGH | README.v2.md | 0 | run from the repository root: uv run examples/snippets/servers/oauth_server.py |
| HIGH | README.md | 0 | run from the repository root: uv run examples/snippets/servers/oauth_server.py |
| HIGH | examples/snippets/servers/oauth_server.py | 0 | run from the repository root: uv run examples/snippets/servers/oauth_server.py |
| HIGH | README.v2.md | 0 | example showing direct execution of an mcp server. this is the simplest way to run an mcp server directly. cd to the `ex |
| HIGH | README.md | 0 | example showing direct execution of an mcp server. this is the simplest way to run an mcp server directly. cd to the `ex |
| HIGH | examples/snippets/servers/direct_execution.py | 0 | example showing direct execution of an mcp server. this is the simplest way to run an mcp server directly. cd to the `ex |
| HIGH | README.v2.md | 0 | run from the repository root: uv run examples/snippets/servers/streamable_config.py |
| HIGH | README.md | 0 | run from the repository root: uv run examples/snippets/servers/streamable_config.py |
| HIGH | examples/snippets/servers/streamable_config.py | 0 | run from the repository root: uv run examples/snippets/servers/streamable_config.py |
| HIGH | README.v2.md | 0 | run from the repository root: uvicorn examples.snippets.servers.streamable_starlette_mount:app --reload |
| HIGH | README.md | 0 | run from the repository root: uvicorn examples.snippets.servers.streamable_starlette_mount:app --reload |
| HIGH | examples/snippets/servers/streamable_starlette_mount.py | 0 | run from the repository root: uvicorn examples.snippets.servers.streamable_starlette_mount:app --reload |
| HIGH | README.v2.md | 0 | basic example showing how to mount streamablehttp server in starlette. run from the repository root: uvicorn examples.sn |
| HIGH | README.md | 0 | basic example showing how to mount streamablehttp server in starlette. run from the repository root: uvicorn examples.sn |
| HIGH | …les/snippets/servers/streamable_http_basic_mounting.py | 0 | basic example showing how to mount streamablehttp server in starlette. run from the repository root: uvicorn examples.sn |
| HIGH | README.v2.md | 0 | example showing how to mount streamablehttp server using host-based routing. run from the repository root: uvicorn examp |
| HIGH | README.md | 0 | example showing how to mount streamablehttp server using host-based routing. run from the repository root: uvicorn examp |
| HIGH | …ples/snippets/servers/streamable_http_host_mounting.py | 0 | example showing how to mount streamablehttp server using host-based routing. run from the repository root: uvicorn examp |
| HIGH | README.v2.md | 0 | example showing how to mount multiple streamablehttp servers with path configuration. run from the repository root: uvic |
| HIGH | README.md | 0 | example showing how to mount multiple streamablehttp servers with path configuration. run from the repository root: uvic |
| HIGH | …s/snippets/servers/streamable_http_multiple_servers.py | 0 | example showing how to mount multiple streamablehttp servers with path configuration. run from the repository root: uvic |
| 62 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/experimental/tasks/server/test_store.py | 220 | # Create a task with very short TTL |
| MEDIUM | tests/experimental/tasks/server/test_server.py | 358 | # Create a task directly in the store for testing |
| MEDIUM | tests/experimental/tasks/server/test_server.py | 375 | # Create a completed task to test get_task_result |
| MEDIUM | tests/experimental/tasks/server/test_server.py | 553 | # Create a test message |
| MEDIUM | tests/experimental/tasks/client/test_tasks.py | 112 | # Create a task |
| MEDIUM | tests/experimental/tasks/client/test_tasks.py | 163 | # Create a task |
| MEDIUM | tests/experimental/tasks/client/test_tasks.py | 287 | # Create a task (but don't complete it) |
| MEDIUM | tests/server/test_streamable_http_security.py | 56 | # Create the ASGI handler |
| MEDIUM | tests/server/test_session.py | 30 | # Create a message handler to catch exceptions |
| MEDIUM | tests/server/test_lowlevel_exception_handling.py | 48 | # Create a mock RequestResponder |
| MEDIUM | tests/server/test_lifespan.py | 43 | # Create a tool that accesses lifespan context |
| MEDIUM | tests/server/auth/test_protected_resource.py | 18 | # Create the protected resource routes |
| MEDIUM | tests/server/auth/middleware/test_auth_context.py | 53 | # Create an authenticated user |
| MEDIUM | tests/server/auth/middleware/test_bearer_auth.py | 323 | # Create a user with read/write scopes but not admin |
| MEDIUM | tests/server/auth/middleware/test_bearer_auth.py | 352 | # Create a user with read/write scopes |
| MEDIUM | tests/server/auth/middleware/test_bearer_auth.py | 380 | # Create a user with read/write scopes |
| MEDIUM | tests/server/auth/middleware/test_bearer_auth.py | 405 | # Create a user with read/write scopes |
| MEDIUM | tests/server/auth/middleware/test_bearer_auth.py | 430 | # Create a user with read/write scopes |
| MEDIUM | tests/server/mcpserver/test_func_metadata.py | 312 | # Create a copy of the actual schema to normalize |
| MEDIUM | tests/server/mcpserver/test_server.py | 413 | # Create a test image |
| MEDIUM | tests/server/mcpserver/test_server.py | 417 | # Create a test audio |
| MEDIUM | tests/server/mcpserver/test_server.py | 309 | # Create a test image |
| MEDIUM | tests/server/mcpserver/test_server.py | 329 | # Create a test audio |
| MEDIUM | tests/server/mcpserver/test_server.py | 365 | # Create a test audio file with the specific extension |
| MEDIUM | tests/server/mcpserver/test_server.py | 772 | # Create a text file |
| MEDIUM | tests/server/mcpserver/test_server.py | 788 | # Create a binary file |
| MEDIUM | tests/server/mcpserver/test_elicitation.py | 66 | # Create a custom handler for elicitation requests |
| MEDIUM | tests/server/mcpserver/auth/test_auth_integration.py | 107 | # Create a RefreshToken object that matches what is expected in later code |
| MEDIUM | tests/server/mcpserver/auth/test_auth_integration.py | 368 | # Create an auth code for the registered client |
| MEDIUM | tests/server/mcpserver/auth/test_auth_integration.py | 834 | # Create a test client with the token |
| MEDIUM | …s/server/mcpserver/resources/test_resource_template.py | 257 | # Create a resource from the template |
| MEDIUM | …s/server/mcpserver/resources/test_resource_template.py | 306 | # Create a resource from the template |
| MEDIUM | tests/shared/test_streamable_http.py | 1784 | # Create a mock SSE event with empty data (keep-alive ping) |
| MEDIUM | tests/shared/test_streamable_http.py | 1787 | # Create a context-aware stream writer (matches StreamWriter type alias) |
| MEDIUM | tests/shared/test_streamable_http.py | 1809 | # Create a transport with an event store |
| MEDIUM | tests/shared/test_streamable_http.py | 1815 | # Create a mock stream writer |
| MEDIUM | tests/shared/test_streamable_http.py | 1838 | # Create a transport WITHOUT an event store |
| MEDIUM | tests/shared/test_streamable_http.py | 1841 | # Create a mock stream writer |
| MEDIUM | tests/shared/test_streamable_http.py | 1858 | # Create a transport with an event store AND retry_interval |
| MEDIUM | tests/shared/test_streamable_http.py | 1865 | # Create a mock stream writer |
| MEDIUM | tests/shared/test_streamable_http.py | 1887 | # Create a transport with an event store |
| MEDIUM | tests/shared/test_streamable_http.py | 1893 | # Create a mock message and request |
| MEDIUM | tests/shared/test_streamable_http.py | 411 | # Create the session manager |
| MEDIUM | tests/shared/test_streamable_http.py | 423 | # Create an ASGI application that uses the session manager |
| MEDIUM | tests/shared/test_streamable_http.py | 1253 | # Create a new response with 204 status code but same headers |
| MEDIUM | tests/shared/test_streamable_http.py | 2228 | # Create a client with custom headers |
| MEDIUM | tests/shared/test_session.py | 46 | # Create a server with a slow tool |
| MEDIUM | tests/shared/test_progress_notifications.py | 26 | # Create a server session |
| MEDIUM | tests/shared/test_progress_notifications.py | 110 | # Create a server with progress capability |
| MEDIUM | tests/shared/test_progress_notifications.py | 209 | # Create a progress callback that raises an exception |
| MEDIUM | tests/shared/test_progress_notifications.py | 213 | # Create a server with a tool that sends progress notifications |
| MEDIUM | tests/issues/test_152_resource_mime_type.py | 24 | # Create a small test image as bytes |
| MEDIUM | tests/issues/test_152_resource_mime_type.py | 69 | # Create a small test image as bytes |
| MEDIUM | tests/issues/test_355_type_error.py | 20 | # Create a named server |
| MEDIUM | …sts/issues/test_1363_race_condition_streamable_http.py | 75 | # Create a new event loop for this thread |
| MEDIUM | tests/issues/test_malformed_input.py | 23 | # Create a malformed initialize request (missing required params field) |
| MEDIUM | tests/issues/test_1027_win_unreachable_cleanup.py | 46 | # Create a minimal MCP server using MCPServer that tracks lifecycle |
| MEDIUM | tests/issues/test_1027_win_unreachable_cleanup.py | 153 | # Create an MCP server that handles stdin closure gracefully |
| MEDIUM | tests/issues/test_552_windows_hang.py | 21 | # Create a minimal MCP server that responds to initialization |
| MEDIUM | tests/client/test_resource_cleanup.py | 20 | # Create a mock session with the minimal required functionality |
| 40 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/shared/test_streamable_http.py | 6 | |
| LOW | tests/shared/test_otel.py | 1 | |
| LOW | tests/client/test_session.py | 1 | |
| LOW | tests/client/test_client.py | 3 | |
| LOW | examples/snippets/clients/url_elicitation_client.py | 23 | |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 1 | |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 8 | |
| LOW | src/mcp/__init__.py | 1 | |
| LOW | src/mcp/__init__.py | 2 | |
| LOW | src/mcp/__init__.py | 3 | |
| LOW | src/mcp/__init__.py | 4 | |
| LOW | src/mcp/__init__.py | 4 | |
| LOW | src/mcp/__init__.py | 5 | |
| LOW | src/mcp/__init__.py | 6 | |
| LOW | src/mcp/__init__.py | 7 | |
| LOW | src/mcp/__init__.py | 7 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| LOW | src/mcp/__init__.py | 8 | |
| 267 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | README.v2.md | 2456 | print(f"Error: {content.text}") |
| MEDIUM | README.md | 2523 | print(f"Error: {content.text}") |
| LOW | tests/shared/test_streamable_http.py | 468 | except Exception: |
| LOW | tests/shared/test_streamable_http.py | 1766 | except Exception: |
| LOW | tests/shared/test_progress_notifications.py | 39 | except Exception as e: # pragma: no cover |
| LOW | tests/issues/test_1027_win_unreachable_cleanup.py | 184 | except Exception: |
| LOW | tests/issues/test_552_windows_hang.py | 61 | except Exception: |
| LOW | tests/interaction/transports/_bridge.py | 145 | except Exception as exc: # The bridge is the application's outermost boundary: a crash |
| MEDIUM | docs/migration.md | 259 | print(f"Error: {e.error.message}") |
| MEDIUM | docs/migration.md | 270 | print(f"Error: {e.message}") |
| LOW | docs/experimental/tasks-client.md | 354 | except Exception as e: |
| MEDIUM | docs/experimental/tasks-client.md | 355 | print(f"Error: {e}") |
| MEDIUM | examples/snippets/clients/url_elicitation_client.py | 77 | print("Error: No URL provided in elicitation request") |
| LOW | examples/snippets/clients/url_elicitation_client.py | 118 | except Exception as e: |
| LOW | examples/snippets/clients/url_elicitation_client.py | 132 | except Exception: |
| LOW | examples/snippets/clients/url_elicitation_client.py | 305 | except Exception as e: |
| MEDIUM | examples/snippets/clients/parsing_tool_results.py | 52 | print(f"Error: {content.text}") |
| MEDIUM | examples/snippets/servers/__init__.py | 36 | print(f"Error: Server '{server_name}' not found") |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 93 | except Exception as e: |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 152 | except Exception as e: |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 169 | except Exception as e: |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 282 | except Exception as e: |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 322 | except Exception as e: |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 338 | except Exception as e: |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 236 | except Exception as e: |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 277 | except Exception as e: |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 297 | except Exception as e: |
| LOW | …vers/everything-server/mcp_everything_server/server.py | 191 | except Exception as e: |
| LOW | …vers/everything-server/mcp_everything_server/server.py | 213 | except Exception as e: |
| LOW | …vers/everything-server/mcp_everything_server/server.py | 245 | except Exception as e: |
| LOW | …vers/everything-server/mcp_everything_server/server.py | 304 | except Exception as e: |
| LOW | examples/servers/simple-auth/mcp_simple_auth/server.py | 155 | except Exception: |
| LOW | …/servers/simple-auth/mcp_simple_auth/token_verifier.py | 81 | except Exception as e: |
| LOW | scripts/update_readme_snippets.py | 89 | except Exception as e: |
| MEDIUM | scripts/update_readme_snippets.py | 90 | print(f"Error processing {file_path}: {e}") |
| MEDIUM | scripts/update_readme_snippets.py | 105 | print(f"Error: README file not found: {readme_path}") |
| LOW | .github/actions/conformance/client.py | 336 | except Exception as e: |
| MEDIUM | src/mcp/server/streamable_http.py | 701 | def standalone_sse_writer(): |
| MEDIUM | src/mcp/server/streamable_http.py | 895 | def replay_sender(): |
| MEDIUM | src/mcp/server/streamable_http.py | 984 | def message_router(): |
| LOW | src/mcp/server/streamable_http.py | 359 | except Exception: # pragma: no cover |
| LOW | src/mcp/server/streamable_http.py | 565 | except Exception: # pragma: no cover |
| LOW | src/mcp/server/streamable_http.py | 601 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 631 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 638 | except Exception as err: |
| LOW | src/mcp/server/streamable_http.py | 719 | except Exception: |
| LOW | src/mcp/server/streamable_http.py | 735 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 792 | except Exception as e: # pragma: no cover |
| LOW | src/mcp/server/streamable_http.py | 927 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 939 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 945 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 1034 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http.py | 1054 | except Exception as e: # pragma: no cover |
| LOW | src/mcp/server/stdio.py | 55 | except Exception as exc: |
| LOW | src/mcp/server/streamable_http_manager.py | 180 | except Exception: # pragma: lax no cover |
| LOW | src/mcp/server/streamable_http_manager.py | 277 | except Exception: |
| LOW | src/mcp/server/experimental/task_result_handler.py | 170 | except Exception: |
| LOW | src/mcp/server/experimental/task_result_handler.py | 178 | except Exception: |
| MEDIUM | src/mcp/server/experimental/task_result_handler.py | 167 | def wait_for_store() -> None: |
| MEDIUM | src/mcp/server/experimental/task_result_handler.py | 175 | def wait_for_queue() -> None: |
| 55 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/client/test_stdio.py | 223 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/client/test_stdio.py | 225 | # --------------------------------------------------------------------------- |
| MEDIUM | tests/interaction/_requirements.py | 82 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 84 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 228 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 230 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 482 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 484 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 611 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 613 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 736 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 738 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 763 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 765 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 868 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 870 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 910 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 912 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 970 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 972 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1008 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1010 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1052 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1054 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1097 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1099 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1244 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1246 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1421 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1423 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1475 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1477 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1527 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1529 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1548 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1550 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1732 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1734 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1828 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1830 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1909 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 1911 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2076 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2078 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2132 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2134 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2265 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2267 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2404 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2406 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2648 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2650 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2695 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | tests/interaction/_requirements.py | 2697 | # ═══════════════════════════════════════════════════════════════════════════ |
| MEDIUM | src/mcp/os/win32/utilities.py | 132 | # ------------------------ |
| MEDIUM | src/mcp/os/win32/utilities.py | 134 | # ------------------------ |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 35 | Load server configuration from JSON file. Args: file_path: Path to the JSON configuration file. |
| HIGH | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 126 | Execute a tool with retry mechanism. Args: tool_name: Name of the tool to execute. argu |
| HIGH | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 224 | Get a response from the LLM. Args: messages: A list of message dictionaries. Returns: |
| HIGH | src/mcp/server/session.py | 287 | Send a sampling/create_message request. Args: messages: The conversation messages to send. |
| HIGH | src/mcp/server/session.py | 386 | Send a form mode elicitation/create request. Args: message: The message to present to the user. |
| HIGH | src/mcp/server/session.py | 419 | Send a URL mode elicitation/create request. This directs the user to an external URL for out-of-band interactio |
| HIGH | src/mcp/server/experimental/request_context.py | 62 | Validate that the request is compatible with the tool's task execution mode. Per MCP spec: - "required" |
| HIGH | src/mcp/server/experimental/request_context.py | 134 | Create a task, spawn background work, and return CreateTaskResult immediately. This is the recommended way to h |
| HIGH | src/mcp/server/experimental/session_features.py | 99 | Send a task-augmented elicitation to the client and poll until complete. The client will create a local task, p |
| HIGH | src/mcp/server/experimental/session_features.py | 155 | Send a task-augmented sampling request and poll until complete. The client will create a local task, process th |
| HIGH | src/mcp/server/experimental/task_context.py | 189 | Send an elicitation request via the task message queue. This method: 1. Checks client capability |
| HIGH | src/mcp/server/experimental/task_context.py | 253 | Send a URL mode elicitation request via the task message queue. This directs the user to an external URL for ou |
| HIGH | src/mcp/server/experimental/task_context.py | 329 | Send a sampling request via the task message queue. This method: 1. Checks client capability 2. |
| HIGH | src/mcp/server/experimental/task_context.py | 414 | Send a task-augmented elicitation via the queue, then poll client. This is for use inside a task-augmented tool |
| HIGH | src/mcp/server/experimental/task_context.py | 499 | Send a task-augmented sampling request via the queue, then poll client. This is for use inside a task-augmented |
| HIGH | src/mcp/server/auth/provider.py | 138 | Handle the /authorize endpoint and return a URL that the client will be redirected to. Many MCP impleme |
| HIGH | src/mcp/server/auth/provider.py | 197 | Exchanges an authorization code for an access token and refresh token. Args: client: The client exc |
| HIGH | src/mcp/server/auth/provider.py | 229 | Exchanges a refresh token for an access token and refresh token. Implementations SHOULD rotate both the access |
| HIGH | src/mcp/server/auth/middleware/client_auth.py | 40 | Authenticate a client from an HTTP request. Extracts client credentials from the appropriate location based on |
| HIGH | src/mcp/shared/experimental/tasks/store.py | 23 | Create a new task. Args: metadata: Task metadata (ttl, etc.) task_id: Optional task ID. |
| HIGH | src/mcp/shared/experimental/tasks/store.py | 54 | Update a task's status and/or message. Args: task_id: The task identifier status: New s |
| HIGH | src/mcp/shared/experimental/tasks/helpers.py | 54 | Cancel a task with spec-compliant validation. Per spec: "Receivers MUST reject cancellation of terminal status task |
| HIGH | src/mcp/shared/experimental/tasks/helpers.py | 128 | Context manager for safe task execution (pure, no server dependencies). Loads a task from the store and provides a |
| HIGH | src/mcp/client/auth/utils.py | 321 | Parse and validate a token response. Parses token response JSON. Callers should check response.status_code before c |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 124 | # Check if refresh token exists |
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 129 | # Check if the access token exists |
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 132 | # Check if the token was issued to this client |
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 167 | # Check if token is expired |
| LOW | tests/issues/test_1027_win_unreachable_cleanup.py | 206 | # Check if process is still running |
| LOW | tests/issues/test_1027_win_unreachable_cleanup.py | 225 | # Check if cleanup ran |
| LOW | tests/client/test_stdio.py | 149 | # Check if we timed out |
| LOW | examples/snippets/clients/url_elicitation_client.py | 154 | # Check if the tool returned an error in the result |
| LOW | examples/snippets/clients/url_elicitation_client.py | 162 | # Check if this is a URL elicitation required error |
| LOW | examples/snippets/clients/pagination_client.py | 29 | # Check if there are more pages |
| LOW | examples/snippets/servers/elicitation.py | 35 | # Check if date is available |
| LOW | …rs/simple-auth/mcp_simple_auth/simple_auth_provider.py | 248 | # Check if expired |
| LOW | src/mcp/server/transport_security.py | 58 | # Check if the actual host starts with base host and has a port |
| LOW | src/mcp/server/transport_security.py | 80 | # Check if the actual origin starts with base origin and has a port |
| LOW | src/mcp/server/elicitation.py | 74 | # Check if it's a sequence-like type with str elements |
| LOW | src/mcp/server/streamable_http.py | 481 | # Check if this is an initialization request |
| LOW | src/mcp/server/streamable_http.py | 485 | # Check if the server already has an established session |
| LOW | src/mcp/server/streamable_http.py | 487 | # Check if request has a session ID |
| LOW | src/mcp/server/streamable_http.py | 689 | # Check if we already have an active GET stream |
| LOW | src/mcp/server/streamable_http.py | 857 | # Check if the protocol version is supported |
| LOW | src/mcp/server/streamable_http.py | 990 | # Check if this is a response with a known request id. |
| LOW | src/mcp/server/mcpserver/server.py | 561 | # Check if user passed function directly instead of calling decorator |
| LOW | src/mcp/server/mcpserver/server.py | 681 | # Check if user passed function directly instead of calling decorator |
| LOW | src/mcp/server/mcpserver/server.py | 689 | # Check if this should be a template |
| LOW | src/mcp/server/mcpserver/server.py | 791 | # Check if user passed function directly instead of calling decorator |
| LOW | src/mcp/server/mcpserver/utilities/func_metadata.py | 232 | # Check if the parameter name conflicts with BaseModel attributes |
| LOW | src/mcp/server/mcpserver/utilities/func_metadata.py | 275 | # Check if CallToolResult appears in the union (excluding None for Optional check) |
| LOW | src/mcp/shared/experimental/tasks/message_queue.py | 199 | # Check if there are already messages |
| LOW | src/mcp/os/posix/utilities.py | 35 | # Check if process group still exists (signal 0 = check only) |
| LOW | src/mcp/os/win32/utilities.py | 97 | # Close the file handles to prevent ResourceWarning |
| LOW | src/mcp/client/session.py | 426 | # Check if this is a task-augmented request |
| LOW | src/mcp/client/session.py | 436 | # Check if this is a task-augmented request |
| LOW | src/mcp/client/streamable_http.py | 453 | # Check if this is a resumption request |
| LOW | src/mcp/client/auth/oauth2.py | 175 | # Check if protocol version is 2025-06-18 or later |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/experimental/tasks/server/test_integration.py | 137 | # Step 1: Send task-augmented tool call |
| LOW | tests/experimental/tasks/server/test_integration.py | 153 | # Step 2: Wait for task to complete |
| LOW | tests/experimental/tasks/server/test_integration.py | 160 | # Step 3: Retrieve the actual result |
| LOW | tests/experimental/tasks/client/test_handlers.py | 449 | # Step 2: Client responds with CreateTaskResult |
| LOW | tests/experimental/tasks/client/test_handlers.py | 458 | # Step 3: Wait for background sampling |
| LOW | tests/experimental/tasks/client/test_handlers.py | 461 | # Step 4: Server polls task status |
| LOW | tests/experimental/tasks/client/test_handlers.py | 589 | # Step 2: Client responds with CreateTaskResult |
| LOW | tests/experimental/tasks/client/test_handlers.py | 598 | # Step 3: Wait for background elicitation |
| LOW | tests/experimental/tasks/client/test_handlers.py | 601 | # Step 4: Server polls task status |
| LOW | tests/experimental/tasks/client/test_handlers.py | 434 | # Step 1: Server sends task-augmented CreateMessageRequest |
| LOW | tests/experimental/tasks/client/test_handlers.py | 477 | # Step 5: Server gets result |
| LOW | tests/experimental/tasks/client/test_handlers.py | 574 | # Step 1: Server sends task-augmented ElicitRequest |
| LOW | tests/experimental/tasks/client/test_handlers.py | 617 | # Step 5: Server gets result |
| LOW | tests/server/test_session_race_condition.py | 85 | # Step 1: Send InitializeRequest |
| LOW | tests/server/test_session_race_condition.py | 101 | # Step 2: Wait for InitializeResult |
| LOW | tests/server/test_session_race_condition.py | 105 | # Step 3: Immediately send tools/list BEFORE InitializedNotification |
| LOW | tests/server/test_session_race_condition.py | 109 | # Step 4: Check the response |
| LOW | tests/server/test_session_race_condition.py | 114 | # Step 5: Send InitializedNotification |
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 557 | # Step 1: First, let's create a token and refresh token at the current time |
| LOW | tests/server/mcpserver/auth/test_auth_integration.py | 576 | # Step 2: Time travel forward 4 hours (tokens expire in 1 hour by default) |
| LOW | src/mcp/server/auth/middleware/client_auth.py | 88 | # form_data.get() can return an UploadFile or None, so we need to check if it's a string |
| LOW | src/mcp/client/auth/oauth2.py | 535 | # Step 1: Discover protected resource metadata (SEP-985 with fallback support) |
| LOW | src/mcp/client/auth/oauth2.py | 565 | # Step 2: Discover OAuth Authorization Server Metadata (OASM) (with fallback for legacy servers) |
| LOW | src/mcp/client/auth/oauth2.py | 579 | # Step 3: Apply scope selection strategy |
| LOW | src/mcp/client/auth/oauth2.py | 587 | # Step 4: Register client or use URL-based client ID (CIMD) |
| LOW | src/mcp/client/auth/oauth2.py | 612 | # Step 5: Perform authorization and complete token exchange |
| LOW | src/mcp/client/auth/oauth2.py | 623 | # Step 1: Extract error field from WWW-Authenticate header |
| LOW | src/mcp/client/auth/oauth2.py | 626 | # Step 2: Check if we need to step-up authorization |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | tests/server/test_sse_security.py | 351 | body = b'{"jsonrpc": "2.0", "id": 1, "method": "ping", "params": null}' |
| HIGH | tests/server/mcpserver/test_func_metadata.py | 151 | "my_model_b": '{"how_many_shrimp": 5, "ok": {"x": 1}, "y": null}', |
| HIGH | tests/server/mcpserver/test_tool_manager.py | 312 | {"tank": '{"x": null, "shrimp": [{"name": "rex"}, {"name": "gertrude"}]}'}, |
| HIGH | tests/shared/test_sse.py | 510 | json_message = '{"jsonrpc": "2.0", "id": "123", "method": "ping", "params": null}' |
| HIGH | tests/shared/test_sse.py | 514 | json_message = '{"jsonrpc": "2.0", "id": 123, "method": "ping", "params": null}' |
| HIGH | tests/client/test_auth.py | 126 | b'"scopes_supported": null}' |
| HIGH | examples/snippets/clients/url_elicitation_client.py | 288 | print("(Start server with: cd examples/snippets && uv run server elicitation sse)") |
| HIGH | examples/snippets/clients/url_elicitation_client.py | 304 | print(" cd examples/snippets && uv run server elicitation sse") |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/server/test_streamable_http_manager.py | 105 | |
| LOW | tests/server/test_streamable_http_manager.py | 160 | |
| LOW | tests/server/test_streamable_http_manager.py | 344 | |
| LOW | tests/server/mcpserver/test_integration.py | 68 | |
| LOW | tests/shared/test_streamable_http.py | 232 | |
| LOW | tests/client/test_session_group.py | 303 | |
| LOW | examples/snippets/clients/url_elicitation_client.py | 235 | |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 285 | |
| LOW | …ples/clients/simple-chatbot/mcp_simple_chatbot/main.py | 332 | |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 260 | |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 280 | |
| LOW | …ents/simple-auth-client/mcp_simple_auth_client/main.py | 300 | |
| LOW | …ervers/sse-polling-demo/mcp_sse_polling_demo/server.py | 60 | |
| LOW | scripts/update_readme_snippets.py | 31 | |
| LOW | src/mcp/server/elicitation.py | 52 | |
| LOW | src/mcp/server/streamable_http.py | 441 | |
| LOW | src/mcp/server/auth/handlers/authorize.py | 70 | |
| LOW | src/mcp/server/lowlevel/server.py | 441 | |
| LOW | src/mcp/server/mcpserver/resources/types.py | 57 | |
| LOW | src/mcp/server/mcpserver/utilities/func_metadata.py | 322 | |
| LOW | src/mcp/server/mcpserver/utilities/context_injection.py | 13 | |
| LOW | src/mcp/server/mcpserver/prompts/base.py | 138 | |
| LOW | src/mcp/shared/session.py | 239 | |
| LOW | src/mcp/shared/session.py | 351 | |
| LOW | src/mcp/shared/session.py | 355 | |
| LOW | src/mcp/cli/cli.py | 119 | |
| LOW | src/mcp/cli/cli.py | 361 | |
| LOW | src/mcp/os/posix/utilities.py | 13 | |
| LOW | src/mcp/os/win32/utilities.py | 278 | |
| LOW | src/mcp/client/auth/oauth2.py | 506 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tests/interaction/transports/test_streamable_http.py | 161 | # Bounded because a harness regression here historically meant deadlock, not failure. |
| LOW | src/mcp/server/auth/handlers/authorize.py | 115 | # if the redirect URI is invalid, ignore it & just return the |
| LOW | src/mcp/server/auth/handlers/revoke.py | 74 | # if token is not found, just return HTTP 200 per the RFC |
| LOW | src/mcp/server/mcpserver/utilities/func_metadata.py | 214 | # This raise could perhaps be skipped, and we (MCPServer) just call |
| LOW | src/mcp/cli/cli.py | 53 | return "npx" # On Unix-like systems, just use npx |
| MEDIUM | src/mcp/client/session_group.py | 273 | # Create read and write streams that facilitate io with the server. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | examples/servers/simple-auth/mcp_simple_auth/server.py | 6 | NOTE: this is a simplified example for demonstration purposes. |
| MEDIUM | …rs/simple-auth/mcp_simple_auth/simple_auth_provider.py | 4 | for demonstration purposes. No external authentication provider is required. |
| MEDIUM | …rs/simple-auth/mcp_simple_auth/simple_auth_provider.py | 6 | NOTE: this is a simplified example for demonstration purposes. |
| MEDIUM | …les/servers/simple-auth/mcp_simple_auth/auth_server.py | 6 | NOTE: this is a simplified example for demonstration purposes. |
| MEDIUM | …ervers/simple-auth/mcp_simple_auth/legacy_as_server.py | 6 | NOTE: this is a simplified example for demonstration purposes. |
| MEDIUM | …/servers/simple-auth/mcp_simple_auth/token_verifier.py | 15 | This is a simple example implementation for demonstration purposes. |
| LOW | src/mcp/shared/session.py | 234 | # would be very surprising behavior), so make sure to cancel the tasks |
| MEDIUM | …/mcp/shared/experimental/tasks/in_memory_task_store.py | 1 | """In-memory implementation of TaskStore for demonstration purposes. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/server/mcpserver/test_func_metadata.py | 952 | return PersonWithAddress(name="Jack", address=Address(street="123 Main St", city="Anytown", zipcode="12345")) |
| LOW | tests/server/mcpserver/test_server.py | 490 | assert result.structured_content == {"name": "John Doe", "age": 30, "active": True} |
| LOW | tests/server/mcpserver/test_server.py | 494 | assert '"name": "John Doe"' in result.content[0].text |
| LOW | tests/server/mcpserver/test_server.py | 472 | return UserOutput(name="John Doe", age=30) |
| LOW | tests/server/mcpserver/test_elicitation.py | 167 | {"required_name": "John Doe", "optional_age": 30, "optional_email": "john@example.com", "subscribe": True}, |
| LOW | tests/client/auth/extensions/test_client_credentials.py | 139 | "name": "John Doe", |
| LOW | tests/client/auth/extensions/test_client_credentials.py | 171 | assert claims["name"] == "John Doe" |
| LOW | …vers/everything-server/mcp_everything_server/server.py | 220 | name: str = Field(default="John Doe", description="User name") |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/server/mcpserver/test_tool_manager.py | 626 | def process_data(input_data: str) -> str: # pragma: no cover |
| LOW | examples/snippets/servers/notifications.py | 7 | async def process_data(data: str, ctx: Context) -> str: |
| LOW | …amples/snippets/servers/streamable_http_path_config.py | 17 | def process_data(data: str) -> str: |
| LOW | src/mcp/server/streamable_http.py | 366 | async def handle_request(self, scope: Scope, receive: Receive, send: Send) -> None: |
| LOW | src/mcp/server/streamable_http_manager.py | 143 | async def handle_request(self, scope: Scope, receive: Receive, send: Send) -> None: |
| LOW | src/mcp/server/experimental/request_context.py | 127 | async def run_task( |
| LOW | src/mcp/client/experimental/task_handlers.py | 253 | async def handle_request( |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/client/test_stdio.py | 221 | |
| LOW | examples/snippets/servers/streamable_config.py | 21 | mcp.run(transport="streamable-http", stateless_http=True, json_response=True) |
| LOW | scripts/build-docs.sh | 1 | #!/usr/bin/env bash |
| LOW | src/mcp/server/auth/handlers/authorize.py | 81 | error_description: str | None, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | scripts/build-docs.sh | 12 | # Usage: |