@mondaydotcomorg/atp-mcp-adapter
Version:
MCP compatibility adapter for Agent Tool Protocol
52 lines • 1.71 kB
TypeScript
import type { AgentToolProtocolClient, Tool } from '@mondaydotcomorg/atp-client';
/**
* MCP tool handler result
*/
export interface MCPToolResult {
content: Array<{
type: 'text';
text: string;
}>;
isError?: boolean;
}
/**
* MCP Server interface - supports both legacy (v0.x) and modern (v1.x) SDK.
*
* Uses minimal duck-typing to avoid TypeScript variance issues with the
* MCP SDK's complex generic callback signatures.
*/
export interface MCPServerLike {
registerTool?: Function;
tool?: Function;
}
/**
* Registers ATP tools with an MCP server.
*
* @example
* ```typescript
* import { Server } from '@modelcontextprotocol/sdk/server/index.js';
* import { AgentToolProtocolClient } from '@mondaydotcomorg/atp-client';
* import { registerATPTools } from '@mondaydotcomorg/atp-mcp-adapter';
*
* const client = new AgentToolProtocolClient({ baseUrl: 'http://localhost:3000' });
* await client.init();
* await client.connect();
*
* const mcpServer = new Server({ name: 'my-server', version: '1.0.0' }, { capabilities: { tools: {} } });
* registerATPTools(client, mcpServer);
* ```
*/
export declare function registerATPTools(client: AgentToolProtocolClient, mcpServer: MCPServerLike): void;
/**
* Registers an array of ATP tools with an MCP server.
* Use this if you want more control over which tools to register.
* Supports both MCP SDK v0.x and v1.x APIs.
*
* @example
* ```typescript
* const tools = client.getATPTools().filter(t => t.name !== 'search_api');
* registerToolsWithMCP(tools, mcpServer);
* ```
*/
export declare function registerToolsWithMCP(tools: Tool[], mcpServer: MCPServerLike): void;
//# sourceMappingURL=atp-to-mcp.d.ts.map