@stratabook/mcp 0.1.1 → 0.1.3
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/dist/src/cli.js +31 -8
- package/dist/src/generated-harness.d.ts +53 -0
- package/dist/src/generated-harness.js +87 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/server.d.ts +8 -0
- package/dist/src/server.js +59 -5
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +4 -0
- package/package.json +2 -2
package/dist/src/cli.js
CHANGED
|
@@ -3,7 +3,9 @@ import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js
|
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
5
|
import { DEFAULT_API_BASE } from "@stratabook/sdk";
|
|
6
|
-
import {
|
|
6
|
+
import { STRATA_AGENT_HARNESS } from "./generated-harness.js";
|
|
7
|
+
import { createStrataMcpServer, probeStrataMcpReadiness } from "./server.js";
|
|
8
|
+
import { SERVER_VERSION } from "./version.js";
|
|
7
9
|
function parse(argv) {
|
|
8
10
|
const values = new Map();
|
|
9
11
|
for (let index = 0; index < argv.length; index++) {
|
|
@@ -26,7 +28,7 @@ function parse(argv) {
|
|
|
26
28
|
}
|
|
27
29
|
const timeoutMs = boundedInteger(values.get("timeout-ms") ?? process.env.STRATA_MCP_TIMEOUT_MS ?? "10000", "timeout-ms", 250, 60_000);
|
|
28
30
|
const port = boundedInteger(values.get("port") ?? process.env.STRATA_MCP_PORT ?? "8787", "port", 1, 65_535);
|
|
29
|
-
const host = values.get("host") ?? process.env.STRATA_MCP_HOST ?? "
|
|
31
|
+
const host = values.get("host") ?? process.env.STRATA_MCP_HOST ?? "localhost";
|
|
30
32
|
if (!/^[a-zA-Z0-9.:[\]-]+$/.test(host))
|
|
31
33
|
throw new Error("host is invalid");
|
|
32
34
|
return {
|
|
@@ -49,13 +51,13 @@ function help() {
|
|
|
49
51
|
|
|
50
52
|
Usage:
|
|
51
53
|
strata-mcp
|
|
52
|
-
strata-mcp --transport http [--host
|
|
54
|
+
strata-mcp --transport http [--host localhost] [--port 8787]
|
|
53
55
|
|
|
54
56
|
Options:
|
|
55
57
|
--transport stdio|http Local stdio by default; Streamable HTTP for hosting
|
|
56
58
|
--api-base URL Strata public API (default: ${DEFAULT_API_BASE})
|
|
57
59
|
--timeout-ms N Upstream timeout, 250..60000 (default: 10000)
|
|
58
|
-
--host HOST HTTP bind host (default:
|
|
60
|
+
--host HOST HTTP bind host (default: localhost)
|
|
59
61
|
--port N HTTP port (default: 8787)
|
|
60
62
|
|
|
61
63
|
This server is read-only. It accepts no wallet, private key, or session key.
|
|
@@ -77,11 +79,26 @@ async function runHttp(options) {
|
|
|
77
79
|
// local MCP installations from DNS-rebinding attacks.
|
|
78
80
|
const app = createMcpExpressApp({ host: options.host });
|
|
79
81
|
app.disable("x-powered-by");
|
|
80
|
-
app.get("/health", (_request, response) => {
|
|
82
|
+
app.get("/health", async (_request, response) => {
|
|
83
|
+
try {
|
|
84
|
+
const readiness = await probeStrataMcpReadiness(options);
|
|
85
|
+
response.status(200).set("Cache-Control", "no-store").json(readiness);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
process.stderr.write(`[strata-mcp] readiness failed: ${safeError(error)}\n`);
|
|
89
|
+
response.status(503).set("Cache-Control", "no-store").json({
|
|
90
|
+
ok: false,
|
|
91
|
+
service: "strata-mcp",
|
|
92
|
+
version: SERVER_VERSION,
|
|
93
|
+
readiness: "failed",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
app.get("/.well-known/strata-agent.json", (_request, response) => {
|
|
81
98
|
response
|
|
82
99
|
.status(200)
|
|
83
|
-
.set("Cache-Control", "
|
|
84
|
-
.json(
|
|
100
|
+
.set("Cache-Control", "public, max-age=300")
|
|
101
|
+
.json(STRATA_AGENT_HARNESS);
|
|
85
102
|
});
|
|
86
103
|
app.post("/mcp", async (request, response) => {
|
|
87
104
|
let runtime;
|
|
@@ -99,7 +116,8 @@ async function runHttp(options) {
|
|
|
99
116
|
await runtime.server.connect(transport);
|
|
100
117
|
await transport.handleRequest(request, response, request.body);
|
|
101
118
|
}
|
|
102
|
-
catch {
|
|
119
|
+
catch (error) {
|
|
120
|
+
process.stderr.write(`[strata-mcp] request failed: ${safeError(error)}\n`);
|
|
103
121
|
if (!response.headersSent) {
|
|
104
122
|
response.status(500).json({
|
|
105
123
|
jsonrpc: "2.0",
|
|
@@ -127,6 +145,11 @@ async function runHttp(options) {
|
|
|
127
145
|
process.once("SIGINT", close);
|
|
128
146
|
process.once("SIGTERM", close);
|
|
129
147
|
}
|
|
148
|
+
function safeError(error) {
|
|
149
|
+
if (!(error instanceof Error))
|
|
150
|
+
return "unknown_error";
|
|
151
|
+
return `${error.name}: ${error.message}`.replace(/[\r\n\t]/g, " ").slice(0, 300);
|
|
152
|
+
}
|
|
130
153
|
async function main() {
|
|
131
154
|
const options = parse(process.argv.slice(2));
|
|
132
155
|
if (options.transport === "stdio")
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const STRATA_AGENT_HARNESS: {
|
|
2
|
+
readonly schema_version: 1;
|
|
3
|
+
readonly harness_version: "1.0";
|
|
4
|
+
readonly contract_version: "1.1";
|
|
5
|
+
readonly name: "Strata Agent Harness";
|
|
6
|
+
readonly summary: "A capability-gated workflow for agents that explore Strata markets and request validated Sonar quotes.";
|
|
7
|
+
readonly entrypoints: {
|
|
8
|
+
readonly documentation: "https://stratabook.org/docs/agent-harness/";
|
|
9
|
+
readonly capabilities: "https://api.stratabook.app/sonar/capabilities";
|
|
10
|
+
readonly markets: "https://api.stratabook.app/sonar/markets";
|
|
11
|
+
readonly mcp: "https://api.stratabook.app/mcp";
|
|
12
|
+
readonly manifest: "https://api.stratabook.app/.well-known/strata-agent.json";
|
|
13
|
+
};
|
|
14
|
+
readonly interfaces: {
|
|
15
|
+
readonly mcp_tool_order: readonly ["strata_capabilities", "strata_markets", "strata_quote"];
|
|
16
|
+
readonly terminal: readonly ["npx -y @stratabook/sdk capabilities --json", "npx -y @stratabook/sdk markets --json", "npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json"];
|
|
17
|
+
};
|
|
18
|
+
readonly workflow: readonly [{
|
|
19
|
+
readonly id: "discover_capabilities";
|
|
20
|
+
readonly instruction: "Read the live capability catalog before every objective. Never infer permission from documentation, package support, or an earlier session.";
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: "establish_mode";
|
|
23
|
+
readonly instruction: "State whether the available session is read-only or exposes a separately authorized prepare or submit capability. Read access never implies permission to move funds.";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "understand_objective";
|
|
26
|
+
readonly instruction: "Resolve the user's market, side, amount, and tolerance. Ask before proceeding when any economically meaningful input is ambiguous.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "discover_market";
|
|
29
|
+
readonly instruction: "List markets, select one marked ready, and use its discovered base and quote decimals. Do not guess market identifiers or token decimals.";
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "preserve_atoms";
|
|
32
|
+
readonly instruction: "Represent token amounts as unsigned base-10 atomic strings. Never pass settlement amounts through floating-point arithmetic.";
|
|
33
|
+
}, {
|
|
34
|
+
readonly id: "request_quote";
|
|
35
|
+
readonly instruction: "Request a fresh Sonar quote with an explicit side, exact input atoms, and user-approved execution tolerance.";
|
|
36
|
+
}, {
|
|
37
|
+
readonly id: "validate_quote";
|
|
38
|
+
readonly instruction: "Verify the quote binds to the selected market, side, and input. Check labelled fees, minimum output, price impact, server time, and expiry.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "report_result";
|
|
41
|
+
readonly instruction: "Report consumed input, expected output, minimum output, fees by asset side, price impact, and remaining validity without inventing private route composition.";
|
|
42
|
+
}, {
|
|
43
|
+
readonly id: "authorize_writes";
|
|
44
|
+
readonly instruction: "If write capabilities are ever exposed, keep prepare and submit separate, require the configured approval, verify immutable economics, and use idempotency.";
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "monitor_outcome";
|
|
47
|
+
readonly instruction: "After an authorized submission, report the durable receipt or explicit failure. Never claim completion from preparation, signing, or an unconfirmed request.";
|
|
48
|
+
}];
|
|
49
|
+
readonly stop_conditions: readonly ["The required live capability is disabled or absent.", "The market is paused, unavailable, or has no reviewed operation path.", "Market, side, amount, decimals, tolerance, or approval is ambiguous.", "The contract version is unsupported or a response contains unknown fields.", "A quote is expired or its market, side, amount, fee, minimum-output, or time binding is inconsistent.", "A requested operation exceeds the exposed tool, account, or policy scope.", "A user asks the agent to receive or expose wallet secrets, private keys, seed phrases, session keys, or production credentials."];
|
|
50
|
+
readonly safety_rules: readonly ["Never request or accept wallet secrets, private keys, seed phrases, session keys, or production credentials in a prompt.", "Never call undocumented endpoints or reconstruct private Sonar behavior.", "Never silently widen slippage, refresh changed economics, substitute a market, or retry a non-retryable failure.", "Treat capability removal, revocation, expiry, and emergency disable as immediate stop signals.", "The current MCP and terminal tools are read-only unless the live catalog and callable tool list explicitly prove otherwise."];
|
|
51
|
+
};
|
|
52
|
+
export declare const STRATA_AGENT_HARNESS_URI = "strata://agent-harness/v1";
|
|
53
|
+
export declare const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_markets. Read strata://agent-harness/v1 for the complete workflow. Resolve the market, side, exact input atoms, and tolerance before strata_quote. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. Stop on ambiguity, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing approval. Never request wallet secrets, private keys, seed phrases, session keys, or production credentials. Current MCP tools are read-only unless the live catalog and callable tool list explicitly prove otherwise.";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @generated by scripts/generate-agent-entry.mjs. Do not edit manually.
|
|
2
|
+
export const STRATA_AGENT_HARNESS = {
|
|
3
|
+
"schema_version": 1,
|
|
4
|
+
"harness_version": "1.0",
|
|
5
|
+
"contract_version": "1.1",
|
|
6
|
+
"name": "Strata Agent Harness",
|
|
7
|
+
"summary": "A capability-gated workflow for agents that explore Strata markets and request validated Sonar quotes.",
|
|
8
|
+
"entrypoints": {
|
|
9
|
+
"documentation": "https://stratabook.org/docs/agent-harness/",
|
|
10
|
+
"capabilities": "https://api.stratabook.app/sonar/capabilities",
|
|
11
|
+
"markets": "https://api.stratabook.app/sonar/markets",
|
|
12
|
+
"mcp": "https://api.stratabook.app/mcp",
|
|
13
|
+
"manifest": "https://api.stratabook.app/.well-known/strata-agent.json"
|
|
14
|
+
},
|
|
15
|
+
"interfaces": {
|
|
16
|
+
"mcp_tool_order": [
|
|
17
|
+
"strata_capabilities",
|
|
18
|
+
"strata_markets",
|
|
19
|
+
"strata_quote"
|
|
20
|
+
],
|
|
21
|
+
"terminal": [
|
|
22
|
+
"npx -y @stratabook/sdk capabilities --json",
|
|
23
|
+
"npx -y @stratabook/sdk markets --json",
|
|
24
|
+
"npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"workflow": [
|
|
28
|
+
{
|
|
29
|
+
"id": "discover_capabilities",
|
|
30
|
+
"instruction": "Read the live capability catalog before every objective. Never infer permission from documentation, package support, or an earlier session."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "establish_mode",
|
|
34
|
+
"instruction": "State whether the available session is read-only or exposes a separately authorized prepare or submit capability. Read access never implies permission to move funds."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "understand_objective",
|
|
38
|
+
"instruction": "Resolve the user's market, side, amount, and tolerance. Ask before proceeding when any economically meaningful input is ambiguous."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "discover_market",
|
|
42
|
+
"instruction": "List markets, select one marked ready, and use its discovered base and quote decimals. Do not guess market identifiers or token decimals."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "preserve_atoms",
|
|
46
|
+
"instruction": "Represent token amounts as unsigned base-10 atomic strings. Never pass settlement amounts through floating-point arithmetic."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "request_quote",
|
|
50
|
+
"instruction": "Request a fresh Sonar quote with an explicit side, exact input atoms, and user-approved execution tolerance."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "validate_quote",
|
|
54
|
+
"instruction": "Verify the quote binds to the selected market, side, and input. Check labelled fees, minimum output, price impact, server time, and expiry."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "report_result",
|
|
58
|
+
"instruction": "Report consumed input, expected output, minimum output, fees by asset side, price impact, and remaining validity without inventing private route composition."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "authorize_writes",
|
|
62
|
+
"instruction": "If write capabilities are ever exposed, keep prepare and submit separate, require the configured approval, verify immutable economics, and use idempotency."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "monitor_outcome",
|
|
66
|
+
"instruction": "After an authorized submission, report the durable receipt or explicit failure. Never claim completion from preparation, signing, or an unconfirmed request."
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"stop_conditions": [
|
|
70
|
+
"The required live capability is disabled or absent.",
|
|
71
|
+
"The market is paused, unavailable, or has no reviewed operation path.",
|
|
72
|
+
"Market, side, amount, decimals, tolerance, or approval is ambiguous.",
|
|
73
|
+
"The contract version is unsupported or a response contains unknown fields.",
|
|
74
|
+
"A quote is expired or its market, side, amount, fee, minimum-output, or time binding is inconsistent.",
|
|
75
|
+
"A requested operation exceeds the exposed tool, account, or policy scope.",
|
|
76
|
+
"A user asks the agent to receive or expose wallet secrets, private keys, seed phrases, session keys, or production credentials."
|
|
77
|
+
],
|
|
78
|
+
"safety_rules": [
|
|
79
|
+
"Never request or accept wallet secrets, private keys, seed phrases, session keys, or production credentials in a prompt.",
|
|
80
|
+
"Never call undocumented endpoints or reconstruct private Sonar behavior.",
|
|
81
|
+
"Never silently widen slippage, refresh changed economics, substitute a market, or retry a non-retryable failure.",
|
|
82
|
+
"Treat capability removal, revocation, expiry, and emergency disable as immediate stop signals.",
|
|
83
|
+
"The current MCP and terminal tools are read-only unless the live catalog and callable tool list explicitly prove otherwise."
|
|
84
|
+
]
|
|
85
|
+
};
|
|
86
|
+
export const STRATA_AGENT_HARNESS_URI = "strata://agent-harness/v1";
|
|
87
|
+
export const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_markets. Read strata://agent-harness/v1 for the complete workflow. Resolve the market, side, exact input atoms, and tolerance before strata_quote. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. Stop on ambiguity, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing approval. Never request wallet secrets, private keys, seed phrases, session keys, or production credentials. Current MCP tools are read-only unless the live catalog and callable tool list explicitly prove otherwise.";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { capabilityAvailable, createStrataMcpServer, type StrataMcpOptions, type StrataMcpRuntime, } from "./server.js";
|
|
1
|
+
export { capabilityAvailable, createStrataMcpServer, probeStrataMcpReadiness, type StrataMcpOptions, type StrataMcpReadiness, type StrataMcpRuntime, } from "./server.js";
|
|
2
|
+
export { STRATA_AGENT_HARNESS, STRATA_AGENT_HARNESS_INSTRUCTIONS, STRATA_AGENT_HARNESS_URI, } from "./generated-harness.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { capabilityAvailable, createStrataMcpServer, } from "./server.js";
|
|
1
|
+
export { capabilityAvailable, createStrataMcpServer, probeStrataMcpReadiness, } from "./server.js";
|
|
2
|
+
export { STRATA_AGENT_HARNESS, STRATA_AGENT_HARNESS_INSTRUCTIONS, STRATA_AGENT_HARNESS_URI, } from "./generated-harness.js";
|
package/dist/src/server.d.ts
CHANGED
|
@@ -10,5 +10,13 @@ export interface StrataMcpRuntime {
|
|
|
10
10
|
refreshCapabilities(): Promise<void>;
|
|
11
11
|
close(): Promise<void>;
|
|
12
12
|
}
|
|
13
|
+
export interface StrataMcpReadiness {
|
|
14
|
+
ok: true;
|
|
15
|
+
service: "strata-mcp";
|
|
16
|
+
version: string;
|
|
17
|
+
contract_version: string;
|
|
18
|
+
harness_version: string;
|
|
19
|
+
}
|
|
13
20
|
export declare function capabilityAvailable(catalog: CapabilityCatalog, id: string): boolean;
|
|
21
|
+
export declare function probeStrataMcpReadiness(options?: StrataMcpOptions): Promise<StrataMcpReadiness>;
|
|
14
22
|
export declare function createStrataMcpServer(options?: StrataMcpOptions): Promise<StrataMcpRuntime>;
|
package/dist/src/server.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { DEFAULT_SLIPPAGE_BPS, StrataApiError, StrataClient, } from "@stratabook/sdk";
|
|
3
3
|
import * as z from "zod/v4";
|
|
4
|
-
|
|
4
|
+
import { STRATA_AGENT_HARNESS, STRATA_AGENT_HARNESS_INSTRUCTIONS, STRATA_AGENT_HARNESS_URI, } from "./generated-harness.js";
|
|
5
|
+
import { SERVER_VERSION } from "./version.js";
|
|
5
6
|
const REFRESH_INTERVAL_MS = 5_000;
|
|
6
7
|
export function capabilityAvailable(catalog, id) {
|
|
7
8
|
return catalog.capabilities.some((capability) => capability.id === id
|
|
@@ -10,20 +11,73 @@ export function capabilityAvailable(catalog, id) {
|
|
|
10
11
|
&& capability.risk === "read"
|
|
11
12
|
&& capability.mcp_exposure === "read");
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
function strataClient(options) {
|
|
15
|
+
return options.client
|
|
15
16
|
?? new StrataClient({
|
|
16
17
|
apiBase: options.apiBase,
|
|
17
18
|
timeoutMs: options.timeoutMs,
|
|
18
19
|
});
|
|
20
|
+
}
|
|
21
|
+
export async function probeStrataMcpReadiness(options = {}) {
|
|
22
|
+
const catalog = await strataClient(options).capabilities();
|
|
23
|
+
if (catalog.contract_version !== STRATA_AGENT_HARNESS.contract_version) {
|
|
24
|
+
throw new Error("agent harness and live contract versions differ");
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
ok: true,
|
|
28
|
+
service: "strata-mcp",
|
|
29
|
+
version: SERVER_VERSION,
|
|
30
|
+
contract_version: catalog.contract_version,
|
|
31
|
+
harness_version: STRATA_AGENT_HARNESS.harness_version,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export async function createStrataMcpServer(options = {}) {
|
|
35
|
+
const client = strataClient(options);
|
|
19
36
|
const initialCatalog = await client.capabilities();
|
|
37
|
+
if (initialCatalog.contract_version !== STRATA_AGENT_HARNESS.contract_version) {
|
|
38
|
+
throw new Error("agent harness and live contract versions differ");
|
|
39
|
+
}
|
|
20
40
|
const server = new McpServer({
|
|
21
41
|
name: "strata",
|
|
22
42
|
version: SERVER_VERSION,
|
|
23
43
|
}, {
|
|
24
|
-
instructions:
|
|
25
|
-
+ "Token values use exact atomic decimal strings. Check quote expiry and minimum output.",
|
|
44
|
+
instructions: STRATA_AGENT_HARNESS_INSTRUCTIONS,
|
|
26
45
|
});
|
|
46
|
+
server.registerResource("strata_agent_harness", STRATA_AGENT_HARNESS_URI, {
|
|
47
|
+
title: "Strata Agent Harness",
|
|
48
|
+
description: "Canonical capability-gated first-run workflow for Strata agents.",
|
|
49
|
+
mimeType: "application/json",
|
|
50
|
+
}, async () => ({
|
|
51
|
+
contents: [
|
|
52
|
+
{
|
|
53
|
+
uri: STRATA_AGENT_HARNESS_URI,
|
|
54
|
+
mimeType: "application/json",
|
|
55
|
+
text: JSON.stringify(STRATA_AGENT_HARNESS),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
}));
|
|
59
|
+
server.registerPrompt("strata_start", {
|
|
60
|
+
title: "Start a Strata objective",
|
|
61
|
+
description: "Apply the Strata Agent Harness to a concrete read-only objective.",
|
|
62
|
+
argsSchema: {
|
|
63
|
+
objective: z
|
|
64
|
+
.string()
|
|
65
|
+
.min(1)
|
|
66
|
+
.max(2_000)
|
|
67
|
+
.describe("The user's concrete Strata market or quote objective."),
|
|
68
|
+
},
|
|
69
|
+
}, async ({ objective }) => ({
|
|
70
|
+
description: "Capability-gated Strata objective",
|
|
71
|
+
messages: [
|
|
72
|
+
{
|
|
73
|
+
role: "user",
|
|
74
|
+
content: {
|
|
75
|
+
type: "text",
|
|
76
|
+
text: `${STRATA_AGENT_HARNESS_INSTRUCTIONS}\n\nObjective: ${objective.trim()}`,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
}));
|
|
27
81
|
server.registerTool("strata_capabilities", {
|
|
28
82
|
title: "Strata capabilities",
|
|
29
83
|
description: "See which Strata features are currently available to MCP clients.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SERVER_VERSION: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratabook/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Connect AI agents to Strata markets and Sonar quotes with MCP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
47
|
-
"@stratabook/sdk": "0.1.
|
|
47
|
+
"@stratabook/sdk": "0.1.2",
|
|
48
48
|
"zod": "^3.25.76"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|