Marketplace of paid HTTP APIs. USDC micropayments via x402 on Base. Non-custodial.
This MCP server is associated with a marketplace of paid HTTP APIs, using USDC micropayments via x402 on Base. It is described in the package readme as @gatefare/mcp (npm). The provided data does not enumerate specific MCP tools or endpoints.
π οΈ Key Features
Model Context Protocol (MCP) server package (io.github.gatefareio/mcp-server)
Paid HTTP APIs marketplace
USDC micropayments via x402 on Base
Non-custodial
π Use Cases
Accessing paid HTTP APIs through an MCP server integration
Paying for API calls with USDC micropayments on Base (x402)
β‘ Developer Benefits
Topics indicate compatibility and relevance to: ai-agents, llm-tools, and model-context-protocol
Implementation ecosystem references: Node.js (nodejs) and TypeScript (typescript)
β οΈ Limitations
Tool list/count and concrete MCP behavior are not included in the provided source data
No detailed usage instructions or configuration details are present in the excerpt
@gatefare/mcp is a Model Context Protocol server that connects Claude
Desktop, Cursor, or any MCP-compatible agent to the
Gatefare catalog of paid HTTP APIs. Payments
settle as USDC on Base via the open x402 standard
β no SaaS keys, no subscriptions, no escrow. Non-custodial: signing
happens locally; the private key never leaves your machine.
Demo: install, list tools, real call against gatefare.io
Buyer tools (call_api, get_wallet_balance, estimate_cost) become available. The
WALLET_BUDGET_USD cap is a runtime safety net β for a hard cap, fund the wallet with
only what you're willing to spend.
"What's London's weather right now? Spend up to $0.001."
Report a malicious / stolen API (DMCA, fraud, malwareβ¦)
Configuration
Var
Default
Required for
GATEFARE_BASE_URL
https://gatefare.io
β (override for self-hosted)
WALLET_PRIVATE_KEY
β
Any buyer tool
WALLET_BUDGET_USD
unlimited
Optional spend cap
WALLET_NETWORK
eip155:8453
eip155:84532 for Sepolia testnet
GATEFARE_PAT
β
Any publisher tool
LOG_LEVEL
info
debug for verbose stderr
Examples
Discover & buy in one breath (Claude Desktop)
You:Find me a sub-$0.001 weather API and call it for "Tokyo".
Claude:Calling gatefare.search_apis with max_price: 0.001β¦ Found demo-weather by @alice at $0.001/call. Calling gatefare.call_api with slug: "demo-weather", query: {city: "Tokyo"}β¦ Tokyo is 22Β°C, partly cloudy. Paid 0.001 USDC. Receipt: settled-tx-0x9aβ¦
Programmatic β Python agent
python
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
server = StdioServerParameters(
command="npx",
args=["-y", "@gatefare/mcp"],
env={"WALLET_PRIVATE_KEY": "0x...", "WALLET_BUDGET_USD": "1.00"},
)
asyncwith stdio_client(server) as (r, w):
asyncwith ClientSession(r, w) as s:
await s.initialize()
result = await s.call_tool(
"gatefare.call_api",
arguments={"slug": "demo-weather", "query": {"city": "Tokyo"}},
)
print(result.content[0].text)
See examples/ for runnable variants: Claude Desktop, Cursor, Python,
TypeScript, and a pure-discovery walkthrough.
Not building an AI agent? Picking the right tool
If you want to pay for x402 APIs from a backend (no agent), use Coinbase's
official x402 SDKs β x402-python (PyPI), coinbase/x402/go, β¦/java, or
@x402/fetch. They handle the
payment flow; you don't need this MCP server.
# Run the server in foreground; talks JSON-RPC over stdio.
npx -y @gatefare/mcp
# In another terminal, send a frame:echo'{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | \
npx -y @gatefare/mcp
Errors
Tool results include isError: true and a structured body
{ error: <code>, message: <human>, details?: <any> }. Codes are stable β
agents can switch on them for retry / surfacing logic.
Code
Meaning
INVALID_INPUT
Input failed zod validation
WALLET_NOT_CONFIGURED
Set WALLET_PRIVATE_KEY for buyer tools
PAT_NOT_CONFIGURED
Set GATEFARE_PAT for publisher tools
BUDGET_EXHAUSTED
Runtime budget cap hit
INSUFFICIENT_BALANCE
Wallet doesn't have enough USDC
PRICE_TOO_HIGH
Server's price exceeds your max_price
API_NOT_FOUND
Slug doesn't exist or is suspended
UPSTREAM_ERROR
Paid API returned non-2xx, or its 402 was malformed
RATE_LIMITED
Gatefare rate-limited the request
NETWORK_ERROR
Could not reach Gatefare
GATEFARE_API_ERROR
Gatefare returned a 4xx / 5xx
How it works (the 30-second version)
The agent calls gatefare.call_api { slug: "demo-weather", β¦ }.
We GET https://gatefare.io/p/demo-weather (no payment yet).
The Gatefare proxy returns 402 Payment Required with accepts: [{network, payTo, maxAmountRequired, β¦}].
We retry the request with the signed X-Payment header (base64-encoded JSON, x402 v2).
Gatefare verifies the signature, settles the USDC transfer, and proxies the call to the upstream API.
We hand the upstream response (and a payment receipt) back to the agent.
The signature is single-use, time-bounded, and never leaves your machine for any
purpose other than this exact transfer to this exact payTo. The private key
is never logged.
Security
Non-custodial. Private keys live in your env, signing happens locally,
no Gatefare service ever sees them.
Network confusion-resistant. A malicious gateway returning Sepolia-only
requirements to a mainnet user is rejected β we never sign for a chain
the user didn't configure.
Cryptographically random nonces. No Date.now()-based collisions.
Validity window clamped to 1 hour even if the server requests more.
Strict input validation. Slugs are ^[a-z0-9_-]+$ and URL-encoded;
no path traversal. targetUrl blocks file://, localhost, cloud
metadata IPs, .local, and .internal hosts at registration time.
Secret hygiene. Tests assert that the private key and PAT never
appear in stderr / stdout, ever.
Development
bash
git clone https://github.com/gatefareio/mcp-server.git
cd mcp-server
npm install
npm run typecheck
npm test# 138 unit tests
npm run test:e2e # 10 e2e tests against live gatefare.io (set GATEFARE_E2E=1)
npm run build
To use a local checkout in your client config:
bash
npm link# in claude_desktop_config.json:# "command": "gatefare-mcp"
EVM private key (32 bytes hex). Required for buyer tools (call_api, get_wallet_balance, estimate_cost). Stays on the user's machine.
WALLET_BUDGET_USD
Optional runtime spend cap in USD; call_api throws BUDGET_EXHAUSTED when reached.
WALLET_NETWORKdefault eip155:8453
Network identifier. Defaults to eip155:8453 (Base mainnet). Use eip155:84532 for Sepolia testnet.
GATEFARE_PATsecret
Personal access token (gfpat_...) from gatefare.io/dashboard/tokens. Required for publisher tools (register_api, list_my_apis, update_api, get_revenue, distribute).
GATEFARE_BASE_URLdefault https://gatefare.io
Override the Gatefare base URL (defaults to https://gatefare.io). Useful for self-hosted deployments.