# _mcp

URL: /milo-cli/api/milo/testing/_mcp/
Section: testing
Description: MCP test client — synchronous wrapper around milo.mcp internals.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Open LLM text
(/milo-cli/api/milo/testing/_mcp/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Ftesting%2F_mcp%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Ftesting%2F_mcp%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Ftesting%2F_mcp%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Ftesting%2F_mcp%2Findex.txt)

Module

#
`testing._mcp`

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

3Classes

## 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`
`—`
