mirascope.mcp.client
Module client
The MCPServer Class and context managers.
Class MCPClient
The SSE client session that connects to the MCP server.
All of the results from the server are converted into Mirascope-friendly types.
Bases:
ClientSessionFunction list_resources
List all resources available on the MCP server.
Parameters
| Name | Type | Description | 
|---|---|---|
| self | Any | - | 
Returns
| Type | Description | 
|---|---|
| list[Resource] | A list of Resource objects | 
Function read_resource
Read a resource from the MCP server.
Parameters
| Name | Type | Description | 
|---|---|---|
| self | Any | - | 
| uri | str | AnyUrl | URI of the resource to read | 
Returns
Function list_prompts
List all prompts available on the MCP server.
Parameters
| Name | Type | Description | 
|---|---|---|
| self | Any | - | 
Function get_prompt_template
Get a prompt template from the MCP server.
Parameters
| Name | Type | Description | 
|---|---|---|
| self | Any | - | 
| name | str | Name of the prompt template | 
Returns
| Type | Description | 
|---|---|
| () => Awaitable[list[BaseMessageParam]] | A callable that accepts keyword arguments and returns a list of BaseMessageParam | 
Function list_tools
List all tools available on the MCP server.
Parameters
| Name | Type | Description | 
|---|---|---|
| self | Any | - | 
Function sse_client
Parameters
Returns
| Type | Description | 
|---|---|
| AsyncIterator[MCPClient] | - | 
Function stdio_client
Create a MCPClient instance with the given server parameters and exception handler.
Returns:
Parameters
Returns
| Type | Description | 
|---|---|
| AsyncIterator[MCPClient] | - |