coinopai-mcp 2.2.3 → 2.2.5

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 CHANGED
@@ -64,6 +64,8 @@ The agent calls a tool → the MCP server receives an `HTTP 402` → automatical
64
64
 
65
65
  Current package: `coinopai-mcp@2.2.3`.
66
66
 
67
+ Hosted MCP: `https://x402.coinopai.com/mcp`. The handshake is free (`initialize`, `ping` and `tools/list` need no payment); only `tools/call` is charged.
68
+
67
69
  Settlement note: the MCP pins `@x402/core` and `@x402/evm` to `2.11.0`. Successful object responses include x402 settlement metadata under `_payment`, including the on-chain transaction hash when available.
68
70
 
69
71
  ---
package/index.js CHANGED
@@ -29,7 +29,7 @@ const TOOLS = [
29
29
  idempotentHint: false,
30
30
  openWorldHint: true,
31
31
  },
32
- description: "Search 819 agent automation prompts by keyword. Returns matching automations with title, description, complexity and services. Costs $0.01 USDC.",
32
+ description: "Automation workflow search: keyword search over 819 ready-made agent automation prompts. Returns matching automations with slug, title, description, complexity and services. Costs $0.01 USDC.",
33
33
  inputSchema: {
34
34
  type: "object",
35
35
  properties: {
@@ -47,7 +47,7 @@ const TOOLS = [
47
47
  idempotentHint: false,
48
48
  openWorldHint: true,
49
49
  },
50
- description: "Get the full agent automation prompt and workflow steps by slug. Costs $0.01 USDC.",
50
+ description: "Automation workflow prompt: the full executable agent prompt and workflow steps for one automation, by slug. Costs $0.01 USDC.",
51
51
  inputSchema: {
52
52
  type: "object",
53
53
  properties: {
@@ -75,7 +75,7 @@ const TOOLS = [
75
75
  idempotentHint: false,
76
76
  openWorldHint: true,
77
77
  },
78
- description: "Latest Kronos model context for BTC, ETH, SOL, XRP, ADA. Directional values are supporting context, not standalone trade instructions; use them with the calibrated range, risk state, and audit record. Costs $0.05 USDC.",
78
+ description: "Crypto trading signals: latest Kronos signal scores for BTC, ETH, SOL, XRP and ADA. Directional values are supporting context, not standalone trade instructions; use them with the calibrated range, risk state and audit record. Costs $0.05 USDC.",
79
79
  inputSchema: {
80
80
  type: "object",
81
81
  properties: {
@@ -90,7 +90,7 @@ const TOOLS = [
90
90
  idempotentHint: false,
91
91
  openWorldHint: true,
92
92
  },
93
- description: "Current market risk state and cooldown context for Kronos decisions. Useful as supporting context, not a standalone trading command. Costs $0.02 USDC.",
93
+ description: "Crypto market risk state: current risk state and cooldown context for Kronos decisions. Supporting context, not a standalone trading command. Costs $0.02 USDC.",
94
94
  inputSchema: { type: "object", properties: {} }
95
95
  },
96
96
  {
@@ -101,7 +101,7 @@ const TOOLS = [
101
101
  idempotentHint: false,
102
102
  openWorldHint: true,
103
103
  },
104
- description: "Recent Kronos context history for BTC/ETH/SOL/XRP/ADA. Use it to inspect model context and freshness before or after a decision. Costs $0.05 USDC.",
104
+ description: "Crypto signal history: recent Kronos signal snapshots for BTC, ETH, SOL, XRP and ADA. Use it to inspect model context and freshness before or after a decision. Costs $0.05 USDC.",
105
105
  inputSchema: {
106
106
  type: "object",
107
107
  properties: {
@@ -117,7 +117,7 @@ const TOOLS = [
117
117
  idempotentHint: false,
118
118
  openWorldHint: true,
119
119
  },
120
- description: "Create a market-intelligence journal entry from Kronos context. Returns directional_bias, confidence context, compliance metadata, regime, anomaly/calibration context, and a decision_id. Call audit_trade_decision with that ID after the evaluation window to see what happened. Costs $0.15 USDC.",
120
+ description: "Crypto decision journal: create a market-intelligence journal entry from Kronos context. Returns directional_bias, confidence context, compliance metadata, regime, anomaly/calibration context, and a decision_id. Call audit_trade_decision with that ID after the evaluation window to see what happened. Costs $0.15 USDC.",
121
121
  inputSchema: {
122
122
  type: "object",
123
123
  properties: {
@@ -134,7 +134,7 @@ const TOOLS = [
134
134
  idempotentHint: false,
135
135
  openWorldHint: true,
136
136
  },
137
- description: "Step 1 of the auditable decision loop. Checks market state, cooldown, data freshness, and model context before calling get_crypto_decision. Costs $0.05 USDC.",
137
+ description: "Crypto market preflight: step 1 of the auditable decision loop. Checks market state, cooldown, data freshness, and model context before calling get_crypto_decision. Costs $0.05 USDC.",
138
138
  inputSchema: {
139
139
  type: "object",
140
140
  properties: {
@@ -151,7 +151,7 @@ const TOOLS = [
151
151
  idempotentHint: false,
152
152
  openWorldHint: true,
153
153
  },
154
- description: "The accountability step. Verify a Kronos decision_id against later market prices. Returns whether direction held, PnL%, and a verdict: GOOD_DECISION, BAD_DIRECTION, NOISE, or NO_ACTION_TAKEN. Costs $0.07 USDC.",
154
+ description: "Decision outcome audit: the accountability step. Verify a Kronos decision_id against later market prices. Returns whether direction held, PnL%, and a verdict: GOOD_DECISION, BAD_DIRECTION, NOISE, or NO_ACTION_TAKEN. Costs $0.07 USDC.",
155
155
  inputSchema: {
156
156
  type: "object",
157
157
  properties: {
@@ -169,7 +169,7 @@ const TOOLS = [
169
169
  idempotentHint: false,
170
170
  openWorldHint: true,
171
171
  },
172
- description: "Kronos Futures: perpetual-futures decision package. Direction LONG / SHORT / FLAT from the Kronos signal, stop-loss and take-profit on the calibrated 80% range, leverage cap keeping liquidation outside 2x the stop, liquidation price, risk-based position size for your equity, and live perp funding cost. Market intelligence only; no exchange execution. Costs $0.15 USDC.",
172
+ description: "Perpetual futures decision (Kronos Futures): perpetual-futures decision package. Direction LONG / SHORT / FLAT from the Kronos signal, stop-loss and take-profit on the calibrated 80% range, leverage cap keeping liquidation outside 2x the stop, liquidation price, risk-based position size for your equity, and live perp funding cost. Market intelligence only; no exchange execution. Costs $0.15 USDC.",
173
173
  inputSchema: {
174
174
  type: "object",
175
175
  properties: {
@@ -188,7 +188,7 @@ const TOOLS = [
188
188
  idempotentHint: false,
189
189
  openWorldHint: true,
190
190
  },
191
- description: "Kronos Futures: live perpetual funding rates (1h, 8h, annualized), mark/index price, open interest, and crowding label (LONG_CROWDED / SHORT_CROWDED / BALANCED) for BTC, ETH, SOL, XRP, ADA from Kraken Futures and Hyperliquid. Costs $0.02 USDC.",
191
+ description: "Perpetual funding rates (Kronos Futures): live perpetual funding rates (1h, 8h, annualized), mark/index price, open interest, and crowding label (LONG_CROWDED / SHORT_CROWDED / BALANCED) for BTC, ETH, SOL, XRP, ADA from Kraken Futures and Hyperliquid. Costs $0.02 USDC.",
192
192
  inputSchema: {
193
193
  type: "object",
194
194
  properties: {
@@ -204,7 +204,7 @@ const TOOLS = [
204
204
  idempotentHint: false,
205
205
  openWorldHint: true,
206
206
  },
207
- description: "Kronos Futures: will a leveraged perp position survive the calibrated range? Returns liquidation price and distance, adverse range bound, verdict (SURVIVES_RANGE / THIN_BUFFER / LIQUIDATION_INSIDE_RANGE), max surviving leverage, P&L at both range bounds, and funding cost. Costs $0.05 USDC.",
207
+ description: "Liquidation risk check (Kronos Futures): will a leveraged perp position survive the calibrated range? Returns liquidation price and distance, adverse range bound, verdict (SURVIVES_RANGE / THIN_BUFFER / LIQUIDATION_INSIDE_RANGE), max surviving leverage, P&L at both range bounds, and funding cost. Costs $0.05 USDC.",
208
208
  inputSchema: {
209
209
  type: "object",
210
210
  properties: {
@@ -226,7 +226,7 @@ const TOOLS = [
226
226
  idempotentHint: false,
227
227
  openWorldHint: true,
228
228
  },
229
- description: "Conformally-calibrated price forecast: an honest 80% prediction interval (range_80, ~0.80 empirical coverage) plus point return and upside probability for BTC/ETH/SOL/XRP/ADA. Directional bias is supporting context; the calibrated range is the validated product. Costs $0.05 USDC.",
229
+ description: "Crypto price forecast, conformally calibrated: an honest 80% prediction interval (range_80, ~0.80 empirical coverage) plus point return and upside probability for BTC/ETH/SOL/XRP/ADA. Directional bias is supporting context; the calibrated range is the validated product. Costs $0.05 USDC.",
230
230
  inputSchema: {
231
231
  type: "object",
232
232
  properties: {
@@ -253,7 +253,7 @@ const TOOLS = [
253
253
  idempotentHint: false,
254
254
  openWorldHint: true,
255
255
  },
256
- description: "Score a market signal feature set for unusual conditions before downstream analysis. Returns anomaly_score, anomaly_level, review_label, drivers, component scores, and market-intelligence disclaimers. Not financial advice and not a market activity instruction. Costs $0.07 USDC.",
256
+ description: "Signal anomaly detection: score a market signal feature set for unusual conditions before downstream analysis. Returns anomaly_score, anomaly_level, review_label, drivers, component scores, and market-intelligence disclaimers. Not financial advice and not a market activity instruction. Costs $0.07 USDC.",
257
257
  inputSchema: {
258
258
  type: "object",
259
259
  properties: {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "coinopai-mcp",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "mcpName": "io.github.forgemeshlabs/coinopai-mcp",
5
- "description": "Auditable market intelligence MCP with x402 payments, calibrated forecast ranges, anomaly review, risk context, and outcome audits",
5
+ "description": "Auditable market intelligence MCP with x402 payments, calibrated forecast ranges, anomaly review, risk context, and outcome audits. The hosted MCP at https://x402.coinopai.com/mcp has a free handshake (initialize, ping, tools/list); only tool calls are charged",
6
6
  "main": "index.js",
7
7
  "bin": {
8
8
  "coinopai-mcp": "index.js"
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/forgemeshlabs/coinopai-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "2.2.3",
9
+ "version": "2.2.5",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "coinopai-mcp",
14
- "version": "2.2.3",
14
+ "version": "2.2.5",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
package/x402-guard.js CHANGED
@@ -99,6 +99,19 @@ function createGuard(opts) {
99
99
  }
100
100
  }
101
101
 
102
+ // Keep the service's refusal intact: HTTP status, body (JSON when parseable) and the charged flag.
103
+ function httpError(res, prefix, charged) {
104
+ let upstream;
105
+ try { upstream = JSON.parse(res.text); } catch { upstream = res.text.slice(0, 500); }
106
+ const body = typeof upstream === "string" ? upstream : JSON.stringify(upstream).slice(0, 1500);
107
+ const err = new Error(`${prefix}HTTP ${res.status}: ${body}`);
108
+ err.status = res.status;
109
+ err.upstream = upstream;
110
+ if (charged !== undefined) err.charged = charged;
111
+ else if (upstream && typeof upstream === "object" && typeof upstream.charged === "boolean") err.charged = upstream.charged;
112
+ return err;
113
+ }
114
+
102
115
  function parseJson(res) {
103
116
  try { return JSON.parse(res.text); } catch { throw new Error(`HTTP ${res.status}: non-JSON response`); }
104
117
  }
@@ -111,7 +124,7 @@ function createGuard(opts) {
111
124
  const init = { method, headers: { ...headers, ...(body ? { "content-type": "application/json" } : {}) }, ...(body ? { body: JSON.stringify(body) } : {}) };
112
125
  const res = await fetchBounded(url, init);
113
126
  if (res.status !== 402) {
114
- if (!res.ok) throw new Error(`HTTP ${res.status}: ${res.text.slice(0, 200)}`);
127
+ if (!res.ok) throw httpError(res, "", false); // nothing was signed, so nothing was charged
115
128
  return parseJson(res);
116
129
  }
117
130
  let challenge;
@@ -119,7 +132,7 @@ function createGuard(opts) {
119
132
  const paymentRequired = httpClient.getPaymentRequiredResponse((n) => res.headers.get(n), challenge);
120
133
  const payload = await httpClient.createPaymentPayload(paymentRequired); // policy runs (and reserves budget) inside
121
134
  const paid = await fetchBounded(url, { ...init, headers: { ...init.headers, ...httpClient.encodePaymentSignatureHeader(payload) } });
122
- if (!paid.ok) throw new Error(`Payment failed — HTTP ${paid.status}: ${paid.text.slice(0, 200)}`);
135
+ if (!paid.ok) throw httpError(paid, "Payment failed — ");
123
136
  let settle = null;
124
137
  try { settle = httpClient.getPaymentSettleResponse((n) => paid.headers.get(n)) || null; } catch { settle = null; }
125
138
  const contentType = paid.headers.get("content-type") || "";