# mcp-integration > Connect to external MCP servers as a client. Discover tools, invoke them, handle auth. Use when AgentHQ needs to call Circle, ENS, Chainlink, Stripe, or any MCP-compatible service. - Author: Clawd Bot - Repository: BAiSEDagent/openclaw-skills - Version: 20260208142402 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/BAiSEDagent/openclaw-skills - Web: https://mule.run/skillshub/@@BAiSEDagent/openclaw-skills~mcp-integration:20260208142402 --- --- name: mcp-integration description: "Connect to external MCP servers as a client. Discover tools, invoke them, handle auth. Use when AgentHQ needs to call Circle, ENS, Chainlink, Stripe, or any MCP-compatible service." metadata: openclaw: emoji: "🔌" --- # MCP Integration (Client) Connect AgentHQ to external MCP servers to invoke their tools. This is the connective tissue between AgentHQ and the broader agent ecosystem. ## Core Concept MCP (Model Context Protocol) uses JSON-RPC over HTTP/SSE or stdio. A client connects to a server, discovers available tools, and invokes them with structured parameters. ## Connection Flow 1. **Configure server endpoint** — URL + auth credentials 2. **Initialize connection** — Send `initialize` request, receive server capabilities 3. **Discover tools** — Call `tools/list` to get available tools with schemas 4. **Invoke tools** — Call `tools/call` with tool name + arguments 5. **Handle responses** — Parse structured results ## Transport Types | Transport | When | Example | |-----------|------|---------| | **HTTP+SSE** | Remote servers | Circle MCP, Stripe MCP | | **stdio** | Local servers | Installed MCP packages | | **Streamable HTTP** | Cloudflare servers | Workers, Observability | ## Quick Start: HTTP+SSE Client ```typescript import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'; const transport = new SSEClientTransport( new URL('https://api.circle.com/v1/codegen/mcp'), { headers: { 'Authorization': `Bearer ${process.env.CIRCLE_API_KEY}` } } ); const client = new Client({ name: 'agenthq', version: '1.0.0' }); await client.connect(transport); // Discover tools const { tools } = await client.listTools(); // Invoke a tool const result = await client.callTool({ name: 'create_wallet', arguments: { blockchain: 'BASE', walletSetId: '...' } }); ``` ## Priority Integration Targets ### P1 — Core Infrastructure - **Circle MCP** (`api.circle.com/v1/codegen/mcp`) — Wallets, CCTP, contracts. See [references/circle.md](references/circle.md) - **ENS MCP** (open-source, Python) — Resolve names, domain details. See [references/ens.md](references/ens.md) - **Chainlink Feeds MCP** (open-source, Node.js) — Price data. See [references/chainlink.md](references/chainlink.md) ### P2 — Expansion - **Stripe MCP** (`mcp.stripe.com`) — Fiat payments. See [references/stripe.md](references/stripe.md) - **Supabase MCP** (`mcp.supabase.com/mcp`) — Database ops ### P3 — Ecosystem - Slack, GitHub, Notion, Cloudflare — See [references/ecosystem.md](references/ecosystem.md) ## Auth Patterns | Server | Auth Method | |--------|------------| | Circle | OAuth Bearer token | | Stripe | OAuth (public preview) | | Supabase | Query params (project-scoped) | | ENS/Chainlink/Uniswap | None (open) | ## Multi-Server Pattern ```typescript // Connect to multiple MCP servers simultaneously const servers = new Map(); for (const [name, config] of Object.entries(MCP_SERVERS)) { const client = new Client({ name: 'agenthq', version: '1.0.0' }); await client.connect(createTransport(config)); servers.set(name, client); } // Route tool calls to correct server async function callTool(serverName: string, tool: string, args: any) { const client = servers.get(serverName); return client.callTool({ name: tool, arguments: args }); } ``` ## Error Handling - **Connection failures** — Retry with exponential backoff, max 3 attempts - **Tool not found** — Re-discover tools (server may have updated) - **Auth errors** — Refresh token and retry once - **Timeout** — Default 30s, configurable per-server ## Environment Config ```bash # MCP server credentials (env-driven, not hardcoded) CIRCLE_API_KEY= STRIPE_API_KEY= SUPABASE_ACCESS_TOKEN= SUPABASE_PROJECT_REF= ``` ## References - **[references/circle.md](references/circle.md)** — Circle MCP tools, wallet ops, CCTP bridging - **[references/ens.md](references/ens.md)** — ENS resolution tools, domain queries - **[references/chainlink.md](references/chainlink.md)** — Price feed tools, supported chains - **[references/stripe.md](references/stripe.md)** — Stripe MCP tools, payment operations - **[references/ecosystem.md](references/ecosystem.md)** — Slack, GitHub, Notion, Cloudflare servers ## Cross-References - **x402**: MCP client can discover 402-paywalled endpoints and pay automatically - **agent-ecosystem-landscape**: Full map of available MCP servers - **bazaar-registry**: Discover MCP endpoints via Coinbase Bazaar