{"_id":"@acrylicfiddle/x402tools-mcp","name":"@acrylicfiddle/x402tools-mcp","dist-tags":{"latest":"1.4.0"},"versions":{"1.4.0":{"name":"@acrylicfiddle/x402tools-mcp","version":"1.4.0","description":"MCP server exposing x402tools pay-per-call APIs as tools for AI agents","type":"module","main":"dist/index.js","bin":{"x402tools-mcp":"dist/stdio.js"},"homepage":"https://x402tools.xyz","repository":{"type":"git","url":"git+https://github.com/acrylicfiddle/x402-services.git","directory":"services/mcp-server"},"license":"MIT","keywords":["mcp","model-context-protocol","x402","usdc","base","ai-agents","claude","cursor","openai","qr-code","screenshot","ocr","pdf","dns"],"mcpName":"io.github.acrylicfiddle/x402tools","scripts":{"build":"tsc","start":"node dist/index.js","start:stdio":"node dist/stdio.js","dev":"tsx src/index.ts","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","@x402/fetch":"^2.13.0","@x402/evm":"^2.13.0","viem":"^2.21.0","zod":"^4.4.3"},"devDependencies":{"typescript":"^5.8.0","@types/node":"^22.0.0","tsx":"^4.19.0"},"_id":"@acrylicfiddle/x402tools-mcp@1.4.0","gitHead":"eae29d0931a742f37b6266d6a1c902dda42e0770","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/acrylicfiddle/x402-services/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-1SEQvwrwHYKuH9FqyaQkVne2w48hzr14Bf49M8C6Ls2wQmNudxfVwlsry2VXrcwWQQ2oAbHr3NyDRlQsst/9PA==","shasum":"d195123808e7a2f35a0f10bf305eef7d8d15a242","tarball":"https://registry.npmjs.org/@acrylicfiddle/x402tools-mcp/-/x402tools-mcp-1.4.0.tgz","fileCount":9,"unpackedSize":33970,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAC0Ex2CD4LWNG6r/KbWnFTyPaRharGBS9JpG5xZAoHwAiABEgv36Yzy9e9JumzuOlgKIOjUemDaP+ydXM0cpGtheg=="}]},"_npmUser":{"name":"acrylicfiddle","email":"kasatsiddhant@gmail.com"},"directories":{},"maintainers":[{"name":"acrylicfiddle","email":"kasatsiddhant@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402tools-mcp_1.4.0_1781226908458_0.5523584997056634"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T01:15:08.341Z","1.4.0":"2026-06-12T01:15:08.607Z","modified":"2026-06-12T01:15:08.795Z"},"maintainers":[{"name":"acrylicfiddle","email":"kasatsiddhant@gmail.com"}],"description":"MCP server exposing x402tools pay-per-call APIs as tools for AI agents","homepage":"https://x402tools.xyz","keywords":["mcp","model-context-protocol","x402","usdc","base","ai-agents","claude","cursor","openai","qr-code","screenshot","ocr","pdf","dns"],"repository":{"type":"git","url":"git+https://github.com/acrylicfiddle/x402-services.git","directory":"services/mcp-server"},"bugs":{"url":"https://github.com/acrylicfiddle/x402-services/issues"},"license":"MIT","readme":"# x402tools MCP Server\n\n[![npm](https://img.shields.io/npm/v/@x402tools/mcp-server.svg)](https://www.npmjs.com/package/@x402tools/mcp-server)\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io/v1/servers?search=x402tools)\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI agents 9 pay-per-call utility tools. Pay with USDC on Base via x402 protocol — agent's private key **never leaves the agent**.\n\n## 🛠 Tools\n\n| Tool | Description | Price |\n|------|-------------|-------|\n| `generate_qr` | Generate QR code from text/URL | $0.001 |\n| `generate_styled_qr` | Artistic QR with shapes & gradients | $0.005 |\n| `capture_screenshot` | Website screenshot (dark mode, selectors) | $0.005 |\n| `dns_lookup` | DNS records (A, AAAA, MX, NS, TXT, SOA) | $0.002 |\n| `parse_document` | HTML/PDF → structured JSON | $0.001 |\n| `screen_prompt_injection` | Detect prompt injection / jailbreak | $0.003 |\n| `validate_email` | Email validation + deliverability + risk | $0.003 |\n| `render_pdf` | HTML/URL → PDF | $0.005 |\n| `extract_text_ocr` | Image → text via OCR | $0.005 |\n\n## 🔌 Connect\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n**Hosted (HTTP):**\n```json\n{\n  \"mcpServers\": {\n    \"x402tools\": {\n      \"url\": \"https://mcp.x402tools.xyz/mcp\"\n    }\n  }\n}\n```\n\n**Local (stdio with auto-pay convenience):**\n```json\n{\n  \"mcpServers\": {\n    \"x402tools\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@x402tools/mcp-server\"],\n      \"env\": {\n        \"WALLET_PRIVATE_KEY\": \"0x...\"\n      }\n    }\n  }\n}\n```\n\n### Cursor\n\nEdit `~/.cursor/mcp.json`:\n```json\n{\n  \"mcpServers\": {\n    \"x402tools\": {\n      \"url\": \"https://mcp.x402tools.xyz/mcp\"\n    }\n  }\n}\n```\n\n### Windsurf\n\nSettings → MCP Servers → Add:\n```json\n{\n  \"x402tools\": {\n    \"serverUrl\": \"https://mcp.x402tools.xyz/mcp\"\n  }\n}\n```\n\n### Cline (VS Code)\n\n`.vscode/mcp.json`:\n```json\n{\n  \"mcpServers\": {\n    \"x402tools\": {\n      \"url\": \"https://mcp.x402tools.xyz/mcp\"\n    }\n  }\n}\n```\n\n### Continue.dev\n\n`~/.continue/config.json`:\n```json\n{\n  \"experimental\": {\n    \"modelContextProtocolServers\": [\n      {\n        \"transport\": {\n          \"type\": \"streamable-http\",\n          \"url\": \"https://mcp.x402tools.xyz/mcp\"\n        }\n      }\n    ]\n  }\n}\n```\n\n### OpenAI Agents SDK / Responses API\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI()\nresponse = client.responses.create(\n    model=\"gpt-4o\",\n    tools=[{\n        \"type\": \"mcp\",\n        \"server_label\": \"x402tools\",\n        \"server_url\": \"https://mcp.x402tools.xyz/mcp\",\n        \"require_approval\": \"never\"\n    }],\n    input=\"Generate a QR code for https://x402tools.xyz\"\n)\n```\n\n### Gemini / Google ADK\n\n```python\nfrom google.genai import types\n\nconfig = types.GenerateContentConfig(\n    tools=[types.Tool(mcp_server={\"url\": \"https://mcp.x402tools.xyz/mcp\"})]\n)\n```\n\n## 💸 Payment Model\n\nThis server uses **payment passthrough** — the MCP server holds NO wallet. Each agent provides their own signed payment per call.\n\n**Flow:**\n1. Agent calls a tool without payment → MCP returns `402 + payment requirements`\n2. Agent signs the payment locally with their wallet (hardware wallet, MPC, smart wallet, or private key)\n3. Agent retries the tool with `_payment` argument or `PAYMENT-SIGNATURE` HTTP header\n4. MCP forwards the signed payment to the underlying x402 service\n\n**Easiest signing**: use `@x402/fetch` to wrap your fetch — it handles the 402 → sign → retry loop automatically:\n\n```typescript\nimport { wrapFetchWithPaymentFromConfig } from \"@x402/fetch\";\nimport { ExactEvmScheme } from \"@x402/evm\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nconst account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY);\nconst paidFetch = wrapFetchWithPaymentFromConfig(fetch, {\n  schemes: [{ network: \"eip155:*\", client: new ExactEvmScheme(account) }]\n});\n\n// Now calls to mcp.x402tools.xyz auto-pay on 402\n```\n\n**Manual signing** (for hardware wallets, MPC, smart accounts):\n1. Read `requirements.accepts[0]` from the 402 response\n2. Use `@x402/evm`'s `ExactEvmScheme.createPaymentPayload(2, requirements)` with your `ClientEvmSigner`\n3. Wrap as v2 PaymentPayload: `{ x402Version: 2, payload, extensions: {}, resource, accepted }`\n4. Base64-encode the JSON\n5. Send as `PAYMENT-SIGNATURE` HTTP header (or `_payment` tool arg)\n\n## 🏷 Protocol\n\n- **Network:** Base mainnet (`eip155:8453`)\n- **Token:** USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)\n- **Receiver:** `0xcEbbB82a183Faa69b929eD1F417aAFc63fa3b5b6`\n- **Header:** `PAYMENT-SIGNATURE` (x402 v2)\n\n## 🔍 Discovery Endpoints\n\n- **MCP server**: `https://mcp.x402tools.xyz/mcp`\n- **Discovery JSON**: `https://mcp.x402tools.xyz/.well-known/mcp`\n- **Health**: `https://mcp.x402tools.xyz/health`\n- **MCP Registry**: [`io.github.acrylicfiddle/x402tools`](https://registry.modelcontextprotocol.io/v1/servers?search=x402tools)\n- **npm**: [`@x402tools/mcp-server`](https://www.npmjs.com/package/@x402tools/mcp-server)\n- **GitHub**: [acrylicfiddle/x402-services](https://github.com/acrylicfiddle/x402-services)\n\n## 🚀 Self-host\n\n```bash\ngit clone https://github.com/acrylicfiddle/x402-services\ncd x402-services/services/mcp-server\nnpm install\nnpm run build\nPORT=4080 npm start\n# MCP at http://localhost:4080/mcp\n```\n\n## 📦 Publishing to MCP Registry\n\n```bash\nbrew install mcp-publisher\nmcp-publisher login github\ncd services/mcp-server\nmcp-publisher publish\n```\n\n## 📜 License\n\nMIT\r\n","readmeFilename":"README.md","_rev":"1-7c94e56e22be18ea768ed657342b924b"}