coinopai-mcp 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -11
- package/index.js +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,50 @@
|
|
|
1
1
|
# coinopai-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An AI that makes crypto trade decisions — then proves whether it was right.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
MCP server for [CoinOpAI](https://x402.coinopai.com). Agents get decisions, then audit them against real prices. Paid per-call with USDC on Base via the [x402 protocol](https://x402.org).
|
|
6
|
+
|
|
7
|
+
> Don't trust signals. Watch what happens after.
|
|
8
|
+
|
|
9
|
+
## Quickstart: Your first verified loop ($0.27)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
1. Fund wallet with $1 USDC on Base
|
|
13
|
+
2. Call check_trade_preflight("BTC") → $0.05
|
|
14
|
+
3. Call get_crypto_decision("BTC") → $0.15
|
|
15
|
+
4. Wait 1 hour
|
|
16
|
+
5. Call audit_trade_decision(decision_id) → $0.07
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You get back a verdict: `GOOD_DECISION`, `BAD_DIRECTION`, or `NOISE`.
|
|
20
|
+
|
|
21
|
+
Real example from a live run:
|
|
22
|
+
|
|
23
|
+
| Decision | Confidence | 1h Outcome | Verdict |
|
|
24
|
+
|----------|-----------|------------|---------|
|
|
25
|
+
| XRP SHORT | 1.0 | -0.54% | GOOD_DECISION |
|
|
26
|
+
| ETH LONG | 0.68 | -0.32% | BAD_DIRECTION |
|
|
27
|
+
| BTC LONG | 0.40 | +0.01% | NOISE |
|
|
28
|
+
|
|
29
|
+
It gets some right. It gets some wrong. The difference: it checks itself after.
|
|
30
|
+
|
|
31
|
+
## Tools
|
|
6
32
|
|
|
7
33
|
| Tool | What it does | Cost |
|
|
8
34
|
|------|-------------|------|
|
|
35
|
+
| `check_trade_preflight` | Step 1 — gate check: allowed? cooldown? regime? | $0.05 |
|
|
36
|
+
| `get_crypto_decision` | Step 2 — CONSIDER_LONG/SHORT/NO_ACTION + decision_id | $0.15 |
|
|
37
|
+
| `audit_trade_decision` | Step 3 — verify against real prices: verdict + PnL% | $0.07 |
|
|
38
|
+
| `get_crypto_signals` | Raw 15-min directional signals for BTC/ETH/SOL/XRP/ADA | $0.05 |
|
|
39
|
+
| `get_crypto_risk` | Market risk state + regime detection | $0.02 |
|
|
40
|
+
| `get_crypto_signal_history` | Up to 168h of signal history | $0.05 |
|
|
9
41
|
| `search_agent_automations` | Search 819 agent automation prompts | $0.01 |
|
|
10
42
|
| `get_agent_automation` | Full prompt + workflow steps by slug | $0.01 |
|
|
11
43
|
| `list_automation_categories` | All 35 categories with counts | $0.005 |
|
|
12
|
-
| `get_crypto_signals` | Latest hourly BTC/ETH/SOL/XRP/ADA signals | $0.05 |
|
|
13
|
-
| `get_crypto_risk` | Current risk state + regime detection | $0.02 |
|
|
14
|
-
| `get_crypto_signal_history` | Up to 168h of signal history | $0.05 |
|
|
15
44
|
|
|
16
45
|
No API keys. No subscriptions. Pay only for what you use.
|
|
17
46
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- A Base wallet with USDC funded (any amount — $1 goes a long way at these prices)
|
|
21
|
-
- Node.js 18+
|
|
47
|
+
> **All decision outputs are probabilistic signals for experimental automated workflows only. Not financial advice. Early system — small sample size. Results will vary.**
|
|
22
48
|
|
|
23
49
|
## Install in Claude Code
|
|
24
50
|
|
|
@@ -44,11 +70,43 @@ Then restart Claude Code. The tools appear automatically.
|
|
|
44
70
|
|
|
45
71
|
1. Install [Coinbase Wallet](https://wallet.coinbase.com) or use any EVM wallet
|
|
46
72
|
2. Switch to Base network
|
|
47
|
-
3. Buy or bridge a small amount of USDC
|
|
73
|
+
3. Buy or bridge a small amount of USDC ($1 runs ~3 full cycles)
|
|
48
74
|
4. Export your private key and add it to the config above
|
|
49
75
|
|
|
50
76
|
## How payment works
|
|
51
77
|
|
|
52
|
-
Each tool call
|
|
78
|
+
Each tool call hits `x402.coinopai.com`. The server returns `402 Payment Required` with the price. The MCP server automatically signs a USDC micropayment using your wallet and resends the request. You get the data. The fee settles on Base mainnet.
|
|
53
79
|
|
|
54
80
|
No human approval needed per call — configure once, pay automatically.
|
|
81
|
+
|
|
82
|
+
## The agent trade loop ($0.27/cycle)
|
|
83
|
+
|
|
84
|
+
The recommended call sequence — three paid calls, one complete verified cycle:
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
// 1. Gate check — is now a good time? ($0.05)
|
|
88
|
+
const pre = await check_trade_preflight({ symbol: "BTC" })
|
|
89
|
+
if (!pre.allowed) return // cooldown, bad regime, stale data
|
|
90
|
+
|
|
91
|
+
// 2. Get interpreted decision ($0.15)
|
|
92
|
+
const dec = await get_crypto_decision({ symbol: "BTC" })
|
|
93
|
+
// dec.next_step tells you exactly when and how to audit
|
|
94
|
+
if (dec.suggested_action === "NO_ACTION") return
|
|
95
|
+
|
|
96
|
+
// 3. Execute your trade here...
|
|
97
|
+
|
|
98
|
+
// 4. Verify the outcome after 1h ($0.07)
|
|
99
|
+
const result = await audit_trade_decision({
|
|
100
|
+
decision_id: dec.decision_id,
|
|
101
|
+
window: "1h"
|
|
102
|
+
})
|
|
103
|
+
// result.outcome.verdict: GOOD_DECISION | BAD_DIRECTION | NOISE
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Every decision response includes a `next_step` field with the exact audit endpoint and expected outcomes — so your agent always knows what to do next.
|
|
107
|
+
|
|
108
|
+
If a symbol isn't in the current Kronos cycle, `check_trade_preflight` returns:
|
|
109
|
+
```json
|
|
110
|
+
{ "status": "UNAVAILABLE_THIS_CYCLE", "available_symbols": ["BTC/USD","ETH/USD","XRP/USD"], "retry_hint_seconds": 900 }
|
|
111
|
+
```
|
|
112
|
+
Route to an available symbol or wait 15 minutes for the next cycle.
|
package/index.js
CHANGED
|
@@ -62,7 +62,7 @@ const TOOLS = [
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
name: "get_crypto_decision",
|
|
65
|
-
description: "
|
|
65
|
+
description: "Get a probabilistic trade decision from Kronos — then verify it. Returns CONSIDER_LONG/SHORT/NO_ACTION with confidence, regime, and a decision_id. Call audit_trade_decision with that ID after 1h to see if the decision was right. Full loop: preflight ($0.05) → decision ($0.15) → audit ($0.07) = $0.27 per verified cycle. Costs $0.15 USDC.",
|
|
66
66
|
inputSchema: {
|
|
67
67
|
type: "object",
|
|
68
68
|
properties: {
|
|
@@ -73,7 +73,7 @@ const TOOLS = [
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
name: "check_trade_preflight",
|
|
76
|
-
description: "
|
|
76
|
+
description: "Step 1 of the trade loop — checks if conditions allow a trade. Returns allowed:true/false, market state, cooldown, signal strength, warnings. If allowed, proceed to get_crypto_decision. Costs $0.05 USDC.",
|
|
77
77
|
inputSchema: {
|
|
78
78
|
type: "object",
|
|
79
79
|
properties: {
|
|
@@ -81,6 +81,18 @@ const TOOLS = [
|
|
|
81
81
|
},
|
|
82
82
|
required: ["symbol"]
|
|
83
83
|
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "audit_trade_decision",
|
|
87
|
+
description: "The accountability step — verify any decision against real prices. Pass the decision_id from get_crypto_decision and a window (1h/4h/24h). Returns: did the direction hold? What was the PnL%? Verdict: GOOD_DECISION, BAD_DIRECTION, or NOISE. Every decision should be audited. Costs $0.07 USDC.",
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
decision_id: { type: "string", description: "UUID from a previous get_crypto_decision call" },
|
|
92
|
+
window: { type: "string", description: "Evaluation window: 1h, 4h, or 24h (default: 4h)" }
|
|
93
|
+
},
|
|
94
|
+
required: ["decision_id"]
|
|
95
|
+
}
|
|
84
96
|
}
|
|
85
97
|
];
|
|
86
98
|
|
|
@@ -134,7 +146,7 @@ async function main() {
|
|
|
134
146
|
}
|
|
135
147
|
|
|
136
148
|
const server = new Server(
|
|
137
|
-
{ name: "coinopai-mcp", version: "1.0.
|
|
149
|
+
{ name: "coinopai-mcp", version: "1.0.4" },
|
|
138
150
|
{ capabilities: { tools: {} } }
|
|
139
151
|
);
|
|
140
152
|
|
|
@@ -169,6 +181,9 @@ async function main() {
|
|
|
169
181
|
case "check_trade_preflight":
|
|
170
182
|
data = await call(httpClient, `/api/kronos/preflight?symbol=${encodeURIComponent(args.symbol || "BTC")}`);
|
|
171
183
|
break;
|
|
184
|
+
case "audit_trade_decision":
|
|
185
|
+
data = await call(httpClient, `/api/kronos/audit?decision_id=${encodeURIComponent(args.decision_id)}&window=${encodeURIComponent(args.window || "4h")}`);
|
|
186
|
+
break;
|
|
172
187
|
default:
|
|
173
188
|
throw new Error("Unknown tool: " + name);
|
|
174
189
|
}
|