From 005153eb659975cf6cdc1020fbb854b62df4703d Mon Sep 17 00:00:00 2001 From: Sachin Date: Fri, 21 Aug 2026 15:53:47 -0700 Subject: [PATCH] fix(sequentialthinking): read version from package.json instead of hardcoding The serverInfo.version was hardcoded as "0.2.0" even though the package version is 0.6.2 (and CalVer releases like 2026.7.4 in published builds). This caused confusing version mismatches when diagnosing client/server issues. Now uses createRequire to read version from package.json at runtime, which works from both source and dist layouts. Fixes #4575 --- src/sequentialthinking/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts index 217845bb3d..12fb1691f4 100644 --- a/src/sequentialthinking/index.ts +++ b/src/sequentialthinking/index.ts @@ -1,10 +1,14 @@ #!/usr/bin/env node +import { createRequire } from "node:module"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { SequentialThinkingServer } from './lib.js'; +const require = createRequire(import.meta.url); +const { version } = require('./package.json'); + /** Safe boolean coercion that correctly handles string "false" */ const coercedBoolean = z.preprocess((val) => { if (typeof val === "boolean") return val; @@ -17,7 +21,7 @@ const coercedBoolean = z.preprocess((val) => { const server = new McpServer({ name: "sequential-thinking-server", - version: "0.2.0", + version, }); const thinkingServer = new SequentialThinkingServer();