Base URL:
https://mcp-gateway.swarms.world/
Service homepage: https://mcp-gateway.swarms.world/x402 clients handle 402 flows automatically (detect payment, construct headers, retry).
Provide a wallet signer via PRIVATE_KEY or a server wallet.
Learn more at the x402 docs.This gateway (
mcp-gateway.swarms.world) is a separate, x402-metered service from the main Swarms API (api.swarms.world) documented elsewhere on this site — it uses on-chain USDC micropayments instead of x-api-key credits.1
Prerequisites
- An EVM wallet with sufficient USDC on Base
- Either:
- Node.js 18+ and npm
- Python 3.9+ and pip
- Env var:
PRIVATE_KEY(hex0x…) for signing x402 payments
2
Install Dependencies
- Python
- TypeScript
3
Configure Environment
4
Use the Research Agent (POST /research-agent)
- Python
- TypeScript
5
Discover MCP Tools (GET /mcp/tools)
Query parameters:
url— Target MCP server URLformat—openai|mcp(defaultopenai)
- Python
- TypeScript
6
Discover MCP Tools (POST /mcp/tools)
JSON body:
url— Target MCP server URLformat—openai|mcp(optional)authorization_token— Bearer token passed to the MCP server (optional)
- Python
- TypeScript
7
Proxy a Tool Call (POST /mcp/request)
JSON body:
url— Target MCP server URLtool_name— Name of tool to callarguments— Tool arguments (object)authorization_token— Bearer token for target MCP (optional)
- Python
- TypeScript