Skip to main content
Version: Next

mcp_communication_protocol

File: plugins/communication_protocols/mcp/src/utcp_mcp/mcp_communication_protocol.py

class McpCommunicationProtocol (CommunicationProtocol)​

Documentation

MCP transport implementation that connects to MCP servers via stdio or HTTP.

This implementation uses MCPClient for simplified session management and reuses sessions for better performance and efficiency.

Methods:​

async register_manual(self, caller: 'UtcpClient', manual_call_template: CallTemplate) -> RegisterManualResult

Register a manual with the communication protocol.

async call_tool(self, caller: 'UtcpClient', tool_name: str, tool_args: Dict[str, Any], tool_call_template: CallTemplate) -> Any

Call a tool using the model context protocol.

async call_tool_streaming(self, caller: 'UtcpClient', tool_name: str, tool_args: Dict[str, Any], tool_call_template: CallTemplate) -> AsyncGenerator[Any, None]

Streaming calls are not supported for MCP protocol, so we just call the tool and return the result as one item.