The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Httpayer MCP listing page.
MCP (Model Context Protocol) server for HTTPayer. Lets AI agents call x402-enabled APIs using credit balance — no wallets, no blockchain, no Web3 knowledge required.
Paste this into any MCP-compatible agent (Claude Code, Cursor, Windsurf, OpenCode...):
The agent detects your environment and handles everything automatically.
1. Run setup:
Get your API key at app.httpayer.com when prompted.
Flags:
| Flag | Description |
|---|---|
--key sk-live-... | Provide key non-interactively |
--client <name> | Target client: claude-code, claude-desktop, cursor, windsurf, opencode, zed, cline, warp, codex |
--scope user|project | Claude Code scope (default: user) |
--yes / -y | Skip all prompts |
--update-key | Replace existing key |
2. Add to your client:
Claude Code:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
Cursor (.cursor/mcp.json), Windsurf (.windsurf/mcp.json), Cline (.cline/mcp_settings.json):
OpenCode (opencode.json or ~/.config/opencode/config.json):
Zed:
3. Restart your client and verify:
Ask your agent: "fetch https://api.httpayer.com/demo/v1/base-weather"
A weather response means HTTPayer is working.
npx -y @httpayer/mcp@latest on startup (stdio transport).~/.httpayer/mcp-config.json.fetch, the MCP server forwards the request to POST https://api.httpayer.com/proxy.This server exposes three MCP primitives so agents get context automatically — without the user having to ask.
Six tools (see full reference below).
| Name | Description |
|---|---|
httpayer-context | Injects full HTTPayer payment context into the agent. Clients that support prompts will load this automatically at session start. |
Compatible clients (Claude Desktop, Cursor, and others) call prompts/list on connection and inject these into the agent's context proactively.
| URI | Description |
|---|---|
httpayer://skill.md | Full setup guide, trigger patterns, available endpoints, and workflow. Clients can pull this on demand as grounding context. |
get_balanceCheck credit balance and daily usage.
Input: none
Example response:
fetchMake an HTTP request to any x402-enabled endpoint. Payment is handled automatically.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | yes | Target URL |
method | string | no | GET, POST, PUT, DELETE, PATCH — default GET |
body | object | no | JSON request body |
params | object | no | Query string parameters |
headers | object | no | Additional request headers |
timeout | number | no | Timeout in seconds, max 120 |
Example response:
On 502, the response includes webhook_id for async polling.
simulateDry-run a fetch. Returns cost estimate without spending credits.
Input: Same as fetch (except timeout).
Example response:
get_topup_linkReturns the dashboard URL to add credits. Show to user when balance is low.
Input: none
check_limitsCheck global HTTPayer system daily limits and remaining capacity.
Input: none
get_webhook_statusPoll the status of an async operation. Use when fetch returns a 502 with webhook_id.
Input: webhook_id (string, required)
Status values: pending, success, success_refunded, payment_failed, upstream_error, internal_error, rate_limited
Authentication: x-api-key: sk-live-... header on all requests.
| Method | Path | Tool |
|---|---|---|
GET | /v1/credits/balance | get_balance |
POST | /proxy | fetch |
POST | /proxy/sim | simulate |
GET | /limits | check_limits |
GET | /webhooks/{id} | get_webhook_status |
POST https://api.httpayer.com/proxy
Only api_url and method are required.
Status codes:
| Code | Meaning |
|---|---|
200 | Success |
402 | Insufficient credits |
429 | Rate limited |
500 | Proxy error |
502 | Target refused payment — includes webhook_id |
API key stored at: ~/.httpayer/mcp-config.json
To update: npx @httpayer/mcp setup --update-key
x402 is an HTTP-native micropayment protocol using the 402 Payment Required status code.
Without HTTPayer:
402 + payment requirementsWith HTTPayer:
POST /proxy { api_url, method, ... }402, pays using your creditsAll blockchain interaction happens on HTTPayer's side.
| Unit | Value |
|---|---|
| 1 credit | 0.001 USDC |
| 1 USDC | 1,000 credits |
| Proxy fee | 3% of target payment |
Top up at app.httpayer.com. Below 100 credits, the agent will prompt you to top up.
| Situation | Behavior |
|---|---|
| Key format invalid | Print error, exit 1 |
| Key rejected (401) | Print "API key rejected", exit 1 |
| Network unreachable | Print reason, exit 1 |
All errors return isError: true — the server stays alive and the agent gets a readable message.
| Situation | Message |
|---|---|
| No config | "No HTTPayer API key configured. Run: npx @httpayer/mcp setup" |
| API non-2xx | "HTTPayer {status}: {body}" |
| Unknown tool | "Unknown tool: {name}" |
© 2026 HTTPayer Inc.