fix(sequentialthinking): read server version from package.json (#4576)

* fix(sequentialthinking): read server version from package.json

Replace the hardcoded 0.2.0 so initialize serverInfo tracks the
package version (0.6.2 in-tree; CalVer after release), matching the
approach used for memory server version sync.

Skip the dist-layout assertion when dist/ is absent so CI's
test-before-build job (and local runs without prepare) still pass.

* test(sequentialthinking): smoke stdio initialize serverInfo.version

Spawn the built server over stdio and assert getServerVersion() matches
package.json (and is not the old hardcoded 0.2.0). Skip when dist/ is
absent so test-before-build CI still passes.
This commit is contained in:
karl4c 2026-08-28 13:01:24 -04:00 • committed by GitHub
commit 40a8de87ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@ 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';
import { SERVER_VERSION } from './version.js';
/** Safe boolean coercion that correctly handles string "false" */
const coercedBoolean = z.preprocess((val) => {
@ -17,7 +18,7 @@ const coercedBoolean = z.preprocess((val) => {
const server = new McpServer({
name: "sequential-thinking-server",
version: "0.2.0",
version: SERVER_VERSION,
});
const thinkingServer = new SequentialThinkingServer();