SYMBOL INDEX (2760 symbols across 274 files) FILE: .github/actions/conformance/client.py function register (line 60) | def register(name: str) -> Callable[[ScenarioHandler], ScenarioHandler]: function get_conformance_context (line 70) | def get_conformance_context() -> dict[str, Any]: class InMemoryTokenStorage (line 84) | class InMemoryTokenStorage(TokenStorage): method __init__ (line 87) | def __init__(self) -> None: method get_tokens (line 91) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 94) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 97) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 100) | async def set_client_info(self, client_info: OAuthClientInformationFul... class ConformanceOAuthCallbackHandler (line 104) | class ConformanceOAuthCallbackHandler: method __init__ (line 109) | def __init__(self) -> None: method handle_redirect (line 113) | async def handle_redirect(self, authorization_url: str) -> None: method handle_callback (line 142) | async def handle_callback(self) -> tuple[str, str | None]: function run_initialize (line 157) | async def run_initialize(server_url: str) -> None: function run_tools_call (line 168) | async def run_tools_call(server_url: str) -> None: function run_sse_retry (line 179) | async def run_sse_retry(server_url: str) -> None: function default_elicitation_callback (line 189) | async def default_elicitation_callback( function run_elicitation_defaults (line 210) | async def run_elicitation_defaults(server_url: str) -> None: function run_client_credentials_jwt (line 223) | async def run_client_credentials_jwt(server_url: str) -> None: function run_client_credentials_basic (line 253) | async def run_client_credentials_basic(server_url: str) -> None: function run_auth_code_client (line 275) | async def run_auth_code_client(server_url: str) -> None: function _run_auth_session (line 317) | async def _run_auth_session(server_url: str, oauth_auth: OAuthClientProv... function main (line 342) | def main() -> None: FILE: examples/clients/simple-auth-client/mcp_simple_auth_client/main.py class InMemoryTokenStorage (line 30) | class InMemoryTokenStorage(TokenStorage): method __init__ (line 33) | def __init__(self): method get_tokens (line 37) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 40) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 43) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 46) | async def set_client_info(self, client_info: OAuthClientInformationFul... class CallbackHandler (line 50) | class CallbackHandler(BaseHTTPRequestHandler): method __init__ (line 53) | def __init__( method do_GET (line 64) | def do_GET(self): method log_message (line 104) | def log_message(self, format: str, *args: Any): class CallbackServer (line 108) | class CallbackServer: method __init__ (line 111) | def __init__(self, port: int = 3000): method _create_handler_with_data (line 117) | def _create_handler_with_data(self): method start (line 132) | def start(self): method stop (line 140) | def stop(self): method wait_for_callback (line 148) | def wait_for_callback(self, timeout: int = 300): method get_state (line 159) | def get_state(self): class SimpleAuthClient (line 164) | class SimpleAuthClient: method __init__ (line 167) | def __init__( method connect (line 178) | async def connect(self): method _run_session (line 242) | async def _run_session( method list_tools (line 260) | async def list_tools(self): method call_tool (line 280) | async def call_tool(self, tool_name: str, arguments: dict[str, Any] | ... method interactive_loop (line 300) | async def interactive_loop(self): function main (line 353) | async def main(): function cli (line 377) | def cli(): FILE: examples/clients/simple-chatbot/mcp_simple_chatbot/main.py class Configuration (line 20) | class Configuration: method __init__ (line 23) | def __init__(self) -> None: method load_env (line 29) | def load_env() -> None: method load_config (line 34) | def load_config(file_path: str) -> dict[str, Any]: method llm_api_key (line 51) | def llm_api_key(self) -> str: class Server (line 65) | class Server: method __init__ (line 68) | def __init__(self, name: str, config: dict[str, Any]) -> None: method initialize (line 76) | async def initialize(self) -> None: method list_tools (line 98) | async def list_tools(self) -> list[Tool]: method execute_tool (line 119) | async def execute_tool( method cleanup (line 162) | async def cleanup(self) -> None: class Tool (line 173) | class Tool: method __init__ (line 176) | def __init__( method format_for_llm (line 188) | def format_for_llm(self) -> str: class LLMClient (line 217) | class LLMClient: method __init__ (line 220) | def __init__(self, api_key: str) -> None: method get_response (line 223) | def get_response(self, messages: list[dict[str, str]]) -> str: class ChatSession (line 270) | class ChatSession: method __init__ (line 273) | def __init__(self, servers: list[Server], llm_client: LLMClient) -> None: method cleanup_servers (line 277) | async def cleanup_servers(self) -> None: method process_llm_response (line 285) | async def process_llm_response(self, llm_response: str) -> str: method start (line 332) | async def start(self) -> None: function run (line 406) | async def run() -> None: function main (line 416) | def main() -> None: FILE: examples/clients/simple-task-client/mcp_simple_task_client/main.py function run (line 11) | async def run(url: str) -> None: function main (line 50) | def main(url: str) -> int: FILE: examples/clients/simple-task-interactive-client/mcp_simple_task_interactive_client/main.py function elicitation_callback (line 25) | async def elicitation_callback( function sampling_callback (line 40) | async def sampling_callback( function get_text (line 67) | def get_text(result: CallToolResult) -> str: function run (line 74) | async def run(url: str) -> None: function main (line 131) | def main(url: str) -> int: FILE: examples/clients/sse-polling-client/mcp_sse_polling_client/main.py function run_demo (line 25) | async def run_demo(url: str, items: int, checkpoint_every: int) -> None: function main (line 88) | def main(url: str, items: int, checkpoint_every: int, log_level: str) ->... FILE: examples/mcpserver/complex_inputs.py class ShrimpTank (line 15) | class ShrimpTank(BaseModel): class Shrimp (line 16) | class Shrimp(BaseModel): function name_shrimp (line 23) | def name_shrimp( FILE: examples/mcpserver/desktop.py function desktop (line 15) | def desktop() -> list[str]: function sum (line 22) | def sum(a: int, b: int) -> int: FILE: examples/mcpserver/direct_call_tool_result_return.py class EchoResponse (line 13) | class EchoResponse(BaseModel): function echo (line 18) | def echo(text: str) -> Annotated[CallToolResult, EchoResponse]: FILE: examples/mcpserver/echo.py function echo_tool (line 10) | def echo_tool(text: str) -> str: function echo_resource (line 16) | def echo_resource() -> str: function echo_template (line 21) | def echo_template(text: str) -> str: function echo_prompt (line 27) | def echo_prompt(text: str) -> str: FILE: examples/mcpserver/icons_demo.py function demo_tool (line 25) | def demo_tool(message: str) -> str: function readme_resource (line 31) | def readme_resource() -> str: function prompt_with_icon (line 37) | def prompt_with_icon(text: str) -> str: function multi_icon_tool (line 49) | def multi_icon_tool(action: str) -> str: FILE: examples/mcpserver/logging_and_progress.py function echo (line 12) | async def echo(text: str, ctx: Context) -> str: FILE: examples/mcpserver/memory.py function cosine_similarity (line 47) | def cosine_similarity(a: list[float], b: list[float]) -> float: function do_ai (line 53) | async def do_ai( class Deps (line 69) | class Deps: function get_db_pool (line 74) | async def get_db_pool() -> asyncpg.Pool: class MemoryNode (line 83) | class MemoryNode(BaseModel): method from_content (line 93) | async def from_content(cls, content: str, deps: Deps): method save (line 97) | async def save(self, deps: Deps): method merge_with (line 132) | async def merge_with(self, other: Self, deps: Deps): method get_effective_importance (line 148) | def get_effective_importance(self): function get_embedding (line 152) | async def get_embedding(text: str, deps: Deps) -> list[float]: function delete_memory (line 160) | async def delete_memory(memory_id: int, deps: Deps): function add_memory (line 165) | async def add_memory(content: str, deps: Deps): function find_similar_memories (line 181) | async def find_similar_memories(embedding: list[float], deps: Deps) -> l... function update_importance (line 207) | async def update_importance(user_embedding: list[float], deps: Deps): function prune_memories (line 231) | async def prune_memories(deps: Deps): function display_memory_tree (line 246) | async def display_memory_tree(deps: Deps) -> str: function remember (line 266) | async def remember( function read_profile (line 277) | async def read_profile() -> str: function initialize_database (line 284) | async def initialize_database(): FILE: examples/mcpserver/parameter_descriptions.py function greet_user (line 12) | def greet_user( FILE: examples/mcpserver/readme-quickstart.py function sum (line 9) | def sum(a: int, b: int) -> int: function get_greeting (line 16) | def get_greeting(name: str) -> str: FILE: examples/mcpserver/screenshot.py function take_screenshot (line 16) | def take_screenshot() -> Image: FILE: examples/mcpserver/simple_echo.py function echo (line 10) | def echo(text: str) -> str: FILE: examples/mcpserver/text_me.py class SurgeSettings (line 29) | class SurgeSettings(BaseSettings): function text_me (line 45) | def text_me(text_content: str) -> str: FILE: examples/mcpserver/unicode_example.py function hello_unicode (line 11) | def hello_unicode(name: str = "世界", greeting: str = "¡Hola") -> str: function list_emoji_categories (line 21) | def list_emoji_categories() -> list[str]: function multilingual_hello (line 37) | def multilingual_hello() -> str: FILE: examples/mcpserver/weather_structured.py class WeatherData (line 24) | class WeatherData(BaseModel): function get_weather (line 36) | def get_weather(city: str) -> WeatherData: class WeatherSummary (line 43) | class WeatherSummary(TypedDict): function get_weather_summary (line 52) | def get_weather_summary(city: str) -> WeatherSummary: function get_weather_metrics (line 59) | def get_weather_metrics(cities: list[str]) -> dict[str, dict[str, float]]: class WeatherAlert (line 73) | class WeatherAlert: function get_weather_alerts (line 84) | def get_weather_alerts(region: str) -> list[WeatherAlert]: function get_temperature (line 109) | def get_temperature(city: str, unit: str = "celsius") -> float: class DailyStats (line 122) | class DailyStats(BaseModel): class WeatherStats (line 130) | class WeatherStats(BaseModel): function get_weather_stats (line 141) | def get_weather_stats(city: str, days: int = 7) -> WeatherStats: function test (line 154) | async def test() -> None: function print_schemas (line 196) | async def print_schemas() -> None: FILE: examples/servers/everything-server/mcp_everything_server/server.py class InMemoryEventStore (line 44) | class InMemoryEventStore(EventStore): method __init__ (line 47) | def __init__(self) -> None: method store_event (line 51) | async def store_event(self, stream_id: StreamId, message: JSONRPCMessa... method replay_events_after (line 58) | async def replay_events_after(self, last_event_id: EventId, send_callb... function test_simple_text (line 94) | def test_simple_text() -> str: function test_image_content (line 100) | def test_image_content() -> list[ImageContent]: function test_audio_content (line 106) | def test_audio_content() -> list[AudioContent]: function test_embedded_resource (line 112) | def test_embedded_resource() -> list[EmbeddedResource]: function test_multiple_content_types (line 127) | def test_multiple_content_types() -> list[TextContent | ImageContent | E... function test_tool_with_logging (line 144) | async def test_tool_with_logging(ctx: Context) -> str: function test_tool_with_progress (line 157) | async def test_tool_with_progress(ctx: Context) -> str: function test_sampling (line 175) | async def test_sampling(prompt: str, ctx: Context) -> str: class UserResponse (line 195) | class UserResponse(BaseModel): function test_elicitation (line 200) | async def test_elicitation(message: str, ctx: Context) -> str: class SEP1034DefaultsSchema (line 217) | class SEP1034DefaultsSchema(BaseModel): function test_elicitation_sep1034_defaults (line 232) | async def test_elicitation_sep1034_defaults(ctx: Context) -> str: class EnumSchemasTestSchema (line 249) | class EnumSchemasTestSchema(BaseModel): function test_elicitation_sep1330_enums (line 291) | async def test_elicitation_sep1330_enums(ctx: Context) -> str: function test_error_handling (line 309) | def test_error_handling() -> str: function test_reconnection (line 315) | async def test_reconnection(ctx: Context) -> str: function static_text_resource (line 329) | def static_text_resource() -> str: function static_binary_resource (line 335) | def static_binary_resource() -> bytes: function template_resource (line 341) | def template_resource(id: str) -> str: function watched_resource (line 347) | def watched_resource() -> str: function test_simple_prompt (line 354) | def test_simple_prompt() -> list[UserMessage]: function test_prompt_with_arguments (line 360) | def test_prompt_with_arguments(arg1: str, arg2: str) -> list[UserMessage]: function test_prompt_with_embedded_resource (line 370) | def test_prompt_with_embedded_resource(resourceUri: str) -> list[UserMes... function test_prompt_with_image (line 389) | def test_prompt_with_image() -> list[UserMessage]: function handle_set_logging_level (line 400) | async def handle_set_logging_level(ctx: ServerRequestContext, params: Se... function handle_subscribe (line 406) | async def handle_subscribe(ctx: ServerRequestContext, params: SubscribeR... function handle_unsubscribe (line 413) | async def handle_unsubscribe(ctx: ServerRequestContext, params: Unsubscr... function _handle_completion (line 426) | async def _handle_completion( function main (line 445) | def main(port: int, log_level: str) -> int: FILE: examples/servers/simple-auth/mcp_simple_auth/auth_server.py class AuthServerSettings (line 32) | class AuthServerSettings(BaseModel): class SimpleAuthProvider (line 42) | class SimpleAuthProvider(SimpleOAuthProvider): method __init__ (line 50) | def __init__(self, auth_settings: SimpleAuthSettings, auth_callback_pa... function create_authorization_server (line 54) | def create_authorization_server(server_settings: AuthServerSettings, aut... function run_server (line 137) | async def run_server(server_settings: AuthServerSettings, auth_settings:... function main (line 156) | def main(port: int) -> int: FILE: examples/servers/simple-auth/mcp_simple_auth/legacy_as_server.py class ServerSettings (line 29) | class ServerSettings(BaseModel): class LegacySimpleOAuthProvider (line 39) | class LegacySimpleOAuthProvider(SimpleOAuthProvider): method __init__ (line 42) | def __init__(self, auth_settings: SimpleAuthSettings, auth_callback_pa... function create_simple_mcp_server (line 46) | def create_simple_mcp_server(server_settings: ServerSettings, auth_setti... function main (line 115) | def main(port: int, transport: Literal["sse", "streamable-http"]) -> int: FILE: examples/servers/simple-auth/mcp_simple_auth/server.py class ResourceServerSettings (line 26) | class ResourceServerSettings(BaseSettings): function create_resource_server (line 48) | def create_resource_server(settings: ResourceServerSettings) -> MCPServer: function main (line 113) | def main(port: int, auth_server: str, transport: Literal["sse", "streama... FILE: examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py class SimpleAuthSettings (line 32) | class SimpleAuthSettings(BaseSettings): class SimpleOAuthProvider (line 45) | class SimpleOAuthProvider(OAuthAuthorizationServerProvider[Authorization... method __init__ (line 54) | def __init__(self, settings: SimpleAuthSettings, auth_callback_url: st... method get_client (line 65) | async def get_client(self, client_id: str) -> OAuthClientInformationFu... method register_client (line 69) | async def register_client(self, client_info: OAuthClientInformationFull): method authorize (line 75) | async def authorize(self, client: OAuthClientInformationFull, params: ... method get_login_page (line 93) | async def get_login_page(self, state: str) -> HTMLResponse: method handle_login_callback (line 135) | async def handle_login_callback(self, request: Request) -> Response: method handle_simple_callback (line 152) | async def handle_simple_callback(self, username: str, password: str, s... method load_authorization_code (line 197) | async def load_authorization_code( method exchange_authorization_code (line 203) | async def exchange_authorization_code( method load_access_token (line 240) | async def load_access_token(self, token: str) -> AccessToken | None: method load_refresh_token (line 253) | async def load_refresh_token(self, client: OAuthClientInformationFull,... method exchange_refresh_token (line 257) | async def exchange_refresh_token( method revoke_token (line 267) | async def revoke_token(self, token: str, token_type_hint: str | None =... FILE: examples/servers/simple-auth/mcp_simple_auth/token_verifier.py class IntrospectionTokenVerifier (line 12) | class IntrospectionTokenVerifier(TokenVerifier): method __init__ (line 23) | def __init__( method verify_token (line 34) | async def verify_token(self, token: str) -> AccessToken | None: method _validate_resource (line 83) | def _validate_resource(self, token_data: dict[str, Any]) -> bool: method _is_valid_resource (line 101) | def _is_valid_resource(self, resource: str) -> bool: FILE: examples/servers/simple-pagination/mcp_simple_pagination/server.py function _paginate (line 48) | def _paginate(cursor: str | None, items: list[T], page_size: int) -> tup... function handle_list_tools (line 64) | async def handle_list_tools( function handle_list_resources (line 73) | async def handle_list_resources( function handle_list_prompts (line 82) | async def handle_list_prompts( function handle_call_tool (line 90) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function handle_read_resource (line 106) | async def handle_read_resource( function handle_get_prompt (line 124) | async def handle_get_prompt(ctx: ServerRequestContext, params: types.Get... function main (line 152) | def main(port: int, transport: str) -> int: FILE: examples/servers/simple-prompt/mcp_simple_prompt/server.py function create_messages (line 7) | def create_messages(context: str | None = None, topic: str | None = None... function handle_list_prompts (line 32) | async def handle_list_prompts( function handle_get_prompt (line 58) | async def handle_get_prompt(ctx: ServerRequestContext, params: types.Get... function main (line 78) | def main(port: int, transport: str) -> int: FILE: examples/servers/simple-resource/mcp_simple_resource/server.py function handle_list_resources (line 24) | async def handle_list_resources( function handle_read_resource (line 41) | async def handle_read_resource( function main (line 71) | def main(port: int, transport: str) -> int: FILE: examples/servers/simple-streamablehttp-stateless/mcp_simple_streamablehttp_stateless/server.py function handle_list_tools (line 13) | async def handle_list_tools( function handle_call_tool (line 44) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function main (line 84) | def main( FILE: examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/event_store.py class EventEntry (line 19) | class EventEntry: class InMemoryEventStore (line 27) | class InMemoryEventStore(EventStore): method __init__ (line 35) | def __init__(self, max_events_per_stream: int = 100): method store_event (line 47) | async def store_event(self, stream_id: StreamId, message: JSONRPCMessa... method replay_events_after (line 68) | async def replay_events_after( FILE: examples/servers/simple-streamablehttp/mcp_simple_streamablehttp/server.py function handle_list_tools (line 16) | async def handle_list_tools( function handle_call_tool (line 47) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function main (line 98) | def main( FILE: examples/servers/simple-task-interactive/mcp_simple_task_interactive/server.py function handle_list_tools (line 18) | async def handle_list_tools( function handle_confirm_delete (line 42) | async def handle_confirm_delete(ctx: ServerRequestContext, arguments: di... function handle_write_haiku (line 75) | async def handle_write_haiku(ctx: ServerRequestContext, arguments: dict[... function handle_call_tool (line 105) | async def handle_call_tool( function main (line 134) | def main(port: int) -> int: FILE: examples/servers/simple-task/mcp_simple_task/server.py function handle_list_tools (line 11) | async def handle_list_tools( function handle_call_tool (line 26) | async def handle_call_tool( function main (line 65) | def main(port: int) -> int: FILE: examples/servers/simple-tool/mcp_simple_tool/server.py function fetch_website (line 8) | async def fetch_website( function handle_list_tools (line 18) | async def handle_list_tools( function handle_call_tool (line 42) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function main (line 60) | def main(port: int, transport: str) -> int: FILE: examples/servers/sse-polling-demo/mcp_sse_polling_demo/event_store.py class EventEntry (line 19) | class EventEntry: class InMemoryEventStore (line 27) | class InMemoryEventStore(EventStore): method __init__ (line 35) | def __init__(self, max_events_per_stream: int = 100): method store_event (line 47) | async def store_event(self, stream_id: StreamId, message: JSONRPCMessa... method replay_events_after (line 73) | async def replay_events_after( FILE: examples/servers/sse-polling-demo/mcp_sse_polling_demo/server.py function handle_list_tools (line 28) | async def handle_list_tools( function handle_call_tool (line 60) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function main (line 134) | def main(port: int, log_level: str, retry_interval: int) -> int: FILE: examples/servers/structured-output-lowlevel/mcp_structured_output_lowlevel/__main__.py function handle_list_tools (line 18) | async def handle_list_tools( function handle_call_tool (line 48) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function run (line 78) | async def run(): FILE: examples/snippets/clients/completion_client.py function run (line 20) | async def run(): function main (line 71) | def main(): FILE: examples/snippets/clients/display_utilities.py function display_tools (line 20) | async def display_tools(session: ClientSession): function display_resources (line 32) | async def display_resources(session: ClientSession): function run (line 46) | async def run(): function main (line 60) | def main(): FILE: examples/snippets/clients/oauth_client.py class InMemoryTokenStorage (line 21) | class InMemoryTokenStorage(TokenStorage): method __init__ (line 24) | def __init__(self): method get_tokens (line 28) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 32) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 36) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 40) | async def set_client_info(self, client_info: OAuthClientInformationFul... function handle_redirect (line 45) | async def handle_redirect(auth_url: str) -> None: function handle_callback (line 49) | async def handle_callback() -> tuple[str, str | None]: function main (line 55) | async def main(): function run (line 83) | def run(): FILE: examples/snippets/clients/pagination_client.py function list_all_resources (line 10) | async def list_all_resources() -> None: FILE: examples/snippets/clients/parsing_tool_results.py function parse_tool_results (line 9) | async def parse_tool_results(): function main (line 55) | async def main(): FILE: examples/snippets/clients/stdio_client.py function handle_sampling_message (line 21) | async def handle_sampling_message( function run (line 36) | async def run(): function main (line 74) | def main(): FILE: examples/snippets/clients/streamable_basic.py function main (line 11) | async def main(): FILE: examples/snippets/clients/url_elicitation_client.py function handle_elicitation (line 38) | async def handle_elicitation( function handle_url_elicitation (line 60) | async def handle_url_elicitation( function extract_domain (line 128) | def extract_domain(url: str) -> str: function call_tool_with_error_handling (line 136) | async def call_tool_with_error_handling( function print_help (line 180) | def print_help() -> None: function print_tool_result (line 191) | def print_tool_result(result: types.CallToolResult | None) -> None: function handle_list_tools (line 203) | async def handle_list_tools(session: ClientSession) -> None: function handle_call_command (line 214) | async def handle_call_command(session: ClientSession, command: str) -> N... function process_command (line 235) | async def process_command(session: ClientSession, command: str) -> bool: function run_command_loop (line 262) | async def run_command_loop(session: ClientSession) -> None: function main (line 280) | async def main() -> None: function run (line 310) | def run() -> None: FILE: examples/snippets/servers/__init__.py function run_server (line 15) | def run_server(): FILE: examples/snippets/servers/basic_prompt.py function review_code (line 8) | def review_code(code: str) -> str: function debug_error (line 13) | def debug_error(error: str) -> list[base.Message]: FILE: examples/snippets/servers/basic_resource.py function read_document (line 7) | def read_document(name: str) -> str: function get_settings (line 14) | def get_settings() -> str: FILE: examples/snippets/servers/basic_tool.py function sum (line 7) | def sum(a: int, b: int) -> int: function get_weather (line 13) | def get_weather(city: str, unit: str = "celsius") -> str: FILE: examples/snippets/servers/completion.py function github_repo (line 14) | def github_repo(owner: str, repo: str) -> str: function review_code (line 20) | def review_code(language: str, code: str) -> str: function handle_completion (line 26) | async def handle_completion( FILE: examples/snippets/servers/direct_call_tool_result.py class ValidationModel (line 13) | class ValidationModel(BaseModel): function advanced_tool (line 21) | def advanced_tool() -> CallToolResult: function validated_tool (line 30) | def validated_tool() -> Annotated[CallToolResult, ValidationModel]: function empty_result_tool (line 40) | def empty_result_tool() -> CallToolResult: FILE: examples/snippets/servers/direct_execution.py function hello (line 16) | def hello(name: str = "World") -> str: function main (line 21) | def main(): FILE: examples/snippets/servers/elicitation.py class BookingPreferences (line 19) | class BookingPreferences(BaseModel): function book_table (line 30) | async def book_table(date: str, time: str, party_size: int, ctx: Context... function secure_payment (line 54) | async def secure_payment(amount: float, ctx: Context) -> str: function connect_service (line 78) | async def connect_service(service_name: str, ctx: Context) -> str: FILE: examples/snippets/servers/images.py function create_thumbnail (line 11) | def create_thumbnail(image_path: str) -> Image: FILE: examples/snippets/servers/lifespan_example.py class Database (line 11) | class Database: method connect (line 15) | async def connect(cls) -> "Database": method disconnect (line 19) | async def disconnect(self) -> None: method query (line 23) | def query(self) -> str: class AppContext (line 29) | class AppContext: function app_lifespan (line 36) | async def app_lifespan(server: MCPServer) -> AsyncIterator[AppContext]: function query_db (line 53) | def query_db(ctx: Context[AppContext]) -> str: FILE: examples/snippets/servers/lowlevel/basic.py function handle_list_prompts (line 12) | async def handle_list_prompts( function handle_get_prompt (line 27) | async def handle_get_prompt(ctx: ServerRequestContext, params: types.Get... function run (line 52) | async def run(): FILE: examples/snippets/servers/lowlevel/direct_call_tool_result.py function handle_list_tools (line 12) | async def handle_list_tools( function handle_call_tool (line 31) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function run (line 51) | async def run(): FILE: examples/snippets/servers/lowlevel/lifespan.py class Database (line 15) | class Database: method connect (line 19) | async def connect(cls) -> "Database": method disconnect (line 24) | async def disconnect(self) -> None: method query (line 28) | async def query(self, query_str: str) -> list[dict[str, str]]: class AppContext (line 34) | class AppContext(TypedDict): function server_lifespan (line 39) | async def server_lifespan(_server: Server[AppContext]) -> AsyncIterator[... function handle_list_tools (line 48) | async def handle_list_tools( function handle_call_tool (line 67) | async def handle_call_tool( function run (line 88) | async def run(): FILE: examples/snippets/servers/lowlevel/structured_output.py function handle_list_tools (line 13) | async def handle_list_tools( function handle_call_tool (line 42) | async def handle_call_tool(ctx: ServerRequestContext, params: types.Call... function run (line 69) | async def run(): FILE: examples/snippets/servers/mcpserver_quickstart.py function add (line 15) | def add(a: int, b: int) -> int: function get_greeting (line 22) | def get_greeting(name: str) -> str: function greet_user (line 29) | def greet_user(name: str, style: str = "friendly") -> str: FILE: examples/snippets/servers/notifications.py function process_data (line 7) | async def process_data(data: str, ctx: Context) -> str: FILE: examples/snippets/servers/oauth_server.py class SimpleTokenVerifier (line 12) | class SimpleTokenVerifier(TokenVerifier): method verify_token (line 15) | async def verify_token(self, token: str) -> AccessToken | None: function get_weather (line 34) | async def get_weather(city: str = "London") -> dict[str, str]: FILE: examples/snippets/servers/pagination_example.py function handle_list_resources (line 10) | async def handle_list_resources( FILE: examples/snippets/servers/sampling.py function generate_poem (line 8) | async def generate_poem(topic: str, ctx: Context) -> str: FILE: examples/snippets/servers/streamable_config.py function greet (line 12) | def greet(name: str = "World") -> str: FILE: examples/snippets/servers/streamable_http_basic_mounting.py function hello (line 19) | def hello() -> str: function lifespan (line 26) | async def lifespan(app: Starlette): FILE: examples/snippets/servers/streamable_http_host_mounting.py function domain_info (line 19) | def domain_info() -> str: function lifespan (line 26) | async def lifespan(app: Starlette): FILE: examples/snippets/servers/streamable_http_multiple_servers.py function api_status (line 20) | def api_status() -> str: function send_message (line 26) | def send_message(message: str) -> str: function lifespan (line 33) | async def lifespan(app: Starlette): FILE: examples/snippets/servers/streamable_http_path_config.py function process_data (line 17) | def process_data(data: str) -> str: FILE: examples/snippets/servers/streamable_starlette_mount.py function echo (line 17) | def echo(message: str) -> str: function add_two (line 27) | def add_two(n: int) -> int: function lifespan (line 34) | async def lifespan(app: Starlette): FILE: examples/snippets/servers/structured_output.py class WeatherData (line 13) | class WeatherData(BaseModel): function get_weather (line 23) | def get_weather(city: str) -> WeatherData: class LocationInfo (line 35) | class LocationInfo(TypedDict): function get_location (line 42) | def get_location(address: str) -> LocationInfo: function get_statistics (line 49) | def get_statistics(data_type: str) -> dict[str, float]: class UserProfile (line 55) | class UserProfile: method __init__ (line 60) | def __init__(self, name: str, age: int, email: str | None = None): function get_user (line 67) | def get_user(user_id: str) -> UserProfile: class UntypedConfig (line 73) | class UntypedConfig: method __init__ (line 74) | def __init__(self, setting1, setting2): # type: ignore[reportMissingP... function get_config (line 80) | def get_config() -> UntypedConfig: function list_cities (line 87) | def list_cities() -> list[str]: function get_temperature (line 94) | def get_temperature(city: str) -> float: FILE: examples/snippets/servers/tool_progress.py function long_running_task (line 7) | async def long_running_task(task_name: str, ctx: Context, steps: int = 5... FILE: scripts/update_readme_snippets.py function get_github_url (line 18) | def get_github_url(file_path: str) -> str: function process_snippet_block (line 31) | def process_snippet_block(match: re.Match[str], check_mode: bool = False... function update_readme_snippets (line 94) | def update_readme_snippets(readme_path: Path = Path("README.md"), check_... function main (line 141) | def main(): FILE: src/mcp/cli/claude.py function get_claude_config_path (line 17) | def get_claude_config_path() -> Path | None: # pragma: no cover function get_uv_path (line 33) | def get_uv_path() -> str: function update_claude_config (line 44) | def update_claude_config( FILE: src/mcp/cli/cli.py function _get_npx_command (line 42) | def _get_npx_command(): function _parse_env_var (line 56) | def _parse_env_var(env_var: str) -> tuple[str, str]: # pragma: no cover function _build_uv_command (line 65) | def _build_uv_command( function _parse_file_path (line 88) | def _parse_file_path(file_spec: str) -> tuple[Path, str | None]: function _import_server (line 119) | def _import_server(file: Path, server_object: str | None = None): # pra... function version (line 210) | def version() -> None: # pragma: no cover function dev (line 221) | def dev( function run (line 304) | def run( function install (line 361) | def install( FILE: src/mcp/client/__main__.py function message_handler (line 25) | async def message_handler( function run_session (line 35) | async def run_session( function main (line 51) | async def main(command_or_url: str, args: list[str], env: list[tuple[str... function cli (line 65) | def cli(): FILE: src/mcp/client/_memory.py class InMemoryTransport (line 18) | class InMemoryTransport: method __init__ (line 26) | def __init__(self, server: Server[Any] | MCPServer, *, raise_exception... method _connect (line 38) | async def _connect(self) -> AsyncIterator[TransportStreams]: method __aenter__ (line 67) | async def __aenter__(self) -> TransportStreams: method __aexit__ (line 72) | async def __aexit__( FILE: src/mcp/client/_transport.py class Transport (line 15) | class Transport(AbstractAsyncContextManager[TransportStreams], Protocol): FILE: src/mcp/client/auth/exceptions.py class OAuthFlowError (line 1) | class OAuthFlowError(Exception): class OAuthTokenError (line 5) | class OAuthTokenError(OAuthFlowError): class OAuthRegistrationError (line 9) | class OAuthRegistrationError(OAuthFlowError): FILE: src/mcp/client/auth/extensions/client_credentials.py class ClientCredentialsOAuthProvider (line 24) | class ClientCredentialsOAuthProvider(OAuthClientProvider): method __init__ (line 41) | def __init__( method _initialize (line 79) | async def _initialize(self) -> None: method _perform_authorization (line 85) | async def _perform_authorization(self) -> httpx.Request: method _exchange_token_client_credentials (line 89) | async def _exchange_token_client_credentials(self) -> httpx.Request: function static_assertion_provider (line 110) | def static_assertion_provider(token: str) -> Callable[[str], Awaitable[s... class SignedJWTParameters (line 139) | class SignedJWTParameters(BaseModel): method create_assertion_provider (line 168) | def create_assertion_provider(self) -> Callable[[str], Awaitable[str]]: class PrivateKeyJWTOAuthProvider (line 194) | class PrivateKeyJWTOAuthProvider(OAuthClientProvider): method __init__ (line 254) | def __init__( method _initialize (line 293) | async def _initialize(self) -> None: method _perform_authorization (line 299) | async def _perform_authorization(self) -> httpx.Request: method _add_client_authentication_jwt (line 303) | async def _add_client_authentication_jwt(self, *, token_data: dict[str... method _exchange_token_client_credentials (line 317) | async def _exchange_token_client_credentials(self) -> httpx.Request: class JWTParameters (line 338) | class JWTParameters(BaseModel): method to_assertion (line 355) | def to_assertion(self, with_audience_fallback: str | None = None) -> str: class RFC7523OAuthClientProvider (line 390) | class RFC7523OAuthClientProvider(OAuthClientProvider): method __init__ (line 402) | def __init__( method _exchange_token_authorization_code (line 421) | async def _exchange_token_authorization_code( method _perform_authorization (line 430) | async def _perform_authorization(self) -> httpx.Request: # pragma: no... method _add_client_authentication_jwt (line 438) | def _add_client_authentication_jwt(self, *, token_data: dict[str, Any]... method _exchange_token_jwt_bearer (line 457) | async def _exchange_token_jwt_bearer(self) -> httpx.Request: FILE: src/mcp/client/auth/oauth2.py class PKCEParameters (line 56) | class PKCEParameters(BaseModel): method generate (line 63) | def generate(cls) -> "PKCEParameters": class TokenStorage (line 71) | class TokenStorage(Protocol): method get_tokens (line 74) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 78) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 82) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 86) | async def set_client_info(self, client_info: OAuthClientInformationFul... class OAuthContext (line 92) | class OAuthContext: method get_authorization_base_url (line 119) | def get_authorization_base_url(self, server_url: str) -> str: method update_token_expiry (line 124) | def update_token_expiry(self, token: OAuthToken) -> None: method is_token_valid (line 128) | def is_token_valid(self) -> bool: method can_refresh_token (line 136) | def can_refresh_token(self) -> bool: method clear_tokens (line 140) | def clear_tokens(self) -> None: method get_resource_url (line 145) | def get_resource_url(self) -> str: method should_include_resource_param (line 160) | def should_include_resource_param(self, protocol_version: str | None =... method prepare_token_auth (line 179) | def prepare_token_auth( class OAuthClientProvider (line 217) | class OAuthClientProvider(httpx.Auth): method __init__ (line 225) | def __init__( method _handle_protected_resource_response (line 276) | async def _handle_protected_resource_response(self, response: httpx.Re... method _perform_authorization (line 307) | async def _perform_authorization(self) -> httpx.Request: method _perform_authorization_code_grant (line 313) | async def _perform_authorization_code_grant(self) -> tuple[str, str]: method _get_token_endpoint (line 366) | def _get_token_endpoint(self) -> str: method _exchange_token_authorization_code (line 374) | async def _exchange_token_authorization_code( method _handle_token_response (line 405) | async def _handle_token_response(self, response: httpx.Response) -> None: method _refresh_token (line 420) | async def _refresh_token(self) -> httpx.Request: method _handle_refresh_response (line 450) | async def _handle_refresh_response(self, response: httpx.Response) -> ... method _initialize (line 471) | async def _initialize(self) -> None: # pragma: no cover method _add_auth_header (line 477) | def _add_auth_header(self, request: httpx.Request) -> None: method _handle_oauth_metadata_response (line 482) | async def _handle_oauth_metadata_response(self, response: httpx.Respon... method _validate_resource_match (line 487) | async def _validate_resource_match(self, prm: ProtectedResourceMetadat... method async_auth_flow (line 501) | async def async_auth_flow(self, request: httpx.Request) -> AsyncGenera... FILE: src/mcp/client/auth/utils.py function extract_field_from_www_auth (line 19) | def extract_field_from_www_auth(response: Response, field_name: str) -> ... function extract_scope_from_www_auth (line 40) | def extract_scope_from_www_auth(response: Response) -> str | None: function extract_resource_metadata_from_www_auth (line 49) | def extract_resource_metadata_from_www_auth(response: Response) -> str |... function build_protected_resource_metadata_discovery_urls (line 61) | def build_protected_resource_metadata_discovery_urls(www_auth_url: str |... function get_client_metadata_scopes (line 98) | def get_client_metadata_scopes( function build_oauth_authorization_server_metadata_discovery_urls (line 122) | def build_oauth_authorization_server_metadata_discovery_urls(auth_server... function handle_protected_resource_response (line 165) | async def handle_protected_resource_response( function handle_auth_metadata_response (line 189) | async def handle_auth_metadata_response(response: Response) -> tuple[boo... function create_oauth_metadata_request (line 202) | def create_oauth_metadata_request(url: str) -> Request: function create_client_registration_request (line 206) | def create_client_registration_request( function handle_registration_response (line 221) | async def handle_registration_response(response: Response) -> OAuthClien... function is_valid_client_metadata_url (line 237) | def is_valid_client_metadata_url(url: str | None) -> bool: function should_use_client_metadata_url (line 257) | def should_use_client_metadata_url( function create_client_info_from_metadata_url (line 283) | def create_client_info_from_metadata_url( function handle_token_response_scopes (line 306) | async def handle_token_response_scopes( FILE: src/mcp/client/client.py class Client (line 37) | class Client: method __post_init__ (line 102) | def __post_init__(self) -> None: method __aenter__ (line 110) | async def __aenter__(self) -> Client: method __aexit__ (line 138) | async def __aexit__(self, exc_type: type[BaseException] | None, exc_va... method session (line 145) | def session(self) -> ClientSession: method initialize_result (line 158) | def initialize_result(self) -> InitializeResult: method send_ping (line 169) | async def send_ping(self, *, meta: RequestParamsMeta | None = None) ->... method send_progress_notification (line 173) | async def send_progress_notification( method set_logging_level (line 188) | async def set_logging_level(self, level: LoggingLevel, *, meta: Reques... method list_resources (line 192) | async def list_resources( method list_resource_templates (line 201) | async def list_resource_templates( method read_resource (line 210) | async def read_resource(self, uri: str, *, meta: RequestParamsMeta | N... method subscribe_resource (line 222) | async def subscribe_resource(self, uri: str, *, meta: RequestParamsMet... method unsubscribe_resource (line 226) | async def unsubscribe_resource(self, uri: str, *, meta: RequestParamsM... method call_tool (line 230) | async def call_tool( method list_prompts (line 259) | async def list_prompts( method get_prompt (line 268) | async def get_prompt( method complete (line 283) | async def complete( method list_tools (line 301) | async def list_tools(self, *, cursor: str | None = None, meta: Request... method send_roots_list_changed (line 305) | async def send_roots_list_changed(self) -> None: FILE: src/mcp/client/experimental/task_handlers.py class GetTaskHandlerFnT (line 29) | class GetTaskHandlerFnT(Protocol): method __call__ (line 35) | async def __call__( class GetTaskResultHandlerFnT (line 42) | class GetTaskResultHandlerFnT(Protocol): method __call__ (line 48) | async def __call__( class ListTasksHandlerFnT (line 55) | class ListTasksHandlerFnT(Protocol): method __call__ (line 61) | async def __call__( class CancelTaskHandlerFnT (line 68) | class CancelTaskHandlerFnT(Protocol): method __call__ (line 74) | async def __call__( class TaskAugmentedSamplingFnT (line 81) | class TaskAugmentedSamplingFnT(Protocol): method __call__ (line 91) | async def __call__( class TaskAugmentedElicitationFnT (line 99) | class TaskAugmentedElicitationFnT(Protocol): method __call__ (line 109) | async def __call__( function default_get_task_handler (line 117) | async def default_get_task_handler( function default_get_task_result_handler (line 127) | async def default_get_task_result_handler( function default_list_tasks_handler (line 137) | async def default_list_tasks_handler( function default_cancel_task_handler (line 147) | async def default_cancel_task_handler( function default_task_augmented_sampling (line 157) | async def default_task_augmented_sampling( function default_task_augmented_elicitation (line 168) | async def default_task_augmented_elicitation( class ExperimentalTaskHandlers (line 180) | class ExperimentalTaskHandlers: method build_capability (line 209) | def build_capability(self) -> types.ClientTasksCapability | None: method handles_request (line 246) | def handles_request(request: types.ServerRequest) -> bool: method handle_request (line 253) | async def handle_request( FILE: src/mcp/client/experimental/tasks.py class ExperimentalClientFeatures (line 41) | class ExperimentalClientFeatures: method __init__ (line 50) | def __init__(self, session: "ClientSession") -> None: method call_tool_as_task (line 53) | async def call_tool_as_task( method get_task (line 107) | async def get_task(self, task_id: str) -> types.GetTaskResult: method get_task_result (line 121) | async def get_task_result( method list_tasks (line 146) | async def list_tasks( method cancel_task (line 164) | async def cancel_task(self, task_id: str) -> types.CancelTaskResult: method poll_task (line 180) | async def poll_task(self, task_id: str) -> AsyncIterator[types.GetTask... FILE: src/mcp/client/session.py class SamplingFnT (line 24) | class SamplingFnT(Protocol): method __call__ (line 25) | async def __call__( class ElicitationFnT (line 32) | class ElicitationFnT(Protocol): method __call__ (line 33) | async def __call__( class ListRootsFnT (line 40) | class ListRootsFnT(Protocol): method __call__ (line 41) | async def __call__( class LoggingFnT (line 46) | class LoggingFnT(Protocol): method __call__ (line 47) | async def __call__(self, params: types.LoggingMessageNotificationParam... class MessageHandlerFnT (line 50) | class MessageHandlerFnT(Protocol): method __call__ (line 51) | async def __call__( function _default_message_handler (line 57) | async def _default_message_handler( function _default_sampling_callback (line 63) | async def _default_sampling_callback( function _default_elicitation_callback (line 73) | async def _default_elicitation_callback( function _default_list_roots_callback (line 83) | async def _default_list_roots_callback( function _default_logging_callback (line 92) | async def _default_logging_callback( class ClientSession (line 101) | class ClientSession( method __init__ (line 110) | def __init__( method _receive_request_adapter (line 141) | def _receive_request_adapter(self) -> TypeAdapter[types.ServerRequest]: method _receive_notification_adapter (line 145) | def _receive_notification_adapter(self) -> TypeAdapter[types.ServerNot... method initialize (line 148) | async def initialize(self) -> types.InitializeResult: method initialize_result (line 195) | def initialize_result(self) -> types.InitializeResult | None: method experimental (line 203) | def experimental(self) -> ExperimentalClientFeatures: method send_ping (line 219) | async def send_ping(self, *, meta: RequestParamsMeta | None = None) ->... method send_progress_notification (line 223) | async def send_progress_notification( method set_logging_level (line 245) | async def set_logging_level( method list_resources (line 257) | async def list_resources(self, *, params: types.PaginatedRequestParams... method list_resource_templates (line 265) | async def list_resource_templates( method read_resource (line 278) | async def read_resource(self, uri: str, *, meta: RequestParamsMeta | N... method subscribe_resource (line 285) | async def subscribe_resource(self, uri: str, *, meta: RequestParamsMet... method unsubscribe_resource (line 292) | async def unsubscribe_resource(self, uri: str, *, meta: RequestParamsM... method call_tool (line 299) | async def call_tool( method _validate_tool_result (line 324) | async def _validate_tool_result(self, name: str, result: types.CallToo... method list_prompts (line 350) | async def list_prompts(self, *, params: types.PaginatedRequestParams |... method get_prompt (line 358) | async def get_prompt( method complete (line 371) | async def complete( method list_tools (line 393) | async def list_tools(self, *, params: types.PaginatedRequestParams | N... method send_roots_list_changed (line 411) | async def send_roots_list_changed(self) -> None: # pragma: no cover method _received_request (line 415) | async def _received_request(self, responder: RequestResponder[types.Se... method _handle_incoming (line 461) | async def _handle_incoming( method _received_notification (line 468) | async def _received_notification(self, notification: types.ServerNotif... FILE: src/mcp/client/session_group.py class SseServerParameters (line 32) | class SseServerParameters(BaseModel): class StreamableHttpParameters (line 48) | class StreamableHttpParameters(BaseModel): class ClientSessionParameters (line 73) | class ClientSessionParameters: class ClientSessionGroup (line 85) | class ClientSessionGroup: class _ComponentNames (line 104) | class _ComponentNames(BaseModel): method __init__ (line 128) | def __init__( method __aenter__ (line 150) | async def __aenter__(self) -> Self: # pragma: no cover method __aexit__ (line 156) | async def __aexit__( method sessions (line 174) | def sessions(self) -> list[mcp.ClientSession]: method prompts (line 179) | def prompts(self) -> dict[str, types.Prompt]: method resources (line 184) | def resources(self) -> dict[str, types.Resource]: method tools (line 189) | def tools(self) -> dict[str, types.Tool]: method call_tool (line 193) | async def call_tool( method disconnect_from_server (line 213) | async def disconnect_from_server(self, session: mcp.ClientSession) -> ... method connect_with_session (line 248) | async def connect_with_session( method connect_to_server (line 255) | async def connect_to_server( method _establish_session (line 264) | async def _establish_session( method _aggregate_components (line 332) | async def _aggregate_components(self, server_info: types.Implementatio... method _component_name (line 407) | def _component_name(self, name: str, server_info: types.Implementation... FILE: src/mcp/client/sse.py function remove_request_params (line 21) | def remove_request_params(url: str) -> str: function _extract_session_id_from_endpoint (line 25) | def _extract_session_id_from_endpoint(endpoint_url: str) -> str | None: function sse_client (line 31) | async def sse_client( FILE: src/mcp/client/stdio.py function get_default_environment (line 51) | def get_default_environment() -> dict[str, str]: class StdioServerParameters (line 71) | class StdioServerParameters(BaseModel): function stdio_client (line 105) | async def stdio_client(server: StdioServerParameters, errlog: TextIO = s... function _get_executable_command (line 214) | def _get_executable_command(command: str) -> str: function _create_platform_compatible_process (line 229) | async def _create_platform_compatible_process( function _terminate_process_tree (line 255) | async def _terminate_process_tree(process: Process | FallbackProcess, ti... FILE: src/mcp/client/streamable_http.py class StreamableHTTPError (line 53) | class StreamableHTTPError(Exception): class ResumptionError (line 57) | class ResumptionError(StreamableHTTPError): class RequestContext (line 62) | class RequestContext: class StreamableHTTPTransport (line 72) | class StreamableHTTPTransport: method __init__ (line 75) | def __init__(self, url: str) -> None: method _prepare_headers (line 85) | def _prepare_headers(self) -> dict[str, str]: method _is_initialization_request (line 102) | def _is_initialization_request(self, message: JSONRPCMessage) -> bool: method _is_initialized_notification (line 106) | def _is_initialized_notification(self, message: JSONRPCMessage) -> bool: method _maybe_extract_session_id_from_response (line 110) | def _maybe_extract_session_id_from_response(self, response: httpx.Resp... method _maybe_extract_protocol_version_from_message (line 117) | def _maybe_extract_protocol_version_from_message(self, message: JSONRP... method _handle_sse_event (line 129) | async def _handle_sse_event( method handle_get_stream (line 181) | async def handle_get_stream(self, client: httpx.AsyncClient, read_stre... method _handle_resumption_request (line 226) | async def _handle_resumption_request(self, ctx: RequestContext) -> None: method _handle_post_request (line 254) | async def _handle_post_request(self, ctx: RequestContext) -> None: method _handle_json_response (line 303) | async def _handle_json_response( method _handle_sse_response (line 328) | async def _handle_sse_response( method _handle_reconnection (line 374) | async def _handle_reconnection( method post_writer (line 432) | async def post_writer( method terminate_session (line 484) | async def terminate_session(self, client: httpx.AsyncClient) -> None: method get_session_id (line 501) | def get_session_id(self) -> str | None: function streamable_http_client (line 510) | async def streamable_http_client( FILE: src/mcp/client/websocket.py function websocket_client (line 16) | async def websocket_client( FILE: src/mcp/os/posix/utilities.py function terminate_posix_process_tree (line 13) | async def terminate_posix_process_tree(process: Process, timeout_seconds... FILE: src/mcp/os/win32/utilities.py function get_windows_executable_command (line 34) | def get_windows_executable_command(command: str) -> str: class FallbackProcess (line 65) | class FallbackProcess: method __init__ (line 74) | def __init__(self, popen_obj: subprocess.Popen[bytes]): method __aenter__ (line 83) | async def __aenter__(self): method __aexit__ (line 87) | async def __aexit__( method wait (line 109) | async def wait(self): method terminate (line 113) | def terminate(self): method kill (line 117) | def kill(self) -> None: method pid (line 122) | def pid(self) -> int: method returncode (line 127) | def returncode(self) -> int | None: function create_windows_process (line 137) | async def create_windows_process( function _create_windows_fallback_process (line 195) | async def _create_windows_fallback_process( function _create_job_object (line 232) | def _create_job_object() -> int | None: function _maybe_assign_process_to_job (line 249) | def _maybe_assign_process_to_job(process: Process | FallbackProcess, job... function terminate_windows_process_tree (line 278) | async def terminate_windows_process_tree(process: Process | FallbackProc... function terminate_windows_process (line 316) | async def terminate_windows_process(process: Process | FallbackProcess): FILE: src/mcp/server/__main__.py function receive_loop (line 20) | async def receive_loop(session: ServerSession): function main (line 30) | async def main(): FILE: src/mcp/server/auth/errors.py function stringify_pydantic_error (line 4) | def stringify_pydantic_error(validation_error: ValidationError) -> str: FILE: src/mcp/server/auth/handlers/authorize.py class AuthorizationRequest (line 25) | class AuthorizationRequest(BaseModel): class AuthorizationErrorResponse (line 45) | class AuthorizationErrorResponse(BaseModel): function best_effort_extract_string (line 53) | def best_effort_extract_string(key: str, params: None | FormData | Query... class AnyUrlModel (line 62) | class AnyUrlModel(RootModel[AnyUrl]): class AuthorizationHandler (line 67) | class AuthorizationHandler: method handle (line 70) | async def handle(self, request: Request) -> Response: FILE: src/mcp/server/auth/handlers/metadata.py class MetadataHandler (line 11) | class MetadataHandler: method handle (line 14) | async def handle(self, request: Request) -> Response: class ProtectedResourceMetadataHandler (line 22) | class ProtectedResourceMetadataHandler: method handle (line 25) | async def handle(self, request: Request) -> Response: FILE: src/mcp/server/auth/handlers/register.py class RegistrationErrorResponse (line 22) | class RegistrationErrorResponse(BaseModel): class RegistrationHandler (line 28) | class RegistrationHandler: method handle (line 32) | async def handle(self, request: Request) -> Response: FILE: src/mcp/server/auth/handlers/revoke.py class RevocationRequest (line 17) | class RevocationRequest(BaseModel): class RevocationErrorResponse (line 26) | class RevocationErrorResponse(BaseModel): class RevocationHandler (line 32) | class RevocationHandler: method handle (line 36) | async def handle(self, request: Request) -> Response: FILE: src/mcp/server/auth/handlers/token.py class AuthorizationCodeRequest (line 17) | class AuthorizationCodeRequest(BaseModel): class RefreshTokenRequest (line 31) | class RefreshTokenRequest(BaseModel): class TokenErrorResponse (line 47) | class TokenErrorResponse(BaseModel): class TokenHandler (line 62) | class TokenHandler: method response (line 66) | def response(self, obj: TokenSuccessResponse | TokenErrorResponse): method handle (line 80) | async def handle(self, request: Request): FILE: src/mcp/server/auth/json_response.py class PydanticJSONResponse (line 6) | class PydanticJSONResponse(JSONResponse): method render (line 9) | def render(self, content: Any) -> bytes: FILE: src/mcp/server/auth/middleware/auth_context.py function get_access_token (line 13) | def get_access_token() -> AccessToken | None: class AuthContextMiddleware (line 23) | class AuthContextMiddleware: method __init__ (line 32) | def __init__(self, app: ASGIApp): method __call__ (line 35) | async def __call__(self, scope: Scope, receive: Receive, send: Send): FILE: src/mcp/server/auth/middleware/bearer_auth.py class AuthenticatedUser (line 13) | class AuthenticatedUser(SimpleUser): method __init__ (line 16) | def __init__(self, auth_info: AccessToken): class BearerAuthBackend (line 22) | class BearerAuthBackend(AuthenticationBackend): method __init__ (line 25) | def __init__(self, token_verifier: TokenVerifier): method authenticate (line 28) | async def authenticate(self, conn: HTTPConnection): class RequireAuthMiddleware (line 50) | class RequireAuthMiddleware: method __init__ (line 57) | def __init__( method __call__ (line 74) | async def __call__(self, scope: Scope, receive: Receive, send: Send) -... method _send_auth_error (line 94) | async def _send_auth_error(self, send: Send, status_code: int, error: ... FILE: src/mcp/server/auth/middleware/client_auth.py class AuthenticationError (line 14) | class AuthenticationError(Exception): method __init__ (line 15) | def __init__(self, message: str): class ClientAuthenticator (line 19) | class ClientAuthenticator: method __init__ (line 31) | def __init__(self, provider: OAuthAuthorizationServerProvider[Any, Any... method authenticate_request (line 39) | async def authenticate_request(self, request: Request) -> OAuthClientI... FILE: src/mcp/server/auth/provider.py class AuthorizationParams (line 10) | class AuthorizationParams(BaseModel): class AuthorizationCode (line 19) | class AuthorizationCode(BaseModel): class RefreshToken (line 30) | class RefreshToken(BaseModel): class AccessToken (line 37) | class AccessToken(BaseModel): class RegistrationError (line 54) | class RegistrationError(Exception): class AuthorizeError (line 71) | class AuthorizeError(Exception): class TokenError (line 87) | class TokenError(Exception): class TokenVerifier (line 92) | class TokenVerifier(Protocol): method verify_token (line 95) | async def verify_token(self, token: str) -> AccessToken | None: class OAuthAuthorizationServerProvider (line 106) | class OAuthAuthorizationServerProvider(Protocol, Generic[AuthorizationCo... method get_client (line 107) | async def get_client(self, client_id: str) -> OAuthClientInformationFu... method register_client (line 120) | async def register_client(self, client_info: OAuthClientInformationFul... method authorize (line 133) | async def authorize(self, client: OAuthClientInformationFull, params: ... method load_authorization_code (line 176) | async def load_authorization_code( method exchange_authorization_code (line 190) | async def exchange_authorization_code( method load_refresh_token (line 207) | async def load_refresh_token(self, client: OAuthClientInformationFull,... method exchange_refresh_token (line 219) | async def exchange_refresh_token( method load_access_token (line 242) | async def load_access_token(self, token: str) -> AccessTokenT | None: method revoke_token (line 252) | async def revoke_token( function construct_redirect_uri (line 269) | def construct_redirect_uri(redirect_uri_base: str, **params: str | None)... class ProviderTokenVerifier (line 280) | class ProviderTokenVerifier(TokenVerifier): method __init__ (line 288) | def __init__(self, provider: "OAuthAuthorizationServerProvider[Authori... method verify_token (line 291) | async def verify_token(self, token: str) -> AccessToken | None: FILE: src/mcp/server/auth/routes.py function validate_issuer_url (line 24) | def validate_issuer_url(url: AnyHttpUrl): function cors_middleware (line 51) | def cors_middleware( function create_auth_routes (line 64) | def create_auth_routes( function build_metadata (line 145) | def build_metadata( function build_resource_metadata_url (line 185) | def build_resource_metadata_url(resource_server_url: AnyHttpUrl) -> AnyH... function create_protected_resource_routes (line 203) | def create_protected_resource_routes( FILE: src/mcp/server/auth/settings.py class ClientRegistrationOptions (line 4) | class ClientRegistrationOptions(BaseModel): class RevocationOptions (line 11) | class RevocationOptions(BaseModel): class AuthSettings (line 15) | class AuthSettings(BaseModel): FILE: src/mcp/server/context.py class ServerRequestContext (line 18) | class ServerRequestContext(RequestContext[ServerSession], Generic[Lifesp... FILE: src/mcp/server/elicitation.py class AcceptedElicitation (line 17) | class AcceptedElicitation(BaseModel, Generic[ElicitSchemaModelT]): class DeclinedElicitation (line 24) | class DeclinedElicitation(BaseModel): class CancelledElicitation (line 30) | class CancelledElicitation(BaseModel): class AcceptedUrlElicitation (line 39) | class AcceptedUrlElicitation(BaseModel): function _validate_elicitation_schema (line 52) | def _validate_elicitation_schema(schema: type[BaseModel]) -> None: function _is_string_sequence (line 71) | def _is_string_sequence(annotation: type) -> bool: function _is_primitive_field (line 87) | def _is_primitive_field(annotation: type) -> bool: function elicit_with_validation (line 105) | async def elicit_with_validation( function elicit_url (line 145) | async def elicit_url( FILE: src/mcp/server/experimental/request_context.py class Experimental (line 33) | class Experimental: method is_task (line 48) | def is_task(self) -> bool: method client_supports_tasks (line 53) | def client_supports_tasks(self) -> bool: method validate_task_mode (line 59) | def validate_task_mode( method validate_for_tool (line 95) | def validate_for_tool(self, tool: Tool, *, raise_error: bool = True) -... method can_use_tool (line 110) | def can_use_tool(self, tool_task_mode: TaskExecutionMode | None) -> bool: method run_task (line 127) | async def run_task( FILE: src/mcp/server/experimental/session_features.py class ExperimentalServerSessionFeatures (line 26) | class ExperimentalServerSessionFeatures: method __init__ (line 39) | def __init__(self, session: "ServerSession") -> None: method get_task (line 42) | async def get_task(self, task_id: str) -> types.GetTaskResult: method get_task_result (line 56) | async def get_task_result( method poll_task (line 75) | async def poll_task(self, task_id: str) -> AsyncIterator[types.GetTask... method elicit_as_task (line 92) | async def elicit_as_task( method create_message_as_task (line 140) | async def create_message_as_task( FILE: src/mcp/server/experimental/task_context.py class ServerTaskContext (line 50) | class ServerTaskContext: method __init__ (line 75) | def __init__( method task_id (line 102) | def task_id(self) -> str: method task (line 107) | def task(self) -> Task: method is_cancelled (line 112) | def is_cancelled(self) -> bool: method request_cancellation (line 116) | def request_cancellation(self) -> None: method update_status (line 122) | async def update_status(self, message: str, *, notify: bool = True) ->... method complete (line 133) | async def complete(self, result: Result, *, notify: bool = True) -> None: method fail (line 144) | async def fail(self, error: str, *, notify: bool = True) -> None: method _send_notification (line 155) | async def _send_notification(self) -> None: method _check_elicitation_capability (line 174) | def _check_elicitation_capability(self) -> None: method _check_sampling_capability (line 179) | def _check_sampling_capability(self) -> None: method elicit (line 184) | async def elicit( method elicit_url (line 247) | async def elicit_url( method create_message (line 315) | async def create_message( method elicit_as_task (line 407) | async def elicit_as_task( method create_message_as_task (line 484) | async def create_message_as_task( FILE: src/mcp/server/experimental/task_result_handler.py class TaskResultHandler (line 36) | class TaskResultHandler: method __init__ (line 57) | def __init__( method send_message (line 67) | async def send_message( method handle (line 78) | async def handle( method _deliver_queued_messages (line 128) | async def _deliver_queued_messages( method _wait_for_task_update (line 160) | async def _wait_for_task_update(self, task_id: str) -> None: method route_response (line 186) | def route_response(self, request_id: RequestId, response: dict[str, An... method route_error (line 204) | def route_error(self, request_id: RequestId, error: ErrorData) -> bool: FILE: src/mcp/server/experimental/task_support.py class TaskSupport (line 22) | class TaskSupport: method __post_init__ (line 55) | def __post_init__(self) -> None: method task_group (line 60) | def task_group(self) -> TaskGroup: method run (line 71) | async def run(self) -> AsyncIterator[None]: method configure_session (line 89) | def configure_session(self, session: ServerSession) -> None: method in_memory (line 104) | def in_memory(cls) -> "TaskSupport": FILE: src/mcp/server/lowlevel/experimental.py class ExperimentalHandlers (line 46) | class ExperimentalHandlers(Generic[LifespanResultT]): method __init__ (line 52) | def __init__( method task_support (line 64) | def task_support(self) -> TaskSupport | None: method update_capabilities (line 68) | def update_capabilities(self, capabilities: ServerCapabilities) -> None: method enable_tasks (line 83) | def enable_tasks( FILE: src/mcp/server/lowlevel/helper_types.py class ReadResourceContents (line 6) | class ReadResourceContents: FILE: src/mcp/server/lowlevel/server.py class NotificationOptions (line 77) | class NotificationOptions: method __init__ (line 78) | def __init__(self, prompts_changed: bool = False, resources_changed: b... function lifespan (line 85) | async def lifespan(_: Server[LifespanResultT]) -> AsyncIterator[dict[str... function _ping_handler (line 94) | async def _ping_handler(ctx: ServerRequestContext[Any], params: types.Re... class Server (line 98) | class Server(Generic[LifespanResultT]): method __init__ (line 99) | def __init__( method _add_request_handler (line 234) | def _add_request_handler( method _has_handler (line 242) | def _has_handler(self, method: str) -> bool: method create_initialization_options (line 251) | def create_initialization_options( method get_capabilities (line 280) | def get_capabilities( method experimental (line 328) | def experimental(self) -> ExperimentalHandlers[LifespanResultT]: method session_manager (line 343) | def session_manager(self) -> StreamableHTTPSessionManager: method run (line 356) | async def run( method _handle_message (line 401) | async def _handle_message( method _handle_request (line 425) | async def _handle_request( method _handle_notification (line 486) | async def _handle_notification( method streamable_http_app (line 512) | def streamable_http_app( FILE: src/mcp/server/mcpserver/context.py class Context (line 22) | class Context(BaseModel, Generic[LifespanContextT, RequestT]): method __init__ (line 60) | def __init__( method mcp_server (line 73) | def mcp_server(self) -> MCPServer: method request_context (line 80) | def request_context(self) -> ServerRequestContext[LifespanContextT, Re... method report_progress (line 86) | async def report_progress(self, progress: float, total: float | None =... method read_resource (line 107) | async def read_resource(self, uri: str | AnyUrl) -> Iterable[ReadResou... method elicit (line 119) | async def elicit( method elicit_url (line 152) | async def elicit_url( method log (line 187) | async def log( method client_id (line 217) | def client_id(self) -> str | None: method request_id (line 222) | def request_id(self) -> str: method session (line 227) | def session(self): method close_sse_stream (line 231) | async def close_sse_stream(self) -> None: method close_standalone_sse_stream (line 248) | async def close_standalone_sse_stream(self) -> None: method debug (line 264) | async def debug(self, message: str, *, logger_name: str | None = None,... method info (line 268) | async def info(self, message: str, *, logger_name: str | None = None, ... method warning (line 272) | async def warning( method error (line 278) | async def error(self, message: str, *, logger_name: str | None = None,... FILE: src/mcp/server/mcpserver/exceptions.py class MCPServerError (line 4) | class MCPServerError(Exception): class ValidationError (line 8) | class ValidationError(MCPServerError): class ResourceError (line 12) | class ResourceError(MCPServerError): class ToolError (line 16) | class ToolError(MCPServerError): class InvalidSignature (line 20) | class InvalidSignature(Exception): FILE: src/mcp/server/mcpserver/prompts/base.py class Message (line 21) | class Message(BaseModel): method __init__ (line 27) | def __init__(self, content: str | ContentBlock, **kwargs: Any): class UserMessage (line 33) | class UserMessage(Message): method __init__ (line 38) | def __init__(self, content: str | ContentBlock, **kwargs: Any): class AssistantMessage (line 42) | class AssistantMessage(Message): method __init__ (line 47) | def __init__(self, content: str | ContentBlock, **kwargs: Any): class PromptArgument (line 57) | class PromptArgument(BaseModel): class Prompt (line 65) | class Prompt(BaseModel): method from_function (line 77) | def from_function( method render (line 136) | async def render( FILE: src/mcp/server/mcpserver/prompts/manager.py class PromptManager (line 17) | class PromptManager: method __init__ (line 20) | def __init__(self, warn_on_duplicate_prompts: bool = True): method get_prompt (line 24) | def get_prompt(self, name: str) -> Prompt | None: method list_prompts (line 28) | def list_prompts(self) -> list[Prompt]: method add_prompt (line 32) | def add_prompt( method render_prompt (line 48) | async def render_prompt( FILE: src/mcp/server/mcpserver/resources/base.py class Resource (line 17) | class Resource(BaseModel, abc.ABC): method set_default_name (line 33) | def set_default_name(cls, name: str | None, info: ValidationInfo) -> str: method read (line 42) | async def read(self) -> str | bytes: FILE: src/mcp/server/mcpserver/resources/resource_manager.py class ResourceManager (line 22) | class ResourceManager: method __init__ (line 25) | def __init__(self, warn_on_duplicate_resources: bool = True): method add_resource (line 30) | def add_resource(self, resource: Resource) -> Resource: method add_template (line 56) | def add_template( method get_resource (line 83) | async def get_resource(self, uri: AnyUrl | str, context: Context[Lifes... method list_resources (line 102) | def list_resources(self) -> list[Resource]: method list_templates (line 107) | def list_templates(self) -> list[ResourceTemplate]: FILE: src/mcp/server/mcpserver/resources/templates.py class ResourceTemplate (line 23) | class ResourceTemplate(BaseModel): method from_function (line 39) | def from_function( method matches (line 85) | def matches(self, uri: str) -> dict[str, Any] | None: method create_resource (line 98) | async def create_resource( FILE: src/mcp/server/mcpserver/resources/types.py class TextResource (line 20) | class TextResource(Resource): method read (line 25) | async def read(self) -> str: class BinaryResource (line 30) | class BinaryResource(Resource): method read (line 35) | async def read(self) -> bytes: class FunctionResource (line 40) | class FunctionResource(Resource): method read (line 55) | async def read(self) -> str | bytes: method from_function (line 76) | def from_function( class FileResource (line 109) | class FileResource(Resource): method validate_absolute_path (line 127) | def validate_absolute_path(cls, path: Path) -> Path: method set_binary_from_mime_type (line 135) | def set_binary_from_mime_type(cls, is_binary: bool, info: ValidationIn... method read (line 142) | async def read(self) -> str | bytes: class HttpResource (line 152) | class HttpResource(Resource): method read (line 158) | async def read(self) -> str | bytes: class DirectoryResource (line 166) | class DirectoryResource(Resource): method validate_absolute_path (line 176) | def validate_absolute_path(cls, path: Path) -> Path: # pragma: no cover method list_files (line 182) | def list_files(self) -> list[Path]: # pragma: no cover method read (line 196) | async def read(self) -> str: # Always returns JSON string # pragma: ... FILE: src/mcp/server/mcpserver/server.py class Settings (line 80) | class Settings(BaseSettings, Generic[LifespanResultT]): function lifespan_wrapper (line 114) | def lifespan_wrapper( class MCPServer (line 126) | class MCPServer(Generic[LifespanResultT]): method __init__ (line 127) | def __init__( method name (line 201) | def name(self) -> str: method title (line 205) | def title(self) -> str | None: method description (line 209) | def description(self) -> str | None: method instructions (line 213) | def instructions(self) -> str | None: method website_url (line 217) | def website_url(self) -> str | None: method icons (line 221) | def icons(self) -> list[Icon] | None: method version (line 225) | def version(self) -> str | None: method session_manager (line 229) | def session_manager(self) -> StreamableHTTPSessionManager: method run (line 241) | def run(self, transport: Literal["stdio"] = ...) -> None: ... method run (line 244) | def run( method run (line 256) | def run( method run (line 270) | def run( method _handle_list_tools (line 293) | async def _handle_list_tools( method _handle_call_tool (line 298) | async def _handle_call_tool( method _handle_list_resources (line 326) | async def _handle_list_resources( method _handle_read_resource (line 331) | async def _handle_read_resource( method _handle_list_resource_templates (line 358) | async def _handle_list_resource_templates( method _handle_list_prompts (line 363) | async def _handle_list_prompts( method _handle_get_prompt (line 368) | async def _handle_get_prompt( method list_tools (line 374) | async def list_tools(self) -> list[MCPTool]: method call_tool (line 391) | async def call_tool( method list_resources (line 399) | async def list_resources(self) -> list[MCPResource]: method list_resource_templates (line 417) | async def list_resource_templates(self) -> list[MCPResourceTemplate]: method read_resource (line 433) | async def read_resource( method add_tool (line 452) | def add_tool( method remove_tool (line 492) | def remove_tool(self, name: str) -> None: method tool (line 503) | def tool( method completion (line 573) | def completion(self): method add_resource (line 610) | def add_resource(self, resource: Resource) -> None: method resource (line 618) | def resource( method add_prompt (line 730) | def add_prompt(self, prompt: Prompt) -> None: method prompt (line 738) | def prompt( method custom_route (line 796) | def custom_route( method run_stdio_async (line 839) | async def run_stdio_async(self) -> None: method run_sse_async (line 848) | async def run_sse_async( # pragma: no cover method run_streamable_http_async (line 876) | async def run_streamable_http_async( # pragma: no cover method sse_app (line 910) | def sse_app( method streamable_http_app (line 1036) | def streamable_http_app( method list_prompts (line 1063) | async def list_prompts(self) -> list[MCPPrompt]: method get_prompt (line 1084) | async def get_prompt( FILE: src/mcp/server/mcpserver/tools/base.py class Tool (line 23) | class Tool(BaseModel): method output_schema (line 41) | def output_schema(self) -> dict[str, Any] | None: method from_function (line 45) | def from_function( method run (line 92) | async def run( function _is_async_callable (line 123) | def _is_async_callable(obj: Any) -> bool: FILE: src/mcp/server/mcpserver/tools/tool_manager.py class ToolManager (line 18) | class ToolManager: method __init__ (line 21) | def __init__( method get_tool (line 36) | def get_tool(self, name: str) -> Tool | None: method list_tools (line 40) | def list_tools(self) -> list[Tool]: method add_tool (line 44) | def add_tool( method remove_tool (line 74) | def remove_tool(self, name: str) -> None: method call_tool (line 80) | async def call_tool( FILE: src/mcp/server/mcpserver/utilities/context_injection.py function find_context_parameter (line 13) | def find_context_parameter(fn: Callable[..., Any]) -> str | None: function inject_context (line 49) | def inject_context( FILE: src/mcp/server/mcpserver/utilities/func_metadata.py class StrictJsonSchema (line 32) | class StrictJsonSchema(GenerateJsonSchema): method emit_warning (line 38) | def emit_warning(self, kind: JsonSchemaWarningKind, detail: str) -> None: class ArgModelBase (line 43) | class ArgModelBase(BaseModel): method model_dump_one_level (line 46) | def model_dump_one_level(self) -> dict[str, Any]: class FuncMetadata (line 62) | class FuncMetadata(BaseModel): method call_fn_with_arg_validation (line 68) | async def call_fn_with_arg_validation( method convert_result (line 91) | def convert_result(self, result: Any) -> Any: method pre_parse_json (line 125) | def pre_parse_json(self, data: dict[str, Any]) -> dict[str, Any]: function func_metadata (line 170) | def func_metadata( function _try_create_model_and_schema (line 322) | def _try_create_model_and_schema( function _create_model_from_class (line 422) | def _create_model_from_class(cls: type[Any], type_hints: dict[str, Any])... function _create_model_from_typeddict (line 446) | def _create_model_from_typeddict(td_type: type[Any]) -> type[BaseModel]: function _create_wrapped_model (line 467) | def _create_wrapped_model(func_name: str, annotation: Any) -> type[BaseM... function _create_dict_model (line 477) | def _create_dict_model(func_name: str, dict_annotation: Any) -> type[Bas... function _convert_to_content (line 492) | def _convert_to_content(result: Any) -> Sequence[ContentBlock]: FILE: src/mcp/server/mcpserver/utilities/logging.py function get_logger (line 7) | def get_logger(name: str) -> logging.Logger: function configure_logging (line 19) | def configure_logging( FILE: src/mcp/server/mcpserver/utilities/types.py class Image (line 9) | class Image: method __init__ (line 12) | def __init__( method _get_mime_type (line 28) | def _get_mime_type(self) -> str: method to_image_content (line 44) | def to_image_content(self) -> ImageContent: class Audio (line 57) | class Audio: method __init__ (line 60) | def __init__( method _get_mime_type (line 74) | def _get_mime_type(self) -> str: method to_audio_content (line 91) | def to_audio_content(self) -> AudioContent: FILE: src/mcp/server/models.py class InitializationOptions (line 10) | class InitializationOptions(BaseModel): FILE: src/mcp/server/session.py class InitializationState (line 54) | class InitializationState(Enum): class ServerSession (line 67) | class ServerSession( method __init__ (line 80) | def __init__( method _receive_request_adapter (line 100) | def _receive_request_adapter(self) -> TypeAdapter[types.ClientRequest]: method _receive_notification_adapter (line 104) | def _receive_notification_adapter(self) -> TypeAdapter[types.ClientNot... method client_params (line 108) | def client_params(self) -> types.InitializeRequestParams | None: method experimental (line 112) | def experimental(self) -> ExperimentalServerSessionFeatures: method check_client_capability (line 121) | def check_client_capability(self, capability: types.ClientCapabilities... method _receive_loop (line 160) | async def _receive_loop(self) -> None: method _received_request (line 164) | async def _received_request(self, responder: RequestResponder[types.Cl... method _received_notification (line 196) | async def _received_notification(self, notification: types.ClientNotif... method send_log_message (line 206) | async def send_log_message( method send_resource_updated (line 225) | async def send_resource_updated(self, uri: str | AnyUrl) -> None: # p... method create_message (line 234) | async def create_message( method create_message (line 253) | async def create_message( method create_message (line 271) | async def create_message( method list_roots (line 348) | async def list_roots(self) -> types.ListRootsResult: method elicit (line 357) | async def elicit( method elicit_form (line 379) | async def elicit_form( method elicit_url (line 411) | async def elicit_url( method send_ping (line 449) | async def send_ping(self) -> types.EmptyResult: # pragma: no cover method send_progress_notification (line 456) | async def send_progress_notification( method send_resource_list_changed (line 477) | async def send_resource_list_changed(self) -> None: method send_tool_list_changed (line 481) | async def send_tool_list_changed(self) -> None: # pragma: no cover method send_prompt_list_changed (line 485) | async def send_prompt_list_changed(self) -> None: # pragma: no cover method send_elicit_complete (line 489) | async def send_elicit_complete( method _build_elicit_form_request (line 511) | def _build_elicit_form_request( method _build_elicit_url_request (line 556) | def _build_elicit_url_request( method _build_create_message_request (line 601) | def _build_create_message_request( method send_message (line 671) | async def send_message(self, message: SessionMessage) -> None: method _handle_incoming (line 686) | async def _handle_incoming(self, req: ServerRequestResponder) -> None: method incoming_messages (line 690) | def incoming_messages(self) -> MemoryObjectReceiveStream[ServerRequest... FILE: src/mcp/server/sse.py class SseServerTransport (line 63) | class SseServerTransport: method __init__ (line 78) | def __init__(self, endpoint: str, security_settings: TransportSecurity... method connect_sse (line 119) | async def connect_sse(self, scope: Scope, receive: Receive, send: Send... method handle_post_message (line 198) | async def handle_post_message(self, scope: Scope, receive: Receive, se... FILE: src/mcp/server/stdio.py function stdio_server (line 33) | async def stdio_server(stdin: anyio.AsyncFile[str] | None = None, stdout... FILE: src/mcp/server/streamable_http.py class EventMessage (line 70) | class EventMessage: class EventStore (line 80) | class EventStore(ABC): method store_event (line 84) | async def store_event(self, stream_id: StreamId, message: JSONRPCMessa... method replay_events_after (line 97) | async def replay_events_after( class StreamableHTTPServerTransport (line 114) | class StreamableHTTPServerTransport: method __init__ (line 128) | def __init__( method is_terminated (line 176) | def is_terminated(self) -> bool: method close_sse_stream (line 180) | def close_sse_stream(self, request_id: RequestId) -> None: # pragma: ... method close_standalone_sse_stream (line 208) | def close_standalone_sse_stream(self) -> None: # pragma: no cover method _create_session_message (line 227) | def _create_session_message( method _maybe_send_priming_event (line 259) | async def _maybe_send_priming_event( method _create_error_response (line 285) | def _create_error_response( method _create_json_response (line 313) | def _create_json_response( method _get_session_id (line 333) | def _get_session_id(self, request: Request) -> str | None: method _create_event_data (line 337) | def _create_event_data(self, event_message: EventMessage) -> dict[str,... method _clean_up_memory_streams (line 350) | async def _clean_up_memory_streams(self, request_id: RequestId) -> None: method handle_request (line 364) | async def handle_request(self, scope: Scope, receive: Receive, send: S... method _check_accept_headers (line 393) | def _check_accept_headers(self, request: Request) -> tuple[bool, bool]: method _check_content_type (line 410) | def _check_content_type(self, request: Request) -> bool: method _validate_accept_header (line 417) | async def _validate_accept_header(self, request: Request, scope: Scope... method _handle_post_request (line 439) | async def _handle_post_request(self, scope: Scope, request: Request, r... method _handle_get_request (line 648) | async def _handle_get_request(self, request: Request, send: Send) -> N... method _handle_delete_request (line 740) | async def _handle_delete_request(self, request: Request, send: Send) -... method terminate (line 763) | async def terminate(self) -> None: method _handle_unsupported_request (line 794) | async def _handle_unsupported_request(self, request: Request, send: Se... method _validate_request_headers (line 810) | async def _validate_request_headers(self, request: Request, send: Send... method _validate_session (line 817) | async def _validate_session(self, request: Request, send: Send) -> bool: method _validate_protocol_version (line 846) | async def _validate_protocol_version(self, request: Request, send: Sen... method _replay_events (line 868) | async def _replay_events(self, last_event_id: str, request: Request, s... method connect (line 953) | async def connect( FILE: src/mcp/server/streamable_http_manager.py class StreamableHTTPSessionManager (line 32) | class StreamableHTTPSessionManager: method __init__ (line 66) | def __init__( method run (line 100) | async def run(self) -> AsyncIterator[None]: method handle_request (line 139) | async def handle_request(self, scope: Scope, receive: Receive, send: S... method _handle_stateless_request (line 153) | async def _handle_stateless_request(self, scope: Scope, receive: Recei... method _handle_stateful_request (line 190) | async def _handle_stateful_request(self, scope: Scope, receive: Receiv... class StreamableHTTPASGIApp (line 289) | class StreamableHTTPASGIApp: method __init__ (line 292) | def __init__(self, session_manager: StreamableHTTPSessionManager): method __call__ (line 295) | async def __call__(self, scope: Scope, receive: Receive, send: Send) -... FILE: src/mcp/server/transport_security.py class TransportSecuritySettings (line 13) | class TransportSecuritySettings(BaseModel): class TransportSecurityMiddleware (line 36) | class TransportSecurityMiddleware: method __init__ (line 39) | def __init__(self, settings: TransportSecuritySettings | None = None): method _validate_host (line 43) | def _validate_host(self, host: str | None) -> bool: # pragma: no cover method _validate_origin (line 65) | def _validate_origin(self, origin: str | None) -> bool: # pragma: no ... method _validate_content_type (line 87) | def _validate_content_type(self, content_type: str | None) -> bool: method validate_request (line 91) | async def validate_request(self, request: Request, is_post: bool = Fal... FILE: src/mcp/server/validation.py function check_sampling_tools_capability (line 11) | def check_sampling_tools_capability(client_caps: ClientCapabilities | No... function validate_sampling_tools (line 29) | def validate_sampling_tools( function validate_tool_use_result_messages (line 49) | def validate_tool_use_result_messages(messages: list[SamplingMessage]) -... FILE: src/mcp/server/websocket.py function websocket_server (line 14) | async def websocket_server(scope: Scope, receive: Receive, send: Send): FILE: src/mcp/shared/_context.py class RequestContext (line 15) | class RequestContext(Generic[SessionT]): FILE: src/mcp/shared/_httpx_utils.py class McpHttpClientFactory (line 14) | class McpHttpClientFactory(Protocol): # pragma: no branch method __call__ (line 15) | def __call__( # pragma: no branch function create_mcp_http_client (line 23) | def create_mcp_http_client( FILE: src/mcp/shared/auth.py class OAuthToken (line 6) | class OAuthToken(BaseModel): method normalize_token_type (line 17) | def normalize_token_type(cls, v: str | None) -> str | None: class InvalidScopeError (line 25) | class InvalidScopeError(Exception): method __init__ (line 26) | def __init__(self, message: str): class InvalidRedirectUriError (line 30) | class InvalidRedirectUriError(Exception): method __init__ (line 31) | def __init__(self, message: str): class OAuthClientMetadata (line 35) | class OAuthClientMetadata(BaseModel): method validate_scope (line 70) | def validate_scope(self, requested_scope: str | None) -> list[str] | N... method validate_redirect_uri (line 80) | def validate_redirect_uri(self, redirect_uri: AnyUrl | None) -> AnyUrl: class OAuthClientInformationFull (line 92) | class OAuthClientInformationFull(OAuthClientMetadata): class OAuthMetadata (line 103) | class OAuthMetadata(BaseModel): class ProtectedResourceMetadata (line 132) | class ProtectedResourceMetadata(BaseModel): FILE: src/mcp/shared/auth_utils.py function resource_url_from_server_url (line 9) | def resource_url_from_server_url(url: str | HttpUrl | AnyUrl) -> str: function check_resource_allowed (line 31) | def check_resource_allowed(requested_resource: str, configured_resource:... function calculate_token_expiry (line 68) | def calculate_token_expiry(expires_in: int | str | None) -> float | None: FILE: src/mcp/shared/exceptions.py class MCPError (line 8) | class MCPError(Exception): method __init__ (line 13) | def __init__(self, code: int, message: str, data: Any = None): method code (line 21) | def code(self) -> int: method message (line 25) | def message(self) -> str: method data (line 29) | def data(self) -> Any: method from_jsonrpc_error (line 33) | def from_jsonrpc_error(cls, error: JSONRPCError) -> MCPError: method from_error_data (line 37) | def from_error_data(cls, error: ErrorData) -> MCPError: method __str__ (line 40) | def __str__(self) -> str: class StatelessModeNotSupported (line 44) | class StatelessModeNotSupported(RuntimeError): method __init__ (line 52) | def __init__(self, method: str): class UrlElicitationRequiredError (line 61) | class UrlElicitationRequiredError(MCPError): method __init__ (line 79) | def __init__(self, elicitations: list[ElicitRequestURLParams], message... method elicitations (line 93) | def elicitations(self) -> list[ElicitRequestURLParams]: method from_error (line 98) | def from_error(cls, error: ErrorData) -> UrlElicitationRequiredError: FILE: src/mcp/shared/experimental/tasks/capabilities.py function check_tasks_capability (line 14) | def check_tasks_capability( function has_task_augmented_elicitation (line 51) | def has_task_augmented_elicitation(caps: ClientCapabilities) -> bool: function has_task_augmented_sampling (line 62) | def has_task_augmented_sampling(caps: ClientCapabilities) -> bool: function require_task_augmented_elicitation (line 73) | def require_task_augmented_elicitation(client_caps: ClientCapabilities |... function require_task_augmented_sampling (line 86) | def require_task_augmented_sampling(client_caps: ClientCapabilities | No... FILE: src/mcp/shared/experimental/tasks/context.py class TaskContext (line 12) | class TaskContext: method __init__ (line 34) | def __init__(self, task: Task, store: TaskStore): method task_id (line 40) | def task_id(self) -> str: method task (line 45) | def task(self) -> Task: method is_cancelled (line 50) | def is_cancelled(self) -> bool: method request_cancellation (line 54) | def request_cancellation(self) -> None: method update_status (line 62) | async def update_status(self, message: str) -> None: method complete (line 73) | async def complete(self, result: Result) -> None: method fail (line 85) | async def fail(self, error: str) -> None: FILE: src/mcp/shared/experimental/tasks/helpers.py function is_terminal (line 36) | def is_terminal(status: TaskStatus) -> bool: function cancel_task (line 50) | async def cancel_task( function generate_task_id (line 92) | def generate_task_id() -> str: function create_task_state (line 97) | def create_task_state( function task_execution (line 124) | async def task_execution( FILE: src/mcp/shared/experimental/tasks/in_memory_task_store.py class StoredTask (line 21) | class StoredTask: class InMemoryTaskStore (line 30) | class InMemoryTaskStore(TaskStore): method __init__ (line 46) | def __init__(self, page_size: int = 10) -> None: method _calculate_expiry (line 51) | def _calculate_expiry(self, ttl_ms: int | None) -> datetime | None: method _is_expired (line 57) | def _is_expired(self, stored: StoredTask) -> bool: method _cleanup_expired (line 63) | def _cleanup_expired(self) -> None: method create_task (line 69) | async def create_task( method get_task (line 92) | async def get_task(self, task_id: str) -> Task | None: method update_task (line 104) | async def update_task( method store_result (line 140) | async def store_result(self, task_id: str, result: Result) -> None: method get_result (line 148) | async def get_result(self, task_id: str) -> Result | None: method list_tasks (line 156) | async def list_tasks( method delete_task (line 184) | async def delete_task(self, task_id: str) -> bool: method wait_for_update (line 192) | async def wait_for_update(self, task_id: str) -> None: method notify_update (line 202) | async def notify_update(self, task_id: str) -> None: method cleanup (line 209) | def cleanup(self) -> None: method get_all_tasks (line 214) | def get_all_tasks(self) -> list[Task]: FILE: src/mcp/shared/experimental/tasks/message_queue.py class QueuedMessage (line 27) | class QueuedMessage: class TaskMessageQueue (line 50) | class TaskMessageQueue(ABC): method enqueue (line 65) | async def enqueue(self, task_id: str, message: QueuedMessage) -> None: method dequeue (line 74) | async def dequeue(self, task_id: str) -> QueuedMessage | None: method peek (line 85) | async def peek(self, task_id: str) -> QueuedMessage | None: method is_empty (line 96) | async def is_empty(self, task_id: str) -> bool: method clear (line 107) | async def clear(self, task_id: str) -> list[QueuedMessage]: method wait_for_message (line 120) | async def wait_for_message(self, task_id: str) -> None: method notify_message_available (line 132) | async def notify_message_available(self, task_id: str) -> None: class InMemoryTaskMessageQueue (line 142) | class InMemoryTaskMessageQueue(TaskMessageQueue): method __init__ (line 154) | def __init__(self) -> None: method _get_queue (line 158) | def _get_queue(self, task_id: str) -> deque[QueuedMessage]: method enqueue (line 164) | async def enqueue(self, task_id: str, message: QueuedMessage) -> None: method dequeue (line 171) | async def dequeue(self, task_id: str) -> QueuedMessage | None: method peek (line 178) | async def peek(self, task_id: str) -> QueuedMessage | None: method is_empty (line 185) | async def is_empty(self, task_id: str) -> bool: method clear (line 190) | async def clear(self, task_id: str) -> list[QueuedMessage]: method wait_for_message (line 197) | async def wait_for_message(self, task_id: str) -> None: method notify_message_available (line 214) | async def notify_message_available(self, task_id: str) -> None: method cleanup (line 219) | def cleanup(self, task_id: str | None = None) -> None: FILE: src/mcp/shared/experimental/tasks/polling.py function poll_until_terminal (line 17) | async def poll_until_terminal( FILE: src/mcp/shared/experimental/tasks/resolver.py class Resolver (line 14) | class Resolver(Generic[T]): method __init__ (line 29) | def __init__(self) -> None: method set_result (line 34) | def set_result(self, value: T) -> None: method set_exception (line 41) | def set_exception(self, exc: BaseException) -> None: method wait (line 48) | async def wait(self) -> T: method done (line 56) | def done(self) -> bool: FILE: src/mcp/shared/experimental/tasks/store.py class TaskStore (line 8) | class TaskStore(ABC): method create_task (line 18) | async def create_task( method get_task (line 37) | async def get_task(self, task_id: str) -> Task | None: method update_task (line 48) | async def update_task( method store_result (line 72) | async def store_result(self, task_id: str, result: Result) -> None: method get_result (line 84) | async def get_result(self, task_id: str) -> Result | None: method list_tasks (line 95) | async def list_tasks( method delete_task (line 109) | async def delete_task(self, task_id: str) -> bool: method wait_for_update (line 120) | async def wait_for_update(self, task_id: str) -> None: method notify_update (line 137) | async def notify_update(self, task_id: str) -> None: FILE: src/mcp/shared/memory.py function create_client_server_memory_streams (line 17) | async def create_client_server_memory_streams() -> AsyncGenerator[tuple[... FILE: src/mcp/shared/message.py class ClientMessageMetadata (line 22) | class ClientMessageMetadata: class ServerMessageMetadata (line 30) | class ServerMessageMetadata: class SessionMessage (line 48) | class SessionMessage: FILE: src/mcp/shared/metadata_utils.py function get_display_name (line 10) | def get_display_name(obj: Tool | Resource | Prompt | ResourceTemplate | ... FILE: src/mcp/shared/response_router.py class ResponseRouter (line 21) | class ResponseRouter(Protocol): method route_response (line 39) | def route_response(self, request_id: RequestId, response: dict[str, An... method route_error (line 51) | def route_error(self, request_id: RequestId, error: ErrorData) -> bool: FILE: src/mcp/shared/session.py class ProgressFnT (line 48) | class ProgressFnT(Protocol): method __call__ (line 51) | async def __call__( class RequestResponder (line 56) | class RequestResponder(Generic[ReceiveRequestT, SendResultT]): method __init__ (line 74) | def __init__( method __enter__ (line 93) | def __enter__(self) -> RequestResponder[ReceiveRequestT, SendResultT]: method __exit__ (line 100) | def __exit__( method respond (line 116) | async def respond(self, response: SendResultT | ErrorData) -> None: method cancel (line 136) | async def cancel(self) -> None: method in_flight (line 152) | def in_flight(self) -> bool: # pragma: no cover method cancelled (line 156) | def cancelled(self) -> bool: class BaseSession (line 160) | class BaseSession( method __init__ (line 182) | def __init__( method add_response_router (line 199) | def add_response_router(self, router: ResponseRouter) -> None: method __aenter__ (line 214) | async def __aenter__(self) -> Self: method __aexit__ (line 220) | async def __aexit__( method send_request (line 233) | async def send_request( method send_notification (line 292) | async def send_notification( method _send_response (line 310) | async def _send_response(self, request_id: RequestId, response: SendRe... method _receive_request_adapter (line 325) | def _receive_request_adapter(self) -> TypeAdapter[ReceiveRequestT]: method _receive_notification_adapter (line 330) | def _receive_notification_adapter(self) -> TypeAdapter[ReceiveNotifica... method _receive_loop (line 333) | async def _receive_loop(self) -> None: method _normalize_request_id (line 431) | def _normalize_request_id(self, response_id: RequestId) -> RequestId: method _handle_response (line 451) | async def _handle_response(self, message: SessionMessage) -> None: method _received_request (line 493) | async def _received_request(self, responder: RequestResponder[ReceiveR... method _received_notification (line 501) | async def _received_notification(self, notification: ReceiveNotificati... method send_progress_notification (line 506) | async def send_progress_notification( method _handle_incoming (line 515) | async def _handle_incoming( FILE: src/mcp/shared/tool_name_validation.py class ToolNameValidationResult (line 28) | class ToolNameValidationResult: function validate_tool_name (line 40) | def validate_tool_name(name: str) -> ToolNameValidationResult: function issue_tool_name_warning (line 97) | def issue_tool_name_warning(name: str, warnings: list[str]) -> None: function validate_and_warn_tool_name (line 115) | def validate_and_warn_tool_name(name: str) -> bool: FILE: src/mcp/types/_types.py class MCPModel (line 39) | class MCPModel(BaseModel): class RequestParamsMeta (line 48) | class RequestParamsMeta(TypedDict, extra_items=Any): class TaskMetadata (line 58) | class TaskMetadata(MCPModel): class RequestParams (line 68) | class RequestParams(MCPModel): class PaginatedRequestParams (line 82) | class PaginatedRequestParams(RequestParams): class NotificationParams (line 90) | class NotificationParams(MCPModel): class Request (line 103) | class Request(MCPModel, Generic[RequestParamsT, MethodT]): class PaginatedRequest (line 110) | class PaginatedRequest(Request[PaginatedRequestParams | None, MethodT], ... class Notification (line 116) | class Notification(MCPModel, Generic[NotificationParamsT, MethodT]): class Result (line 123) | class Result(MCPModel): class PaginatedResult (line 133) | class PaginatedResult(Result): class EmptyResult (line 141) | class EmptyResult(Result): class BaseMetadata (line 145) | class BaseMetadata(MCPModel): class Icon (line 162) | class Icon(MCPModel): class Implementation (line 184) | class Implementation(BaseMetadata): class RootsCapability (line 202) | class RootsCapability(MCPModel): class SamplingContextCapability (line 209) | class SamplingContextCapability(MCPModel): class SamplingToolsCapability (line 217) | class SamplingToolsCapability(MCPModel): class FormElicitationCapability (line 225) | class FormElicitationCapability(MCPModel): class UrlElicitationCapability (line 229) | class UrlElicitationCapability(MCPModel): class ElicitationCapability (line 233) | class ElicitationCapability(MCPModel): class SamplingCapability (line 246) | class SamplingCapability(MCPModel): class TasksListCapability (line 261) | class TasksListCapability(MCPModel): class TasksCancelCapability (line 265) | class TasksCancelCapability(MCPModel): class TasksCreateMessageCapability (line 269) | class TasksCreateMessageCapability(MCPModel): class TasksSamplingCapability (line 273) | class TasksSamplingCapability(MCPModel): class TasksCreateElicitationCapability (line 279) | class TasksCreateElicitationCapability(MCPModel): class TasksElicitationCapability (line 283) | class TasksElicitationCapability(MCPModel): class ClientTasksRequestsCapability (line 289) | class ClientTasksRequestsCapability(MCPModel): class ClientTasksCapability (line 297) | class ClientTasksCapability(MCPModel): class ClientCapabilities (line 310) | class ClientCapabilities(MCPModel): class PromptsCapability (line 328) | class PromptsCapability(MCPModel): class ResourcesCapability (line 335) | class ResourcesCapability(MCPModel): class ToolsCapability (line 344) | class ToolsCapability(MCPModel): class LoggingCapability (line 351) | class LoggingCapability(MCPModel): class CompletionsCapability (line 355) | class CompletionsCapability(MCPModel): class TasksCallCapability (line 359) | class TasksCallCapability(MCPModel): class TasksToolsCapability (line 363) | class TasksToolsCapability(MCPModel): class ServerTasksRequestsCapability (line 369) | class ServerTasksRequestsCapability(MCPModel): class ServerTasksCapability (line 375) | class ServerTasksCapability(MCPModel): class ServerCapabilities (line 383) | class ServerCapabilities(MCPModel): class RelatedTaskMetadata (line 418) | class RelatedTaskMetadata(MCPModel): class Task (line 428) | class Task(MCPModel): class CreateTaskResult (line 459) | class CreateTaskResult(Result): class GetTaskRequestParams (line 465) | class GetTaskRequestParams(RequestParams): class GetTaskRequest (line 470) | class GetTaskRequest(Request[GetTaskRequestParams, Literal["tasks/get"]]): class GetTaskResult (line 478) | class GetTaskResult(Result, Task): class GetTaskPayloadRequestParams (line 482) | class GetTaskPayloadRequestParams(RequestParams): class GetTaskPayloadRequest (line 487) | class GetTaskPayloadRequest(Request[GetTaskPayloadRequestParams, Literal... class GetTaskPayloadResult (line 494) | class GetTaskPayloadResult(Result): class CancelTaskRequestParams (line 504) | class CancelTaskRequestParams(RequestParams): class CancelTaskRequest (line 509) | class CancelTaskRequest(Request[CancelTaskRequestParams, Literal["tasks/... class CancelTaskResult (line 516) | class CancelTaskResult(Result, Task): class ListTasksRequest (line 520) | class ListTasksRequest(PaginatedRequest[Literal["tasks/list"]]): class ListTasksResult (line 526) | class ListTasksResult(PaginatedResult): class TaskStatusNotificationParams (line 532) | class TaskStatusNotificationParams(NotificationParams, Task): class TaskStatusNotification (line 536) | class TaskStatusNotification(Notification[TaskStatusNotificationParams, ... class InitializeRequestParams (line 545) | class InitializeRequestParams(RequestParams): class InitializeRequest (line 554) | class InitializeRequest(Request[InitializeRequestParams, Literal["initia... class InitializeResult (line 563) | class InitializeResult(Result): class InitializedNotification (line 574) | class InitializedNotification(Notification[NotificationParams | None, Li... class PingRequest (line 583) | class PingRequest(Request[RequestParams | None, Literal["ping"]]): class ProgressNotificationParams (line 592) | class ProgressNotificationParams(NotificationParams): class ProgressNotification (line 614) | class ProgressNotification(Notification[ProgressNotificationParams, Lite... class ListResourcesRequest (line 621) | class ListResourcesRequest(PaginatedRequest[Literal["resources/list"]]): class Annotations (line 627) | class Annotations(MCPModel): class Resource (line 632) | class Resource(BaseMetadata): class ResourceTemplate (line 662) | class ResourceTemplate(BaseMetadata): class ListResourcesResult (line 689) | class ListResourcesResult(PaginatedResult): class ListResourceTemplatesRequest (line 695) | class ListResourceTemplatesRequest(PaginatedRequest[Literal["resources/t... class ListResourceTemplatesResult (line 701) | class ListResourceTemplatesResult(PaginatedResult): class ReadResourceRequestParams (line 707) | class ReadResourceRequestParams(RequestParams): class ReadResourceRequest (line 717) | class ReadResourceRequest(Request[ReadResourceRequestParams, Literal["re... class ResourceContents (line 724) | class ResourceContents(MCPModel): class TextResourceContents (line 738) | class TextResourceContents(ResourceContents): class BlobResourceContents (line 748) | class BlobResourceContents(ResourceContents): class ReadResourceResult (line 755) | class ReadResourceResult(Result): class ResourceListChangedNotification (line 761) | class ResourceListChangedNotification( class SubscribeRequestParams (line 772) | class SubscribeRequestParams(RequestParams): class SubscribeRequest (line 782) | class SubscribeRequest(Request[SubscribeRequestParams, Literal["resource... class UnsubscribeRequestParams (line 791) | class UnsubscribeRequestParams(RequestParams): class UnsubscribeRequest (line 798) | class UnsubscribeRequest(Request[UnsubscribeRequestParams, Literal["reso... class ResourceUpdatedNotificationParams (line 807) | class ResourceUpdatedNotificationParams(NotificationParams): class ResourceUpdatedNotification (line 817) | class ResourceUpdatedNotification( class ListPromptsRequest (line 828) | class ListPromptsRequest(PaginatedRequest[Literal["prompts/list"]]): class PromptArgument (line 834) | class PromptArgument(MCPModel): class Prompt (line 845) | class Prompt(BaseMetadata): class ListPromptsResult (line 861) | class ListPromptsResult(PaginatedResult): class GetPromptRequestParams (line 867) | class GetPromptRequestParams(RequestParams): class GetPromptRequest (line 876) | class GetPromptRequest(Request[GetPromptRequestParams, Literal["prompts/... class TextContent (line 883) | class TextContent(MCPModel): class ImageContent (line 897) | class ImageContent(MCPModel): class AudioContent (line 916) | class AudioContent(MCPModel): class ToolUseContent (line 935) | class ToolUseContent(MCPModel): class ToolResultContent (line 962) | class ToolResultContent(MCPModel): class SamplingMessage (line 1006) | class SamplingMessage(MCPModel): method content_as_list (line 1022) | def content_as_list(self) -> list[SamplingMessageContentBlock]: class EmbeddedResource (line 1028) | class EmbeddedResource(MCPModel): class ResourceLink (line 1045) | class ResourceLink(Resource): class PromptMessage (line 1058) | class PromptMessage(MCPModel): class GetPromptResult (line 1065) | class GetPromptResult(Result): class PromptListChangedNotification (line 1073) | class PromptListChangedNotification( class ListToolsRequest (line 1084) | class ListToolsRequest(PaginatedRequest[Literal["tools/list"]]): class ToolAnnotations (line 1090) | class ToolAnnotations(MCPModel): class ToolExecution (line 1136) | class ToolExecution(MCPModel): class Tool (line 1153) | class Tool(BaseMetadata): class ListToolsResult (line 1178) | class ListToolsResult(PaginatedResult): class CallToolRequestParams (line 1184) | class CallToolRequestParams(RequestParams): class CallToolRequest (line 1191) | class CallToolRequest(Request[CallToolRequestParams, Literal["tools/call... class CallToolResult (line 1198) | class CallToolResult(Result): class ToolListChangedNotification (line 1207) | class ToolListChangedNotification(Notification[NotificationParams | None... class SetLevelRequestParams (line 1219) | class SetLevelRequestParams(RequestParams): class SetLevelRequest (line 1226) | class SetLevelRequest(Request[SetLevelRequestParams, Literal["logging/se... class LoggingMessageNotificationParams (line 1233) | class LoggingMessageNotificationParams(NotificationParams): class LoggingMessageNotification (line 1247) | class LoggingMessageNotification(Notification[LoggingMessageNotification... class ModelHint (line 1257) | class ModelHint(MCPModel): class ModelPreferences (line 1264) | class ModelPreferences(MCPModel): class ToolChoice (line 1312) | class ToolChoice(MCPModel): class CreateMessageRequestParams (line 1328) | class CreateMessageRequestParams(RequestParams): class CreateMessageRequest (line 1362) | class CreateMessageRequest(Request[CreateMessageRequestParams, Literal["... class CreateMessageResult (line 1372) | class CreateMessageResult(Result): class CreateMessageResultWithTools (line 1389) | class CreateMessageResultWithTools(Result): method content_as_list (line 1411) | def content_as_list(self) -> list[SamplingMessageContentBlock]: class ResourceTemplateReference (line 1417) | class ResourceTemplateReference(MCPModel): class PromptReference (line 1425) | class PromptReference(MCPModel): class CompletionArgument (line 1433) | class CompletionArgument(MCPModel): class CompletionContext (line 1442) | class CompletionContext(MCPModel): class CompleteRequestParams (line 1449) | class CompleteRequestParams(RequestParams): class CompleteRequest (line 1458) | class CompleteRequest(Request[CompleteRequestParams, Literal["completion... class Completion (line 1465) | class Completion(MCPModel): class CompleteResult (line 1482) | class CompleteResult(Result): class ListRootsRequest (line 1488) | class ListRootsRequest(Request[RequestParams | None, Literal["roots/list... class Root (line 1502) | class Root(MCPModel): class ListRootsResult (line 1524) | class ListRootsResult(Result): class RootsListChangedNotification (line 1534) | class RootsListChangedNotification( class CancelledNotificationParams (line 1549) | class CancelledNotificationParams(NotificationParams): class CancelledNotification (line 1564) | class CancelledNotification(Notification[CancelledNotificationParams, Li... class ElicitCompleteNotificationParams (line 1573) | class ElicitCompleteNotificationParams(NotificationParams): class ElicitCompleteNotification (line 1580) | class ElicitCompleteNotification( class ElicitRequestFormParams (line 1633) | class ElicitRequestFormParams(RequestParams): class ElicitRequestURLParams (line 1653) | class ElicitRequestURLParams(RequestParams): class ElicitRequest (line 1681) | class ElicitRequest(Request[ElicitRequestParams, Literal["elicitation/cr... class ElicitResult (line 1688) | class ElicitResult(Result): class ElicitationRequiredErrorData (line 1708) | class ElicitationRequiredErrorData(MCPModel): FILE: src/mcp/types/jsonrpc.py class JSONRPCRequest (line 13) | class JSONRPCRequest(BaseModel): class JSONRPCNotification (line 22) | class JSONRPCNotification(BaseModel): class JSONRPCResponse (line 31) | class JSONRPCResponse(BaseModel): class ErrorData (line 55) | class ErrorData(BaseModel): class JSONRPCError (line 74) | class JSONRPCError(BaseModel): FILE: tests/cli/test_claude.py function config_dir (line 13) | def config_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: function _read_server (line 22) | def _read_server(config_dir: Path, name: str) -> dict[str, Any]: function test_generates_uv_run_command (line 27) | def test_generates_uv_run_command(config_dir: Path): function test_file_spec_without_object_suffix (line 38) | def test_file_spec_without_object_suffix(config_dir: Path): function test_with_packages_sorted_and_deduplicated (line 45) | def test_with_packages_sorted_and_deduplicated(config_dir: Path): function test_with_editable_adds_flag (line 53) | def test_with_editable_adds_flag(config_dir: Path, tmp_path: Path): function test_env_vars_written (line 62) | def test_env_vars_written(config_dir: Path): function test_existing_env_vars_merged_new_wins (line 69) | def test_existing_env_vars_merged_new_wins(config_dir: Path): function test_existing_env_vars_preserved_without_new (line 80) | def test_existing_env_vars_preserved_without_new(config_dir: Path): function test_other_servers_preserved (line 89) | def test_other_servers_preserved(config_dir: Path): function test_raises_when_config_dir_missing (line 100) | def test_raises_when_config_dir_missing(monkeypatch: pytest.MonkeyPatch): function test_get_uv_path (line 110) | def test_get_uv_path(monkeypatch: pytest.MonkeyPatch, which_result: str ... function test_windows_drive_letter_not_split (line 127) | def test_windows_drive_letter_not_split( FILE: tests/cli/test_utils.py function test_parse_file_path_accepts_valid_specs (line 18) | def test_parse_file_path_accepts_valid_specs(tmp_path: Path, spec: str, ... function test_parse_file_path_missing (line 27) | def test_parse_file_path_missing(tmp_path: Path): function test_parse_file_exit_on_dir (line 33) | def test_parse_file_exit_on_dir(tmp_path: Path): function test_build_uv_command_minimal (line 41) | def test_build_uv_command_minimal(): function test_build_uv_command_adds_editable_and_packages (line 47) | def test_build_uv_command_adds_editable_and_packages(): function test_get_npx_unix_like (line 72) | def test_get_npx_unix_like(monkeypatch: pytest.MonkeyPatch): function test_get_npx_windows (line 78) | def test_get_npx_windows(monkeypatch: pytest.MonkeyPatch): function test_get_npx_returns_none_when_npx_missing (line 93) | def test_get_npx_returns_none_when_npx_missing(monkeypatch: pytest.Monke... FILE: tests/client/auth/extensions/test_client_credentials.py class MockTokenStorage (line 19) | class MockTokenStorage: method __init__ (line 22) | def __init__(self): method get_tokens (line 26) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 29) | async def set_tokens(self, tokens: OAuthToken) -> None: # pragma: no ... method get_client_info (line 32) | async def get_client_info(self) -> OAuthClientInformationFull | None: ... method set_client_info (line 35) | async def set_client_info(self, client_info: OAuthClientInformationFul... function mock_storage (line 40) | def mock_storage(): function client_metadata (line 45) | def client_metadata(): function rfc7523_oauth_provider (line 55) | def rfc7523_oauth_provider(client_metadata: OAuthClientMetadata, mock_st... class TestOAuthFlowClientCredentials (line 75) | class TestOAuthFlowClientCredentials: method test_token_exchange_request_jwt_predefined (line 79) | async def test_token_exchange_request_jwt_predefined(self, rfc7523_oau... method test_token_exchange_request_jwt (line 118) | async def test_token_exchange_request_jwt(self, rfc7523_oauth_provider... class TestClientCredentialsOAuthProvider (line 176) | class TestClientCredentialsOAuthProvider: method test_init_sets_client_info (line 180) | async def test_init_sets_client_info(self, mock_storage: MockTokenStor... method test_init_with_scopes (line 199) | async def test_init_with_scopes(self, mock_storage: MockTokenStorage): method test_init_with_client_secret_post (line 214) | async def test_init_with_client_secret_post(self, mock_storage: MockTo... method test_exchange_token_client_credentials (line 229) | async def test_exchange_token_client_credentials(self, mock_storage: M... method test_exchange_token_client_secret_post_includes_client_id (line 256) | async def test_exchange_token_client_secret_post_includes_client_id(se... method test_exchange_token_client_secret_post_without_client_id (line 284) | async def test_exchange_token_client_secret_post_without_client_id(sel... method test_exchange_token_without_scopes (line 322) | async def test_exchange_token_without_scopes(self, mock_storage: MockT... class TestPrivateKeyJWTOAuthProvider (line 345) | class TestPrivateKeyJWTOAuthProvider: method test_init_sets_client_info (line 349) | async def test_init_sets_client_info(self, mock_storage: MockTokenStor... method test_exchange_token_client_credentials (line 371) | async def test_exchange_token_client_credentials(self, mock_storage: M... method test_exchange_token_without_scopes (line 403) | async def test_exchange_token_without_scopes(self, mock_storage: MockT... class TestSignedJWTParameters (line 430) | class TestSignedJWTParameters: method test_create_assertion_provider (line 434) | async def test_create_assertion_provider(self): method test_create_assertion_provider_with_additional_claims (line 461) | async def test_create_assertion_provider_with_additional_claims(self): class TestStaticAssertionProvider (line 483) | class TestStaticAssertionProvider: method test_returns_static_token (line 487) | async def test_returns_static_token(self): FILE: tests/client/conftest.py class SpyMemoryObjectSendStream (line 14) | class SpyMemoryObjectSendStream: method __init__ (line 15) | def __init__(self, original_stream: MemoryObjectSendStream[SessionMess... method send (line 19) | async def send(self, message: SessionMessage): method aclose (line 23) | async def aclose(self): method __aenter__ (line 26) | async def __aenter__(self): method __aexit__ (line 29) | async def __aexit__(self, *args: Any): class StreamSpyCollection (line 33) | class StreamSpyCollection: method __init__ (line 34) | def __init__(self, client_spy: SpyMemoryObjectSendStream, server_spy: ... method clear (line 38) | def clear(self) -> None: method get_client_requests (line 43) | def get_client_requests(self, method: str | None = None) -> list[JSONR... method get_server_requests (line 51) | def get_server_requests(self, method: str | None = None) -> list[JSONR... method get_client_notifications (line 59) | def get_client_notifications(self, method: str | None = None) -> list[... method get_server_notifications (line 67) | def get_server_notifications(self, method: str | None = None) -> list[... function stream_spy (line 77) | def stream_spy() -> Generator[Callable[[], StreamSpyCollection], None, N... FILE: tests/client/test_auth.py class MockTokenStorage (line 40) | class MockTokenStorage: method __init__ (line 43) | def __init__(self): method get_tokens (line 47) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 50) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 53) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 56) | async def set_client_info(self, client_info: OAuthClientInformationFul... function mock_storage (line 61) | def mock_storage(): function client_metadata (line 66) | def client_metadata(): function valid_tokens (line 76) | def valid_tokens(): function oauth_provider (line 87) | def oauth_provider(client_metadata: OAuthClientMetadata, mock_storage: M... function prm_metadata_response (line 106) | def prm_metadata_response(): function prm_metadata_without_scopes_response (line 119) | def prm_metadata_without_scopes_response(): function init_response_with_www_auth_scope (line 132) | def init_response_with_www_auth_scope(): function init_response_without_www_auth_scope (line 142) | def init_response_without_www_auth_scope(): class TestPKCEParameters (line 151) | class TestPKCEParameters: method test_pkce_generation (line 154) | def test_pkce_generation(self): method test_pkce_uniqueness (line 169) | def test_pkce_uniqueness(self): class TestOAuthContext (line 178) | class TestOAuthContext: method test_oauth_provider_initialization (line 182) | async def test_oauth_provider_initialization( method test_context_url_parsing (line 192) | def test_context_url_parsing(self, oauth_provider: OAuthClientProvider): method test_token_validity_checking (line 214) | async def test_token_validity_checking(self, oauth_provider: OAuthClie... method test_clear_tokens (line 249) | def test_clear_tokens(self, oauth_provider: OAuthClientProvider, valid... class TestOAuthFlow (line 263) | class TestOAuthFlow: method test_build_protected_resource_discovery_urls (line 267) | async def test_build_protected_resource_discovery_urls( method test_create_oauth_metadata_request (line 310) | def test_create_oauth_metadata_request(self, oauth_provider: OAuthClie... class TestOAuthFallback (line 320) | class TestOAuthFallback: method test_oauth_discovery_legacy_fallback_when_no_prm (line 324) | async def test_oauth_discovery_legacy_fallback_when_no_prm(self): method test_oauth_discovery_path_aware_when_auth_server_has_path (line 335) | async def test_oauth_discovery_path_aware_when_auth_server_has_path(se... method test_oauth_discovery_root_when_auth_server_has_no_path (line 349) | async def test_oauth_discovery_root_when_auth_server_has_no_path(self): method test_oauth_discovery_root_when_auth_server_has_only_slash (line 362) | async def test_oauth_discovery_root_when_auth_server_has_only_slash(se... method test_oauth_discovery_fallback_order (line 375) | async def test_oauth_discovery_fallback_order(self, oauth_provider: OA... method test_oauth_discovery_fallback_conditions (line 391) | async def test_oauth_discovery_fallback_conditions(self, oauth_provide... method test_handle_metadata_response_success (line 510) | async def test_handle_metadata_response_success(self, oauth_provider: ... method test_prioritize_www_auth_scope_over_prm (line 526) | async def test_prioritize_www_auth_scope_over_prm( method test_prioritize_prm_scopes_when_no_www_auth_scope (line 546) | async def test_prioritize_prm_scopes_when_no_www_auth_scope( method test_omit_scope_when_no_prm_scopes_or_www_auth (line 566) | async def test_omit_scope_when_no_prm_scopes_or_www_auth( method test_token_exchange_request_authorization_code (line 585) | async def test_token_exchange_request_authorization_code(self, oauth_p... method test_refresh_token_request (line 610) | async def test_refresh_token_request(self, oauth_provider: OAuthClient... method test_basic_auth_token_exchange (line 635) | async def test_basic_auth_token_exchange(self, oauth_provider: OAuthCl... method test_basic_auth_refresh_token (line 680) | async def test_basic_auth_refresh_token(self, oauth_provider: OAuthCli... method test_none_auth_method (line 715) | async def test_none_auth_method(self, oauth_provider: OAuthClientProvi... class TestProtectedResourceMetadata (line 743) | class TestProtectedResourceMetadata: method test_resource_param_included_with_recent_protocol_version (line 747) | async def test_resource_param_included_with_recent_protocol_version(se... method test_resource_param_excluded_with_old_protocol_version (line 776) | async def test_resource_param_excluded_with_old_protocol_version(self,... method test_resource_param_included_with_protected_resource_metadata (line 802) | async def test_resource_param_included_with_protected_resource_metadat... function test_validate_resource_rejects_mismatched_resource (line 823) | async def test_validate_resource_rejects_mismatched_resource( function test_validate_resource_accepts_matching_resource (line 843) | async def test_validate_resource_accepts_matching_resource( function test_validate_resource_custom_callback (line 863) | async def test_validate_resource_custom_callback( function test_validate_resource_accepts_root_url_with_trailing_slash (line 891) | async def test_validate_resource_accepts_root_url_with_trailing_slash( function test_validate_resource_accepts_server_url_with_trailing_slash (line 911) | async def test_validate_resource_accepts_server_url_with_trailing_slash( function test_get_resource_url_uses_canonical_when_prm_mismatches (line 931) | async def test_get_resource_url_uses_canonical_when_prm_mismatches( class TestRegistrationResponse (line 952) | class TestRegistrationResponse: method test_handle_registration_response_reads_before_accessing_text (line 956) | async def test_handle_registration_response_reads_before_accessing_tex... class TestCreateClientRegistrationRequest (line 988) | class TestCreateClientRegistrationRequest: method test_uses_registration_endpoint_from_metadata (line 991) | def test_uses_registration_endpoint_from_metadata(self): method test_falls_back_to_default_register_endpoint_when_no_metadata (line 1006) | def test_falls_back_to_default_register_endpoint_when_no_metadata(self): method test_falls_back_when_metadata_has_no_registration_endpoint (line 1015) | def test_falls_back_when_metadata_has_no_registration_endpoint(self): class TestAuthFlow (line 1031) | class TestAuthFlow: method test_auth_flow_with_valid_tokens (line 1035) | async def test_auth_flow_with_valid_tokens( method test_auth_flow_with_no_tokens (line 1063) | async def test_auth_flow_with_no_tokens(self, oauth_provider: OAuthCli... method test_auth_flow_no_unnecessary_retry_after_oauth (line 1171) | async def test_auth_flow_no_unnecessary_retry_after_oauth( method test_token_exchange_accepts_201_status (line 1214) | async def test_token_exchange_accepts_201_status( method test_403_insufficient_scope_updates_scope_from_header (line 1324) | async def test_403_insufficient_scope_updates_scope_from_header( function test_build_metadata (line 1458) | def test_build_metadata( class TestLegacyServerFallback (line 1490) | class TestLegacyServerFallback: method test_legacy_server_no_prm_falls_back_to_root_oauth_discovery (line 1494) | async def test_legacy_server_no_prm_falls_back_to_root_oauth_discovery( method test_legacy_server_with_different_prm_and_root_urls (line 1593) | async def test_legacy_server_with_different_prm_and_root_urls( class TestSEP985Discovery (line 1694) | class TestSEP985Discovery: method test_path_based_fallback_when_no_www_authenticate (line 1698) | async def test_path_based_fallback_when_no_www_authenticate( method test_root_based_fallback_after_path_based_404 (line 1733) | async def test_root_based_fallback_after_path_based_404( method test_www_authenticate_takes_priority_over_well_known (line 1834) | async def test_www_authenticate_takes_priority_over_well_known( class TestWWWAuthenticate (line 1874) | class TestWWWAuthenticate: method test_extract_field_from_www_auth_valid_cases (line 1923) | def test_extract_field_from_www_auth_valid_cases( method test_extract_field_from_www_auth_invalid_cases (line 1957) | def test_extract_field_from_www_auth_invalid_cases( class TestCIMD (line 1976) | class TestCIMD: method test_is_valid_client_metadata_url (line 1999) | def test_is_valid_client_metadata_url(self, url: str | None, expected:... method test_should_use_client_metadata_url_when_server_supports (line 2003) | def test_should_use_client_metadata_url_when_server_supports(self): method test_should_not_use_client_metadata_url_when_server_does_not_support (line 2013) | def test_should_not_use_client_metadata_url_when_server_does_not_suppo... method test_should_not_use_client_metadata_url_when_not_provided (line 2023) | def test_should_not_use_client_metadata_url_when_not_provided(self): method test_should_not_use_client_metadata_url_when_no_metadata (line 2033) | def test_should_not_use_client_metadata_url_when_no_metadata(self): method test_create_client_info_from_metadata_url (line 2037) | def test_create_client_info_from_metadata_url(self): method test_oauth_provider_with_valid_client_metadata_url (line 2048) | def test_oauth_provider_with_valid_client_metadata_url( method test_oauth_provider_with_invalid_client_metadata_url_raises_error (line 2069) | def test_oauth_provider_with_invalid_client_metadata_url_raises_error( method test_auth_flow_uses_cimd_when_server_supports (line 2092) | async def test_auth_flow_uses_cimd_when_server_supports( method test_auth_flow_falls_back_to_dcr_when_no_cimd_support (line 2183) | async def test_auth_flow_falls_back_to_dcr_when_no_cimd_support( FILE: tests/client/test_client.py function simple_server (line 42) | def simple_server() -> Server: function app (line 77) | def app() -> MCPServer: function test_client_is_initialized (line 99) | async def test_client_is_initialized(app: MCPServer): function test_client_with_simple_server (line 113) | async def test_client_with_simple_server(simple_server: Server): function test_client_send_ping (line 124) | async def test_client_send_ping(app: MCPServer): function test_client_list_tools (line 130) | async def test_client_list_tools(app: MCPServer): function test_client_call_tool (line 157) | async def test_client_call_tool(app: MCPServer): function test_read_resource (line 168) | async def test_read_resource(app: MCPServer): function test_read_resource_error_propagates (line 179) | async def test_read_resource_error_propagates(): function test_get_prompt (line 194) | async def test_get_prompt(app: MCPServer): function test_client_session_property_before_enter (line 206) | def test_client_session_property_before_enter(app: MCPServer): function test_client_reentry_raises_runtime_error (line 213) | async def test_client_reentry_raises_runtime_error(app: MCPServer): function test_client_send_progress_notification (line 220) | async def test_client_send_progress_notification(): function test_client_subscribe_resource (line 238) | async def test_client_subscribe_resource(simple_server: Server): function test_client_unsubscribe_resource (line 244) | async def test_client_unsubscribe_resource(simple_server: Server): function test_client_set_logging_level (line 250) | async def test_client_set_logging_level(simple_server: Server): function test_client_list_resources_with_params (line 257) | async def test_client_list_resources_with_params(app: MCPServer): function test_client_list_resource_templates (line 275) | async def test_client_list_resource_templates(app: MCPServer): function test_list_prompts (line 282) | async def test_list_prompts(app: MCPServer): function test_complete_with_prompt_reference (line 299) | async def test_complete_with_prompt_reference(simple_server: Server): function test_client_with_url_initializes_streamable_http_transport (line 307) | def test_client_with_url_initializes_streamable_http_transport(): function test_client_uses_transport_directly (line 313) | async def test_client_uses_transport_directly(app: MCPServer): FILE: tests/client/test_http_unicode.py function run_unicode_server (line 44) | def run_unicode_server(port: int) -> None: # pragma: no cover function unicode_server_port (line 152) | def unicode_server_port() -> int: function running_unicode_server (line 160) | def running_unicode_server(unicode_server_port: int) -> Generator[str, N... function test_streamable_http_client_unicode_tool_call (line 180) | async def test_streamable_http_client_unicode_tool_call(running_unicode_... function test_streamable_http_client_unicode_prompts (line 212) | async def test_streamable_http_client_unicode_prompts(running_unicode_se... FILE: tests/client/test_list_methods_cursor.py function full_featured_server (line 16) | async def full_featured_server(): function test_list_methods_params_parameter (line 55) | async def test_list_methods_params_parameter( function test_list_tools_with_strict_server_validation (line 96) | async def test_list_tools_with_strict_server_validation( function test_list_tools_with_lowlevel_server (line 106) | async def test_list_tools_with_lowlevel_server(): FILE: tests/client/test_list_roots_callback.py function test_list_roots_callback (line 12) | async def test_list_roots_callback(): FILE: tests/client/test_logging_callback.py class LoggingCollector (line 14) | class LoggingCollector: method __init__ (line 15) | def __init__(self): method __call__ (line 18) | async def __call__(self, params: LoggingMessageNotificationParams) -> ... function test_logging_callback (line 23) | async def test_logging_callback(): FILE: tests/client/test_notification_response.py function _init_json_response (line 30) | def _init_json_response(data: dict[str, object]) -> JSONResponse: function _create_non_sdk_server_app (line 34) | def _create_non_sdk_server_app() -> Starlette: function _create_unexpected_content_type_app (line 55) | def _create_unexpected_content_type_app() -> Starlette: function test_non_compliant_notification_response (line 74) | async def test_non_compliant_notification_response() -> None: function test_unexpected_content_type_sends_jsonrpc_error (line 103) | async def test_unexpected_content_type_sends_jsonrpc_error() -> None: function _create_http_error_app (line 119) | def _create_http_error_app(error_status: int, *, error_on_notifications:... function test_http_error_status_sends_jsonrpc_error (line 139) | async def test_http_error_status_sends_jsonrpc_error() -> None: function test_http_error_on_notification_does_not_hang (line 155) | async def test_http_error_on_notification_does_not_hang() -> None: function _create_invalid_json_response_app (line 171) | def _create_invalid_json_response_app() -> Starlette: function test_invalid_json_response_sends_jsonrpc_error (line 190) | async def test_invalid_json_response_sends_jsonrpc_error() -> None: FILE: tests/client/test_output_schema_validation.py function _make_server (line 18) | def _make_server( function test_tool_structured_output_client_side_validation_basemodel (line 37) | async def test_tool_structured_output_client_side_validation_basemodel(): function test_tool_structured_output_client_side_validation_primitive (line 65) | async def test_tool_structured_output_client_side_validation_primitive(): function test_tool_structured_output_client_side_validation_dict_typed (line 93) | async def test_tool_structured_output_client_side_validation_dict_typed(): function test_tool_structured_output_client_side_validation_missing_required (line 116) | async def test_tool_structured_output_client_side_validation_missing_req... function test_tool_not_listed_warning (line 144) | async def test_tool_not_listed_warning(caplog: pytest.LogCaptureFixture): FILE: tests/client/test_resource_cleanup.py function test_send_request_stream_cleanup (line 14) | async def test_send_request_stream_cleanup(): FILE: tests/client/test_sampling_callback.py function test_sampling_callback (line 18) | async def test_sampling_callback(): function test_create_message_backwards_compat_single_content (line 61) | async def test_create_message_backwards_compat_single_content(): function test_create_message_result_with_tools_type (line 103) | async def test_create_message_result_with_tools_type(): FILE: tests/client/test_scope_bug_1630.py class MockTokenStorage (line 17) | class MockTokenStorage: method __init__ (line 20) | def __init__(self) -> None: method get_tokens (line 24) | async def get_tokens(self) -> OAuthToken | None: method set_tokens (line 27) | async def set_tokens(self, tokens: OAuthToken) -> None: method get_client_info (line 30) | async def get_client_info(self) -> OAuthClientInformationFull | None: method set_client_info (line 33) | async def set_client_info(self, client_info: OAuthClientInformationFul... function test_401_uses_www_auth_scope_not_resource_metadata_url (line 38) | async def test_401_uses_www_auth_scope_not_resource_metadata_url(): FILE: tests/client/test_session.py function test_client_session_initialize (line 31) | async def test_client_session_initialize(): function test_client_session_custom_client_info (line 114) | async def test_client_session_custom_client_info(): function test_client_session_default_client_info (line 172) | async def test_client_session_default_client_info(): function test_client_session_version_negotiation_success (line 225) | async def test_client_session_version_negotiation_success(): function test_client_session_version_negotiation_failure (line 281) | async def test_client_session_version_negotiation_failure(): function test_client_capabilities_default (line 329) | async def test_client_capabilities_default(): function test_client_capabilities_with_custom_callbacks (line 385) | async def test_client_capabilities_with_custom_callbacks(): function test_client_capabilities_with_sampling_tools (line 469) | async def test_client_capabilities_with_sampling_tools(): function test_initialize_result (line 543) | async def test_initialize_result(): function test_client_tool_call_with_meta (line 611) | async def test_client_tool_call_with_meta(meta: RequestParamsMeta | None): FILE: tests/client/test_session_group.py function mock_exit_stack (line 20) | def mock_exit_stack(): function test_client_session_group_init (line 28) | def test_client_session_group_init(): function test_client_session_group_component_properties (line 36) | def test_client_session_group_component_properties(): function test_client_session_group_call_tool (line 55) | async def test_client_session_group_call_tool(): function test_client_session_group_connect_to_server (line 90) | async def test_client_session_group_connect_to_server(mock_exit_stack: c... function test_client_session_group_connect_to_server_with_name_hook (line 129) | async def test_client_session_group_connect_to_server_with_name_hook(moc... function test_client_session_group_disconnect_from_server (line 160) | async def test_client_session_group_disconnect_from_server(): function test_client_session_group_connect_to_server_duplicate_tool_raises_error (line 225) | async def test_client_session_group_connect_to_server_duplicate_tool_rai... function test_client_session_group_disconnect_non_existent_server (line 273) | async def test_client_session_group_disconnect_non_existent_server(): function test_client_session_group_establish_session_parameterized (line 303) | async def test_client_session_group_establish_session_parameterized( FILE: tests/client/test_stdio.py function test_stdio_context_manager_exiting (line 34) | async def test_stdio_context_manager_exiting(): function test_stdio_client (line 42) | async def test_stdio_client(): function test_stdio_client_bad_path (line 74) | async def test_stdio_client_bad_path(): function test_stdio_client_nonexistent_command (line 89) | async def test_stdio_client_nonexistent_command(): function test_stdio_client_universal_cleanup (line 107) | async def test_stdio_client_universal_cleanup(): function test_stdio_client_sigint_only_process (line 159) | async def test_stdio_client_sigint_only_process(): # pragma: lax no cover function _connect_back_script (line 247) | def _connect_back_script(port: int) -> str: function _spawn_then_block (line 259) | def _spawn_then_block(child_script: str) -> str: function _open_liveness_listener (line 268) | async def _open_liveness_listener() -> tuple[anyio.abc.SocketListener, i... function _accept_alive (line 279) | async def _accept_alive(sock: anyio.abc.SocketListener) -> anyio.abc.Soc... function _assert_stream_closed (line 292) | async def _assert_stream_closed(stream: anyio.abc.SocketStream) -> None: function _terminate_and_reap (line 310) | async def _terminate_and_reap(proc: anyio.abc.Process | FallbackProcess)... class TestChildProcessCleanup (line 349) | class TestChildProcessCleanup: method test_basic_child_process_cleanup (line 356) | async def test_basic_child_process_cleanup(self): method test_nested_process_tree (line 380) | async def test_nested_process_tree(self): method test_early_parent_exit (line 416) | async def test_early_parent_exit(self): function test_stdio_client_graceful_stdin_exit (line 450) | async def test_stdio_client_graceful_stdin_exit(): function test_stdio_client_stdin_close_ignored (line 505) | async def test_stdio_client_stdin_close_ignored(): FILE: tests/client/test_transport_stream_cleanup.py function _assert_no_memory_stream_leak (line 28) | def _assert_no_memory_stream_leak() -> Iterator[None]: function test_sse_client_closes_all_streams_on_connection_error (line 60) | async def test_sse_client_closes_all_streams_on_connection_error(free_tc... function test_sse_client_closes_all_streams_on_http_error (line 74) | async def test_sse_client_closes_all_streams_on_http_error() -> None: function test_streamable_http_client_closes_all_streams_on_exit (line 97) | async def test_streamable_http_client_closes_all_streams_on_exit() -> None: function test_websocket_client_closes_all_streams_on_connection_error (line 110) | async def test_websocket_client_closes_all_streams_on_connection_error(f... FILE: tests/client/transports/test_memory.py function simple_server (line 13) | def simple_server() -> Server: function mcpserver_server (line 33) | def mcpserver_server() -> MCPServer: function test_with_server (line 53) | async def test_with_server(simple_server: Server): function test_with_mcpserver (line 61) | async def test_with_mcpserver(mcpserver_server: MCPServer): function test_server_is_running (line 69) | async def test_server_is_running(mcpserver_server: MCPServer): function test_list_tools (line 75) | async def test_list_tools(mcpserver_server: MCPServer): function test_call_tool (line 84) | async def test_call_tool(mcpserver_server: MCPServer): function test_raise_exceptions (line 93) | async def test_raise_exceptions(mcpserver_server: MCPServer): FILE: tests/conftest.py function anyio_backend (line 5) | def anyio_backend(): FILE: tests/experimental/tasks/client/test_capabilities.py function test_client_capabilities_without_tasks (line 24) | async def test_client_capabilities_without_tasks(): function test_client_capabilities_with_tasks (line 81) | async def test_client_capabilities_with_tasks(): function test_client_capabilities_auto_built_from_handlers (line 161) | async def test_client_capabilities_auto_built_from_handlers(): function test_client_capabilities_with_task_augmented_handlers (line 242) | async def test_client_capabilities_with_task_augmented_handlers(): FILE: tests/experimental/tasks/client/test_handlers.py class ClientTestStreams (line 63) | class ClientTestStreams: function client_streams (line 73) | async def client_streams() -> AsyncIterator[ClientTestStreams]: function _default_message_handler (line 101) | async def _default_message_handler( function test_client_handles_get_task_request (line 109) | async def test_client_handles_get_task_request(client_streams: ClientTes... function test_client_handles_get_task_result_request (line 173) | async def test_client_handles_get_task_result_request(client_streams: Cl... function test_client_handles_list_tasks_request (line 236) | async def test_client_handles_list_tasks_request(client_streams: ClientT... function test_client_handles_cancel_task_request (line 291) | async def test_client_handles_cancel_task_request(client_streams: Client... function test_client_task_augmented_sampling (line 355) | async def test_client_task_augmented_sampling(client_streams: ClientTest... function test_client_task_augmented_elicitation (line 499) | async def test_client_task_augmented_elicitation(client_streams: ClientT... function test_client_returns_error_for_unhandled_task_request (line 641) | async def test_client_returns_error_for_unhandled_task_request(client_st... function test_client_returns_error_for_unhandled_task_result_request (line 680) | async def test_client_returns_error_for_unhandled_task_result_request(cl... function test_client_returns_error_for_unhandled_list_tasks_request (line 716) | async def test_client_returns_error_for_unhandled_list_tasks_request(cli... function test_client_returns_error_for_unhandled_cancel_task_request (line 752) | async def test_client_returns_error_for_unhandled_cancel_task_request(cl... function test_client_returns_error_for_unhandled_task_augmented_sampling (line 788) | async def test_client_returns_error_for_unhandled_task_augmented_samplin... function test_client_returns_error_for_unhandled_task_augmented_elicitation (line 832) | async def test_client_returns_error_for_unhandled_task_augmented_elicita... FILE: tests/experimental/tasks/client/test_poll_task.py function make_task_result (line 14) | def make_task_result( function make_status_sequence (line 33) | def make_status_sequence( function mock_session (line 47) | def mock_session() -> AsyncMock: function features (line 52) | def features(mock_session: AsyncMock) -> ExperimentalClientFeatures: function test_poll_task_yields_until_completed (line 57) | async def test_poll_task_yields_until_completed(features: ExperimentalCl... function test_poll_task_exits_on_terminal (line 68) | async def test_poll_task_exits_on_terminal(features: ExperimentalClientF... function test_poll_task_continues_through_input_required (line 78) | async def test_poll_task_continues_through_input_required(features: Expe... function test_poll_task_passes_task_id (line 88) | async def test_poll_task_passes_task_id(features: ExperimentalClientFeat... function test_poll_task_yields_full_result (line 104) | async def test_poll_task_yields_full_result(features: ExperimentalClient... FILE: tests/experimental/tasks/client/test_tasks.py class AppContext (line 38) | class AppContext: function _handle_list_tools (line 46) | async def _handle_list_tools( function _handle_call_tool_with_done_event (line 52) | async def _handle_call_tool_with_done_event( function _make_lifespan (line 75) | def _make_lifespan(store: InMemoryTaskStore, task_done_events: dict[str,... function test_session_experimental_get_task (line 84) | async def test_session_experimental_get_task() -> None: function test_session_experimental_get_task_result (line 135) | async def test_session_experimental_get_task_result() -> None: function test_session_experimental_list_tasks (line 188) | async def test_session_experimental_list_tasks() -> None: function test_session_experimental_cancel_task (line 230) | async def test_session_experimental_cancel_task() -> None: FILE: tests/experimental/tasks/server/test_context.py function test_task_context_properties (line 12) | async def test_task_context_properties() -> None: function test_task_context_update_status (line 27) | async def test_task_context_update_status() -> None: function test_task_context_complete (line 44) | async def test_task_context_complete() -> None: function test_task_context_fail (line 66) | async def test_task_context_fail() -> None: function test_task_context_cancellation (line 84) | async def test_task_context_cancellation() -> None: function test_create_task_state_generates_id (line 99) | def test_create_task_state_generates_id() -> None: function test_create_task_state_uses_provided_id (line 107) | def test_create_task_state_uses_provided_id() -> None: function test_create_task_state_null_ttl (line 113) | def test_create_task_state_null_ttl() -> None: function test_create_task_state_has_created_at (line 119) | def test_create_task_state_has_created_at() -> None: function test_task_execution_provides_context (line 126) | async def test_task_execution_provides_context() -> None: function test_task_execution_auto_fails_on_exception (line 139) | async def test_task_execution_auto_fails_on_exception() -> None: function test_task_execution_doesnt_fail_if_already_terminal (line 157) | async def test_task_execution_doesnt_fail_if_already_terminal() -> None: function test_task_execution_not_found (line 177) | async def test_task_execution_not_found() -> None: FILE: tests/experimental/tasks/server/test_integration.py class AppContext (line 44) | class AppContext: function _make_lifespan (line 52) | def _make_lifespan(store: InMemoryTaskStore, task_done_events: dict[str,... function test_task_lifecycle_with_task_execution (line 61) | async def test_task_lifecycle_with_task_execution() -> None: function test_task_auto_fails_on_exception (line 169) | async def test_task_auto_fails_on_exception() -> None: FILE: tests/experimental/tasks/server/test_run_task_flow.py function _handle_list_tools_simple_task (line 40) | async def _handle_list_tools_simple_task( function test_run_task_basic_flow (line 46) | async def test_run_task_basic_flow() -> None: function test_run_task_auto_fails_on_exception (line 97) | async def test_run_task_auto_fails_on_exception() -> None: function test_enable_tasks_auto_registers_handlers (line 138) | async def test_enable_tasks_auto_registers_handlers() -> None: function test_enable_tasks_with_custom_store_and_queue (line 159) | async def test_enable_tasks_with_custom_store_and_queue() -> None: function test_enable_tasks_skips_default_handlers_when_custom_registered (line 172) | async def test_enable_tasks_skips_default_handlers_when_custom_registere... function test_run_task_without_enable_tasks_raises (line 189) | async def test_run_task_without_enable_tasks_raises() -> None: function test_task_support_task_group_before_run_raises (line 205) | async def test_task_support_task_group_before_run_raises() -> None: function test_run_task_without_session_raises (line 213) | async def test_run_task_without_session_raises() -> None: function test_run_task_without_task_metadata_raises (line 231) | async def test_run_task_without_task_metadata_raises() -> None: function test_run_task_with_model_immediate_response (line 250) | async def test_run_task_with_model_immediate_response() -> None: function test_run_task_doesnt_complete_if_already_terminal (line 287) | async def test_run_task_doesnt_complete_if_already_terminal() -> None: function test_run_task_doesnt_fail_if_already_terminal (line 328) | async def test_run_task_doesnt_fail_if_already_terminal() -> None: FILE: tests/experimental/tasks/server/test_server.py function test_list_tasks_handler (line 56) | async def test_list_tasks_handler() -> None: function test_get_task_handler (line 77) | async def test_get_task_handler() -> None: function test_get_task_result_handler (line 100) | async def test_get_task_result_handler() -> None: function test_cancel_task_handler (line 119) | async def test_cancel_task_handler() -> None: function test_server_capabilities_include_tasks (line 141) | async def test_server_capabilities_include_tasks() -> None: function test_server_capabilities_partial_tasks (line 167) | async def test_server_capabilities_partial_tasks() -> None: # pragma: n... function test_tool_with_task_execution_metadata (line 184) | async def test_tool_with_task_execution_metadata() -> None: function test_task_metadata_in_call_tool_request (line 225) | async def test_task_metadata_in_call_tool_request() -> None: function test_task_metadata_is_task_property (line 256) | async def test_task_metadata_is_task_property() -> None: function test_update_capabilities_no_handlers (line 289) | async def test_update_capabilities_no_handlers() -> None: function test_update_capabilities_partial_handlers (line 298) | async def test_update_capabilities_partial_handlers() -> None: function test_default_task_handlers_via_enable_tasks (line 317) | async def test_default_task_handlers_via_enable_tasks() -> None: function test_build_elicit_form_request (line 400) | async def test_build_elicit_form_request() -> None: function test_build_elicit_url_request (line 441) | async def test_build_elicit_url_request() -> None: function test_build_create_message_request (line 487) | async def test_build_create_message_request() -> None: function test_send_message (line 538) | async def test_send_message() -> None: function test_response_routing_success (line 575) | async def test_response_routing_success() -> None: function test_response_routing_error (line 629) | async def test_response_routing_error() -> None: function test_response_routing_skips_non_matching_routers (line 684) | async def test_response_routing_skips_non_matching_routers() -> None: function test_error_routing_skips_non_matching_routers (line 742) | async def test_error_routing_skips_non_matching_routers() -> None: FILE: tests/experimental/tasks/server/test_server_task_context.py function test_server_task_context_properties (line 33) | async def test_server_task_context_properties() -> None: function test_server_task_context_request_cancellation (line 55) | async def test_server_task_context_request_cancellation() -> None: function test_server_task_context_update_status_with_notify (line 77) | async def test_server_task_context_update_status_with_notify() -> None: function test_server_task_context_update_status_without_notify (line 99) | async def test_server_task_context_update_status_without_notify() -> None: function test_server_task_context_complete_with_notify (line 121) | async def test_server_task_context_complete_with_notify() -> None: function test_server_task_context_fail_with_notify (line 144) | async def test_server_task_context_fail_with_notify() -> None: function test_elicit_raises_when_client_lacks_capability (line 166) | async def test_elicit_raises_when_client_lacks_capability() -> None: function test_create_message_raises_when_client_lacks_capability (line 192) | async def test_create_message_raises_when_client_lacks_capability() -> N... function test_elicit_raises_without_handler (line 218) | async def test_elicit_raises_without_handler() -> None: function test_elicit_url_raises_without_handler (line 241) | async def test_elicit_url_raises_without_handler() -> None: function test_create_message_raises_without_handler (line 268) | async def test_create_message_raises_without_handler() -> None: function test_elicit_queues_request_and_waits_for_response (line 291) | async def test_elicit_queues_request_and_waits_for_response() -> None: function test_elicit_url_queues_request_and_waits_for_response (line 359) | async def test_elicit_url_queues_request_and_waits_for_response() -> None: function test_create_message_queues_request_and_waits_for_response (line 427) | async def test_create_message_queues_request_and_waits_for_response() ->... function test_elicit_restores_status_on_cancellation (line 502) | async def test_elicit_restores_status_on_cancellation() -> None: function test_create_message_restores_status_on_cancellation (line 571) | async def test_create_message_restores_status_on_cancellation() -> None: function test_elicit_as_task_raises_without_handler (line 640) | async def test_elicit_as_task_raises_without_handler() -> None: function test_create_message_as_task_raises_without_handler (line 675) | async def test_create_message_as_task_raises_without_handler() -> None: FILE: tests/experimental/tasks/server/test_store.py function store (line 15) | async def store() -> AsyncIterator[InMemoryTaskStore]: function test_create_and_get (line 23) | async def test_create_and_get(store: InMemoryTaskStore) -> None: function test_create_with_custom_id (line 38) | async def test_create_with_custom_id(store: InMemoryTaskStore) -> None: function test_create_duplicate_id_raises (line 54) | async def test_create_duplicate_id_raises(store: InMemoryTaskStore) -> N... function test_get_nonexistent_returns_none (line 63) | async def test_get_nonexistent_returns_none(store: InMemoryTaskStore) ->... function test_update_status (line 70) | async def test_update_status(store: InMemoryTaskStore) -> None: function test_update_nonexistent_raises (line 86) | async def test_update_nonexistent_raises(store: InMemoryTaskStore) -> None: function test_store_and_get_result (line 93) | async def test_store_and_get_result(store: InMemoryTaskStore) -> None: function test_get_result_nonexistent_returns_none (line 107) | async def test_get_result_nonexistent_returns_none(store: InMemoryTaskSt... function test_get_result_no_result_returns_none (line 114) | async def test_get_result_no_result_returns_none(store: InMemoryTaskStor... function test_list_tasks (line 122) | async def test_list_tasks(store: InMemoryTaskStore) -> None: function test_list_tasks_pagination (line 134) | async def test_list_tasks_pagination() -> None: function test_list_tasks_invalid_cursor (line 162) | async def test_list_tasks_invalid_cursor(store: InMemoryTaskStore) -> None: function test_delete_task (line 171) | async def test_delete_task(store: InMemoryTaskStore) -> None: function test_get_all_tasks_helper (line 187) | async def test_get_all_tasks_helper(store: InMemoryTaskStore) -> None: function test_store_result_nonexistent_raises (line 197) | async def test_store_result_nonexistent_raises(store: InMemoryTaskStore)... function test_create_task_with_null_ttl (line 206) | async def test_create_task_with_null_ttl(store: InMemoryTaskStore) -> None: function test_task_expiration_cleanup (line 218) | async def test_task_expiration_cleanup(store: InMemoryTaskStore) -> None: function test_task_with_null_ttl_never_expires (line 241) | async def test_task_with_null_ttl_never_expires(store: InMemoryTaskStore... function test_terminal_task_ttl_reset (line 262) | async def test_terminal_task_ttl_reset(store: InMemoryTaskStore) -> None: function test_terminal_status_transition_rejected (line 283) | async def test_terminal_status_transition_rejected(store: InMemoryTaskSt... function test_terminal_status_allows_same_status (line 307) | async def test_terminal_status_allows_same_status(store: InMemoryTaskSto... function test_wait_for_update_nonexistent_raises (line 325) | async def test_wait_for_update_nonexistent_raises(store: InMemoryTaskSto... function test_cancel_task_succeeds_for_working_task (line 332) | async def test_cancel_task_succeeds_for_working_task(store: InMemoryTask... function test_cancel_task_rejects_nonexistent_task (line 349) | async def test_cancel_task_rejects_nonexistent_task(store: InMemoryTaskS... function test_cancel_task_rejects_completed_task (line 359) | async def test_cancel_task_rejects_completed_task(store: InMemoryTaskSto... function test_cancel_task_rejects_failed_task (line 372) | async def test_cancel_task_rejects_failed_task(store: InMemoryTaskStore)... function test_cancel_task_rejects_already_cancelled_task (line 385) | async def test_cancel_task_rejects_already_cancelled_task(store: InMemor... function test_cancel_task_succeeds_for_input_required_task (line 398) | async def test_cancel_task_succeeds_for_input_required_task(store: InMem... FILE: tests/experimental/tasks/server/test_task_result_handler.py function store (line 30) | async def store() -> AsyncIterator[InMemoryTaskStore]: function queue (line 38) | def queue() -> InMemoryTaskMessageQueue: function handler (line 44) | def handler(store: InMemoryTaskStore, queue: InMemoryTaskMessageQueue) -... function test_handle_returns_result_for_completed_task (line 50) | async def test_handle_returns_result_for_completed_task( function test_handle_raises_for_nonexistent_task (line 71) | async def test_handle_raises_for_nonexistent_task( function test_handle_returns_empty_result_when_no_result_stored (line 85) | async def test_handle_returns_empty_result_when_no_result_stored( function test_handle_delivers_queued_messages (line 104) | async def test_handle_delivers_queued_messages( function test_handle_waits_for_task_completion (line 137) | async def test_handle_waits_for_task_completion( function test_route_response_resolves_pending_request (line 166) | async def test_route_response_resolves_pending_request( function test_route_response_returns_false_for_unknown_request (line 181) | async def test_route_response_returns_false_for_unknown_request( function test_route_response_returns_false_for_already_done_resolver (line 190) | async def test_route_response_returns_false_for_already_done_resolver( function test_route_error_resolves_pending_request_with_exception (line 204) | async def test_route_error_resolves_pending_request_with_exception( function test_route_error_returns_false_for_unknown_request (line 223) | async def test_route_error_returns_false_for_unknown_request( function test_deliver_registers_resolver_for_request_messages (line 233) | async def test_deliver_registers_resolver_for_request_messages( function test_deliver_skips_resolver_registration_when_no_original_id (line 263) | async def test_deliver_skips_resolver_registration_when_no_original_id( function test_wait_for_task_update_handles_store_exception (line 295) | async def test_wait_for_task_update_handles_store_exception( function test_wait_for_task_update_handles_queue_exception (line 332) | async def test_wait_for_task_update_handles_queue_exception( FILE: tests/experimental/tasks/test_capabilities.py class TestCheckTasksCapability (line 24) | class TestCheckTasksCapability: method test_required_requests_none_returns_true (line 27) | def test_required_requests_none_returns_true(self) -> None: method test_client_requests_none_returns_false (line 33) | def test_client_requests_none_returns_false(self) -> None: method test_elicitation_required_but_client_missing (line 39) | def test_elicitation_required_but_client_missing(self) -> None: method test_elicitation_create_required_but_client_missing (line 47) | def test_elicitation_create_required_but_client_missing(self) -> None: method test_elicitation_create_present (line 61) | def test_elicitation_create_present(self) -> None: method test_sampling_required_but_client_missing (line 75) | def test_sampling_required_but_client_missing(self) -> None: method test_sampling_create_message_required_but_client_missing (line 81) | def test_sampling_create_message_required_but_client_missing(self) -> ... method test_sampling_create_message_present (line 95) | def test_sampling_create_message_present(self) -> None: method test_both_elicitation_and_sampling_present (line 109) | def test_both_elicitation_and_sampling_present(self) -> None: method test_elicitation_without_create_required (line 125) | def test_elicitation_without_create_required(self) -> None: method test_sampling_without_create_message_required (line 139) | def test_sampling_without_create_message_required(self) -> None: class TestHasTaskAugmentedElicitation (line 154) | class TestHasTaskAugmentedElicitation: method test_tasks_none (line 157) | def test_tasks_none(self) -> None: method test_requests_none (line 162) | def test_requests_none(self) -> None: method test_elicitation_none (line 167) | def test_elicitation_none(self) -> None: method test_create_none (line 172) | def test_create_none(self) -> None: method test_create_present (line 181) | def test_create_present(self) -> None: class TestHasTaskAugmentedSampling (line 193) | class TestHasTaskAugmentedSampling: method test_tasks_none (line 196) | def test_tasks_none(self) -> None: method test_requests_none (line 201) | def test_requests_none(self) -> None: method test_sampling_none (line 206) | def test_sampling_none(self) -> None: method test_create_message_none (line 211) | def test_create_message_none(self) -> None: method test_create_message_present (line 218) | def test_create_message_present(self) -> None: class TestRequireTaskAugmentedElicitation (line 230) | class TestRequireTaskAugmentedElicitation: method test_raises_when_none (line 233) | def test_raises_when_none(self) -> None: method test_raises_when_missing (line 239) | def test_raises_when_missing(self) -> None: method test_passes_when_present (line 246) | def test_passes_when_present(self) -> None: class TestRequireTaskAugmentedSampling (line 258) | class TestRequireTaskAugmentedSampling: method test_raises_when_none (line 261) | def test_raises_when_none(self) -> None: method test_raises_when_missing (line 267) | def test_raises_when_missing(self) -> None: method test_passes_when_present (line 274) | def test_passes_when_present(self) -> None: FILE: tests/experimental/tasks/test_elicitation_scenarios.py function create_client_task_handlers (line 48) | def create_client_task_handlers( function create_sampling_task_handlers (line 112) | def create_sampling_task_handlers( function test_scenario1_normal_tool_normal_elicitation (line 181) | async def test_scenario1_normal_tool_normal_elicitation() -> None: function test_scenario2_normal_tool_task_augmented_elicitation (line 260) | async def test_scenario2_normal_tool_task_augmented_elicitation() -> None: function test_scenario3_task_augmented_tool_normal_elicitation (line 338) | async def test_scenario3_task_augmented_tool_normal_elicitation() -> None: function test_scenario4_task_augmented_tool_task_augmented_elicitation (line 429) | async def test_scenario4_task_augmented_tool_task_augmented_elicitation(... function test_scenario2_sampling_normal_tool_task_augmented_sampling (line 528) | async def test_scenario2_sampling_normal_tool_task_augmented_sampling() ... function test_scenario4_sampling_task_augmented_tool_task_augmented_sampling (line 608) | async def test_scenario4_sampling_task_augmented_tool_task_augmented_sam... FILE: tests/experimental/tasks/test_message_queue.py function queue (line 15) | def queue() -> InMemoryTaskMessageQueue: function make_request (line 19) | def make_request(id: int = 1, method: str = "test/method") -> JSONRPCReq... function make_notification (line 23) | def make_notification(method: str = "test/notify") -> JSONRPCNotification: class TestInMemoryTaskMessageQueue (line 27) | class TestInMemoryTaskMessageQueue: method test_enqueue_and_dequeue (line 29) | async def test_enqueue_and_dequeue(self, queue: InMemoryTaskMessageQue... method test_dequeue_empty_returns_none (line 42) | async def test_dequeue_empty_returns_none(self, queue: InMemoryTaskMes... method test_fifo_ordering (line 48) | async def test_fifo_ordering(self, queue: InMemoryTaskMessageQueue) ->... method test_separate_queues_per_task (line 65) | async def test_separate_queues_per_task(self, queue: InMemoryTaskMessa... method test_peek_does_not_remove (line 77) | async def test_peek_does_not_remove(self, queue: InMemoryTaskMessageQu... method test_is_empty (line 92) | async def test_is_empty(self, queue: InMemoryTaskMessageQueue) -> None: method test_clear_returns_all_messages (line 105) | async def test_clear_returns_all_messages(self, queue: InMemoryTaskMes... method test_clear_empty_queue (line 119) | async def test_clear_empty_queue(self, queue: InMemoryTaskMessageQueue... method test_notification_messages (line 125) | async def test_notification_messages(self, queue: InMemoryTaskMessageQ... method test_message_timestamp (line 138) | async def test_message_timestamp(self, queue: InMemoryTaskMessageQueue... method test_message_with_resolver (line 147) | async def test_message_with_resolver(self, queue: InMemoryTaskMessageQ... method test_cleanup_specific_task (line 167) | async def test_cleanup_specific_task(self, queue: InMemoryTaskMessageQ... method test_cleanup_all (line 178) | async def test_cleanup_all(self, queue: InMemoryTaskMessageQueue) -> N... method test_wait_for_message_returns_immediately_if_message_exists (line 189) | async def test_wait_for_message_returns_immediately_if_message_exists( method test_wait_for_message_blocks_until_message (line 201) | async def test_wait_for_message_blocks_until_message(self, queue: InMe... method test_notify_message_available_wakes_waiter (line 226) | async def test_notify_message_available_wakes_waiter(self, queue: InMe... method test_peek_empty_queue_returns_none (line 251) | async def test_peek_empty_queue_returns_none(self, queue: InMemoryTask... method test_wait_for_message_double_check_race_condition (line 257) | async def test_wait_for_message_double_check_race_condition(self, queu... class TestResolver (line 284) | class TestResolver: method test_set_result_and_wait (line 286) | async def test_set_result_and_wait(self) -> None: method test_set_exception_and_wait (line 297) | async def test_set_exception_and_wait(self) -> None: method test_set_result_when_already_completed_raises (line 309) | async def test_set_result_when_already_completed_raises(self) -> None: method test_set_exception_when_already_completed_raises (line 318) | async def test_set_exception_when_already_completed_raises(self) -> None: method test_done_returns_false_before_completion (line 327) | async def test_done_returns_false_before_completion(self) -> None: FILE: tests/experimental/tasks/test_request_context.py function test_is_task_true_when_metadata_present (line 20) | def test_is_task_true_when_metadata_present() -> None: function test_is_task_false_when_no_metadata (line 25) | def test_is_task_false_when_no_metadata() -> None: function test_client_supports_tasks_true (line 30) | def test_client_supports_tasks_true() -> None: function test_client_supports_tasks_false_no_tasks (line 35) | def test_client_supports_tasks_false_no_tasks() -> None: function test_client_supports_tasks_false_no_capabilities (line 40) | def test_client_supports_tasks_false_no_capabilities() -> None: function test_validate_task_mode_required_with_task_is_valid (line 45) | def test_validate_task_mode_required_with_task_is_valid() -> None: function test_validate_task_mode_required_without_task_returns_error (line 51) | def test_validate_task_mode_required_without_task_returns_error() -> None: function test_validate_task_mode_required_without_task_raises_by_default (line 59) | def test_validate_task_mode_required_without_task_raises_by_default() ->... function test_validate_task_mode_forbidden_without_task_is_valid (line 66) | def test_validate_task_mode_forbidden_without_task_is_valid() -> None: function test_validate_task_mode_forbidden_with_task_returns_error (line 72) | def test_validate_task_mode_forbidden_with_task_returns_error() -> None: function test_validate_task_mode_forbidden_with_task_raises_by_default (line 80) | def test_validate_task_mode_forbidden_with_task_raises_by_default() -> N... function test_validate_task_mode_none_treated_as_forbidden (line 87) | def test_validate_task_mode_none_treated_as_forbidden() -> None: function test_validate_task_mode_optional_with_task_is_valid (line 94) | def test_validate_task_mode_optional_with_task_is_valid() -> None: function test_validate_task_mode_optional_without_task_is_valid (line 100) | def test_validate_task_mode_optional_without_task_is_valid() -> None: function test_validate_for_tool_with_execution_required (line 106) | def test_validate_for_tool_with_execution_required() -> None: function test_validate_for_tool_without_execution (line 119) | def test_validate_for_tool_without_execution() -> None: function test_validate_for_tool_optional_with_task (line 132) | def test_validate_for_tool_optional_with_task() -> None: function test_can_use_tool_required_with_task_support (line 144) | def test_can_use_tool_required_with_task_support() -> None: function test_can_use_tool_required_without_task_support (line 149) | def test_can_use_tool_required_without_task_support() -> None: function test_can_use_tool_optional_without_task_support (line 154) | def test_can_use_tool_optional_without_task_support() -> None: function test_can_use_tool_forbidden_without_task_support (line 159) | def test_can_use_tool_forbidden_without_task_support() -> None: function test_can_use_tool_none_without_task_support (line 164) | def test_can_use_tool_none_without_task_support() -> None: FILE: tests/experimental/tasks/test_spec_compliance.py function _get_capabilities (line 32) | def _get_capabilities(server: Server) -> ServerCapabilities: function test_server_without_task_handlers_has_no_tasks_capability (line 40) | def test_server_without_task_handlers_has_no_tasks_capability() -> None: function _noop_get_task (line 47) | async def _noop_get_task(ctx: ServerRequestContext, params: GetTaskReque... function _noop_list_tasks (line 51) | async def _noop_list_tasks(ctx: ServerRequestContext, params: PaginatedR... function _noop_cancel_task (line 55) | async def _noop_cancel_task(ctx: ServerRequestContext, params: CancelTas... function test_server_with_list_tasks_handler_declares_list_capability (line 59) | def test_server_with_list_tasks_handler_declares_list_capability() -> None: function test_server_with_cancel_task_handler_declares_cancel_capability (line 69) | def test_server_with_cancel_task_handler_declares_cancel_capability() ->... function test_server_with_get_task_handler_declares_requests_tools_call_capability (line 79) | def test_server_with_get_task_handler_declares_requests_tools_call_capab... function test_server_without_list_handler_has_no_list_capability (line 97) | def test_server_without_list_handler_has_no_list_capability() -> None: ... function test_server_without_cancel_handler_has_no_cancel_capability (line 112) | def test_server_without_cancel_handler_has_no_cancel_capability() -> Non... function test_server_with_all_task_handlers_has_full_capability (line 122) | def test_server_with_all_task_handlers_has_full_capability() -> None: class TestClientCapabilities (line 139) | class TestClientCapabilities: method test_client_declares_tasks_capability (line 147) | def test_client_declares_tasks_capability(self) -> None: class TestToolLevelNegotiation (line 152) | class TestToolLevelNegotiation: method test_tool_execution_task_forbidden_rejects_task_augmented_call (line 159) | def test_tool_execution_task_forbidden_rejects_task_augmented_call(sel... method test_tool_execution_task_absent_rejects_task_augmented_call (line 163) | def test_tool_execution_task_absent_rejects_task_augmented_call(self) ... method test_tool_execution_task_optional_accepts_normal_call (line 167) | def test_tool_execution_task_optional_accepts_normal_call(self) -> None: method test_tool_execution_task_optional_accepts_task_augmented_call (line 171) | def test_tool_execution_task_optional_accepts_task_augmented_call(self... method test_tool_execution_task_required_rejects_normal_call (line 175) | def test_tool_execution_task_required_rejects_normal_call(self) -> None: method test_tool_execution_task_required_accepts_task_augmented_call (line 179) | def test_tool_execution_task_required_accepts_task_augmented_call(self... class TestCapabilityNegotiation (line 184) | class TestCapabilityNegotiation: method test_receiver_without_capability_ignores_task_metadata (line 193) | def test_receiver_without_capability_ignores_task_metadata(self) -> None: method test_receiver_with_capability_may_require_task_augmentation (line 199) | def test_receiver_with_capability_may_require_task_augmentation(self) ... class TestTaskStatusLifecycle (line 206) | class TestTaskStatusLifecycle: method test_task_begins_in_working_status (line 218) | def test_task_begins_in_working_status(self) -> None: method test_working_to_completed_transition (line 222) | def test_working_to_completed_transition(self) -> None: method test_working_to_failed_transition (line 226) | def test_working_to_failed_transition(self) -> None: method test_working_to_cancelled_transition (line 230) | def test_working_to_cancelled_transition(self) -> None: method test_working_to_input_required_transition (line 234) | def test_working_to_input_required_transition(self) -> None: method test_input_required_to_working_transition (line 238) | def test_input_required_to_working_transition(self) -> None: method test_input_required_to_terminal_transition (line 242) | def test_input_required_to_terminal_transition(self) -> None: method test_terminal_state_no_further_transitions (line 246) | def test_terminal_state_no_further_transitions(self) -> None: method test_completed_is_terminal (line 250) | def test_completed_is_terminal(self) -> None: method test_failed_is_terminal (line 254) | def test_failed_is_terminal(self) -> None: method test_cancelled_is_terminal (line 258) | def test_cancelled_is_terminal(self) -> None: class TestInputRequiredStatus (line 263) | class TestInputRequiredStatus: method test_input_required_status_retrievable_via_tasks_get (line 269) | def test_input_required_status_retrievable_via_tasks_get(self) -> None: method test_input_required_related_task_metadata_in_requests (line 273) | def test_input_required_related_task_metadata_in_requests(self) -> None: class TestCreatingTask (line 280) | class TestCreatingTask: method test_task_augmented_request_returns_create_task_result (line 290) | def test_task_augmented_request_returns_create_task_result(self) -> None: method test_create_task_result_contains_task_id (line 294) | def test_create_task_result_contains_task_id(self) -> None: method test_create_task_result_contains_status_working (line 298) | def test_create_task_result_contains_status_working(self) -> None: method test_create_task_result_contains_created_at (line 302) | def test_create_task_result_contains_created_at(self) -> None: method test_create_task_result_created_at_is_iso8601 (line 306) | def test_create_task_result_created_at_is_iso8601(self) -> None: method test_create_task_result_may_contain_ttl (line 310) | def test_create_task_result_may_contain_ttl(self) -> None: method test_create_task_result_may_contain_poll_interval (line 314) | def test_create_task_result_may_contain_poll_interval(self) -> None: method test_create_task_result_may_contain_status_message (line 318) | def test_create_task_result_may_contain_status_message(self) -> None: method test_receiver_may_override_requested_ttl (line 322) | def test_receiver_may_override_requested_ttl(self) -> None: method test_model_immediate_response_in_meta (line 326) | def test_model_immediate_response_in_meta(self) -> None: class TestGettingTaskStatus (line 360) | class TestGettingTaskStatus: method test_tasks_get_returns_task_object (line 365) | def test_tasks_get_returns_task_object(self) -> None: method test_tasks_get_returns_current_status (line 369) | def test_tasks_get_returns_current_status(self) -> None: method test_tasks_get_may_return_poll_interval (line 373) | def test_tasks_get_may_return_poll_interval(self) -> None: method test_tasks_get_invalid_task_id_returns_error (line 377) | def test_tasks_get_invalid_task_id_returns_error(self) -> None: method test_tasks_get_nonexistent_task_id_returns_error (line 381) | def test_tasks_get_nonexistent_task_id_returns_error(self) -> None: class TestRetrievingResults (line 386) | class TestRetrievingResults: method test_tasks_result_returns_underlying_result (line 393) | def test_tasks_result_returns_underlying_result(self) -> None: method test_tasks_result_blocks_until_terminal (line 397) | def test_tasks_result_blocks_until_terminal(self) -> None: method test_tasks_result_unblocks_on_terminal (line 401) | def test_tasks_result_unblocks_on_terminal(self) -> None: method test_tasks_result_includes_related_task_metadata (line 405) | def test_tasks_result_includes_related_task_metadata(self) -> None: method test_tasks_result_returns_error_for_failed_task (line 409) | def test_tasks_result_returns_error_for_failed_task(self) -> None: method test_tasks_result_invalid_task_id_returns_error (line 415) | def test_tasks_result_invalid_task_id_returns_error(self) -> None: class TestListingTasks (line 420) | class TestListingTasks: method test_tasks_list_returns_array_of_tasks (line 425) | def test_tasks_list_returns_array_of_tasks(self) -> None: method test_tasks_list_pagination_with_cursor (line 429) | def test_tasks_list_pagination_with_cursor(self) -> None: method test_tasks_list_returns_next_cursor_when_more_results (line 433) | def test_tasks_list_returns_next_cursor_when_more_results(self) -> None: method test_tasks_list_cursors_are_opaque (line 437) | def test_tasks_list_cursors_are_opaque(self) -> None: method test_tasks_list_invalid_cursor_returns_error (line 441) | def test_tasks_list_invalid_cursor_returns_error(self) -> None: class TestCancellingTasks (line 446) | class TestCancellingTasks: method test_tasks_cancel_returns_cancelled_task (line 451) | def test_tasks_cancel_returns_cancelled_task(self) -> None: method test_tasks_cancel_terminal_task_returns_error (line 455) | def test_tasks_cancel_terminal_task_returns_error(self) -> None: method test_tasks_cancel_completed_task_returns_error (line 459) | def test_tasks_cancel_completed_task_returns_error(self) -> None: method test_tasks_cancel_failed_task_returns_error (line 463) | def test_tasks_cancel_failed_task_returns_error(self) -> None: method test_tasks_cancel_already_cancelled_task_returns_error (line 467) | def test_tasks_cancel_already_cancelled_task_returns_error(self) -> None: method test_tasks_cancel_invalid_task_id_returns_error (line 471) | def test_tasks_cancel_invalid_task_id_returns_error(self) -> None: class TestStatusNotifications (line 476) | class TestStatusNotifications: method test_receiver_may_send_status_notification (line 481) | def test_receiver_may_send_status_notification(self) -> None: method test_status_notification_contains_task_id (line 485) | def test_status_notification_contains_task_id(self) -> None: method test_status_notification_contains_status (line 489) | def test_status_notification_contains_status(self) -> None: class TestTaskManagement (line 494) | class TestTaskManagement: method test_task_ids_are_unique_strings (line 504) | def test_task_ids_are_unique_strings(self) -> None: method test_multiple_tasks_have_unique_ids (line 508) | def test_multiple_tasks_have_unique_ids(self) -> None: method test_receiver_may_delete_tasks_after_ttl (line 512) | def test_receiver_may_delete_tasks_after_ttl(self) -> None: method test_related_task_metadata_in_task_messages (line 516) | def test_related_task_metadata_in_task_messages(self) -> None: method test_tasks_get_does_not_require_related_task_metadata (line 522) | def test_tasks_get_does_not_require_related_task_metadata(self) -> None: method test_tasks_list_does_not_require_related_task_metadata (line 526) | def test_tasks_list_does_not_require_related_task_metadata(self) -> None: method test_tasks_cancel_does_not_require_related_task_metadata (line 530) | def test_tasks_cancel_does_not_require_related_task_metadata(self) -> ... class TestResultHandling (line 535) | class TestResultHandling: method test_create_task_result_returned_immediately (line 541) | def test_create_task_result_returned_immediately(self) -> None: method test_tasks_result_matches_underlying_result_structure (line 545) | def test_tasks_result_matches_underlying_result_structure(self) -> None: method test_tasks_result_for_tool_call_returns_call_tool_result (line 549) | def test_tasks_result_for_tool_call_returns_call_tool_result(self) -> ... class TestProgressTracking (line 554) | class TestProgressTracking: method test_progress_token_valid_throughout_task_lifetime (line 559) | def test_progress_token_valid_throughout_task_lifetime(self) -> None: method test_progress_notifications_sent_during_task_execution (line 563) | def test_progress_notifications_sent_during_task_execution(self) -> None: class TestProtocolErrors (line 568) | class TestProtocolErrors: method test_invalid_request_for_required_task_augmentation (line 575) | def test_invalid_request_for_required_task_augmentation(self) -> None: method test_invalid_params_for_invalid_task_id (line 579) | def test_invalid_params_for_invalid_task_id(self) -> None: method test_invalid_params_for_nonexistent_task_id (line 583) | def test_invalid_params_for_nonexistent_task_id(self) -> None: method test_invalid_params_for_invalid_cursor (line 587) | def test_invalid_params_for_invalid_cursor(self) -> None: method test_invalid_params_for_cancel_terminal_task (line 591) | def test_invalid_params_for_cancel_terminal_task(self) -> None: method test_internal_error_for_server_failure (line 595) | def test_internal_error_for_server_failure(self) -> None: class TestTaskExecutionErrors (line 600) | class TestTaskExecutionErrors: method test_underlying_failure_moves_task_to_failed (line 607) | def test_underlying_failure_moves_task_to_failed(self) -> None: method test_failed_task_has_status_message (line 611) | def test_failed_task_has_status_message(self) -> None: method test_tasks_result_returns_underlying_error (line 615) | def test_tasks_result_returns_underlying_error(self) -> None: method test_tool_call_is_error_true_moves_to_failed (line 619) | def test_tool_call_is_error_true_moves_to_failed(self) -> None: class TestTaskObject (line 624) | class TestTaskObject: method test_task_has_task_id_string (line 634) | def test_task_has_task_id_string(self) -> None: method test_task_has_status (line 638) | def test_task_has_status(self) -> None: method test_task_status_message_is_optional (line 642) | def test_task_status_message_is_optional(self) -> None: method test_task_has_created_at (line 646) | def test_task_has_created_at(self) -> None: method test_task_ttl_is_optional (line 650) | def test_task_ttl_is_optional(self) -> None: method test_task_poll_interval_is_optional (line 654) | def test_task_poll_interval_is_optional(self) -> None: class TestRelatedTaskMetadata (line 659) | class TestRelatedTaskMetadata: method test_related_task_metadata_structure (line 664) | def test_related_task_metadata_structure(self) -> None: method test_related_task_metadata_contains_task_id (line 668) | def test_related_task_metadata_contains_task_id(self) -> None: class TestAccessAndIsolation (line 673) | class TestAccessAndIsolation: method test_task_bound_to_authorization_context (line 679) | def test_task_bound_to_authorization_context(self) -> None: method test_reject_task_operations_outside_authorization_context (line 683) | def test_reject_task_operations_outside_authorization_context(self) ->... method test_non_authorized_environments_use_secure_ids (line 689) | def test_non_authorized_environments_use_secure_ids(self) -> None: method test_non_authorized_environments_use_shorter_ttls (line 695) | def test_non_authorized_environments_use_shorter_ttls(self) -> None: class TestResourceLimits (line 700) | class TestResourceLimits: method test_concurrent_task_limit_enforced (line 707) | def test_concurrent_task_limit_enforced(self) -> None: method test_maximum_ttl_constraint_enforced (line 711) | def test_maximum_ttl_constraint_enforced(self) -> None: method test_expired_tasks_cleaned_up (line 715) | def test_expired_tasks_cleaned_up(self) -> None: FILE: tests/issues/test_100_tool_listing.py function test_list_tools_returns_all_tools (line 8) | async def test_list_tools_returns_all_tools(): FILE: tests/issues/test_1027_win_unreachable_cleanup.py function test_lifespan_cleanup_executed (line 24) | async def test_lifespan_cleanup_executed(): function test_stdin_close_triggers_cleanup (line 124) | async def test_stdin_close_triggers_cleanup(): FILE: tests/issues/test_129_resource_templates.py function test_resource_templates (line 8) | async def test_resource_templates(): FILE: tests/issues/test_1338_icons_and_metadata.py function test_icons_and_website_url (line 11) | async def test_icons_and_website_url(): function test_multiple_icons (line 95) | async def test_multiple_icons(): function test_no_icons_or_website (line 122) | async def test_no_icons_or_website(): FILE: tests/issues/test_1363_race_condition_streamable_http.py class RaceConditionTestServer (line 35) | class RaceConditionTestServer(Server): method __init__ (line 36) | def __init__(self): function create_app (line 40) | def create_app(json_response: bool = False) -> Starlette: class ServerThread (line 64) | class ServerThread(threading.Thread): method __init__ (line 67) | def __init__(self, app: Starlette): method run (line 72) | def run(self) -> None: method stop (line 87) | def stop(self) -> None: function check_logs_for_race_condition_errors (line 92) | def check_logs_for_race_condition_errors(caplog: pytest.LogCaptureFixtur... function test_race_condition_invalid_accept_headers (line 122) | async def test_race_condition_invalid_accept_headers(caplog: pytest.LogC... function test_race_condition_invalid_content_type (line 196) | async def test_race_condition_invalid_content_type(caplog: pytest.LogCap... function test_race_condition_message_router_async_for (line 236) | async def test_race_condition_message_router_async_for(caplog: pytest.Lo... FILE: tests/issues/test_141_resource_templates.py function test_resource_template_edge_cases (line 13) | async def test_resource_template_edge_cases(): function test_resource_template_client_interaction (line 66) | async def test_resource_template_client_interaction(): FILE: tests/issues/test_152_resource_mime_type.py function test_mcpserver_resource_mime_type (line 20) | async def test_mcpserver_resource_mime_type(): function test_lowlevel_resource_mime_type (line 66) | async def test_lowlevel_resource_mime_type(): FILE: tests/issues/test_1574_resource_uri_validation.py function test_relative_uri_roundtrip (line 28) | async def test_relative_uri_roundtrip(): function test_custom_scheme_uri_roundtrip (line 70) | async def test_custom_scheme_uri_roundtrip(): function test_uri_json_roundtrip_preserves_value (line 106) | def test_uri_json_roundtrip_preserves_value(): function test_resource_contents_uri_json_roundtrip (line 128) | def test_resource_contents_uri_json_roundtrip(): FILE: tests/issues/test_1754_mime_type_parameters.py function test_mime_type_with_parameters (line 15) | async def test_mime_type_with_parameters(): function test_mime_type_with_parameters_and_space (line 29) | async def test_mime_type_with_parameters_and_space(): function test_mime_type_with_multiple_parameters (line 42) | async def test_mime_type_with_multiple_parameters(): function test_mime_type_preserved_in_read_resource (line 55) | async def test_mime_type_preserved_in_read_resource(): FILE: tests/issues/test_176_progress_token.py function test_progress_token_zero_first_call (line 12) | async def test_progress_token_zero_first_call(): FILE: tests/issues/test_188_concurrency.py function test_messages_are_executed_concurrently_tools (line 9) | async def test_messages_are_executed_concurrently_tools(): function test_messages_are_executed_concurrently_tools_and_resources (line 50) | async def test_messages_are_executed_concurrently_tools_and_resources(): FILE: tests/issues/test_192_request_id.py function test_request_id_match (line 21) | async def test_request_id_match() -> None: FILE: tests/issues/test_342_base64_encoding.py function test_server_base64_encoding (line 18) | async def test_server_base64_encoding(): FILE: tests/issues/test_355_type_error.py class Database (line 8) | class Database: # Replace with your actual DB type method connect (line 10) | async def connect(cls): # pragma: no cover method disconnect (line 13) | async def disconnect(self): # pragma: no cover method query (line 16) | def query(self): # pragma: no cover class AppContext (line 25) | class AppContext: function app_lifespan (line 30) | async def app_lifespan(server: MCPServer) -> AsyncIterator[AppContext]: ... function query_db (line 47) | def query_db(ctx: Context[AppContext]) -> str: # pragma: no cover FILE: tests/issues/test_552_windows_hang.py function test_windows_stdio_client_with_session (line 15) | async def test_windows_stdio_client_with_session(): FILE: tests/issues/test_88_random_error.py function test_notification_validation_error (line 19) | async def test_notification_validation_error(tmp_path: Path): FILE: tests/issues/test_973_url_decoding.py function test_template_matches_decodes_space (line 9) | def test_template_matches_decodes_space(): function test_template_matches_decodes_accented_characters (line 26) | def test_template_matches_decodes_accented_characters(): function test_template_matches_decodes_complex_phrase (line 43) | def test_template_matches_decodes_complex_phrase(): function test_template_matches_preserves_plus_sign (line 60) | def test_template_matches_preserves_plus_sign(): FILE: tests/issues/test_malformed_input.py function test_malformed_initialize_request_does_not_crash_server (line 14) | async def test_malformed_initialize_request_does_not_crash_server(): function test_multiple_concurrent_malformed_requests (line 94) | async def test_multiple_concurrent_malformed_requests(): FILE: tests/server/auth/middleware/test_auth_context.py class MockApp (line 17) | class MockApp: method __init__ (line 20) | def __init__(self): method __call__ (line 27) | async def __call__(self, scope: Scope, receive: Receive, send: Send) -... function valid_access_token (line 37) | def valid_access_token() -> AccessToken: function test_auth_context_middleware_with_authenticated_user (line 48) | async def test_auth_context_middleware_with_authenticated_user(valid_acc... function test_auth_context_middleware_with_no_user (line 87) | async def test_auth_context_middleware_with_no_user(): FILE: tests/server/auth/middleware/test_bearer_auth.py class MockOAuthProvider (line 16) | class MockOAuthProvider: method __init__ (line 23) | def __init__(self): method add_token (line 26) | def add_token(self, token: str, access_token: AccessToken) -> None: method load_access_token (line 30) | async def load_access_token(self, token: str) -> AccessToken | None: function add_token_to_provider (line 35) | def add_token_to_provider( class MockApp (line 49) | class MockApp: method __init__ (line 52) | def __init__(self): method __call__ (line 58) | async def __call__(self, scope: Scope, receive: Receive, send: Send) -... function mock_oauth_provider (line 66) | def mock_oauth_provider() -> OAuthAuthorizationServerProvider[Any, Any, ... function valid_access_token (line 73) | def valid_access_token() -> AccessToken: function expired_access_token (line 84) | def expired_access_token() -> AccessToken: function no_expiry_access_token (line 95) | def no_expiry_access_token() -> AccessToken: class TestBearerAuthBackend (line 106) | class TestBearerAuthBackend: method test_no_auth_header (line 109) | async def test_no_auth_header(self, mock_oauth_provider: OAuthAuthoriz... method test_non_bearer_auth_header (line 116) | async def test_non_bearer_auth_header(self, mock_oauth_provider: OAuth... method test_invalid_token (line 128) | async def test_invalid_token(self, mock_oauth_provider: OAuthAuthoriza... method test_expired_token (line 140) | async def test_expired_token( method test_valid_token (line 157) | async def test_valid_token( method test_token_without_expiry (line 181) | async def test_token_without_expiry( method test_lowercase_bearer_prefix (line 205) | async def test_lowercase_bearer_prefix( method test_mixed_case_bearer_prefix (line 225) | async def test_mixed_case_bearer_prefix( method test_mixed_case_authorization_header (line 245) | async def test_mixed_case_authorization_header( class TestRequireAuthMiddleware (line 267) | class TestRequireAuthMiddleware: method test_no_user (line 270) | async def test_no_user(self): method test_non_authenticated_user (line 294) | async def test_non_authenticated_user(self): method test_missing_required_scope (line 318) | async def test_missing_required_scope(self, valid_access_token: Access... method test_no_auth_credentials (line 347) | async def test_no_auth_credentials(self, valid_access_token: AccessTok... method test_has_required_scopes (line 375) | async def test_has_required_scopes(self, valid_access_token: AccessTok... method test_multiple_required_scopes (line 400) | async def test_multiple_required_scopes(self, valid_access_token: Acce... method test_no_required_scopes (line 425) | async def test_no_required_scopes(self, valid_access_token: AccessToken): FILE: tests/server/auth/test_error_handling.py function oauth_provider (line 23) | def oauth_provider(): function app (line 29) | def app(oauth_provider: MockOAuthProvider): function client (line 47) | def client(app: Starlette): function pkce_challenge (line 54) | def pkce_challenge(): function registered_client (line 68) | async def registered_client(client: httpx.AsyncClient) -> dict[str, Any]: function test_registration_error_handling (line 87) | async def test_registration_error_handling(client: httpx.AsyncClient, oa... function test_authorize_error_handling (line 120) | async def test_authorize_error_handling( function test_token_error_handling_auth_code (line 161) | async def test_token_error_handling_auth_code( function test_token_error_handling_refresh_token (line 220) | async def test_token_error_handling_refresh_token( FILE: tests/server/auth/test_protected_resource.py function test_app (line 15) | def test_app(): function test_client (line 32) | async def test_client(test_app: Starlette): function test_metadata_endpoint_with_path (line 39) | async def test_metadata_endpoint_with_path(test_client: httpx.AsyncClient): function test_metadata_endpoint_root_path_returns_404 (line 57) | async def test_metadata_endpoint_root_path_returns_404(test_client: http... function root_resource_app (line 66) | def root_resource_app(): function root_resource_client (line 82) | async def root_resource_client(root_resource_app: Starlette): function test_metadata_endpoint_without_path (line 91) | async def test_metadata_endpoint_without_path(root_resource_client: http... function test_metadata_url_construction_url_without_path (line 111) | def test_metadata_url_construction_url_without_path(): function test_metadata_url_construction_url_with_path_component (line 118) | def test_metadata_url_construction_url_with_path_component(): function test_metadata_url_construction_url_with_trailing_slash_only (line 125) | def test_metadata_url_construction_url_with_trailing_slash_only(): function test_metadata_url_construction_various_resource_configurations (line 142) | def test_metadata_url_construction_various_resource_configurations(resou... function test_route_consistency_route_path_matches_metadata_url (line 151) | def test_route_consistency_route_path_matches_metadata_url(): function test_route_consistency_consistent_paths_for_various_resources (line 180) | def test_route_consistency_consistent_paths_for_various_resources(resour... FILE: tests/server/auth/test_provider.py function test_construct_redirect_uri_no_existing_params (line 6) | def test_construct_redirect_uri_no_existing_params(): function test_construct_redirect_uri_with_existing_params (line 14) | def test_construct_redirect_uri_with_existing_params(): function test_construct_redirect_uri_multiple_existing_params (line 26) | def test_construct_redirect_uri_multiple_existing_params(): function test_construct_redirect_uri_with_none_values (line 36) | def test_construct_redirect_uri_with_none_values(): function test_construct_redirect_uri_empty_params (line 45) | def test_construct_redirect_uri_empty_params(): function test_construct_redirect_uri_duplicate_param_names (line 53) | def test_construct_redirect_uri_duplicate_param_names(): function test_construct_redirect_uri_multivalued_existing_params (line 63) | def test_construct_redirect_uri_multivalued_existing_params(): function test_construct_redirect_uri_encoded_values (line 73) | def test_construct_redirect_uri_encoded_values(): FILE: tests/server/auth/test_routes.py function test_validate_issuer_url_https_allowed (line 7) | def test_validate_issuer_url_https_allowed(): function test_validate_issuer_url_http_localhost_allowed (line 11) | def test_validate_issuer_url_http_localhost_allowed(): function test_validate_issuer_url_http_127_0_0_1_allowed (line 15) | def test_validate_issuer_url_http_127_0_0_1_allowed(): function test_validate_issuer_url_http_ipv6_loopback_allowed (line 19) | def test_validate_issuer_url_http_ipv6_loopback_allowed(): function test_validate_issuer_url_http_non_loopback_rejected (line 23) | def test_validate_issuer_url_http_non_loopback_rejected(): function test_validate_issuer_url_http_127_prefix_domain_rejected (line 28) | def test_validate_issuer_url_http_127_prefix_domain_rejected(): function test_validate_issuer_url_http_127_prefix_subdomain_rejected (line 34) | def test_validate_issuer_url_http_127_prefix_subdomain_rejected(): function test_validate_issuer_url_fragment_rejected (line 40) | def test_validate_issuer_url_fragment_rejected(): function test_validate_issuer_url_query_rejected (line 45) | def test_validate_issuer_url_query_rejected(): FILE: tests/server/lowlevel/test_helper_types.py function test_read_resource_contents_with_metadata (line 13) | def test_read_resource_contents_with_metadata(): function test_read_resource_contents_without_metadata (line 36) | def test_read_resource_contents_without_metadata(): function test_read_resource_contents_with_bytes (line 47) | def test_read_resource_contents_with_bytes(): FILE: tests/server/lowlevel/test_server_listing.py function test_list_prompts_basic (line 19) | async def test_list_prompts_basic() -> None: function test_list_resources_basic (line 38) | async def test_list_resources_basic() -> None: function test_list_tools_basic (line 57) | async def test_list_tools_basic() -> None: function test_list_prompts_empty (line 95) | async def test_list_prompts_empty() -> None: function test_list_resources_empty (line 110) | async def test_list_resources_empty() -> None: function test_list_tools_empty (line 125) | async def test_list_tools_empty() -> None: FILE: tests/server/lowlevel/test_server_pagination.py function test_list_prompts_pagination (line 14) | async def test_list_prompts_pagination() -> None: function test_list_resources_pagination (line 39) | async def test_list_resources_pagination() -> None: function test_list_tools_pagination (line 64) | async def test_list_tools_pagination() -> None: FILE: tests/server/mcpserver/auth/test_auth_integration.py class MockOAuthProvider (line 30) | class MockOAuthProvider(OAuthAuthorizationServerProvider[AuthorizationCo... method __init__ (line 31) | def __init__(self): method get_client (line 37) | async def get_client(self, client_id: str) -> OAuthClientInformationFu... method register_client (line 40) | async def register_client(self, client_info: OAuthClientInformationFull): method authorize (line 44) | async def authorize(self, client: OAuthClientInformationFull, params: ... method load_authorization_code (line 61) | async def load_authorization_code( method exchange_authorization_code (line 66) | async def exchange_authorization_code( method load_refresh_token (line 97) | async def load_refresh_token(self, client: OAuthClientInformationFull,... method exchange_refresh_token (line 115) | async def exchange_refresh_token( method load_access_token (line 160) | async def load_access_token(self, token: str) -> AccessToken | None: method revoke_token (line 174) | async def revoke_token(self, token: AccessToken | RefreshToken) -> None: function mock_oauth_provider (line 191) | def mock_oauth_provider(): function auth_app (line 196) | def auth_app(mock_oauth_provider: MockOAuthProvider): function test_client (line 217) | async def test_client(auth_app: Starlette): function registered_client (line 223) | async def registered_client( function pkce_challenge (line 252) | def pkce_challenge(): function auth_code (line 261) | async def auth_code( class TestAuthEndpoints (line 306) | class TestAuthEndpoints: method test_metadata_endpoint (line 308) | async def test_metadata_endpoint(self, test_client: httpx.AsyncClient): method test_token_validation_error (line 330) | async def test_token_validation_error(self, test_client: httpx.AsyncCl... method test_token_invalid_client_secret_returns_invalid_client (line 347) | async def test_token_invalid_client_secret_returns_invalid_client( method test_token_invalid_auth_code (line 395) | async def test_token_invalid_auth_code( method test_token_expired_auth_code (line 421) | async def test_token_expired_auth_code( method test_token_redirect_uri_mismatch (line 476) | async def test_token_redirect_uri_mismatch( method test_token_code_verifier_mismatch (line 503) | async def test_token_code_verifier_mismatch( method test_token_invalid_refresh_token (line 526) | async def test_token_invalid_refresh_token(self, test_client: httpx.As... method test_token_expired_refresh_token (line 544) | async def test_token_expired_refresh_token( method test_token_invalid_scope (line 592) | async def test_token_invalid_scope( method test_client_registration (line 634) | async def test_client_registration(self, test_client: httpx.AsyncClien... method test_client_registration_missing_required_fields (line 660) | async def test_client_registration_missing_required_fields(self, test_... method test_client_registration_invalid_uri (line 679) | async def test_client_registration_invalid_uri(self, test_client: http... method test_client_registration_empty_redirect_uris (line 700) | async def test_client_registration_empty_redirect_uris(self, test_clie... method test_authorize_form_post (line 721) | async def test_authorize_form_post(self, test_client: httpx.AsyncClien... method test_authorization_get (line 760) | async def test_authorization_get( method test_revoke_invalid_token (line 870) | async def test_revoke_invalid_token(self, test_client: httpx.AsyncClie... method test_revoke_with_malformed_token (line 884) | async def test_revoke_with_malformed_token(self, test_client: httpx.As... method test_client_registration_disallowed_scopes (line 900) | async def test_client_registration_disallowed_scopes(self, test_client... method test_client_registration_default_scopes (line 917) | async def test_client_registration_default_scopes( method test_client_registration_with_authorization_code_only (line 941) | async def test_client_registration_with_authorization_code_only(self, ... method test_client_registration_missing_authorization_code (line 956) | async def test_client_registration_missing_authorization_code(self, te... method test_client_registration_with_additional_grant_type (line 972) | async def test_client_registration_with_additional_grant_type(self, te... method test_client_registration_with_additional_response_types (line 989) | async def test_client_registration_with_additional_response_types( method test_client_registration_response_types_without_code (line 1009) | async def test_client_registration_response_types_without_code(self, t... method test_client_registration_default_response_types (line 1026) | async def test_client_registration_default_response_types( method test_client_secret_basic_authentication (line 1045) | async def test_client_secret_basic_authentication( method test_wrong_auth_method_without_valid_credentials_fails (line 1091) | async def test_wrong_auth_method_without_valid_credentials_fails( method test_basic_auth_without_header_fails (line 1143) | async def test_basic_auth_without_header_fails( method test_basic_auth_invalid_base64_fails (line 1188) | async def test_basic_auth_invalid_base64_fails( method test_basic_auth_no_colon_fails (line 1233) | async def test_basic_auth_no_colon_fails( method test_basic_auth_client_id_mismatch_fails (line 1279) | async def test_basic_auth_client_id_mismatch_fails( method test_none_auth_method_public_client (line 1325) | async def test_none_auth_method_public_client( class TestAuthorizeEndpointErrors (line 1370) | class TestAuthorizeEndpointErrors: method test_authorize_missing_client_id (line 1374) | async def test_authorize_missing_client_id(self, test_client: httpx.As... method test_authorize_invalid_client_id (line 1398) | async def test_authorize_invalid_client_id(self, test_client: httpx.As... method test_authorize_missing_redirect_uri (line 1422) | async def test_authorize_missing_redirect_uri( method test_authorize_invalid_redirect_uri (line 1448) | async def test_authorize_invalid_redirect_uri( method test_authorize_missing_redirect_uri_multiple_registered (line 1488) | async def test_authorize_missing_redirect_uri_multiple_registered( method test_authorize_unsupported_response_type (line 1514) | async def test_authorize_unsupported_response_type( method test_authorize_missing_response_type (line 1548) | async def test_authorize_missing_response_type( method test_authorize_missing_pkce_challenge (line 1581) | async def test_authorize_missing_pkce_challenge( method test_authorize_invalid_scope (line 1612) | async def test_authorize_invalid_scope( FILE: tests/server/mcpserver/prompts/test_base.py class TestRenderPrompt (line 10) | class TestRenderPrompt: method test_basic_fn (line 12) | async def test_basic_fn(self): method test_async_fn (line 22) | async def test_async_fn(self): method test_fn_with_args (line 32) | async def test_fn_with_args(self): method test_fn_with_invalid_kwargs (line 42) | async def test_fn_with_invalid_kwargs(self): method test_fn_returns_message (line 51) | async def test_fn_returns_message(self): method test_fn_returns_assistant_message (line 61) | async def test_fn_returns_assistant_message(self): method test_fn_returns_multiple_messages (line 71) | async def test_fn_returns_multiple_messages(self): method test_fn_returns_list_of_strings (line 85) | async def test_fn_returns_list_of_strings(self): method test_fn_returns_resource_content (line 98) | async def test_fn_returns_resource_content(self): method test_fn_returns_mixed_content (line 128) | async def test_fn_returns_mixed_content(self): method test_fn_returns_dict_with_resource (line 164) | async def test_fn_returns_dict_with_resource(self): FILE: tests/server/mcpserver/prompts/test_manager.py class TestPromptManager (line 9) | class TestPromptManager: method test_add_prompt (line 10) | def test_add_prompt(self): method test_add_duplicate_prompt (line 22) | def test_add_duplicate_prompt(self, caplog: pytest.LogCaptureFixture): method test_disable_warn_on_duplicate_prompts (line 35) | def test_disable_warn_on_duplicate_prompts(self, caplog: pytest.LogCap... method test_list_prompts (line 48) | def test_list_prompts(self): method test_render_prompt (line 67) | async def test_render_prompt(self): method test_render_prompt_with_args (line 80) | async def test_render_prompt_with_args(self): method test_render_unknown_prompt (line 93) | async def test_render_unknown_prompt(self): method test_render_prompt_with_missing_args (line 100) | async def test_render_prompt_with_missing_args(self): FILE: tests/server/mcpserver/resources/test_file_resources.py function temp_file (line 11) | def temp_file(): class TestFileResource (line 27) | class TestFileResource: method test_file_resource_creation (line 30) | def test_file_resource_creation(self, temp_file: Path): method test_file_resource_str_path_conversion (line 45) | def test_file_resource_str_path_conversion(self, temp_file: Path): method test_read_text_file (line 56) | async def test_read_text_file(self, temp_file: Path): method test_read_binary_file (line 68) | async def test_read_binary_file(self, temp_file: Path): method test_relative_path_error (line 80) | def test_relative_path_error(self): method test_missing_file_error (line 90) | async def test_missing_file_error(self, temp_file: Path): method test_permission_error (line 104) | async def test_permission_error(self, temp_file: Path): # pragma: lax... FILE: tests/server/mcpserver/resources/test_function_resources.py class TestFunctionResource (line 7) | class TestFunctionResource: method test_function_resource_creation (line 10) | def test_function_resource_creation(self): method test_read_text (line 29) | async def test_read_text(self): method test_read_binary (line 45) | async def test_read_binary(self): method test_json_conversion (line 60) | async def test_json_conversion(self): method test_error_handling (line 76) | async def test_error_handling(self): method test_basemodel_conversion (line 91) | async def test_basemodel_conversion(self): method test_custom_type_conversion (line 106) | async def test_custom_type_conversion(self): method test_async_read_text (line 125) | async def test_async_read_text(self): method test_from_function (line 141) | async def test_from_function(self): class TestFunctionResourceMetadata (line 160) | class TestFunctionResourceMetadata: method test_from_function_with_metadata (line 161) | def test_from_function_with_metadata(self): method test_from_function_without_metadata (line 181) | def test_from_function_without_metadata(self): FILE: tests/server/mcpserver/resources/test_resource_manager.py function temp_file (line 12) | def temp_file(): class TestResourceManager (line 28) | class TestResourceManager: method test_add_resource (line 31) | def test_add_resource(self, temp_file: Path): method test_add_duplicate_resource (line 43) | def test_add_duplicate_resource(self, temp_file: Path): method test_warn_on_duplicate_resources (line 56) | def test_warn_on_duplicate_resources(self, temp_file: Path, caplog: py... method test_disable_warn_on_duplicate_resources (line 68) | def test_disable_warn_on_duplicate_resources(self, temp_file: Path, ca... method test_get_resource (line 81) | async def test_get_resource(self, temp_file: Path): method test_get_resource_from_template (line 94) | async def test_get_resource_from_template(self): method test_get_unknown_resource (line 114) | async def test_get_unknown_resource(self): method test_list_resources (line 120) | def test_list_resources(self, temp_file: Path): class TestResourceManagerMetadata (line 140) | class TestResourceManagerMetadata: method test_add_template_with_metadata (line 143) | def test_add_template_with_metadata(self): method test_add_template_without_metadata (line 164) | def test_add_template_without_metadata(self): FILE: tests/server/mcpserver/resources/test_resource_template.py class TestResourceTemplate (line 12) | class TestResourceTemplate: method test_template_creation (line 15) | def test_template_creation(self): method test_template_matches (line 31) | def test_template_matches(self): method test_create_resource (line 52) | async def test_create_resource(self): method test_template_error (line 77) | async def test_template_error(self): method test_async_text_resource (line 93) | async def test_async_text_resource(self): method test_async_binary_resource (line 116) | async def test_async_binary_resource(self): method test_basemodel_conversion (line 139) | async def test_basemodel_conversion(self): method test_custom_type_conversion (line 168) | async def test_custom_type_conversion(self): class TestResourceTemplateAnnotations (line 198) | class TestResourceTemplateAnnotations: method test_template_with_annotations (line 201) | def test_template_with_annotations(self): method test_template_without_annotations (line 216) | def test_template_without_annotations(self): method test_template_annotations_in_mcpserver (line 227) | async def test_template_annotations_in_mcpserver(self): method test_template_created_resources_inherit_annotations (line 244) | async def test_template_created_resources_inherit_annotations(self): class TestResourceTemplateMetadata (line 268) | class TestResourceTemplateMetadata: method test_template_from_function_with_metadata (line 271) | def test_template_from_function_with_metadata(self): method test_template_created_resources_inherit_metadata (line 291) | async def test_template_created_resources_inherit_metadata(self): FILE: tests/server/mcpserver/resources/test_resources.py class TestResourceValidation (line 8) | class TestResourceValidation: method test_resource_uri_accepts_any_string (line 11) | def test_resource_uri_accepts_any_string(self): method test_resource_name_from_uri (line 41) | def test_resource_name_from_uri(self): method test_resource_name_validation (line 53) | def test_resource_name_validation(self): method test_resource_mime_type (line 73) | def test_resource_mime_type(self): method test_resource_read_abstract (line 103) | async def test_resource_read_abstract(self): class TestResourceAnnotations (line 113) | class TestResourceAnnotations: method test_resource_with_annotations (line 116) | def test_resource_with_annotations(self): method test_resource_without_annotations (line 130) | def test_resource_without_annotations(self): method test_resource_annotations_in_mcpserver (line 141) | async def test_resource_annotations_in_mcpserver(self): method test_resource_annotations_with_both_audiences (line 158) | async def test_resource_annotations_with_both_audiences(self): class TestAnnotationsValidation (line 173) | class TestAnnotationsValidation: method test_priority_validation (line 176) | def test_priority_validation(self): method test_audience_validation (line 191) | def test_audience_validation(self): class TestResourceMetadata (line 205) | class TestResourceMetadata: method test_resource_with_metadata (line 208) | def test_resource_with_metadata(self): method test_resource_without_metadata (line 228) | def test_resource_without_metadata(self): FILE: tests/server/mcpserver/servers/test_file_server.py function test_dir (line 10) | def test_dir(tmp_path_factory: pytest.TempPathFactory) -> Path: function mcp (line 23) | def mcp() -> MCPServer: function resources (line 30) | def resources(mcp: MCPServer, test_dir: Path) -> MCPServer: function tools (line 64) | def tools(mcp: MCPServer, test_dir: Path) -> MCPServer: function test_list_resources (line 77) | async def test_list_resources(mcp: MCPServer): function test_read_resource_dir (line 90) | async def test_read_resource_dir(mcp: MCPServer): function test_read_resource_file (line 107) | async def test_read_resource_file(mcp: MCPServer): function test_delete_file (line 116) | async def test_delete_file(mcp: MCPServer, test_dir: Path): function test_delete_file_and_check_resources (line 122) | async def test_delete_file_and_check_resources(mcp: MCPServer, test_dir:... FILE: tests/server/mcpserver/test_elicitation.py class AnswerSchema (line 16) | class AnswerSchema(BaseModel): function create_ask_user_tool (line 20) | def create_ask_user_tool(mcp: MCPServer): function call_tool_and_assert (line 37) | async def call_tool_and_assert( function test_stdio_elicitation (line 61) | async def test_stdio_elicitation(): function test_stdio_elicitation_decline (line 79) | async def test_stdio_elicitation_decline(): function test_elicitation_schema_validation (line 93) | async def test_elicitation_schema_validation(): function test_elicitation_with_optional_fields (line 138) | async def test_elicitation_with_optional_fields(): function test_elicitation_with_default_values (line 253) | async def test_elicitation_with_default_values(): function test_elicitation_with_enum_titles (line 309) | async def test_elicitation_with_enum_titles(): FILE: tests/server/mcpserver/test_func_metadata.py class SomeInputModelA (line 20) | class SomeInputModelA(BaseModel): class SomeInputModelB (line 24) | class SomeInputModelB(BaseModel): class InnerModel (line 25) | class InnerModel(BaseModel): function complex_arguments_fn (line 33) | def complex_arguments_fn( function test_complex_function_runtime_arg_validation_non_json (line 95) | async def test_complex_function_runtime_arg_validation_non_json(): function test_complex_function_runtime_arg_validation_with_json (line 132) | async def test_complex_function_runtime_arg_validation_with_json(): function test_str_vs_list_str (line 158) | def test_str_vs_list_str(): function test_skip_names (line 185) | def test_skip_names(): function test_structured_output_dict_str_types (line 206) | def test_structured_output_dict_str_types(): function test_lambda_function (line 249) | async def test_lambda_function(): function test_complex_function_json_schema (line 283) | def test_complex_function_json_schema(): function test_str_vs_int (line 450) | def test_str_vs_int(): function test_str_annotation_preserves_json_string (line 464) | def test_str_annotation_preserves_json_string(): function test_str_annotation_runtime_validation (line 514) | async def test_str_annotation_runtime_validation(): function test_structured_output_requires_return_annotation (line 557) | def test_structured_output_requires_return_annotation(): function test_structured_output_basemodel (line 580) | def test_structured_output_basemodel(): function test_structured_output_primitives (line 604) | def test_structured_output_primitives(): function test_structured_output_generic_types (line 668) | def test_structured_output_generic_types(): function test_structured_output_dataclass (line 719) | def test_structured_output_dataclass(): function test_structured_output_typeddict (line 750) | def test_structured_output_typeddict(): function test_structured_output_ordinary_class (line 792) | def test_structured_output_ordinary_class(): function test_unstructured_output_unannotated_class (line 821) | def test_unstructured_output_unannotated_class(): function test_tool_call_result_is_unstructured_and_not_converted (line 835) | def test_tool_call_result_is_unstructured_and_not_converted(): function test_tool_call_result_annotated_is_structured_and_converted (line 845) | def test_tool_call_result_annotated_is_structured_and_converted(): function test_tool_call_result_annotated_is_structured_and_invalid (line 865) | def test_tool_call_result_annotated_is_structured_and_invalid(): function test_tool_call_result_in_optional_is_rejected (line 878) | def test_tool_call_result_in_optional_is_rejected(): function test_tool_call_result_in_union_is_rejected (line 891) | def test_tool_call_result_in_union_is_rejected(): function test_tool_call_result_in_pipe_union_is_rejected (line 904) | def test_tool_call_result_in_pipe_union_is_rejected(): function test_structured_output_with_field_descriptions (line 917) | def test_structured_output_with_field_descriptions(): function test_structured_output_nested_models (line 939) | def test_structured_output_nested_models(): function test_structured_output_unserializable_type_error (line 978) | def test_structured_output_unserializable_type_error(): function test_structured_output_aliases (line 1019) | def test_structured_output_aliases(): function test_basemodel_reserved_names (line 1064) | def test_basemodel_reserved_names(): function test_basemodel_reserved_names_validation (line 1092) | async def test_basemodel_reserved_names_validation(): function test_basemodel_reserved_names_with_json_preparsing (line 1150) | def test_basemodel_reserved_names_with_json_preparsing(): function test_disallowed_type_qualifier (line 1176) | def test_disallowed_type_qualifier(): function test_preserves_pydantic_metadata (line 1185) | def test_preserves_pydantic_metadata(): FILE: tests/server/mcpserver/test_integration.py class NotificationCollector (line 59) | class NotificationCollector: method __init__ (line 62) | def __init__(self): method handle_generic_notification (line 68) | async def handle_generic_notification( function sampling_callback (line 83) | async def sampling_callback( function elicitation_callback (line 97) | async def elicitation_callback(context: RequestContext[ClientSession], p... function test_basic_tools (line 109) | async def test_basic_tools() -> None: function test_basic_resources (line 127) | async def test_basic_resources() -> None: function test_basic_prompts (line 149) | async def test_basic_prompts() -> None: function test_tool_progress (line 183) | async def test_tool_progress() -> None: function test_sampling (line 220) | async def test_sampling() -> None: function test_elicitation (line 232) | async def test_elicitation() -> None: function test_notifications (line 262) | async def test_notifications() -> None: function test_completion (line 290) | async def test_completion() -> None: function test_mcpserver_quickstart (line 324) | async def test_mcpserver_quickstart() -> None: function test_structured_output (line 340) | async def test_structured_output() -> None: FILE: tests/server/mcpserver/test_parameter_descriptions.py function test_parameter_descriptions (line 10) | async def test_parameter_descriptions(): FILE: tests/server/mcpserver/test_server.py class TestServer (line 48) | class TestServer: method test_create_server (line 49) | async def test_create_server(self): method test_sse_app_returns_starlette_app (line 68) | async def test_sse_app_returns_starlette_app(self): method test_non_ascii_description (line 85) | async def test_non_ascii_description(self): method test_add_tool_decorator (line 108) | async def test_add_tool_decorator(self): method test_add_tool_decorator_incorrect_usage (line 117) | async def test_add_tool_decorator_incorrect_usage(self): method test_add_resource_decorator (line 126) | async def test_add_resource_decorator(self): method test_add_resource_decorator_incorrect_usage (line 135) | async def test_add_resource_decorator_incorrect_usage(self): class TestDnsRebindingProtection (line 145) | class TestDnsRebindingProtection: method test_auto_enabled_for_127_0_0_1_sse (line 152) | def test_auto_enabled_for_127_0_0_1_sse(self): method test_auto_enabled_for_127_0_0_1_streamable_http (line 161) | def test_auto_enabled_for_127_0_0_1_streamable_http(self): method test_auto_enabled_for_localhost_sse (line 167) | def test_auto_enabled_for_localhost_sse(self): method test_auto_enabled_for_ipv6_localhost_sse (line 173) | def test_auto_enabled_for_ipv6_localhost_sse(self): method test_not_auto_enabled_for_other_hosts_sse (line 179) | def test_not_auto_enabled_for_other_hosts_sse(self): method test_explicit_settings_not_overridden_sse (line 185) | def test_explicit_settings_not_overridden_sse(self): method test_explicit_settings_not_overridden_streamable_http (line 195) | def test_explicit_settings_not_overridden_streamable_http(self): function tool_fn (line 206) | def tool_fn(x: int, y: int) -> int: function error_tool_fn (line 210) | def error_tool_fn() -> None: function image_tool_fn (line 214) | def image_tool_fn(path: str) -> Image: function audio_tool_fn (line 218) | def audio_tool_fn(path: str) -> Audio: function mixed_content_tool_fn (line 222) | def mixed_content_tool_fn() -> list[ContentBlock]: class TestServerTools (line 230) | class TestServerTools: method test_add_tool (line 231) | async def test_add_tool(self): method test_list_tools (line 237) | async def test_list_tools(self): method test_call_tool (line 244) | async def test_call_tool(self): method test_tool_exception_handling (line 252) | async def test_tool_exception_handling(self): method test_tool_error_handling (line 263) | async def test_tool_error_handling(self): method test_tool_error_details (line 274) | async def test_tool_error_details(self): method test_tool_return_value_conversion (line 286) | async def test_tool_return_value_conversion(self): method test_tool_image_helper (line 299) | async def test_tool_image_helper(self, tmp_path: Path): method test_tool_audio_helper (line 319) | async def test_tool_audio_helper(self, tmp_path: Path): method test_tool_audio_suffix_detection (line 351) | async def test_tool_audio_suffix_detection(self, tmp_path: Path, filen... method test_tool_mixed_content (line 371) | async def test_tool_mixed_content(self): method test_tool_mixed_list_with_audio_and_image (line 401) | async def test_tool_mixed_list_with_audio_and_image(self, tmp_path: Pa... method test_tool_structured_output_basemodel (line 453) | async def test_tool_structured_output_basemodel(self): method test_tool_structured_output_primitive (line 487) | async def test_tool_structured_output_primitive(self): method test_tool_structured_output_list (line 513) | async def test_tool_structured_output_list(self): method test_tool_structured_output_server_side_validation_error (line 529) | async def test_tool_structured_output_server_side_validation_error(self): method test_tool_structured_output_dict_str_any (line 545) | async def test_tool_structured_output_dict_str_any(self): method test_tool_structured_output_dict_str_typed (line 586) | async def test_tool_structured_output_dict_str_typed(self): method test_remove_tool (line 609) | async def test_remove_tool(self): method test_remove_nonexistent_tool (line 623) | async def test_remove_nonexistent_tool(self): method test_remove_tool_and_list (line 630) | async def test_remove_tool_and_list(self): method test_remove_tool_and_call (line 653) | async def test_remove_tool_and_call(self): class TestServerResources (line 678) | class TestServerResources: method test_text_resource (line 679) | async def test_text_resource(self): method test_read_unknown_resource (line 694) | async def test_read_unknown_resource(self): method test_read_resource_error (line 702) | async def test_read_resource_error(self): method test_binary_resource (line 714) | async def test_binary_resource(self): method test_file_resource_text (line 734) | async def test_file_resource_text(self, tmp_path: Path): method test_file_resource_binary (line 750) | async def test_file_resource_binary(self, tmp_path: Path): method test_function_resource (line 771) | async def test_function_resource(self): class TestServerResourceTemplates (line 789) | class TestServerResourceTemplates: method test_resource_with_params (line 790) | async def test_resource_with_params(self): method test_resource_with_uri_params (line 801) | async def test_resource_with_uri_params(self): method test_resource_with_untyped_params (line 811) | async def test_resource_with_untyped_params(self): method test_resource_matching_params (line 819) | async def test_resource_matching_params(self): method test_resource_mismatched_params (line 833) | async def test_resource_mismatched_params(self): method test_resource_multiple_params (line 843) | async def test_resource_multiple_params(self): method test_resource_multiple_mismatched_params (line 857) | async def test_resource_multiple_mismatched_params(self): method test_template_to_resource_conversion (line 880) | async def test_template_to_resource_conversion(self): method test_resource_template_includes_mime_type (line 898) | async def test_resource_template_includes_mime_type(self): class TestServerResourceMetadata (line 924) | class TestServerResourceMetadata: method test_resource_decorator_with_metadata (line 931) | async def test_resource_decorator_with_metadata(self): method test_resource_template_decorator_with_metadata (line 952) | async def test_resource_template_decorator_with_metadata(self): method test_read_resource_returns_meta (line 973) | async def test_read_resource_returns_meta(self): class TestContextInjection (line 998) | class TestContextInjection: method test_context_detection (line 1001) | async def test_context_detection(self): method test_context_injection (line 1011) | async def test_context_injection(self): method test_async_context (line 1028) | async def test_async_context(self): method test_context_logging (line 1045) | async def test_context_logging(self): method test_optional_context (line 1072) | async def test_optional_context(self): method test_context_resource_access (line 1087) | async def test_context_resource_access(self): method test_resource_with_context (line 1110) | async def test_resource_with_context(self): method test_resource_without_context (line 1136) | async def test_resource_without_context(self): method test_resource_context_custom_name (line 1163) | async def test_resource_context_custom_name(self): method test_prompt_with_context (line 1191) | async def test_prompt_with_context(self): method test_prompt_without_context (line 1211) | async def test_prompt_without_context(self): class TestServerPrompts (line 1230) | class TestServerPrompts: method test_get_prompt_direct_call_without_context (line 1233) | async def test_get_prompt_direct_call_without_context(self): method test_prompt_decorator (line 1246) | async def test_prompt_decorator(self): method test_prompt_decorator_with_name (line 1262) | async def test_prompt_decorator_with_name(self): method test_prompt_decorator_with_description (line 1277) | async def test_prompt_decorator_with_description(self): method test_prompt_decorator_error (line 1292) | def test_prompt_decorator_error(self): method test_list_prompts (line 1300) | async def test_list_prompts(self): method test_get_prompt (line 1324) | async def test_get_prompt(self): method test_get_prompt_with_description (line 1341) | async def test_get_prompt_with_description(self): method test_get_prompt_with_docstring_description (line 1353) | async def test_get_prompt_with_docstring_description(self): method test_get_prompt_with_resource (line 1371) | async def test_get_prompt_with_resource(self): method test_get_unknown_prompt (line 1402) | async def test_get_unknown_prompt(self): method test_get_prompt_missing_args (line 1410) | async def test_get_prompt_missing_args(self): function test_completion_decorator (line 1422) | async def test_completion_decorator() -> None: function test_streamable_http_no_redirect (line 1439) | def test_streamable_http_no_redirect() -> None: function test_report_progress_passes_related_request_id (line 1455) | async def test_report_progress_passes_related_request_id(): FILE: tests/server/mcpserver/test_title.py function test_server_name_title_description_version (line 13) | async def test_server_name_title_description_version(): function test_tool_title_precedence (line 37) | async def test_tool_title_precedence(): function test_prompt_title (line 91) | async def test_prompt_title(): function test_resource_title (line 124) | async def test_resource_title(): function test_get_display_name_utility (line 197) | async def test_get_display_name_utility(): FILE: tests/server/mcpserver/test_tool_manager.py class TestAddTools (line 17) | class TestAddTools: method test_basic_function (line 18) | def test_basic_function(self): method test_init_with_tools (line 36) | def test_init_with_tools(self, caplog: pytest.LogCaptureFixture): method test_async_function (line 67) | async def test_async_function(self): method test_pydantic_model_function (line 84) | def test_pydantic_model_function(self): method test_add_callable_object (line 107) | def test_add_callable_object(self): method test_add_async_callable_object (line 124) | async def test_add_async_callable_object(self): method test_add_invalid_tool (line 140) | def test_add_invalid_tool(self): method test_add_lambda (line 145) | def test_add_lambda(self): method test_add_lambda_with_no_name (line 150) | def test_add_lambda_with_no_name(self): method test_warn_on_duplicate_tools (line 155) | def test_warn_on_duplicate_tools(self, caplog: pytest.LogCaptureFixture): method test_disable_warn_on_duplicate_tools (line 167) | def test_disable_warn_on_duplicate_tools(self, caplog: pytest.LogCaptu... class TestCallTools (line 181) | class TestCallTools: method test_call_tool (line 183) | async def test_call_tool(self): method test_call_async_tool (line 194) | async def test_call_async_tool(self): method test_call_object_tool (line 205) | async def test_call_object_tool(self): method test_call_async_object_tool (line 219) | async def test_call_async_object_tool(self): method test_call_tool_with_default_args (line 233) | async def test_call_tool_with_default_args(self): method test_call_tool_with_missing_args (line 244) | async def test_call_tool_with_missing_args(self): method test_call_unknown_tool (line 255) | async def test_call_unknown_tool(self): method test_call_tool_with_list_int_input (line 261) | async def test_call_tool_with_list_int_input(self): method test_call_tool_with_list_str_or_str_input (line 274) | async def test_call_tool_with_list_str_or_str_input(self): method test_call_tool_with_complex_model (line 291) | async def test_call_tool_with_complex_model(self): class TestToolSchema (line 318) | class TestToolSchema: method test_context_arg_excluded_from_schema (line 320) | async def test_context_arg_excluded_from_schema(self): class TestContextHandling (line 331) | class TestContextHandling: method test_context_parameter_detection (line 334) | def test_context_parameter_detection(self): method test_context_injection (line 358) | async def test_context_injection(self): method test_context_injection_async (line 372) | async def test_context_injection_async(self): method test_context_error_handling (line 386) | async def test_context_error_handling(self): class TestToolAnnotations (line 399) | class TestToolAnnotations: method test_tool_annotations (line 400) | def test_tool_annotations(self): method test_tool_annotations_in_mcpserver (line 422) | async def test_tool_annotations_in_mcpserver(self): class TestStructuredOutput (line 439) | class TestStructuredOutput: method test_tool_with_basemodel_output (line 443) | async def test_tool_with_basemodel_output(self): method test_tool_with_primitive_output (line 461) | async def test_tool_with_primitive_output(self): method test_tool_with_typeddict_output (line 476) | async def test_tool_with_typeddict_output(self): method test_tool_with_dataclass_output (line 495) | async def test_tool_with_dataclass_output(self): method test_tool_with_list_output (line 516) | async def test_tool_with_list_output(self): method test_tool_without_structured_output (line 534) | async def test_tool_without_structured_output(self): method test_tool_output_schema_property (line 547) | def test_tool_output_schema_property(self): method test_tool_with_dict_str_any_output (line 570) | async def test_tool_with_dict_str_any_output(self): method test_tool_with_dict_str_typed_output (line 595) | async def test_tool_with_dict_str_typed_output(self): class TestToolMetadata (line 620) | class TestToolMetadata: method test_add_tool_with_metadata (line 623) | def test_add_tool_with_metadata(self): method test_add_tool_without_metadata (line 640) | def test_add_tool_without_metadata(self): method test_metadata_in_mcpserver_decorator (line 653) | async def test_metadata_in_mcpserver_decorator(self): method test_metadata_in_list_tools (line 674) | async def test_metadata_in_list_tools(self): method test_multiple_tools_with_different_metadata (line 695) | async def test_multiple_tools_with_different_metadata(self): method test_metadata_with_complex_structure (line 728) | def test_metadata_with_complex_structure(self): method test_metadata_empty_dict (line 757) | def test_metadata_empty_dict(self): method test_metadata_with_annotations (line 771) | async def test_metadata_with_annotations(self): class TestRemoveTools (line 792) | class TestRemoveTools: method test_remove_existing_tool (line 795) | def test_remove_existing_tool(self): method test_remove_nonexistent_tool (line 816) | def test_remove_nonexistent_tool(self): method test_remove_tool_from_multiple_tools (line 823) | def test_remove_tool_from_multiple_tools(self): method test_call_removed_tool_raises_error (line 859) | async def test_call_removed_tool_raises_error(self): method test_remove_tool_case_sensitive (line 880) | def test_remove_tool_case_sensitive(self): FILE: tests/server/mcpserver/test_url_elicitation.py function test_url_elicitation_accept (line 16) | async def test_url_elicitation_accept(): function test_url_elicitation_decline (line 46) | async def test_url_elicitation_decline(): function test_url_elicitation_cancel (line 72) | async def test_url_elicitation_cancel(): function test_url_elicitation_helper_function (line 98) | async def test_url_elicitation_helper_function(): function test_url_no_content_in_response (line 124) | async def test_url_no_content_in_response(): function test_form_mode_still_works (line 158) | async def test_form_mode_still_works(): function test_elicit_complete_notification (line 189) | async def test_elicit_complete_notification(): function test_url_elicitation_required_error_code (line 226) | async def test_url_elicitation_required_error_code(): function test_elicit_url_typed_results (line 235) | async def test_elicit_url_typed_results(): function test_deprecated_elicit_method (line 287) | async def test_deprecated_elicit_method(): function test_ctx_elicit_url_convenience_method (line 320) | async def test_ctx_elicit_url_convenience_method(): FILE: tests/server/mcpserver/test_url_elicitation_error_throw.py function test_url_elicitation_error_thrown_from_tool (line 12) | async def test_url_elicitation_error_thrown_from_tool(): function test_url_elicitation_error_from_error (line 53) | async def test_url_elicitation_error_from_error(): function test_normal_exceptions_still_return_error_result (line 94) | async def test_normal_exceptions_still_return_error_result(): FILE: tests/server/mcpserver/tools/test_base.py function test_context_detected_in_union_annotation (line 5) | def test_context_detected_in_union_annotation(): FILE: tests/server/test_cancel_handling.py function test_server_remains_functional_after_cancel (line 23) | async def test_server_remains_functional_after_cancel(): FILE: tests/server/test_completion_with_context.py function test_completion_handler_receives_context (line 17) | async def test_completion_handler_receives_context(): function test_completion_backward_compatibility (line 45) | async def test_completion_backward_compatibility(): function test_dependent_completion_scenario (line 68) | async def test_dependent_completion_scenario(): function test_completion_error_on_missing_context (line 123) | async def test_completion_error_on_missing_context(): FILE: tests/server/test_lifespan.py function test_lowlevel_server_lifespan (line 30) | async def test_lowlevel_server_lifespan(): function test_mcpserver_server_lifespan (line 124) | async def test_mcpserver_server_lifespan(): FILE: tests/server/test_lowlevel_exception_handling.py function test_exception_handling_with_raise_exceptions_true (line 14) | async def test_exception_handling_with_raise_exceptions_true(): function test_exception_handling_with_raise_exceptions_false (line 26) | async def test_exception_handling_with_raise_exceptions_false(): function test_normal_message_handling_not_affected (line 43) | async def test_normal_message_handling_not_affected(): function test_server_run_exits_cleanly_when_transport_yields_exception_then_closes (line 65) | async def test_server_run_exits_cleanly_when_transport_yields_exception_... FILE: tests/server/test_lowlevel_tool_annotations.py function test_lowlevel_server_tool_annotations (line 11) | async def test_lowlevel_server_tool_annotations(): FILE: tests/server/test_read_resource.py function test_read_resource_text (line 17) | async def test_read_resource_text(): function test_read_resource_binary (line 35) | async def test_read_resource_binary(): FILE: tests/server/test_session.py function test_server_session_initialize (line 26) | async def test_server_session_initialize(): function test_server_capabilities (line 80) | async def test_server_capabilities(): function test_server_session_initialize_with_older_protocol_version (line 132) | async def test_server_session_initialize_with_older_protocol_version(): function test_ping_request_before_initialization (line 211) | async def test_ping_request_before_initialization(): function test_create_message_tool_result_validation (line 270) | async def test_create_message_tool_result_validation(): function test_create_message_without_tools_capability (line 395) | async def test_create_message_without_tools_capability(): function test_other_requests_blocked_before_initialization (line 445) | async def test_other_requests_blocked_before_initialization(): FILE: tests/server/test_session_race_condition.py function test_request_immediately_after_initialize_response (line 21) | async def test_request_immediately_after_initialize_response(): FILE: tests/server/test_sse_security.py function server_port (line 26) | def server_port() -> int: function server_url (line 33) | def server_url(server_port: int) -> str: # pragma: no cover class SecurityTestServer (line 37) | class SecurityTestServer(Server): # pragma: no cover method __init__ (line 38) | def __init__(self): method on_list_tools (line 41) | async def on_list_tools(self) -> list[Tool]: function run_server_with_settings (line 45) | def run_server_with_settings(port: int, security_settings: TransportSecu... function start_server_process (line 69) | def start_server_process(port: int, security_settings: TransportSecurity... function test_sse_security_default_settings (line 79) | async def test_sse_security_default_settings(server_port: int): function test_sse_security_invalid_host_header (line 95) | async def test_sse_security_invalid_host_header(server_port: int): function test_sse_security_invalid_origin_header (line 116) | async def test_sse_security_invalid_origin_header(server_port: int): function test_sse_security_post_invalid_content_type (line 139) | async def test_sse_security_post_invalid_content_type(server_port: int): function test_sse_security_disabled (line 172) | async def test_sse_security_disabled(server_port: int): function test_sse_security_custom_allowed_hosts (line 193) | async def test_sse_security_custom_allowed_hosts(server_port: int): function test_sse_security_wildcard_ports (line 226) | async def test_sse_security_wildcard_ports(server_port: int): function test_sse_security_post_valid_content_type (line 260) | async def test_sse_security_post_valid_content_type(server_port: int): FILE: tests/server/test_stateless_mode.py function stateless_session (line 25) | async def stateless_session() -> AsyncGenerator[ServerSession, None]: function test_list_roots_fails_in_stateless_mode (line 52) | async def test_list_roots_fails_in_stateless_mode(stateless_session: Ser... function test_create_message_fails_in_stateless_mode (line 59) | async def test_create_message_fails_in_stateless_mode(stateless_session:... function test_elicit_form_fails_in_stateless_mode (line 74) | async def test_elicit_form_fails_in_stateless_mode(stateless_session: Se... function test_elicit_url_fails_in_stateless_mode (line 84) | async def test_elicit_url_fails_in_stateless_mode(stateless_session: Ser... function test_elicit_deprecated_fails_in_stateless_mode (line 95) | async def test_elicit_deprecated_fails_in_stateless_mode(stateless_sessi... function test_stateless_error_message_is_actionable (line 105) | async def test_stateless_error_message_is_actionable(stateless_session: ... function test_exception_has_method_attribute (line 120) | async def test_exception_has_method_attribute(stateless_session: ServerS... function stateful_session (line 129) | async def stateful_session() -> AsyncGenerator[ServerSession, None]: function test_stateful_mode_does_not_raise_stateless_error (line 156) | async def test_stateful_mode_does_not_raise_stateless_error( FILE: tests/server/test_stdio.py function test_stdio_server (line 14) | async def test_stdio_server(): function test_stdio_server_invalid_utf8 (line 67) | async def test_stdio_server_invalid_utf8(monkeypatch: pytest.MonkeyPatch): FILE: tests/server/test_streamable_http_manager.py function test_run_can_only_be_called_once (line 22) | async def test_run_can_only_be_called_once(): function test_run_prevents_concurrent_calls (line 40) | async def test_run_prevents_concurrent_calls(): function test_handle_request_without_run_raises_error (line 66) | async def test_handle_request_without_run_raises_error(): class TestException (line 87) | class TestException(Exception): function running_manager (line 93) | async def running_manager(): function test_stateful_session_cleanup_on_graceful_exit (line 103) | async def test_stateful_session_cleanup_on_graceful_exit(running_manager... function test_stateful_session_cleanup_on_exception (line 158) | async def test_stateful_session_cleanup_on_exception(running_manager: tu... function test_stateless_requests_memory_cleanup (line 211) | async def test_stateless_requests_memory_cleanup(): function test_unknown_session_id_returns_404 (line 273) | async def test_unknown_session_id_returns_404(caplog: pytest.LogCaptureF... function test_e2e_streamable_http_server_cleanup (line 324) | async def test_e2e_streamable_http_server_cleanup(): function test_idle_session_is_reaped (line 342) | async def test_idle_session_is_reaped(): function test_session_idle_timeout_rejects_non_positive (line 406) | def test_session_idle_timeout_rejects_non_positive(): function test_session_idle_timeout_rejects_stateless (line 413) | def test_session_idle_timeout_rejects_stateless(): FILE: tests/server/test_streamable_http_security.py function server_port (line 25) | def server_port() -> int: function server_url (line 32) | def server_url(server_port: int) -> str: # pragma: no cover class SecurityTestServer (line 36) | class SecurityTestServer(Server): # pragma: no cover method __init__ (line 37) | def __init__(self): method on_list_tools (line 40) | async def on_list_tools(self) -> list[Tool]: function run_server_with_settings (line 44) | def run_server_with_settings(port: int, security_settings: TransportSecu... function start_server_process (line 74) | def start_server_process(port: int, security_settings: TransportSecurity... function test_streamable_http_security_default_settings (line 84) | async def test_streamable_http_security_default_settings(server_port: int): function test_streamable_http_security_invalid_host_header (line 109) | async def test_streamable_http_security_invalid_host_header(server_port:... function test_streamable_http_security_invalid_origin_header (line 137) | async def test_streamable_http_security_invalid_origin_header(server_por... function test_streamable_http_security_invalid_content_type (line 165) | async def test_streamable_http_security_invalid_content_type(server_port... function test_streamable_http_security_disabled (line 198) | async def test_streamable_http_security_disabled(server_port: int): function test_streamable_http_security_custom_allowed_hosts (line 226) | async def test_streamable_http_security_custom_allowed_hosts(server_port... function test_streamable_http_security_get_request (line 257) | async def test_streamable_http_security_get_request(server_port: int): FILE: tests/server/test_validation.py function test_check_sampling_tools_capability_returns_false_when_caps_none (line 26) | def test_check_sampling_tools_capability_returns_false_when_caps_none() ... function test_check_sampling_tools_capability_returns_false_when_sampling_none (line 31) | def test_check_sampling_tools_capability_returns_false_when_sampling_non... function test_check_sampling_tools_capability_returns_false_when_tools_none (line 37) | def test_check_sampling_tools_capability_returns_false_when_tools_none()... function test_check_sampling_tools_capability_returns_true_when_tools_present (line 43) | def test_check_sampling_tools_capability_returns_true_when_tools_present... function test_validate_sampling_tools_no_error_when_tools_none (line 52) | def test_validate_sampling_tools_no_error_when_tools_none() -> None: function test_validate_sampling_tools_raises_when_tools_provided_but_no_capability (line 57) | def test_validate_sampling_tools_raises_when_tools_provided_but_no_capab... function test_validate_sampling_tools_raises_when_tool_choice_provided_but_no_capability (line 65) | def test_validate_sampling_tools_raises_when_tool_choice_provided_but_no... function test_validate_sampling_tools_no_error_when_capability_present (line 72) | def test_validate_sampling_tools_no_error_when_capability_present() -> N... function test_validate_tool_use_result_messages_no_error_for_empty_messages (line 82) | def test_validate_tool_use_result_messages_no_error_for_empty_messages()... function test_validate_tool_use_result_messages_no_error_for_simple_text_messages (line 87) | def test_validate_tool_use_result_messages_no_error_for_simple_text_mess... function test_validate_tool_use_result_messages_raises_when_tool_result_mixed_with_other_content (line 96) | def test_validate_tool_use_result_messages_raises_when_tool_result_mixed... function test_validate_tool_use_result_messages_raises_when_tool_result_without_previous_tool_use (line 111) | def test_validate_tool_use_result_messages_raises_when_tool_result_witho... function test_validate_tool_use_result_messages_raises_when_tool_result_ids_dont_match_tool_use (line 123) | def test_validate_tool_use_result_messages_raises_when_tool_result_ids_d... function test_validate_tool_use_result_messages_no_error_when_tool_result_matches_tool_use (line 139) | def test_validate_tool_use_result_messages_no_error_when_tool_result_mat... FILE: tests/shared/test_auth.py function test_oauth (line 6) | def test_oauth(): function test_oidc (line 20) | def test_oidc(): function test_oauth_with_jarm (line 40) | def test_oauth_with_jarm(): FILE: tests/shared/test_auth_utils.py function test_resource_url_from_server_url_removes_fragment (line 10) | def test_resource_url_from_server_url_removes_fragment(): function test_resource_url_from_server_url_preserves_path (line 16) | def test_resource_url_from_server_url_preserves_path(): function test_resource_url_from_server_url_preserves_query (line 25) | def test_resource_url_from_server_url_preserves_query(): function test_resource_url_from_server_url_preserves_port (line 31) | def test_resource_url_from_server_url_preserves_port(): function test_resource_url_from_server_url_lowercase_scheme_and_host (line 37) | def test_resource_url_from_server_url_lowercase_scheme_and_host(): function test_resource_url_from_server_url_handles_pydantic_urls (line 43) | def test_resource_url_from_server_url_handles_pydantic_urls(): function test_check_resource_allowed_identical_urls (line 52) | def test_check_resource_allowed_identical_urls(): function test_check_resource_allowed_different_schemes (line 59) | def test_check_resource_allowed_different_schemes(): function test_check_resource_allowed_different_domains (line 65) | def test_check_resource_allowed_different_domains(): function test_check_resource_allowed_different_ports (line 71) | def test_check_resource_allowed_different_ports(): function test_check_resource_allowed_hierarchical_matching (line 77) | def test_check_resource_allowed_hierarchical_matching(): function test_check_resource_allowed_path_boundary_matching (line 92) | def test_check_resource_allowed_path_boundary_matching(): function test_check_resource_allowed_trailing_slash_handling (line 103) | def test_check_resource_allowed_trailing_slash_handling(): function test_check_resource_allowed_case_insensitive_origin (line 112) | def test_check_resource_allowed_case_insensitive_origin(): function test_check_resource_allowed_empty_paths (line 119) | def test_check_resource_allowed_empty_paths(): FILE: tests/shared/test_exceptions.py function test_url_elicitation_required_error_create_with_single_elicitation (line 9) | def test_url_elicitation_required_error_create_with_single_elicitation()... function test_url_elicitation_required_error_create_with_multiple_elicitations (line 25) | def test_url_elicitation_required_error_create_with_multiple_elicitation... function test_url_elicitation_required_error_custom_message (line 47) | def test_url_elicitation_required_error_custom_message() -> None: function test_url_elicitation_required_error_from_error_data (line 60) | def test_url_elicitation_required_error_from_error_data() -> None: function test_url_elicitation_required_error_from_error_data_wrong_code (line 84) | def test_url_elicitation_required_error_from_error_data_wrong_code() -> ... function test_url_elicitation_required_error_serialization_roundtrip (line 96) | def test_url_elicitation_required_error_serialization_roundtrip() -> None: function test_url_elicitation_required_error_data_contains_elicitations (line 120) | def test_url_elicitation_required_error_data_contains_elicitations() -> ... function test_url_elicitation_required_error_inherits_from_mcp_error (line 139) | def test_url_elicitation_required_error_inherits_from_mcp_error() -> None: function test_url_elicitation_required_error_exception_message (line 153) | def test_url_elicitation_required_error_exception_message() -> None: FILE: tests/shared/test_httpx_utils.py function test_default_settings (line 8) | def test_default_settings(): function test_custom_parameters (line 16) | def test_custom_parameters(): FILE: tests/shared/test_progress_notifications.py function test_bidirectional_progress_notifications (line 18) | async def test_bidirectional_progress_notifications(): function test_progress_callback_exception_logging (line 200) | async def test_progress_callback_exception_logging(): FILE: tests/shared/test_session.py function test_in_flight_requests_cleared_after_completion (line 27) | async def test_in_flight_requests_cleared_after_completion(): function test_request_cancellation (line 40) | async def test_request_cancellation(): function test_response_id_type_mismatch_string_to_int (line 102) | async def test_response_id_type_mismatch_string_to_int(): function test_error_response_id_type_mismatch_string_to_int (line 156) | async def test_error_response_id_type_mismatch_string_to_int(): function test_response_id_non_numeric_string_no_match (line 211) | async def test_response_id_non_numeric_string_no_match(): function test_connection_closed (line 262) | async def test_connection_closed(): function test_null_id_error_surfaced_via_message_handler (line 308) | async def test_null_id_error_surfaced_via_message_handler(): function test_null_id_error_does_not_affect_pending_request (line 354) | async def test_null_id_error_does_not_affect_pending_request(): FILE: tests/shared/test_sse.py function server_port (line 50) | def server_port() -> int: function server_url (line 57) | def server_url(server_port: int) -> str: function _handle_read_resource (line 61) | async def _handle_read_resource( # pragma: no cover function _handle_list_tools (line 76) | async def _handle_list_tools( # pragma: no cover function _handle_call_tool (line 90) | async def _handle_call_tool( # pragma: no cover function _create_server (line 96) | def _create_server() -> Server: # pragma: no cover function make_server_app (line 106) | def make_server_app() -> Starlette: # pragma: no cover function run_server (line 130) | def run_server(server_port: int) -> None: # pragma: no cover function server (line 138) | def server(server_port: int) -> Generator[None, None, None]: function http_client (line 158) | async def http_client(server: None, server_url: str) -> AsyncGenerator[h... function test_raw_sse_connection (line 166) | async def test_raw_sse_connection(http_client: httpx.AsyncClient) -> None: function test_sse_client_basic_connection (line 191) | async def test_sse_client_basic_connection(server: None, server_url: str... function test_sse_client_on_session_created (line 205) | async def test_sse_client_on_session_created(server: None, server_url: s... function test_extract_session_id_from_endpoint (line 228) | def test_extract_session_id_from_endpoint(endpoint_url: str, expected: s... function test_sse_client_on_session_created_not_called_when_no_session_id (line 233) | async def test_sse_client_on_session_created_not_called_when_no_session_id( function initialized_sse_client_session (line 253) | async def initialized_sse_client_session(server: None, server_url: str) ... function test_sse_client_happy_request_and_response (line 261) | async def test_sse_client_happy_request_and_response( function test_sse_client_exception_handling (line 272) | async def test_sse_client_exception_handling( function test_sse_client_timeout (line 282) | async def test_sse_client_timeout( # pragma: no cover function run_mounted_server (line 300) | def run_mounted_server(server_port: int) -> None: # pragma: no cover function mounted_server (line 309) | def mounted_server(server_port: int) -> Generator[None, None, None]: function test_sse_client_basic_connection_mounted_app (line 329) | async def test_sse_client_basic_connection_mounted_app(mounted_server: N... function _handle_context_call_tool (line 342) | async def _handle_context_call_tool( # pragma: no cover function _handle_context_list_tools (line 361) | async def _handle_context_list_tools( # pragma: no cover function run_context_server (line 384) | def run_context_server(server_port: int) -> None: # pragma: no cover function context_server (line 415) | def context_server(server_port: int) -> Generator[None, None, None]: function test_request_context_propagation (line 435) | async def test_request_context_propagation(context_server: None, server_... function test_request_context_isolation (line 468) | async def test_request_context_isolation(context_server: None, server_ur... function test_sse_message_id_coercion (line 500) | def test_sse_message_id_coercion(): function test_sse_server_transport_endpoint_validation (line 534) | def test_sse_server_transport_endpoint_validation(endpoint: str, expecte... function test_sse_client_handles_empty_keepalive_pings (line 548) | async def test_sse_client_handles_empty_keepalive_pings() -> None: function test_sse_session_cleanup_on_disconnect (line 608) | async def test_sse_session_cleanup_on_disconnect(server: None, server_ur... FILE: tests/shared/test_streamable_http.py function extract_protocol_version_from_sse (line 86) | def extract_protocol_version_from_sse(response: requests.Response) -> str: class SimpleEventStore (line 97) | class SimpleEventStore(EventStore): method __init__ (line 100) | def __init__(self): method store_event (line 104) | async def store_event(self, stream_id: StreamId, message: types.JSONRP... method replay_events_after (line 111) | async def replay_events_after( # pragma: no cover class ServerState (line 142) | class ServerState: function _server_lifespan (line 147) | async def _server_lifespan(_server: Server[ServerState]) -> AsyncIterato... function _handle_read_resource (line 151) | async def _handle_read_resource( # pragma: no cover function _handle_list_tools (line 166) | async def _handle_list_tools( # pragma: no cover function _handle_call_tool (line 231) | async def _handle_call_tool( # pragma: no cover function _create_server (line 385) | def _create_server() -> Server[ServerState]: # pragma: no cover function create_app (line 395) | def create_app( function run_server (line 434) | def run_server( function basic_server_port (line 473) | def basic_server_port() -> int: function json_server_port (line 481) | def json_server_port() -> int: function basic_server (line 489) | def basic_server(basic_server_port: int) -> Generator[None, None, None]: function event_store (line 505) | def event_store() -> SimpleEventStore: function event_server_port (line 511) | def event_server_port() -> int: function event_server (line 519) | def event_server( function json_response_server (line 541) | def json_response_server(json_server_port: int) -> Generator[None, None,... function basic_server_url (line 561) | def basic_server_url(basic_server_port: int) -> str: function json_server_url (line 567) | def json_server_url(json_server_port: int) -> str: function test_accept_header_validation (line 573) | def test_accept_header_validation(basic_server: None, basic_server_url: ... function test_accept_header_wildcard (line 598) | def test_accept_header_wildcard(basic_server: None, basic_server_url: st... function test_accept_header_incompatible (line 619) | def test_accept_header_incompatible(basic_server: None, basic_server_url... function test_content_type_validation (line 633) | def test_content_type_validation(basic_server: None, basic_server_url: s... function test_json_validation (line 649) | def test_json_validation(basic_server: None, basic_server_url: str): function test_json_parsing (line 664) | def test_json_parsing(basic_server: None, basic_server_url: str): function test_method_not_allowed (line 679) | def test_method_not_allowed(basic_server: None, basic_server_url: str): function test_session_validation (line 694) | def test_session_validation(basic_server: None, basic_server_url: str): function test_session_id_pattern (line 711) | def test_session_id_pattern(): function test_streamable_http_transport_init_validation (line 746) | def test_streamable_http_transport_init_validation(): function test_session_termination (line 769) | def test_session_termination(basic_server: None, basic_server_url: str): function test_response (line 809) | def test_response(basic_server: None, basic_server_url: str): function test_json_response (line 844) | def test_json_response(json_response_server: None, json_server_url: str): function test_json_response_accept_json_only (line 859) | def test_json_response_accept_json_only(json_response_server: None, json... function test_json_response_missing_accept_header (line 874) | def test_json_response_missing_accept_header(json_response_server: None,... function test_json_response_incorrect_accept_header (line 891) | def test_json_response_incorrect_accept_header(json_response_server: Non... function test_json_response_wildcard_accept_header (line 915) | def test_json_response_wildcard_accept_header(json_response_server: None... function test_get_sse_stream (line 930) | def test_get_sse_stream(basic_server: None, basic_server_url: str): function test_get_validation (line 990) | def test_get_validation(basic_server: None, basic_server_url: str): function http_client (line 1047) | async def http_client(basic_server: None, basic_server_url: str): # pra... function initialized_client_session (line 1054) | async def initialized_client_session(basic_server: None, basic_server_ur... function test_streamable_http_client_basic_connection (line 1063) | async def test_streamable_http_client_basic_connection(basic_server: Non... function test_streamable_http_client_resource_read (line 1074) | async def test_streamable_http_client_resource_read(initialized_client_s... function test_streamable_http_client_tool_invocation (line 1084) | async def test_streamable_http_client_tool_invocation(initialized_client... function test_streamable_http_client_error_handling (line 1099) | async def test_streamable_http_client_error_handling(initialized_client_... function test_streamable_http_client_session_persistence (line 1108) | async def test_streamable_http_client_session_persistence(basic_server: ... function test_streamable_http_client_json_response (line 1129) | async def test_streamable_http_client_json_response(json_response_server... function test_streamable_http_client_get_stream (line 1150) | async def test_streamable_http_client_get_stream(basic_server: None, bas... function create_session_id_capturing_client (line 1183) | def create_session_id_capturing_client() -> tuple[httpx.AsyncClient, lis... function test_streamable_http_client_session_termination (line 1201) | async def test_streamable_http_client_session_termination(basic_server: ... function test_streamable_http_client_session_termination_204 (line 1236) | async def test_streamable_http_client_session_termination_204( function test_streamable_http_client_resumption (line 1297) | async def test_streamable_http_client_resumption(event_server: tuple[Sim... function test_streamablehttp_server_sampling (line 1415) | async def test_streamablehttp_server_sampling(basic_server: None, basic_... function _handle_context_list_tools (line 1465) | async def _handle_context_list_tools( # pragma: no cover function _handle_context_call_tool (line 1490) | async def _handle_context_call_tool( # pragma: no cover function run_context_aware_server (line 1520) | def run_context_aware_server(port: int): # pragma: no cover function context_aware_server (line 1554) | def context_aware_server(basic_server_port: int) -> Generator[None, None... function test_streamablehttp_request_context_propagation (line 1571) | async def test_streamablehttp_request_context_propagation(context_aware_... function test_streamablehttp_request_context_isolation (line 1604) | async def test_streamablehttp_request_context_isolation(context_aware_se... function test_client_includes_protocol_version_header_after_init (line 1642) | async def test_client_includes_protocol_version_header_after_init(contex... function test_server_validates_protocol_version_header (line 1662) | def test_server_validates_protocol_version_header(basic_server: None, ba... function test_server_backwards_compatibility_no_protocol_version (line 1720) | def test_server_backwards_compatibility_no_protocol_version(basic_server... function test_client_crash_handled (line 1750) | async def test_client_crash_handled(basic_server: None, basic_server_url... function test_handle_sse_event_skips_empty_data (line 1779) | async def test_handle_sse_event_skips_empty_data(): function test_priming_event_not_sent_for_old_protocol_version (line 1805) | async def test_priming_event_not_sent_for_old_protocol_version(): function test_priming_event_not_sent_without_event_store (line 1834) | async def test_priming_event_not_sent_without_event_store(): function test_priming_event_includes_retry_interval (line 1854) | async def test_priming_event_includes_retry_interval(): function test_close_sse_stream_callback_not_provided_for_old_protocol_version (line 1883) | async def test_close_sse_stream_callback_not_provided_for_old_protocol_v... function test_streamable_http_client_receives_priming_event (line 1915) | async def test_streamable_http_client_receives_priming_event( function test_server_close_sse_stream_via_context (line 1953) | async def test_server_close_sse_stream_via_context( function test_streamable_http_client_auto_reconnects (line 1976) | async def test_streamable_http_client_auto_reconnects( function test_streamable_http_client_respects_retry_interval (line 2013) | async def test_streamable_http_client_respects_retry_interval( function test_streamable_http_sse_polling_full_cycle (line 2040) | async def test_streamable_http_sse_polling_full_cycle( function test_streamable_http_events_replayed_after_disconnect (line 2080) | async def test_streamable_http_events_replayed_after_disconnect( function test_streamable_http_multiple_reconnections (line 2120) | async def test_streamable_http_multiple_reconnections( function test_standalone_get_stream_reconnection (line 2172) | async def test_standalone_get_stream_reconnection(event_server: tuple[Si... function test_streamable_http_client_does_not_mutate_provided_client (line 2222) | async def test_streamable_http_client_does_not_mutate_provided_client( function test_streamable_http_client_mcp_headers_override_defaults (line 2255) | async def test_streamable_http_client_mcp_headers_override_defaults( function test_streamable_http_client_preserves_custom_with_mcp_headers (line 2286) | async def test_streamable_http_client_preserves_custom_with_mcp_headers( FILE: tests/shared/test_tool_name_validation.py function test_validate_tool_name_accepts_valid_names (line 37) | def test_validate_tool_name_accepts_valid_names(tool_name: str) -> None: function test_validate_tool_name_rejects_empty_name (line 47) | def test_validate_tool_name_rejects_empty_name() -> None: function test_validate_tool_name_rejects_name_exceeding_max_length (line 54) | def test_validate_tool_name_rejects_name_exceeding_max_length() -> None: function test_validate_tool_name_rejects_invalid_characters (line 76) | def test_validate_tool_name_rejects_invalid_characters(tool_name: str, e... function test_validate_tool_name_rejects_multiple_invalid_chars (line 83) | def test_validate_tool_name_rejects_multiple_invalid_chars() -> None: function test_validate_tool_name_rejects_unicode_characters (line 93) | def test_validate_tool_name_rejects_unicode_characters() -> None: function test_validate_tool_name_warns_on_leading_dash (line 102) | def test_validate_tool_name_warns_on_leading_dash() -> None: function test_validate_tool_name_warns_on_trailing_dash (line 109) | def test_validate_tool_name_warns_on_trailing_dash() -> None: function test_validate_tool_name_warns_on_leading_dot (line 116) | def test_validate_tool_name_warns_on_leading_dot() -> None: function test_validate_tool_name_warns_on_trailing_dot (line 123) | def test_validate_tool_name_warns_on_trailing_dot() -> None: function test_issue_tool_name_warning_logs_warnings (line 133) | def test_issue_tool_name_warning_logs_warnings(caplog: pytest.LogCapture... function test_issue_tool_name_warning_no_logging_for_empty_warnings (line 146) | def test_issue_tool_name_warning_no_logging_for_empty_warnings(caplog: p... function test_validate_and_warn_tool_name_returns_true_for_valid_name (line 157) | def test_validate_and_warn_tool_name_returns_true_for_valid_name() -> None: function test_validate_and_warn_tool_name_returns_false_for_invalid_name (line 162) | def test_validate_and_warn_tool_name_returns_false_for_invalid_name() ->... function test_validate_and_warn_tool_name_logs_warnings_for_invalid_name (line 169) | def test_validate_and_warn_tool_name_logs_warnings_for_invalid_name(capl... function test_validate_and_warn_tool_name_no_warnings_for_clean_valid_name (line 177) | def test_validate_and_warn_tool_name_no_warnings_for_clean_valid_name(ca... function test_edge_cases (line 204) | def test_edge_cases(tool_name: str, is_valid: bool, expected_warning_fra... FILE: tests/shared/test_win32_utils.py function escape_path_for_python (line 4) | def escape_path_for_python(path: str) -> str: FILE: tests/shared/test_ws.py function make_server_app (line 26) | def make_server_app() -> Starlette: function ws_server_url (line 37) | def ws_server_url() -> Generator[str, None, None]: function test_ws_client_basic_connection (line 43) | async def test_ws_client_basic_connection(ws_server_url: str) -> None: FILE: tests/test_examples.py function test_simple_echo (line 19) | async def test_simple_echo(): function test_complex_inputs (line 31) | async def test_complex_inputs(): function test_direct_call_tool_result_return (line 51) | async def test_direct_call_tool_result_return(): function test_desktop (line 67) | async def test_desktop(tmp_path: Path, monkeypatch: pytest.MonkeyPatch): function test_docs_examples (line 98) | def test_docs_examples(example: CodeExample, eval_example: EvalExample): FILE: tests/test_helpers.py function run_uvicorn_in_thread (line 16) | def run_uvicorn_in_thread(app: Any, **config_kwargs: Any) -> Generator[s... function wait_for_server (line 61) | def wait_for_server(port: int, timeout: float = 20.0) -> None: FILE: tests/test_types.py function test_jsonrpc_request (line 29) | async def test_jsonrpc_request(): function test_method_initialization (line 53) | async def test_method_initialization(): function test_tool_use_content (line 74) | async def test_tool_use_content(): function test_tool_result_content (line 96) | async def test_tool_result_content(): function test_tool_choice (line 118) | async def test_tool_choice(): function test_sampling_message_with_user_role (line 138) | async def test_sampling_message_with_user_role(): function test_sampling_message_with_assistant_role (line 161) | async def test_sampling_message_with_assistant_role(): function test_sampling_message_backward_compatibility (line 191) | async def test_sampling_message_backward_compatibility(): function test_create_message_request_params_with_tools (line 218) | async def test_create_message_request_params_with_tools(): function test_create_message_result_with_tool_use (line 241) | async def test_create_message_result_with_tool_use(): function test_create_message_result_basic (line 264) | async def test_create_message_result_basic(): function test_client_capabilities_with_sampling_tools (line 283) | async def test_client_capabilities_with_sampling_tools(): function test_tool_preserves_json_schema_2020_12_fields (line 302) | def test_tool_preserves_json_schema_2020_12_fields(): function test_list_tools_result_preserves_json_schema_2020_12_fields (line 339) | def test_list_tools_result_preserves_json_schema_2020_12_fields():