@robota-sdk/agent-transport-mcp
v3.0.0-beta.53
Published
MCP transport adapter for exposing InteractiveSession as an MCP server
Readme
@robota-sdk/agent-transport-mcp
MCP transport adapter for exposing InteractiveSession as a Model Context Protocol server. Allows MCP-compatible clients (Claude, other agents) to interact with a Robota agent via the standard MCP tool protocol.
Installation
pnpm add @robota-sdk/agent-transport-mcpUsage
import { createAgentMcpServer } from '@robota-sdk/agent-transport-mcp';
import type { InteractiveSession } from '@robota-sdk/agent-sdk';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const mcpServer = createAgentMcpServer({
name: 'robota-agent',
version: '1.0.0',
session: interactiveSession,
});
// Connect via stdio (subprocess / Claude Desktop)
await mcpServer.connect(new StdioServerTransport());MCP Tools
Each tool maps directly to an InteractiveSession operation or a system command.
| Tool Name | Input | Description |
| ----------------- | -------------------- | --------------------------------------- |
| submit | { prompt: string } | Submit a prompt, wait for full response |
| command_help | { args?: string } | Show available commands |
| command_clear | { args?: string } | Clear conversation history |
| command_compact | { args?: string } | Compress the context window |
| command_mode | { args?: string } | Show or change permission mode |
| command_model | { args?: string } | Change the active AI model |
| command_context | { args?: string } | Show context window info |
| ... | ... | One tool per registered system command |
The submit tool waits for the session to reach complete or interrupted state before returning, so MCP clients receive a single text response rather than a stream.
ITransportAdapter
The MCP transport implements the ITransportAdapter interface from @robota-sdk/agent-sdk:
import { createMcpTransport } from '@robota-sdk/agent-transport-mcp';
import type { ITransportAdapter } from '@robota-sdk/agent-sdk';
const transport: ITransportAdapter = createMcpTransport({
name: 'robota-agent',
version: '1.0.0',
});
transport.attach(interactiveSession);
await transport.start();
// Access the underlying MCP server
const server = transport.getServer();Dependencies
@robota-sdk/agent-sdk—InteractiveSession@modelcontextprotocol/sdk— MCP server implementationzod— input schema definitions
