@stratabook/mcp 0.1.1 → 0.1.2
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 +5 -4
- package/dist/src/server.js +1 -1
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +4 -0
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ 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
6
|
import { createStrataMcpServer } from "./server.js";
|
|
7
|
+
import { SERVER_VERSION } from "./version.js";
|
|
7
8
|
function parse(argv) {
|
|
8
9
|
const values = new Map();
|
|
9
10
|
for (let index = 0; index < argv.length; index++) {
|
|
@@ -26,7 +27,7 @@ function parse(argv) {
|
|
|
26
27
|
}
|
|
27
28
|
const timeoutMs = boundedInteger(values.get("timeout-ms") ?? process.env.STRATA_MCP_TIMEOUT_MS ?? "10000", "timeout-ms", 250, 60_000);
|
|
28
29
|
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 ?? "
|
|
30
|
+
const host = values.get("host") ?? process.env.STRATA_MCP_HOST ?? "localhost";
|
|
30
31
|
if (!/^[a-zA-Z0-9.:[\]-]+$/.test(host))
|
|
31
32
|
throw new Error("host is invalid");
|
|
32
33
|
return {
|
|
@@ -49,13 +50,13 @@ function help() {
|
|
|
49
50
|
|
|
50
51
|
Usage:
|
|
51
52
|
strata-mcp
|
|
52
|
-
strata-mcp --transport http [--host
|
|
53
|
+
strata-mcp --transport http [--host localhost] [--port 8787]
|
|
53
54
|
|
|
54
55
|
Options:
|
|
55
56
|
--transport stdio|http Local stdio by default; Streamable HTTP for hosting
|
|
56
57
|
--api-base URL Strata public API (default: ${DEFAULT_API_BASE})
|
|
57
58
|
--timeout-ms N Upstream timeout, 250..60000 (default: 10000)
|
|
58
|
-
--host HOST HTTP bind host (default:
|
|
59
|
+
--host HOST HTTP bind host (default: localhost)
|
|
59
60
|
--port N HTTP port (default: 8787)
|
|
60
61
|
|
|
61
62
|
This server is read-only. It accepts no wallet, private key, or session key.
|
|
@@ -81,7 +82,7 @@ async function runHttp(options) {
|
|
|
81
82
|
response
|
|
82
83
|
.status(200)
|
|
83
84
|
.set("Cache-Control", "no-store")
|
|
84
|
-
.json({ ok: true, service: "strata-mcp", version:
|
|
85
|
+
.json({ ok: true, service: "strata-mcp", version: SERVER_VERSION });
|
|
85
86
|
});
|
|
86
87
|
app.post("/mcp", async (request, response) => {
|
|
87
88
|
let runtime;
|
package/dist/src/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 { SERVER_VERSION } from "./version.js";
|
|
5
5
|
const REFRESH_INTERVAL_MS = 5_000;
|
|
6
6
|
export function capabilityAvailable(catalog, id) {
|
|
7
7
|
return catalog.capabilities.some((capability) => capability.id === id
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SERVER_VERSION: string;
|