
HTTPayer
io.github.HTTPayer由 GitHub 账号 HTTPayer 发布v0.1.7更新于 Oct 24, 2026
x402 micropayments for AI agents — credits-based, no wallets, no blockchain.
概览
本地 MCP 服务器,让 AI 助手通过 HTTPayer 基于额度的代理调用 x402 付费 API,无需钱包或区块链配置。
- 可以做什么
- 查询额度余额、每日限额、已用与剩余额度,额度不足时获取充值链接,并查看 HTTPayer 全局系统每日限额与剩余容量,以及按 webhook ID 轮询异步操作状态,以及向支持 x402 的端点发起 HTTP 请求,由额度自动完成支付,以及试运行请求,在花费额度前查看费用估算。
- 适用场景
- 当助手需要访问按次收费的 x402 协议 API,而你希望用预付额度付款而不是管理钱包时适用。simulate 工具可在发起付费请求前核对费用。
- 运行要求
- 通过 npx 在本地运行,需要 Node.js,由 MCP 客户端以 stdio 启动。需要从 HTTPayer 控制台获取 API 密钥(sk-live-...),保存在本地配置文件中或在安装时传入。需要能访问 HTTPayer API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 HTTPayer,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@httpayer/mcp
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.
- Dashboard & API keys: app.httpayer.com
- npm: @httpayer/mcp
- GitHub: httpayer/mcp
Quickstart
With an AI agent (recommended)
Paste this into any MCP-compatible agent (Claude Code, Cursor, Windsurf, OpenCode...):
The agent detects your environment and handles everything automatically.
Without an agent (manual)
1. Run setup:
Get your API key at app.httpayer.com when prompted.
Flags:
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.
How it works
Runtime flow
- Your client launches the MCP server via
npx -y @httpayer/mcp@lateston startup (stdio transport). - The server reads the API key from
~/.httpayer/mcp-config.json. - The agent receives the tool list, system instructions, prompts, and resources in its context.
- When the agent calls
fetch, the MCP server forwards the request toPOST https://api.httpayer.com/proxy. - HTTPayer's proxy detects a 402, pays using your credits, retries, and returns the final response.
- The result (status, body, headers) comes back to the agent.
MCP capabilities
This server exposes three MCP primitives so agents get context automatically — without the user having to ask.
Tools
Six tools (see full reference below).
Prompts
Compatible clients (Claude Desktop, Cursor, and others) call prompts/list on connection and inject these into the agent's context proactively.
Resources
MCP tools reference
get_balance
Check credit balance and daily usage.
Input: none
Example response:
fetch
Make an HTTP request to any x402-enabled endpoint. Payment is handled automatically.
Input:
Example response:
On 502, the response includes webhook_id for async polling.
simulate
Dry-run a fetch. Returns cost estimate without spending credits.
Input: Same as fetch (except timeout).
Example response:
get_topup_link
Returns the dashboard URL to add credits. Show to user when balance is low.
Input: none
check_limits
Check global HTTPayer system daily limits and remaining capacity.
Input: none
get_webhook_status
Poll 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
HTTPayer API reference
Authentication: x-api-key: sk-live-... header on all requests.
Proxy endpoint
POST https://api.httpayer.com/proxy
Only api_url and method are required.
Status codes:
Configuration
API key stored at: ~/.httpayer/mcp-config.json
To update: npx @httpayer/mcp setup --update-key
x402 protocol overview
x402 is an HTTP-native micropayment protocol using the 402 Payment Required status code.
Without HTTPayer:
- Client hits endpoint → gets
402+ payment requirements - Client pays on-chain (requires wallet + USDC)
- Client retries with payment proof
With HTTPayer:
- Client calls
POST /proxy { api_url, method, ... } - HTTPayer detects
402, pays using your credits - HTTPayer retries and returns the final response
All blockchain interaction happens on HTTPayer's side.
Credit system
Top up at app.httpayer.com. Below 100 credits, the agent will prompt you to top up.
Error handling
Setup errors
MCP tool errors
All errors return isError: true — the server stays alive and the agent gets a readable message.
© 2026 HTTPayer Inc.
来源:README.md,提交 0fd8780
工具
0版本历史
1- v0.1.7最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。