Skip to main content
Glama
server.ts796 B
import { createPaidMcpHandler } from "x402-mcp"; import { z } from "zod"; import { facilitator } from "@coinbase/x402"; const handler = createPaidMcpHandler( // add facilitator as the first argument (server) => { server.paidTool( "add", "Add two numbers together", { price: 0.01 }, { a: z.number(), b: z.number() }, {}, async ({ a, b }) => { const result = a + b; return { content: [{ type: "text", text: `✅ ${a} + ${b} = ${result}` }], }; }, ); }, { serverInfo: { name: "basic-math-mcp", version: "0.1.0" } }, { recipient: "0x09BbBa1f31CB4b8458Ac5106545053A61446d641", facilitator, network: "base-sepolia" }); export { handler as GET, handler as POST, handler as DELETE };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheGreatAxios/basic-math-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server