@tokcalc/mcp-server 0.2.3 → 0.2.5

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/server.js CHANGED
@@ -13125,6 +13125,7 @@ function datetime2(params) {
13125
13125
  }
13126
13126
  // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
13127
13127
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
13128
+ var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
13128
13129
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
13129
13130
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
13130
13131
  var JSONRPC_VERSION = "2.0";
@@ -13298,6 +13299,7 @@ var InitializeRequestSchema = RequestSchema.extend({
13298
13299
  method: literal("initialize"),
13299
13300
  params: InitializeRequestParamsSchema
13300
13301
  });
13302
+ var isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;
13301
13303
  var ServerCapabilitiesSchema = object2({
13302
13304
  experimental: record(string2(), AssertObjectSchema).optional(),
13303
13305
  logging: AssertObjectSchema.optional(),
@@ -16303,11 +16305,23 @@ var TOOL_DEFINITIONS = [
16303
16305
  inputSchema: formatInputSchema(GetMlperfBenchmarksSchema)
16304
16306
  }
16305
16307
  ];
16308
+ var SERVER_VERSION = "0.2.4";
16309
+ function withProvenance(result) {
16310
+ return {
16311
+ ...result,
16312
+ provenance: {
16313
+ serverVersion: SERVER_VERSION,
16314
+ catalogVersion: "0.3.0",
16315
+ buildStamp: `tokcalc-mcp/${SERVER_VERSION}`
16316
+ }
16317
+ };
16318
+ }
16306
16319
  function createMcpServer() {
16307
- const server = new Server({ name: "tokcalc", version: "0.2.0" }, {
16320
+ const server = new Server({ name: "tokcalc", version: SERVER_VERSION }, {
16308
16321
  capabilities: {
16309
16322
  tools: {}
16310
- }
16323
+ },
16324
+ instructions: `tokcalc MCP server ${SERVER_VERSION} — LLM serving capacity planner. ` + `Use list_models / list_gpus to discover canonical IDs before calling ` + `estimate_capacity, compare_gpus, recommend_topology, or ` + `estimate_api_vs_self_host. All estimates are planning projections, not ` + `deployment guarantees. Every response carries provenance.serverVersion.`
16311
16325
  });
16312
16326
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
16313
16327
  tools: TOOL_DEFINITIONS
@@ -16359,17 +16373,24 @@ function createMcpServer() {
16359
16373
  };
16360
16374
  }
16361
16375
  const isHandlerError = !!result && typeof result === "object" && "error" in result;
16376
+ const stamped = withProvenance(result);
16362
16377
  return {
16363
16378
  content: [
16364
- { type: "text", text: JSON.stringify(result, null, 2) }
16379
+ { type: "text", text: JSON.stringify(stamped, null, 2) }
16365
16380
  ],
16366
- structuredContent: result,
16381
+ structuredContent: stamped,
16367
16382
  ...isHandlerError ? { isError: true } : {}
16368
16383
  };
16369
16384
  } catch (error) {
16370
16385
  return {
16371
16386
  content: [
16372
- { type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }
16387
+ {
16388
+ type: "text",
16389
+ text: JSON.stringify({
16390
+ error: error instanceof Error ? error.message : String(error),
16391
+ provenance: { serverVersion: SERVER_VERSION, buildStamp: `tokcalc-mcp/${SERVER_VERSION}` }
16392
+ }, null, 2)
16393
+ }
16373
16394
  ],
16374
16395
  isError: true
16375
16396
  };
@@ -16378,5 +16399,6 @@ function createMcpServer() {
16378
16399
  return server;
16379
16400
  }
16380
16401
  export {
16402
+ SERVER_VERSION,
16381
16403
  createMcpServer
16382
16404
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
- {
1
+ {
2
2
  "name": "@tokcalc/mcp-server",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "mcpName": "io.github.stevecrates489-commits/tokcalc",
5
5
  "description": "tokcalc MCP server — open-source LLM serving capacity planner for AI agents. v0.2.1: stdio + stateless HTTP transport with bearer API key auth + KV-backed rate limiting + public hosted endpoint. 7 read-only tools: estimate_capacity, compare_gpus, recommend_topology, estimate_api_vs_self_host, list_models, list_gpus, get_mlperf_benchmarks.",
6
6
  "type": "module",
@@ -53,7 +53,9 @@
53
53
  "./package.json": "./package.json"
54
54
  },
55
55
  "scripts": {
56
- "build": "bun build ./index.ts ./server.ts ./http.ts --outdir ./dist --target node"
56
+ "build": "bun build ./index.ts ./server.ts ./http.ts --outdir ./dist --target node",
57
+ "prepublishOnly": "node scripts/prepublish-check.js",
58
+ "verify:dist": "node scripts/prepublish-check.js"
57
59
  },
58
60
  "dependencies": {
59
61
  "@modelcontextprotocol/sdk": "^1.30.1",