Skip to main content
Glama

coinopai-mcp

npm version npm downloads License: MIT Node.js payments network

面向自主代理的付费决策基础设施。

这是一个 MCP 服务器,它根据 AI 代理发起的已验证智能请求进行收费——使用 Base 链上的 x402 微支付。每个决策都会获得一个 decision_id。每个 decision_id 都可以根据实际价格进行审计。

本仓库为 MCP 客户端层;付费智能服务由托管的 CoinOpAI x402 端点提供。

错误的预测也会被展示出来。这正是其意义所在。


架构

┌──────────────────────────────────┐
│   Claude Code / AI Agent         │
└──────────────┬───────────────────┘
               │  MCP (stdio)
               ▼
┌──────────────────────────────────┐
│        coinopai-mcp              │
│    npx coinopai-mcp              │
└──────────────┬───────────────────┘
               │  HTTP + 402 payment header
               ▼
┌──────────────────────────────────┐
│      x402.coinopai.com           │
│   Kronos intelligence API        │
└──────────────┬───────────────────┘
               │
               ▼
┌──────────────────────────────────┐
│   Coinbase x402 Facilitator      │
│   USDC settled on Base mainnet   │
└──────────────────────────────────┘

代理调用工具 → MCP 服务器收到 HTTP 402 → 自动签署 USDC 微支付 → 使用支付头重试 → 返回数据。配置一次,即可从配置的低余额钱包中自动支付。


验证循环 ($0.27/周期)

check_trade_preflight  ──→  get_crypto_decision  ──→  [wait 1h]  ──→  audit_trade_decision
       $0.05                      $0.15                                      $0.07

   Is now allowed?           CONSIDER_LONG/SHORT              GOOD_DECISION
   Cooldown check?           NO_ACTION                        BAD_DIRECTION
   Regime ok?                + decision_id                    NOISE
   Signal strength?          + next_step hint                 + pnl_pct

每个决策都是自我验证的。decision_id 将预测与结果关联起来。审计会获取实际市场价格并得出结论。没有任何隐藏内容。


实际输出

第 1 步 — 预检 (BTC, $0.05)

{
  "allowed": true,
  "symbol": "BTC/USD",
  "market_state": "NORMAL",
  "signal_strength": 0.72,
  "regime": "TREND",
  "cooldown_remaining_seconds": 0
}

第 2 步 — 决策 (BTC, $0.15)

{
  "symbol": "BTC/USD",
  "suggested_action": "CONSIDER_LONG",
  "confidence": 0.72,
  "regime": "TREND",
  "decision_id": "a3f8c1d2-9472-4dfe-b459-5df17b282614",
  "next_step": "Call audit_trade_decision with this decision_id after 1h using window=1h"
}

第 3 步 — 审计 (1小时后, $0.07)

{
  "decision_id": "a3f8c1d2-9472-4dfe-b459-5df17b282614",
  "direction_held": true,
  "pnl_pct": 0.82,
  "verdict": "GOOD_DECISION"
}

来自实际运行的实时结果:

交易对

决策

置信度

1小时结果

结论

XRP

做空

1.0

-0.54%

✅ GOOD_DECISION

ETH

做多

0.68

-0.32%

❌ BAD_DIRECTION

BTC

做多

0.40

+0.01%

— NOISE

它有时正确,有时错误。循环使两者都可见。


工具

工具

功能

成本

check_trade_preflight

门控检查:市场是否允许、冷却时间、机制、信号强度

$0.05

get_crypto_decision

CONSIDER_LONG/SHORT/NO_ACTION + decision_id

$0.15

audit_trade_decision

根据实际价格验证:结论 + PnL%

$0.07

get_crypto_signals

BTC、ETH、SOL、XRP、ADA 的实时方向信号

$0.05

get_crypto_risk

市场风险状态 + 机制检测

$0.02

get_crypto_signal_history

长达 168 小时的信号历史记录

$0.05

search_agent_automations

搜索 819 个代理自动化提示词

$0.01

get_agent_automation

按 slug 获取完整提示词 + 工作流步骤

$0.01

list_automation_categories

所有 35 个自动化类别及计数

$0.005

无需 API 密钥。无需订阅。按调用次数以 USDC 支付。


安装

Claude Code

添加到 ~/.claude/settings.json

{
  "mcpServers": {
    "coinopai": {
      "command": "npx",
      "args": ["-y", "coinopai-mcp"],
      "env": {
        "WALLET_PRIVATE_KEY": "0x<your-base-wallet-private-key>"
      }
    }
  }
}

重启 Claude Code。9 个工具将自动出现。

Claude Desktop

添加到您的 Claude Desktop 配置 (claude_desktop_config.json):

{
  "mcpServers": {
    "coinopai": {
      "command": "npx",
      "args": ["-y", "coinopai-mcp"],
      "env": {
        "WALLET_PRIVATE_KEY": "0x<your-base-wallet-private-key>"
      }
    }
  }
}

Smithery

通过 Smithery 安装。配置一个专用的低余额支付钱包。请勿使用您的主钱包。


获取钱包

  1. 安装 Coinbase Wallet 或任何 EVM 钱包

  2. 切换到 Base 网络

  3. 购买或跨链 USDC ($1 ≈ ~3 个完整的验证周期)

  4. 使用专用的低余额 Base 钱包进行代理支付,并通过环境变量在本地提供其私钥。

您的钱包密钥保留在本地。它永远不会离开您的机器。每笔支付都是一次已签署的微支付,而不是全权批准。


代理代码示例

// Step 1 — gate check ($0.05)
const pre = await mcp.call("check_trade_preflight", { symbol: "BTC" })
if (!pre.allowed) return  // cooldown, bad regime, or stale data

// Step 2 — get decision ($0.15)
const dec = await mcp.call("get_crypto_decision", { symbol: "BTC" })
if (dec.suggested_action === "NO_ACTION") return

// Store the decision_id — you'll need it to close the loop
const { decision_id, suggested_action, confidence } = dec

// Step 3 — act on the decision here...

// Step 4 — audit 1 hour later ($0.07)
const audit = await mcp.call("audit_trade_decision", {
  decision_id,
  window: "1h"
})
// verdict: "GOOD_DECISION" | "BAD_DIRECTION" | "NOISE"
console.log(audit.verdict, audit.pnl_pct + "%")

每个决策响应都包含一个 next_step 字段——您的代理始终知道何时以及如何进行审计。

交易对不可用? 如果某个交易对不在当前的 Kronos 周期内:

{
  "status": "UNAVAILABLE_THIS_CYCLE",
  "available_symbols": ["BTC/USD", "ETH/USD", "XRP/USD"],
  "retry_hint_seconds": 900
}

路由到可用的交易对,或等待 15 分钟进入下一个周期。


支付栈

组件

协议

x402

方案

ExactEvmScheme (EIP-3009 transferWithAuthorization)

网络

Base 主网 (eip155:8453)

代币

USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)

促进者

Coinbase


免责声明

决策输出仅为实验性自动化工作流的概率信号。不构成财务建议。这是一个样本量较小的早期系统。结果会有所不同。切勿投入您无法承受损失的资金。


许可证

MIT — 参见 LICENSE

A
license - permissive license
-
quality - not tested
C
maintenance

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/clawdbotworker/coinopai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server