@coinrithm/mcp-trading 0.7.2 → 0.7.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/CHANGELOG.md +171 -113
- package/README.md +277 -238
- package/dist/agent/act.d.ts +2 -2
- package/dist/agent/act.js +24 -3
- package/dist/agent/cli.js +68 -23
- package/dist/agent/client.d.ts +33 -0
- package/dist/agent/client.js +34 -7
- package/dist/agent/decision.d.ts +3 -0
- package/dist/agent/decision.js +26 -3
- package/dist/agent/decisionValidator.js +2 -1
- package/dist/agent/deploymentOverlay.js +25 -5
- package/dist/agent/engine.d.ts +2 -1
- package/dist/agent/engine.js +4 -1
- package/dist/agent/extract.js +3 -1
- package/dist/agent/gate.js +25 -5
- package/dist/agent/index.js +0 -1
- package/dist/agent/indicators.js +4 -2
- package/dist/agent/manifest.js +1 -1
- package/dist/agent/mechanical.d.ts +36 -0
- package/dist/agent/mechanical.js +286 -0
- package/dist/agent/observe.d.ts +4 -0
- package/dist/agent/observe.js +140 -53
- package/dist/agent/prompt.d.ts +3 -1
- package/dist/agent/prompt.js +17 -6
- package/dist/agent/providers.js +39 -4
- package/dist/agent/resolve.js +23 -6
- package/dist/agent/resolvePm.js +14 -3
- package/dist/agent/runEvidence.js +6 -2
- package/dist/agent/runner.d.ts +8 -2
- package/dist/agent/runner.js +363 -59
- package/dist/agent/scorecard.js +12 -4
- package/dist/agent/setups.js +57 -9
- package/dist/agent/skill.js +1 -1
- package/dist/agent/state.js +9 -4
- package/dist/agent/types.d.ts +17 -2
- package/dist/agent/types.js +2 -1
- package/dist/agent/util.js +11 -4
- package/dist/agent/version.d.ts +1 -1
- package/dist/agent/version.js +1 -1
- package/dist/client.d.ts +51 -0
- package/dist/client.js +30 -3
- package/dist/executionPolicy.d.ts +2 -0
- package/dist/executionPolicy.js +21 -0
- package/dist/http.js +13 -3
- package/dist/tools.d.ts +23 -0
- package/dist/tools.js +796 -39
- package/package.json +86 -78
package/dist/agent/state.js
CHANGED
|
@@ -42,7 +42,9 @@ export function loadState(file, runId) {
|
|
|
42
42
|
...base,
|
|
43
43
|
...parsed,
|
|
44
44
|
seen: Array.isArray(parsed.seen) ? parsed.seen : [],
|
|
45
|
-
intentSeq: parsed.intentSeq &&
|
|
45
|
+
intentSeq: parsed.intentSeq &&
|
|
46
|
+
typeof parsed.intentSeq === "object" &&
|
|
47
|
+
!Array.isArray(parsed.intentSeq)
|
|
46
48
|
? parsed.intentSeq
|
|
47
49
|
: {},
|
|
48
50
|
});
|
|
@@ -91,13 +93,16 @@ export function checkKillSwitch(spec, state) {
|
|
|
91
93
|
return `consecutive model failures ${state.consecutiveModelFailures} >= ${threshold}`;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
|
-
if (ks.maxConsecutiveRejects > 0 &&
|
|
96
|
+
if (ks.maxConsecutiveRejects > 0 &&
|
|
97
|
+
state.consecutiveRejectCycles >= ks.maxConsecutiveRejects) {
|
|
95
98
|
return `consecutive reject cycles ${state.consecutiveRejectCycles} >= ${ks.maxConsecutiveRejects}`;
|
|
96
99
|
}
|
|
97
|
-
if (ks.maxDrawdownMusd > 0 &&
|
|
100
|
+
if (ks.maxDrawdownMusd > 0 &&
|
|
101
|
+
state.peakRealizedMusd - state.realizedPnlMusd >= ks.maxDrawdownMusd) {
|
|
98
102
|
return `drawdown ${(state.peakRealizedMusd - state.realizedPnlMusd).toFixed(2)} >= ${ks.maxDrawdownMusd}`;
|
|
99
103
|
}
|
|
100
|
-
if (ks.onRateLimitPressure &&
|
|
104
|
+
if (ks.onRateLimitPressure &&
|
|
105
|
+
state.rateLimitHits >= RATE_LIMIT_PRESSURE_THRESHOLD) {
|
|
101
106
|
return `rate-limit pressure: ${state.rateLimitHits} 429s this session`;
|
|
102
107
|
}
|
|
103
108
|
return null;
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type Venue = "spot" | "futures" | "pm";
|
|
|
4
4
|
export declare const VENUES: readonly Venue[];
|
|
5
5
|
export declare const ACTION_TYPES: readonly ["futures_open", "futures_close", "futures_set_sltp", "spot_order", "spot_cancel", "pm_open"];
|
|
6
6
|
export type ActionType = (typeof ACTION_TYPES)[number];
|
|
7
|
-
export type ProviderName = "anthropic" | "openai" | "groq" | "nvidia" | "gemini" | "openai-compatible";
|
|
7
|
+
export type ProviderName = "anthropic" | "openai" | "groq" | "nvidia" | "gemini" | "openai-compatible" | "mechanical";
|
|
8
8
|
export declare const PROVIDERS: readonly ProviderName[];
|
|
9
9
|
export interface ModelConfig {
|
|
10
10
|
provider: ProviderName;
|
|
@@ -159,6 +159,7 @@ export interface PmMarket {
|
|
|
159
159
|
probability?: number;
|
|
160
160
|
title?: string;
|
|
161
161
|
freshness?: Freshness;
|
|
162
|
+
volumeUsd?: number;
|
|
162
163
|
}
|
|
163
164
|
export interface SetupSignal {
|
|
164
165
|
symbol: string;
|
|
@@ -240,10 +241,11 @@ export type ProposedAction = {
|
|
|
240
241
|
stakeMusd: number;
|
|
241
242
|
confidence?: number;
|
|
242
243
|
rationaleSummary?: string;
|
|
244
|
+
forecastProbability?: number;
|
|
243
245
|
};
|
|
244
246
|
export type ActionVenue = Venue;
|
|
245
247
|
export declare function actionVenue(a: ProposedAction): ActionVenue;
|
|
246
|
-
export declare function isWriteAction(
|
|
248
|
+
export declare function isWriteAction(_a: ProposedAction): boolean;
|
|
247
249
|
export declare function isOpenAction(a: ProposedAction): a is Extract<ProposedAction, {
|
|
248
250
|
type: "futures_open" | "spot_order" | "pm_open";
|
|
249
251
|
}>;
|
|
@@ -265,6 +267,8 @@ export interface QuoteEvidence {
|
|
|
265
267
|
executionPrice?: number;
|
|
266
268
|
estimatedCostMusd?: number;
|
|
267
269
|
freshness?: Freshness;
|
|
270
|
+
openBlocked?: boolean;
|
|
271
|
+
openBlockReasons?: unknown;
|
|
268
272
|
}
|
|
269
273
|
export interface RunState {
|
|
270
274
|
runId: string;
|
|
@@ -334,6 +338,17 @@ export interface CycleResult {
|
|
|
334
338
|
decisionType?: "act" | "skip" | "gate_skip" | "model_error";
|
|
335
339
|
writeAttempted?: number;
|
|
336
340
|
writeAccepted?: number;
|
|
341
|
+
opportunity?: PostedOpportunity;
|
|
342
|
+
}
|
|
343
|
+
export interface PostedOpportunity {
|
|
344
|
+
kind: "abstained" | "forecast_only" | "quote_expired";
|
|
345
|
+
source?: string;
|
|
346
|
+
slug?: string;
|
|
347
|
+
outcomeExternalMarketId?: string;
|
|
348
|
+
universeSize?: number;
|
|
349
|
+
forecastProbability?: number;
|
|
350
|
+
marketProbability?: number;
|
|
351
|
+
reasonCode?: string;
|
|
337
352
|
}
|
|
338
353
|
export interface ResolveIssue {
|
|
339
354
|
code: string;
|
package/dist/agent/types.js
CHANGED
|
@@ -27,6 +27,7 @@ export const PROVIDERS = [
|
|
|
27
27
|
"nvidia",
|
|
28
28
|
"gemini",
|
|
29
29
|
"openai-compatible",
|
|
30
|
+
"mechanical",
|
|
30
31
|
];
|
|
31
32
|
export const DEFAULT_TRIGGER_POLICY = {
|
|
32
33
|
mode: "event_driven",
|
|
@@ -67,7 +68,7 @@ export function actionVenue(a) {
|
|
|
67
68
|
return "spot";
|
|
68
69
|
return "pm";
|
|
69
70
|
}
|
|
70
|
-
export function isWriteAction(
|
|
71
|
+
export function isWriteAction(_a) {
|
|
71
72
|
// Every proposed action mutates state (set-sltp/cancel included). The model
|
|
72
73
|
// never proposes a read; reads are the runner's job during observe.
|
|
73
74
|
return true;
|
package/dist/agent/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Small dependency-free helpers shared across the runner.
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { resolve as resolvePath, relative as relativePath, isAbsolute } from "node:path";
|
|
3
|
+
import { resolve as resolvePath, relative as relativePath, isAbsolute, } from "node:path";
|
|
4
4
|
export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5
5
|
// Parse a cadence string ("30s", "15m", "1h", "4h", "1d") to milliseconds.
|
|
6
6
|
// Returns null for anything unparseable so the skill validator can reject it.
|
|
@@ -14,7 +14,13 @@ export function parseCadenceMs(cadence) {
|
|
|
14
14
|
if (!Number.isFinite(n) || n <= 0)
|
|
15
15
|
return null;
|
|
16
16
|
const unit = m[2].toLowerCase();
|
|
17
|
-
const mult = unit === "s"
|
|
17
|
+
const mult = unit === "s"
|
|
18
|
+
? 1000
|
|
19
|
+
: unit === "m"
|
|
20
|
+
? 60_000
|
|
21
|
+
: unit === "h"
|
|
22
|
+
? 3_600_000
|
|
23
|
+
: 86_400_000;
|
|
18
24
|
return n * mult;
|
|
19
25
|
}
|
|
20
26
|
// A UTC day key (YYYY-MM-DD) for resetting per-day counters.
|
|
@@ -65,14 +71,15 @@ export function shortId() {
|
|
|
65
71
|
// so a Windows checkout and a Linux checkout of the same file hash identically.
|
|
66
72
|
export function normalizeContent(text) {
|
|
67
73
|
return text
|
|
68
|
-
.replace(
|
|
74
|
+
.replace(/^\uFEFF/, "") // strip UTF-8 BOM (Windows editors add it)
|
|
69
75
|
.replace(/\r\n/g, "\n")
|
|
70
76
|
.replace(/\r/g, "\n")
|
|
71
77
|
.replace(/\s+$/, "");
|
|
72
78
|
}
|
|
73
79
|
// SHA-256 of normalized content — the manifest lock's per-file contentHash.
|
|
74
80
|
export function sha256(text) {
|
|
75
|
-
return ("sha256:" +
|
|
81
|
+
return ("sha256:" +
|
|
82
|
+
createHash("sha256").update(normalizeContent(text), "utf8").digest("hex"));
|
|
76
83
|
}
|
|
77
84
|
// Canonical POSIX path (forward slashes) so the lock is byte-identical on
|
|
78
85
|
// Windows and Linux.
|
package/dist/agent/version.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const COINRITHM_API: {
|
|
|
5
5
|
readonly kind: "coinrithm-agent-api";
|
|
6
6
|
readonly baseUrl: "https://api.coinrithm.com";
|
|
7
7
|
readonly mcpUrl: "https://mcp.coinrithm.com/mcp";
|
|
8
|
-
readonly openapiVersion: "1.
|
|
8
|
+
readonly openapiVersion: "1.6.0";
|
|
9
9
|
readonly mcpPackage: "@coinrithm/mcp-trading";
|
|
10
10
|
readonly mcpVersion: string;
|
|
11
11
|
};
|
package/dist/agent/version.js
CHANGED
|
@@ -20,7 +20,7 @@ export const COINRITHM_API = {
|
|
|
20
20
|
mcpUrl: "https://mcp.coinrithm.com/mcp",
|
|
21
21
|
// The API CONTRACT version (openapi.yaml info.version). Versioned independently
|
|
22
22
|
// from the npm package below — hand-bump this when the OpenAPI contract changes.
|
|
23
|
-
openapiVersion: "1.
|
|
23
|
+
openapiVersion: "1.6.0",
|
|
24
24
|
mcpPackage: "@coinrithm/mcp-trading",
|
|
25
25
|
mcpVersion: PACKAGE_VERSION,
|
|
26
26
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -24,6 +24,21 @@ export interface ApiResult {
|
|
|
24
24
|
type TraceableBody<T extends Record<string, unknown>> = T & {
|
|
25
25
|
agentTrace?: AgentTrace;
|
|
26
26
|
};
|
|
27
|
+
export type ProvenanceReport = {
|
|
28
|
+
runtimeKind?: "hosted_scheduler" | "self_host_runner" | "byo_api" | "mcp_tool";
|
|
29
|
+
packageVersion?: string;
|
|
30
|
+
bundleId?: string;
|
|
31
|
+
bundleVersion?: string;
|
|
32
|
+
skillVersions?: Record<string, string>;
|
|
33
|
+
promptHash?: string;
|
|
34
|
+
configHash?: string;
|
|
35
|
+
modelProvider?: string;
|
|
36
|
+
modelName?: string;
|
|
37
|
+
evidenceRef?: {
|
|
38
|
+
snapshotIds?: string[];
|
|
39
|
+
sourceCapturedAt?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
27
42
|
export declare class CoinRithmClient {
|
|
28
43
|
private readonly defaultApiKey?;
|
|
29
44
|
private readonly baseUrl;
|
|
@@ -46,6 +61,24 @@ export declare class CoinRithmClient {
|
|
|
46
61
|
fiat?: string;
|
|
47
62
|
}): Promise<ApiResult>;
|
|
48
63
|
getPublicPmWhales(): Promise<ApiResult>;
|
|
64
|
+
getPublicPmMatches(query?: {
|
|
65
|
+
limit?: number;
|
|
66
|
+
offset?: number;
|
|
67
|
+
sort?: string;
|
|
68
|
+
minDivergence?: number;
|
|
69
|
+
sourceKind?: string;
|
|
70
|
+
status?: string;
|
|
71
|
+
maxSnapshotAgeMinutes?: number;
|
|
72
|
+
requirePriced?: boolean;
|
|
73
|
+
fiat?: string;
|
|
74
|
+
}): Promise<ApiResult>;
|
|
75
|
+
getPublicPmCalibration(): Promise<ApiResult>;
|
|
76
|
+
getPublicPmCanonicalList(query?: {
|
|
77
|
+
limit?: number;
|
|
78
|
+
cursor?: number;
|
|
79
|
+
}): Promise<ApiResult>;
|
|
80
|
+
getPublicPmCanonicalDetail(key: string): Promise<ApiResult>;
|
|
81
|
+
getPublicPmVolumeHistory(): Promise<ApiResult>;
|
|
49
82
|
whoami(apiKey?: string, agentTrace?: AgentTrace): Promise<ApiResult>;
|
|
50
83
|
getPortfolio(query?: {
|
|
51
84
|
fiat?: string;
|
|
@@ -176,6 +209,24 @@ export declare class CoinRithmClient {
|
|
|
176
209
|
side?: "yes" | "no";
|
|
177
210
|
stakeMusd: number;
|
|
178
211
|
idempotencyKey: string;
|
|
212
|
+
forecastProbability?: number;
|
|
213
|
+
provenance?: ProvenanceReport;
|
|
214
|
+
}>, apiKey?: string): Promise<ApiResult>;
|
|
215
|
+
reportPmOpportunity(body: TraceableBody<{
|
|
216
|
+
kind: "abstained" | "forecast_only" | "quote_expired";
|
|
217
|
+
source?: string;
|
|
218
|
+
slug?: string;
|
|
219
|
+
outcomeExternalMarketId?: string;
|
|
220
|
+
forecastProbability?: number;
|
|
221
|
+
marketProbability?: number;
|
|
222
|
+
reasonCode?: string;
|
|
223
|
+
cohort?: {
|
|
224
|
+
universeSize?: number;
|
|
225
|
+
horizon?: string;
|
|
226
|
+
};
|
|
227
|
+
decisionId?: string;
|
|
228
|
+
runId?: string;
|
|
229
|
+
provenance?: ProvenanceReport;
|
|
179
230
|
}>, apiKey?: string): Promise<ApiResult>;
|
|
180
231
|
}
|
|
181
232
|
export {};
|
package/dist/client.js
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
export const DEFAULT_BASE_URL = "https://api.coinrithm.com";
|
|
21
21
|
export function log(...args) {
|
|
22
22
|
// stderr only — stdout is reserved for the MCP protocol.
|
|
23
|
-
// eslint-disable-next-line no-console
|
|
24
23
|
console.error("[coinrithm-mcp]", ...args);
|
|
25
24
|
}
|
|
26
25
|
function resolveBaseUrl() {
|
|
@@ -69,7 +68,7 @@ const applyAgentTraceHeaders = (headers, trace) => {
|
|
|
69
68
|
}
|
|
70
69
|
};
|
|
71
70
|
const traceFromBody = (body) => body && typeof body === "object" && "agentTrace" in body
|
|
72
|
-
?
|
|
71
|
+
? body.agentTrace
|
|
73
72
|
: undefined;
|
|
74
73
|
export class CoinRithmClient {
|
|
75
74
|
// Default key for the stdio (single-user) path. Undefined in the multi-user
|
|
@@ -213,6 +212,24 @@ export class CoinRithmClient {
|
|
|
213
212
|
getPublicPmWhales() {
|
|
214
213
|
return this.publicRequest("/api/prediction-markets/whales");
|
|
215
214
|
}
|
|
215
|
+
// Cross-venue disagreement clusters (approved event matches, graph-clustered).
|
|
216
|
+
getPublicPmMatches(query) {
|
|
217
|
+
return this.publicRequest("/api/prediction-markets/matches/public", query);
|
|
218
|
+
}
|
|
219
|
+
// Per-venue forecast-accuracy calibration (ECE + reliability curve). No query params.
|
|
220
|
+
getPublicPmCalibration() {
|
|
221
|
+
return this.publicRequest("/api/prediction-markets/calibration");
|
|
222
|
+
}
|
|
223
|
+
getPublicPmCanonicalList(query) {
|
|
224
|
+
return this.publicRequest("/api/prediction-markets/canonical", query);
|
|
225
|
+
}
|
|
226
|
+
getPublicPmCanonicalDetail(key) {
|
|
227
|
+
return this.publicRequest(`/api/prediction-markets/canonical/${encodeURIComponent(key)}`);
|
|
228
|
+
}
|
|
229
|
+
// Global daily volume trend (real-money venues only). No query params.
|
|
230
|
+
getPublicPmVolumeHistory() {
|
|
231
|
+
return this.publicRequest("/api/prediction-markets/volume-history");
|
|
232
|
+
}
|
|
216
233
|
// Every method takes an optional trailing `apiKey` (the per-request key for
|
|
217
234
|
// the multi-user HTTP path). When omitted, the constructor key (stdio) is used.
|
|
218
235
|
// ---- reads (scope: read) ----
|
|
@@ -293,7 +310,9 @@ export class CoinRithmClient {
|
|
|
293
310
|
return this.request("GET", "/api/arena", { query, apiKey });
|
|
294
311
|
}
|
|
295
312
|
getArenaAgent(handle, apiKey) {
|
|
296
|
-
return this.request("GET", `/api/arena/${encodeURIComponent(handle)}`, {
|
|
313
|
+
return this.request("GET", `/api/arena/${encodeURIComponent(handle)}`, {
|
|
314
|
+
apiKey,
|
|
315
|
+
});
|
|
297
316
|
}
|
|
298
317
|
listOpenOrders(query, apiKey, agentTrace) {
|
|
299
318
|
return this.request("GET", "/api/agent/orders/open", {
|
|
@@ -347,4 +366,12 @@ export class CoinRithmClient {
|
|
|
347
366
|
openPmPosition(body, apiKey) {
|
|
348
367
|
return this.request("POST", "/api/agent/pm/open", { body, apiKey });
|
|
349
368
|
}
|
|
369
|
+
// Report a NON-opened opportunity (scope: read — it is EVIDENCE, not a trade, so
|
|
370
|
+
// it never moves a wallet or a position). Captures the model ABSTAINING while
|
|
371
|
+
// markets were listed, forecasting WITHOUT trading (forecast_only), or a validated
|
|
372
|
+
// open whose quote EXPIRED at act time (quote_expired), so the public evaluation
|
|
373
|
+
// is not selection-biased toward opened trades. Idempotent by (key, decisionId).
|
|
374
|
+
reportPmOpportunity(body, apiKey) {
|
|
375
|
+
return this.request("POST", "/api/agent/pm/opportunity", { body, apiKey });
|
|
376
|
+
}
|
|
350
377
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Mirror of the backend paper-execution policy. This package is published
|
|
2
|
+
// standalone and cannot import the backend, so the versioned policy name is
|
|
3
|
+
// mirrored here as the SINGLE place any package text that mentions execution
|
|
4
|
+
// cost refers to. That is what stops a served/tool description from drifting
|
|
5
|
+
// back into a "costless" claim while the backend charges real modeled costs.
|
|
6
|
+
//
|
|
7
|
+
// It deliberately does NOT restate the fee/spread/slippage bps — those live in
|
|
8
|
+
// the backend SSOT and are disclosed per fill in the response `executionModel`
|
|
9
|
+
// and in the OpenAPI cost-model description. Text points THERE instead of
|
|
10
|
+
// duplicating numbers that could silently diverge.
|
|
11
|
+
//
|
|
12
|
+
// Drift-tested in executionPolicy.test.ts: the summary names the versioned
|
|
13
|
+
// policy and never matches the costless regex.
|
|
14
|
+
export const PAPER_EXECUTION_VERSION = "paper_execution_v1";
|
|
15
|
+
export const EXECUTION_POLICY_SUMMARY = "Paper execution is not costless: every fill runs under the versioned " +
|
|
16
|
+
`${PAPER_EXECUTION_VERSION} policy — a disclosed taker fee (plus, on spot ` +
|
|
17
|
+
"market orders and PM entries, an adverse spread and size-based slippage; " +
|
|
18
|
+
"futures charge the taker fee and do not model funding) folded into realized " +
|
|
19
|
+
"PnL, so reported PnL is net of modeled costs. The exact per-fill amounts are " +
|
|
20
|
+
"disclosed in each quote/trade `executionModel`; see the OpenAPI cost-model " +
|
|
21
|
+
"description for the bps. A rehearsal cost model, not an exchange-fill guarantee.";
|
package/dist/http.js
CHANGED
|
@@ -46,8 +46,14 @@ async function main() {
|
|
|
46
46
|
const app = express();
|
|
47
47
|
app.use(express.json());
|
|
48
48
|
// Lightweight, unauthenticated liveness probe (handy for Coolify/uptime checks).
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
// Keep `/healthz` as the deployment contract and expose `/health` as a
|
|
50
|
+
// compatibility alias for agents and generic uptime monitors.
|
|
51
|
+
app.get(["/health", "/healthz"], (_req, res) => {
|
|
52
|
+
res.json({
|
|
53
|
+
ok: true,
|
|
54
|
+
service: "coinrithm-mcp",
|
|
55
|
+
transport: "streamable-http",
|
|
56
|
+
});
|
|
51
57
|
});
|
|
52
58
|
// Self-describing landing for humans and validate-before-recommend agents.
|
|
53
59
|
// GET / and GET /mcp used to 404, which reads as a dead service to anyone
|
|
@@ -58,7 +64,11 @@ async function main() {
|
|
|
58
64
|
service: "CoinRithm MCP",
|
|
59
65
|
version: SERVER_VERSION,
|
|
60
66
|
description: "Model Context Protocol server for CoinRithm: keyless public prediction-market data tools (pm_data_*) plus paper-trading tools (spot, futures, prediction markets) with a crk_live_ API key. Paper only — never real money.",
|
|
61
|
-
endpoint: {
|
|
67
|
+
endpoint: {
|
|
68
|
+
url: "https://mcp.coinrithm.com/mcp",
|
|
69
|
+
method: "POST",
|
|
70
|
+
transport: "streamable-http",
|
|
71
|
+
},
|
|
62
72
|
connect: "Point any MCP client at the endpoint above. Data tools need no key; trading tools take Authorization: Bearer crk_live_… (mint one at coinrithm.com → Settings → API Keys).",
|
|
63
73
|
localAlternative: "npx -y @coinrithm/mcp-trading",
|
|
64
74
|
docs: {
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { CoinRithmClient } from "./client.js";
|
|
3
|
+
export declare const PAPER_NOTE: string;
|
|
4
|
+
/**
|
|
5
|
+
* Keep keyless discovery calls small enough for an agent context window.
|
|
6
|
+
* Full event evidence remains available from pm_data_event.
|
|
7
|
+
*/
|
|
8
|
+
export declare function compactPublicPmOverview(data: unknown): unknown;
|
|
9
|
+
export declare function compactPublicPmEvents(data: unknown): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Default event detail for agents: enough provenance and comparison evidence
|
|
12
|
+
* to reason safely without recursively spending an entire context window.
|
|
13
|
+
* Callers can explicitly request detail=full for the untouched API record.
|
|
14
|
+
*/
|
|
15
|
+
export declare function compactPublicPmEvent(data: unknown): unknown;
|
|
16
|
+
export declare function compactPublicPmWhales(data: unknown, limit: number): unknown;
|
|
17
|
+
/**
|
|
18
|
+
* Keep cross-venue disagreement clusters small enough for an agent context
|
|
19
|
+
* window: each event is reduced to eventSummary (drops descriptions, images,
|
|
20
|
+
* sparklines) and each pairwise comparison keeps only its top-5 highest-delta
|
|
21
|
+
* shared outcomes (compactComparison) — the same bounding pm_data_event
|
|
22
|
+
* applies to crossSourceMatches. Verified live: a 5-cluster page drops from
|
|
23
|
+
* ~466KB to ~48KB.
|
|
24
|
+
*/
|
|
25
|
+
export declare function compactPublicPmDisagreements(data: unknown): unknown;
|
|
3
26
|
export declare function registerTools(server: McpServer, client: CoinRithmClient): void;
|