@powforge/captcha-mcp
@powforge/captcha-mcp
当智能体重击你的 MCP 服务器时,它返回 429。captcha-mcp 让它们为下一次调用付出代价。 给智能体一个工作量证明谜题(免费,约 5 秒 CPU)或一张 3 sats 的 Lightning 发票——两者都是自主调用者无需账户、邮箱或 API 密钥即可满足的机器可读退避信号。
三个工具,支持 stdio 或 HTTP。仅使用标准库。无需注册、免费回退、可自托管、无收入分成。
为什么不是 429?
429 Too Many Requests 在智能体时代是错误的形态。MCP 服务器报告中反复出现三种模式:
智能体框架将 429 视为连接失败。 它们会立即重试,通常采用指数退避,但仍然过于激进,并放大了最初触发限制的过载。
没有按调用者区分的信号。 429 是针对整个桶(bucket)而非某个智能体触发的。一个吵闹的调用者会让所有其他调用者都被限流,服务器无法要求那个吵闹的调用者特别减速。
Retry-After 只是建议性的,经常被忽略。 智能体不会一致地解析它,也不会一致地尊重它,而且没有等待的动机——重试的成本为零。
captcha-mcp 用 402 风格的挑战(challenge)取代 429。下一次调用需要调用者付出代价(CPU 秒或 3 sats)。这种代价是按调用者计算的、机器可读的,并且会自动限流——无法解决谜题的智能体就无法淹没端点。
Related MCP server: @bitcoinbenji/mcp
快速开始
npx -y @powforge/captcha-mcp无需安装、无需配置、无需 API 密钥。服务器在 stdio 上启动,等待 MCP 客户端。
要将其接入 Claude Code、Cursor 或任何兼容 MCP 的主机,请在你的配置中添加:
{
"mcpServers": {
"powforge-captcha": {
"command": "npx",
"args": ["-y", "@powforge/captcha-mcp"]
}
}
}或者运行 npx @powforge/captcha-mcp --install 来打印配置块。
功能
将 PowForge 的 pow-captcha 服务(captcha.powforge.dev)封装为三个 MCP 工具:
工具 | 用途 |
| 请求一个新的工作量证明谜题。返回 |
| 提交已求解的 nonce。返回一个有效期为 5 分钟的 HMAC 签名访问令牌。 |
| 服务器健康状态、生命周期统计信息、L402 端点元数据。 |
免费层级需要智能体约 5-10 秒的 CPU 时间(SHA-256,默认 14 个前导零位)。付费层级通过 L402 在 Lightning 上花费 3 sats(RFC 7235 + WWW-Authenticate 中的 bolt11 发票)。
为什么选择它而不是 OAuth、API 密钥或 Stripe?
方法 | 每次调用成本 | 需要账户 | 可自托管 | 智能体友好 |
API 密钥 | $0 | 是 | n/a | 否 |
OAuth | $0 | 是 | n/a | 否 |
Stripe 计量 | 高开销 | 是 | n/a | 否 |
托管式 MCP 认证平台 | 100–2000 sats | 否 | 否 | 是 |
PoW + L402(本项目) | 数秒或 3 sats | 否 | 是 | 是 |
智能体没有电子邮件地址。它们不会点击确认链接。它们不会输入信用卡。PoW + Lightning 是唯一适用于完全自主调用者的认证原语。
托管式 MCP 认证平台是可行的,但它们会在供应商基础设施上按每次调用收取 100–2000 sats——你的收入流经他们的管道。这个包运行在你自己的服务器上,使用你自己的 Lightning 节点和密钥。sats 归你所有。
配置
设置 CAPTCHA_URL 以指向不同的验证码后端。默认值为 http://localhost:3077,因此你可以在本地运行全栈进行开发。生产环境可将其指向 https://captcha.powforge.dev。
CAPTCHA_URL=https://captcha.powforge.dev npx @powforge/captcha-mcpHTTP 流式传输
托管式 MCP 客户端(Smithery、基于浏览器的宿主)需要 HTTP,而不是 stdio。传入 --http 或设置 HTTP_MODE=1:
HTTP_MODE=1 PORT=3200 npx @powforge/captcha-mcp
# or
npx @powforge/captcha-mcp --http然后服务器监听:
端点 | 方法 | 用途 |
| POST | 单个 JSON-RPC 请求,单个 JSON-RPC 响应。通知返回 202。 |
| GET | 用于服务器推送通知的 SSE 流(通过 25 秒心跳保持打开)。 |
| GET | 存活探针——返回 |
无状态。没有会话 ID。CORS 开放(Access-Control-Allow-Origin: *),因此浏览器客户端可以工作。Stdio 模式保持不变,且仍然是默认模式——不带任何标志的 npx @powforge/captcha-mcp 仍通过 stdin/stdout 进行 JSON-RPC 通信。
对 HTTP 传输进行冒烟测试:
HTTP_MODE=1 PORT=3200 node src/server.js &
curl -X POST http://localhost:3200/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}'返回 {jsonrpc:"2.0", id:1, result:{protocolVersion:"2024-11-05", capabilities:{tools:{}}, serverInfo:{...}}}。
本地开发
克隆 captcha widget 仓库 或运行公共服务。MCP 服务器只需要 HTTP 访问 status 下列出的验证码端点。
git clone https://github.com/zekebuilds-lab/captcha-mcp
cd captcha-mcp
node src/server.js它会向 stderr 打印 ready,并在 stdin 上等待 JSON-RPC。
手动对协议进行冒烟测试:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}' | node src/server.js你应该会看到带有 serverInfo: { name: "@powforge/captcha-mcp", version: "0.2.5" } 的 JSON 响应。
从你自己的后端验证令牌
当智能体向你的服务提交令牌时,在不必信任该智能体的情况下验证它:
curl -X POST https://captcha.powforge.dev/api/token/verify \
-H "Content-Type: application/json" \
-d '{"token":"<token-from-verify-tool>"}'返回 {valid: true, method, issued_at, expires_at} 或 {valid: false, reason}。
相关包
@powforge/captcha— 同一服务的浏览器组件。@powforge/mcp-l402-gate— Express 中间件,用于使用 L402 + Depth-of-Identity 评分来门控任何 MCP 服务器。@powforge/mcp-identity— 智能体信誉预言机。与此门控配合使用,可在首次调用时提供滥用保护。
与其他 MCP 智能体认证原语的比较
门控 MCP 服务器的领域正在变得拥挤。以下是真实的格局,按每个工具与 captcha-mcp 的功能重叠程度排序。
工具 | 支付轨道 | 认证模型 | 可自托管 | 免费 PoW 层级 | 无需账户付款 |
PayGated | Stri |
Available Tools
3 toolschallengeA
Request a fresh PoW challenge from the PowForge captcha service. Returns {id, salt, difficulty, signature, instructions}. The agent must find a nonce such that SHA-256(salt + nonce) has at least difficulty leading zero bits, then call the verify tool. Free tier — no payment required.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses the tool creates a new challenge (non-idempotent), returns specific fields, requires a subsequent PoW solution, and mentions free tier. Lacks rate limit info but is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences concisely cover purpose, return structure, workflow, and free tier. No redundancies or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no input schema and no output schema, so the description fully covers both: explains that no input is needed and details the returned object fields along with subsequent steps. Sufficient for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No input parameters exist, so schema coverage is 100%. The description adds value by explaining the return structure, which is not parameter semantics but compensates for missing output schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Request' and resource 'fresh PoW challenge from PowForge captcha service', and distinguishes from sibling 'verify' by mentioning the complete workflow including the call to verify.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use (requesting a captcha challenge) and what to do next (find nonce, call verify), but does not explicitly contrast with 'status' or provide when-not-to-use conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
statusA
Return PowForge captcha server health, lifetime stats (pow_solves, ln_skips, challenges_issued), and L402 endpoint metadata (scope, price_sats, paid endpoint URL). Use this to discover the Lightning skip price before paying, or as a liveness check.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden and adequately lists the return data: health, lifetime stats, and L402 metadata. It implies a read-only operation but could explicitly state no side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single dense sentence that is front-loaded with the main purpose. It could be split into two sentences for readability, but it is efficient and contains no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description explains the return values and use cases adequately. It does not specify response format or error handling, but for a health endpoint, the provided information is sufficient for tool selection.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is 100% (vacuously). Baseline for zero parameters is 4, and the description adds value by detailing the output fields beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns health, lifetime stats, and L402 endpoint metadata. It distinguishes itself from siblings 'challenge' and 'verify' by specifying use cases like discovering the Lightning skip price and liveness check.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly provides two use cases: discovering the Lightning skip price before paying and as a liveness check. It gives clear context for when to use the tool, though it does not mention when not to use it or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verifyA
Verify a PoW solution. Input: {salt, nonce, id, signature, algo?, difficulty?} from a prior challenge call plus the nonce the agent computed. Returns a 5-minute HMAC-signed token on success, or {valid: false, reason} on failure. Tokens can be re-verified server-side via POST /api/token/verify.
| Name | Required | Description | Default |
|---|---|---|---|
| salt | Yes | Hex salt from the challenge response | |
| nonce | Yes | Nonce string the agent computed | |
| id | Yes | Challenge id from the challenge response | |
| signature | Yes | HMAC signature from the challenge response | |
| algo | No | Hash algorithm. Default: 'sha256' | |
| difficulty | No | Leading zero bits required. Default: matches challenge. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavior. It explains the return value: a 5-minute HMAC-signed token on success or an error object on failure. It also mentions server-side re-verification. However, it does not cover potential side effects or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of three concise sentences: the first states the purpose, the second details input/output, and the third mentions server-side capabilities. It is front-loaded and free of superfluous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description adequately explains return values (success token with lifetime, failure reason). It references the sibling 'challenge' and describes the token's re-verification endpoint. However, it lacks detail on possible failure reasons or error codes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the description adds valuable context by listing parameters and stating they come from a prior challenge call, plus the agent-computed nonce. This clarifies the origin and usage beyond the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Verify a PoW solution,' using a specific verb and resource. It clearly distinguishes from sibling tools like 'challenge' by describing input from a prior challenge call and the verification purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description indicates that input comes 'from a prior challenge call,' implying a sequence (call challenge first, then verify). It does not explicitly state when not to use it or contrast with alternatives, but the context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.2.0- First observed
challenge - First observed
status - First observed
verify
TDQS
Scored across 3 tools
Each tool has a distinct purpose: challenge initiates a PoW challenge, status checks server health and metadata, and verify submits the solution. No overlap in functionality.
All tool names are single-word imperative verbs (challenge, status, verify), following a consistent naming pattern.
Three tools are appropriate for a captcha service, covering the core workflow (challenge, verify) and a status check. Not excessive or insufficient.
The core PoW challenge-verify cycle is complete. However, the status tool mentions a Lightning skip option, but no tool to execute it, which is a minor gap.
Maintenance
Related MCP Connectors
Pay-per-action access to APIs and MCP tools over Lightning L402 and Base USDC x402.
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Remote MCP server exposing 330 production AI-agent services for web/data processing, validation, AI utilities, blockchain/crypto utilities, and x402 pay-per-use access.
- UnifAPIOAuthcom.unifapi
Hosted MCP server for live public-data APIs and Skills for AI agents.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that enables AI agents to make autonomous Bitcoin Lightning Network payments using the L402 protocol. Agents can pay for API access, purchase resources, and complete transactions without human intervention — invoice comes in, sats go out, done.179MIT
- AlicenseBqualityDmaintenanceMCP server offering 26 Lightning-paid tools for Bitcoin mempool intelligence and sovereign on-prem AI inference, with no third-party APIs and pay-per-call in sats.2610 npm1MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables AI agents to access paid AI inference and web tools via HTTP 402 micropayments in USDC on Base, using the agent's wallet as identity.14175 npmMIT
- AlicenseAqualityDmaintenanceMCP server that gives AI agents Lightning payments, L402 API access, trust verification, and service discovery.1111 npmMIT