Skip to Content
🚀 {xpay✦} is building the future of x402 payments - Join the developer beta →

SDK

Connect xpay✦ Tools programmatically using the Vercel AI SDK or MCP TypeScript SDK.

Vercel AI SDK

npm install ai @ai-sdk/openai
import { createMCPClient } from "ai"; import { generateText } from "ai"; const client = await createMCPClient({ transport: { type: "sse", url: "https://firecrawl.mcp.xpay.sh/mcp?key=YOUR_API_KEY", }, }); const tools = await client.tools(); const { text } = await generateText({ model: yourModel, tools, prompt: "Scrape example.com and summarize it", });

MCP TypeScript SDK

npm install @modelcontextprotocol/sdk
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const client = new Client({ name: "my-client", version: "1.0.0", }); await client.connect( new StreamableHTTPClientTransport( new URL("https://firecrawl.mcp.xpay.sh/mcp?key=YOUR_API_KEY") ) ); // List tools const { tools } = await client.listTools(); console.log(tools); // Call a tool const result = await client.callTool({ name: "firecrawl_scrape", arguments: { url: "https://example.com" }, }); console.log(result);

URL Patterns

Use any connection level:

LevelURL
Masterhttps://mcp.xpay.sh/mcp?key=YOUR_API_KEY
Providerhttps://{provider}.mcp.xpay.sh/mcp?key=YOUR_API_KEY
Collectionhttps://{collection}.mcp.xpay.sh/mcp?key=YOUR_API_KEY
Last updated on: