Module

testing._mcp

MCP test client — synchronous wrapper around milo.mcp internals.

Classes

ToolInfo 4
Frozen snapshot of an MCP tool descriptor.

Frozen snapshot of an MCP tool descriptor.

Attributes

Name Type Description
name str
description str
input_schema dict[str, Any]
output_schema dict[str, Any] | None
CallResult 3
Frozen snapshot of an MCP tools/call response.

Frozen snapshot of an MCP tools/call response.

Attributes

Name Type Description
text str
is_error bool
structured Any
MCPClient 8
Synchronous test client for exercising a CLI's MCP surface.

Synchronous test client for exercising a CLI's MCP surface.

Methods

initialize 0 dict[str, Any]
Send ``initialize`` and return the server info dict.
def initialize(self) -> dict[str, Any]
Returns
dict[str, Any]
list_tools 0 list[ToolInfo]
Return all visible tools as ToolInfo objects.
def list_tools(self) -> list[ToolInfo]
Returns
list[ToolInfo]
call 2 CallResult
Invoke a tool by name and return a CallResult.
def call(self, tool_name: str, **arguments: Any) -> CallResult
Parameters
Name Type Description
tool_name
**arguments
Returns
CallResult
list_resources 0 list[dict[str, Any]]
Return all resources (requires F3 resources support).
def list_resources(self) -> list[dict[str, Any]]
Returns
list[dict[str, Any]]
read_resource 1 dict[str, Any]
Read a resource by URI (requires F3 resources support).
def read_resource(self, uri: str) -> dict[str, Any]
Parameters
Name Type Description
uri
Returns
dict[str, Any]
list_prompts 0 list[dict[str, Any]]
Return all prompts (requires F3 prompts support).
def list_prompts(self) -> list[dict[str, Any]]
Returns
list[dict[str, Any]]
get_prompt 2 dict[str, Any]
Get a prompt by name (requires F3 prompts support).
def get_prompt(self, prompt_name: str, **arguments: Any) -> dict[str, Any]
Parameters
Name Type Description
prompt_name
**arguments
Returns
dict[str, Any]
Internal Methods 1
__init__ 1
def __init__(self, cli: CLI) -> None
Parameters
Name Type Description
cli