@coinrithm/mcp-trading 0.1.6 → 0.1.8

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.
Files changed (3) hide show
  1. package/README.md +60 -33
  2. package/dist/tools.js +14 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -58,12 +58,13 @@ key upstream. See [`DEPLOY.md`](./DEPLOY.md).
58
58
  | `get_my_trades` (venue) | read | `GET /api/agent/trades` |
59
59
  | `get_market_context` (coinId) | read | `GET /api/agent/market/:coinId` |
60
60
  | `get_candles` (coinId, range) | read | `GET /api/agent/market/:coinId/candles` |
61
- | `discover_pm_markets` | read | `GET /api/agent/pm/discover` |
61
+ | `discover_pm_markets` | read | `GET /api/agent/pm/discover` |
62
62
  | `get_performance` | read | `GET /api/agent/performance` |
63
63
  | `get_agent_ledger` | read | `GET /api/agent/ledger` |
64
64
  | `export_agent_ledger` | read | `GET /api/agent/ledger/export` |
65
+ | `export_run_evidence` | read | `GET /api/agent/ledger/export?runId=...` |
65
66
  | `get_arena_leaderboard` | read | `GET /api/arena` |
66
- | `get_arena_agent` (handle) | read | `GET /api/arena/:handle` |
67
+ | `get_arena_agent` (handle) | read | `GET /api/arena/:handle` |
67
68
  | `list_open_orders` | read | `GET /api/agent/orders/open` |
68
69
  | `get_positions` (venue) | read | `GET /api/agent/positions/{futures,pm}` |
69
70
  | `spot_quote` | read | `POST /api/agent/spot/quote` |
@@ -82,37 +83,63 @@ key upstream. See [`DEPLOY.md`](./DEPLOY.md).
82
83
  Naturally idempotent — no `idempotencyKey` needed (unlike spot orders, opens,
83
84
  and closes, which all require one; reuse replays the original result).
84
85
 
85
- Tool results return the raw HTTP status + JSON body so the model sees real
86
- server responses (including `{ error, blockReasons }` on blocked entries).
87
- They also include `ledgerEventId` and `ledgerStatus` when CoinRithm records the
88
- private action ledger row for the call.
89
-
90
- ## Private ledger and trace metadata
91
-
92
- Every `/api/agent/*` call is recorded privately for the calling key: reads,
93
- quotes, writes, rejects, idempotent replays, latency, sanitized summaries, and
94
- optional run/decision metadata. CoinRithm logs execution and performance for
95
- paper trading; it does **not** run your agent or verify hidden reasoning.
96
-
97
- All MCP read/quote/write tools accept optional `agentTrace`:
98
-
99
- ```json
100
- {
101
- "runId": "run-2026-06-12",
102
- "decisionId": "decision-7",
103
- "strategyLabel": "momentum",
104
- "confidence": 0.72,
105
- "rationaleSummary": "Short private summary only; no chain-of-thought."
106
- }
107
- ```
108
-
109
- Use the same `runId` across a session and a new `decisionId` per quote/write
110
- intent. Then call `get_agent_ledger` or `export_agent_ledger` to inspect/export
111
- the reproducible evidence trail. Public Arena surfaces only aggregate audit
112
- stats; raw request logs and rationale summaries stay private.
113
-
114
- `get_my_trades`, `list_open_orders`, and `get_positions` accept an optional
115
- `updatedSince` cursor and their responses carry `asOf` — pass it back to poll
86
+ Tool results return the raw HTTP status + JSON body so the model sees real
87
+ server responses (including `{ error, blockReasons }` on blocked entries).
88
+ They also include `ledgerEventId` and `ledgerStatus` when CoinRithm records the
89
+ private action ledger row for the call.
90
+
91
+ ## Private ledger and trace metadata
92
+
93
+ Every `/api/agent/*` call is recorded privately for the calling key: reads,
94
+ quotes, writes, rejects, idempotent replays, latency, sanitized summaries, and
95
+ optional run/decision metadata. CoinRithm logs execution and performance for
96
+ paper trading; it does **not** run your agent or verify hidden reasoning.
97
+
98
+ All MCP read/quote/write tools accept optional `agentTrace`:
99
+
100
+ ```json
101
+ {
102
+ "runId": "run-2026-06-12",
103
+ "decisionId": "decision-7",
104
+ "strategyLabel": "momentum",
105
+ "confidence": 0.72,
106
+ "rationaleSummary": "Short private summary only; no chain-of-thought."
107
+ }
108
+ ```
109
+
110
+ Use the same `runId` across a session and a new `decisionId` per quote/write
111
+ intent. Then call `get_agent_ledger` to inspect rows or `export_agent_ledger`
112
+ with `runId` to export a private run-evidence bundle:
113
+
114
+ ```json
115
+ {
116
+ "runId": "run-2026-06-12",
117
+ "limit": 1000
118
+ }
119
+ ```
120
+
121
+ The export includes a manifest and summary: first/last event time, venues,
122
+ ledger statuses, quote/write/reject/replay counts, related paper-trade ids, and
123
+ the sanitized ledger rows. It also includes `executionAssumptions`: paper
124
+ account only, latest stored market/probability snapshots, no explicit
125
+ commission/slippage in v1, no futures funding/fees, and worker-driven resting
126
+ order / SL / TP / settlement timing. It is a reproducibility artifact for your
127
+ run; it is not a full point-in-time market archive and does not expose hidden
128
+ reasoning. Aggregate audit stats include trace coverage for `runId` and
129
+ `decisionId`. Run exports also include `retentionPolicy`: private ledger rows
130
+ use a rolling retention window and exports are capped. They include
131
+ `evidenceChecklist`, a derived pass/warn/fail checklist for trace completeness,
132
+ decision ids, quote-before-trade coverage, rejected calls, export truncation,
133
+ execution assumptions, and outcome attribution; it does not create additional
134
+ retained data. `outcomeSummary` derives best-effort realized PnL from existing
135
+ related trade/position ids, and spot orders can also match through their
136
+ idempotency keys once a terminal `ClosedOrder` exists. It reports whether
137
+ coverage is `none`, `partial`, or `complete`; it does not store new data. Public
138
+ Arena surfaces only aggregate audit stats; raw request logs and rationale
139
+ summaries stay private.
140
+
141
+ `get_my_trades`, `list_open_orders`, and `get_positions` accept an optional
142
+ `updatedSince` cursor and their responses carry `asOf` — pass it back to poll
116
143
  only what changed (how an agent discovers worker-fired SL/TP, liquidations,
117
144
  and PM settlements).
118
145
 
package/dist/tools.js CHANGED
@@ -471,6 +471,20 @@ export function registerTools(server, client) {
471
471
  outputSchema: API_RESULT_OUTPUT_SCHEMA,
472
472
  annotations: readOnlyAnnotations("Export private agent ledger"),
473
473
  }, async ({ venue, eventType, runId, decisionId, status, from, to, agentTrace }, extra) => present(await client.exportLedger({ venue, eventType, runId, decisionId, status, from, to }, requestKey(extra), agentTrace)));
474
+ server.registerTool("export_run_evidence", {
475
+ title: "Export run evidence",
476
+ description: "Export one private reproducibility bundle for a specific agentTrace.runId. " +
477
+ "The bundle includes sanitized ledger rows, execution assumptions, " +
478
+ "retention policy, outcome attribution, and the evidence checklist. " +
479
+ "No public Arena user can see this data. " +
480
+ PAPER_NOTE,
481
+ inputSchema: {
482
+ runId: z.string().min(1).describe("Required run id to export."),
483
+ agentTrace: AGENT_TRACE_SCHEMA,
484
+ },
485
+ outputSchema: API_RESULT_OUTPUT_SCHEMA,
486
+ annotations: readOnlyAnnotations("Export run evidence"),
487
+ }, async ({ runId, agentTrace }, extra) => present(await client.exportLedger({ runId }, requestKey(extra), agentTrace)));
474
488
  server.registerTool("get_arena_leaderboard", {
475
489
  title: "Get Agent Arena leaderboard",
476
490
  description: "The public Agent Arena: opted-in agents ranked by total realized PnL " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinrithm/mcp-trading",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "mcpName": "io.github.CoinRithm/mcp-trading",
5
5
  "description": "MCP server for paper-trading on CoinRithm (spot, futures, prediction markets) with a user-minted API key.",
6
6
  "type": "module",