gatefareio/mcp-server
Official@gatefare/mcp
Give your AI agent a wallet and a marketplace.
@gatefare/mcpis 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.

┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Claude / │ MCP stdio │ @gatefare/mcp│ HTTP + x402 │ gatefare.io │
│ Cursor / │ ─────────────► │ (this repo)│ ─────────────► │ proxy + │
│ your agent │ │ │ │ catalog │
└─────────────┘ └──────┬───────┘ └─────────────────┘
│
│ EIP-3009 sign
▼
┌─────────────┐
│ Base USDC │
└─────────────┘Quick start
1. Drop into your client
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"gatefare": {
"command": "npx",
"args": ["-y", "@gatefare/mcp"]
}
}
}Cursor — ~/.cursor/mcp.json or project-level .cursor/mcp.json:
{
"mcpServers": {
"gatefare": {
"command": "npx",
"args": ["-y", "@gatefare/mcp"]
}
}
}Restart the client. The agent now has 5 read-only tools — discovery + safety. Try:
"Search Gatefare for weather APIs."
2. Add a wallet to make paid calls
Add env to the same config:
{
"mcpServers": {
"gatefare": {
"command": "npx",
"args": ["-y", "@gatefare/mcp"],
"env": {
"WALLET_PRIVATE_KEY": "0xYOUR_KEY",
"WALLET_BUDGET_USD": "5.00"
}
}
}
}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."
3. (Optional) Publish your own APIs
Get a PAT at gatefare.io/dashboard/tokens and add:
"env": {
"GATEFARE_PAT": "gfpat_..."
}Publisher tools (register_api, list_my_apis, update_api, get_revenue,
distribute) appear.
"Publish my API at https://api.example.com/sentiment for $0.001 per call."
Related MCP server: oom-x402-mcp
Tools
13 tools across 4 domains. Tools auto-register based on which env vars are set — the agent never sees a tool it can't use.
Discovery — always available
Tool | Description |
| Full-text search the catalog with filters (price, category, sort) |
| Full details for one API by slug or |
| All categories with API counts |
| Autocomplete suggestions for a query string |
Buyer — needs WALLET_PRIVATE_KEY
Tool | Description |
| Make a paid call. Handles 402 → sign → retry automatically |
| USDC + ETH on Base, plus remaining runtime budget |
| Project total cost for N planned calls |
Publisher — needs GATEFARE_PAT
Tool | Description |
| Publish a new paid API |
| Your published APIs with stats |
| Edit metadata, price, target URL |
| Revenue time series + totals |
| Trigger on-chain |
Safety — always available
Tool | Description |
| Report a malicious / stolen API (DMCA, fraud, malware…) |
Configuration
Var | Default | Required for |
|
| — (override for self-hosted) |
| — | Any buyer tool |
| unlimited | Optional spend cap |
|
|
|
| — | Any publisher tool |
|
|
|
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_apiswithmax_price: 0.001…
Founddemo-weatherby @alice at $0.001/call.
Callinggatefare.call_apiwithslug: "demo-weather",query: {city: "Tokyo"}…
Tokyo is 22°C, partly cloudy. Paid 0.001 USDC. Receipt:settled-tx-0x9a…
Programmatic — Python agent
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"},
)
async with stdio_client(server) as (r, w):
async with 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.
If you want to browse the Gatefare catalog from any language, hit the
REST API directly: gatefare.io/api/catalog
(OpenAPI 3.1 spec).
Full breakdown of which tool fits which use case in
docs/integrations.md.
Direct CLI (for debugging)
# 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/mcpErrors
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 |
| Input failed zod validation |
| Set |
| Set |
| Runtime budget cap hit |
| Wallet doesn't have enough USDC |
| Server's price exceeds your |
| Slug doesn't exist or is suspended |
| Paid API returned non-2xx, or its 402 was malformed |
| Gatefare rate-limited the request |
| Could not reach Gatefare |
| 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 sign an EIP-3009
transferWithAuthorizationfor that exact amount and recipient on the configured network.We retry the request with the signed
X-Paymentheader (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.targetUrlblocksfile://,localhost, cloud metadata IPs,.local, and.internalhosts at registration time.Secret hygiene. Tests assert that the private key and PAT never appear in stderr / stdout, ever.
Development
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 buildTo use a local checkout in your client config:
npm link
# in claude_desktop_config.json:
# "command": "gatefare-mcp"Architecture
src/
├── index.ts # entry — wires stdio transport
├── server.ts # McpServer instance + tool registration
├── config.ts # env parsing, capability detection
├── client.ts # REST client (wraps fetch)
├── x402.ts # 402 parsing + EIP-3009 signing
├── types.ts # shared types + GatefareError
└── tools/
├── discovery.ts # search_apis, get_api, list_categories, suggest
├── buyer.ts # call_api, get_wallet_balance, estimate_cost
├── publisher.ts # register_api, list_my_apis, update_api, get_revenue, distribute
└── safety.ts # report_abuseTest layout
tests/
├── config.test.ts # env parsing edges
├── client.test.ts # HTTP client error mapping
├── x402.test.ts # signing + parsing primitives
├── x402-flow.test.ts # full 402 → sign → retry handshake (mocked fetch)
├── server.test.ts # capability-driven tool registration
├── init.test.ts # subprocess: bootstrap, env crashes, secret leakage
├── stdio-protocol.test.ts # stdout pollution + recovery from tool errors
├── stability.test.ts # 100 concurrent calls, memory baseline, ReDoS
├── tools/
│ ├── discovery.test.ts
│ ├── buyer.test.ts
│ ├── buyer-flow.test.ts
│ ├── publisher.test.ts
│ └── safety.test.ts
└── integration/
└── e2e.test.ts # real gatefare.io, gated by GATEFARE_E2E=1Contributing
Issues and PRs welcome. See CONTRIBUTING.md for the workflow, style guide, and how to add a new tool.
Related packages
Gatefare ships three first-party packages. They share the same x402 protocol and the same backend, so a project can mix them as needed:
Package | Where | When to use |
| npm | Drop into Claude Desktop / Cursor / any MCP host to give the agent tools for catalog discovery + paid calls |
npm | TypeScript / JavaScript agents that pay APIs in code, outside MCP | |
PyPI | Python agents (LangChain, LlamaIndex, etc.) |
License
MIT © Gatefare
Links
🌐 Marketplace: gatefare.io
📚 API docs: gatefare.io/docs
🤖 LLM context (single file): gatefare.io/llms-full.txt
📐 OpenAPI spec: gatefare.io/openapi.json
🐦 Twitter: @Gatefareio
🔌 Model Context Protocol: modelcontextprotocol.io
💸 x402 standard: x402.org
Available Tools
7 toolsgatefare.get_apiARead-onlyIdempotent
Get full details for a specific API by slug, or by handle + urlName pair. Returns pricing, stats, uptime, and publisher info.
Inputs: slug, handle, urlName.
gatefare.list_categoriesARead-onlyIdempotent
List all available API categories in the Gatefare catalog with API counts.
Inputs: no named parameters.
gatefare.publisher_reputationARead-onlyIdempotent
Look up the publisher of an API and return their positive-only trust badges: Established (>=3 months tenure), Top contributor (>=1M lifetime successful calls), Highly rated (>=4.5 avg across >=10 reviews). New publishers come back unmarked — absence of badges is NOT a warning, just a lack of accumulated signal. Use this BEFORE calling an unfamiliar API to gauge counterparty risk.
Inputs: slug, handle, urlName.
gatefare.report_abuseA
Report an API for abuse — CSAM, fraud, malware, copyright, trademark, etc. Returns a reference ID for tracking. Submitting a report does not guarantee removal; trust & safety reviews each report.
Inputs: apiSlug (required), details (required), category (required), reporterEmail.
gatefare.sample_responseARead-onlyIdempotent
Fetch the publisher-pasted representative response for an API. This is what the publisher claims their API returns on a typical successful call. Compare against gatefare.get_api's captured example (what we actually got from probing) to spot inconsistencies BEFORE you pay. Capped at 4 KiB UTF-8 by the platform. Returns null when the publisher has not provided a sample (older listings).
Inputs: slug, handle, urlName.
gatefare.search_apisBRead-onlyIdempotent
Search the Gatefare catalog for paid APIs by text, price, category, or sort order. Returns paginated results with publisher info.
Inputs: page, sort, query, category, +2 more.
gatefare.suggestBRead-onlyIdempotent
Autocomplete search suggestions for API discovery.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: search, details, categories, suggestions, reporting, reputation, and sample responses. Even get_api and sample_response are well-separated by their descriptions.
Most tools follow the verb_noun pattern (search_apis, get_api, list_categories, report_abuse), but suggest and publisher_reputation deviate (bare verb, noun_noun). Overall snake_case and gatefare prefix maintain readability.
Seven tools is ideal for this domain, covering discovery, inspection, reputation, and feedback without bloat or redundancy.
The surface fully covers the API catalog workflow: search, suggest, categories, detailed lookups, publisher trust evaluation, sample response verification, and abuse reporting—no obvious dead ends or missing critical operations.
Maintenance
Related MCP Connectors
x402 pay-per-call APIs over MCP, settled in USDC on Base for autonomous agents and developers.
Pay-per-call APIs via x402 USDC on Base. Hosted MCP: original gateway; stdio: full catalog.
Pay-per-use MCP tools for AI agents. USDC on Base via x402. No API keys.
8 pay-per-call web intel tools over MCP. Free discovery, calls settle in USDC on Base (x402).
Related MCP Servers
- AlicenseAqualityBmaintenanceEight crypto and DeFi data tools for AI agents: prices, gas, one ParaSwap route quote, GoPlus token security and top-holder samples, DefiLlama yields, Hyperliquid/dYdX funding, and observed wallet balances. Inspect prices free; pay 0.001–0.008 USDC per call on Base through x402. No API key or subscription.8120 npmMIT

oom-x402-mcpofficial
FlicenseNot gradedqualityBmaintenanceMCP server exposing 1,000+ pay-per-call API endpoints across agent infrastructure (memory, coordination, secrets, verification), data, compute, finance, weather, geography, and reference categories — payments via x402 protocol in USDC on Base.-
halowerk-mcpofficial
AlicenseAqualityDmaintenanceProvides access to 70 paid APIs as MCP tools with per-call and session budgets, paying via x402/USDC on Base without requiring an account or login. Includes a built-in allowlist of hosts and safe defaults to prevent unintended payments.1489 npmMIT- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, call, and pay for existing HTTP APIs over MCP with x402 paywalls, non-custodial settlement, and no code changes to the backend.322 npm68Apache 2.0