@stratabook/mcp 0.1.0 → 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/README.md CHANGED
@@ -72,8 +72,7 @@ npx -y @modelcontextprotocol/inspector --cli \
72
72
  --tool-name strata_quote \
73
73
  --tool-arg market=SOL/USDC \
74
74
  --tool-arg side=sell \
75
- --tool-arg 'amountInAtoms="10000000"' \
76
- --tool-arg slippageBps=50
75
+ --tool-arg 'amountInAtoms="10000000"'
77
76
  ```
78
77
 
79
78
  The response is structured data, ready for terminals, scripts, and agents.
@@ -92,8 +91,7 @@ The response is structured data, ready for terminals, scripts, and agents.
92
91
  {
93
92
  "market": "SOL/USDC",
94
93
  "side": "sell",
95
- "amountInAtoms": "10000000",
96
- "slippageBps": 50
94
+ "amountInAtoms": "10000000"
97
95
  }
98
96
  ```
99
97
 
@@ -104,7 +102,7 @@ The result gives an agent the economics it needs to reason clearly:
104
102
  "provider": "Sonar",
105
103
  "amount_in_consumed_atoms": "10000000",
106
104
  "amount_out_atoms": "1990000",
107
- "minimum_output_atoms": "1980050",
105
+ "minimum_output_atoms": "1990000",
108
106
  "output_fee_atoms": "995",
109
107
  "reference_price": "199.1",
110
108
  "price_impact_pct": "0.0005"
@@ -116,6 +114,13 @@ also include a unique quote ID and authoritative expiry.
116
114
 
117
115
  Sonar handles the market. Your agent works with one economic result.
118
116
 
117
+ ### Execution tolerance
118
+
119
+ Quotes default to exact output: `minimum_output_atoms` equals
120
+ `amount_out_atoms`. An agent may explicitly provide `slippageBps` when its task
121
+ accepts a lower minimum output. This is an execution safeguard, not an estimate
122
+ of market depth; `price_impact_pct` reports price impact separately.
123
+
119
124
  ## Hosted or local
120
125
 
121
126
  | | Hosted Streamable HTTP | Local stdio |
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 ?? "127.0.0.1";
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 127.0.0.1] [--port 8787]
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: 127.0.0.1)
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: "0.1.0" });
85
+ .json({ ok: true, service: "strata-mcp", version: SERVER_VERSION });
85
86
  });
86
87
  app.post("/mcp", async (request, response) => {
87
88
  let runtime;
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { StrataApiError, StrataClient, } from "@stratabook/sdk";
2
+ import { DEFAULT_SLIPPAGE_BPS, StrataApiError, StrataClient, } from "@stratabook/sdk";
3
3
  import * as z from "zod/v4";
4
- const SERVER_VERSION = "0.1.0";
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
@@ -82,8 +82,9 @@ export async function createStrataMcpServer(options = {}) {
82
82
  .min(0)
83
83
  .max(1_000)
84
84
  .optional()
85
- .default(50)
86
- .describe("Maximum slippage in basis points."),
85
+ .default(DEFAULT_SLIPPAGE_BPS)
86
+ .describe("Optional maximum execution tolerance in basis points. "
87
+ + "The default 0 requires exact quoted output."),
87
88
  },
88
89
  annotations: {
89
90
  readOnlyHint: true,
@@ -0,0 +1 @@
1
+ export declare const SERVER_VERSION: string;
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module";
2
+ const require = createRequire(import.meta.url);
3
+ const packageMetadata = require("../../package.json");
4
+ export const SERVER_VERSION = packageMetadata.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stratabook/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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.0",
47
+ "@stratabook/sdk": "0.1.1",
48
48
  "zod": "^3.25.76"
49
49
  },
50
50
  "devDependencies": {