MCP tools (remote server)
What you will achieve
Section titled “What you will achieve”Connect to the public DeepWiki MCP server (https://mcp.deepwiki.com/mcp), ask the model to answer a question about the MCP TypeScript SDK using the ask_question tool, and assert the response mentions stdio.
Why it matters with a raw provider SDK
Section titled “Why it matters with a raw provider SDK”The official SDKs split into two camps:
- Hosted MCP (OpenAI, Anthropic, xAI): hand the provider a public URL; the provider calls DeepWiki. No MCP client lib needed — but only works with public, provider-reachable servers.
- Client-side MCP (Google, OpenRouter): install
@modelcontextprotocol/sdk, create anMCPClient, connect, list tools, wrap them per-SDK, manage the tool-call loop yourself. Google alone needs 4 extra imports. OpenRouter needs all that plus a hand-rolled response loop.
Four different integration patterns for the same protocol.
Do it with ORXA
Section titled “Do it with ORXA”connectMcp() is always client-side — one call, no extra packages, works with any server (local, private, or public):
import { complete, connectMcp, createEngine } from '@combycode/llm-sdk';
const engine = createEngine();const mcp = await connectMcp({ url: 'https://mcp.deepwiki.com/mcp', name: 'deepwiki' }, { engine });
const { text } = await complete({ model: process.env.LLM_MODEL!, apiKey: process.env.LLM_API_KEY, prompt: 'What transport protocols does the modelcontextprotocol/typescript-sdk support? Use the DeepWiki MCP server.', tools: mcp.tools, maxTokens: 1024,});
await mcp.close();Compare the SDKs
Section titled “Compare the SDKs”How it works
Section titled “How it works”connectMcp() opens an MCP session over HTTP (Streamable HTTP transport). It fetches the server’s tool list via tools/list, wraps each as a defineTool-compatible descriptor with an execute that calls tools/call. The resulting mcp.tools array is passed to complete() as normal client-side tools. Because it is client-side, it works with stdio servers and private/local servers that hosted connectors cannot reach.
Next steps
Section titled “Next steps”- MCP guide — stdio servers, auth flows,
mcpToolset - Server-side built-in tools — provider-hosted execution (no MCP)