From 2bb442bd267bcbdab61361ba9696f079f2a88415 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 30 Sep 2026 10:02:07 +0000 Subject: [PATCH] Remove sequentialthinking server Delete src/sequentialthinking and all references to it across the repo. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01WgDQSktc6zqp83pR1Y4qgZ --- CLAUDE.md | 3 +- README.md | 1 - package-lock.json | 276 +--------------- package.json | 3 +- src/sequentialthinking/Dockerfile | 24 -- src/sequentialthinking/README.md | 222 ------------- .../__tests__/input-schema.test.ts | 66 ---- src/sequentialthinking/__tests__/lib.test.ts | 308 ------------------ .../__tests__/server-version.test.ts | 57 ---- src/sequentialthinking/index.ts | 135 -------- src/sequentialthinking/lib.ts | 99 ------ src/sequentialthinking/package.json | 41 --- src/sequentialthinking/tsconfig.json | 14 - src/sequentialthinking/version.ts | 33 -- src/sequentialthinking/vitest.config.ts | 14 - 15 files changed, 3 insertions(+), 1293 deletions(-) delete mode 100644 src/sequentialthinking/Dockerfile delete mode 100644 src/sequentialthinking/README.md delete mode 100644 src/sequentialthinking/__tests__/input-schema.test.ts delete mode 100644 src/sequentialthinking/__tests__/lib.test.ts delete mode 100644 src/sequentialthinking/__tests__/server-version.test.ts delete mode 100644 src/sequentialthinking/index.ts delete mode 100644 src/sequentialthinking/lib.ts delete mode 100644 src/sequentialthinking/package.json delete mode 100644 src/sequentialthinking/tsconfig.json delete mode 100644 src/sequentialthinking/version.ts delete mode 100644 src/sequentialthinking/vitest.config.ts diff --git a/CLAUDE.md b/CLAUDE.md index ad30b915a8..2d0bf3b33a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code when working with code in this reposi ## Project Overview -Official MCP reference server implementations. This is an npm workspaces monorepo containing 7 servers (4 TypeScript, 3 Python) under `src/`. Each server is a standalone package published to npm or PyPI. +Official MCP reference server implementations. This is an npm workspaces monorepo containing 6 servers (3 TypeScript, 3 Python) under `src/`. Each server is a standalone package published to npm or PyPI. ## Monorepo Structure @@ -13,7 +13,6 @@ src/ everything/ TS @modelcontextprotocol/server-everything (reference server, all MCP features) filesystem/ TS @modelcontextprotocol/server-filesystem (file operations with Roots access control) memory/ TS @modelcontextprotocol/server-memory (knowledge graph persistence) - sequentialthinking/ TS @modelcontextprotocol/server-sequential-thinking (step-by-step reasoning) fetch/ Py mcp-server-fetch (web content fetching) git/ Py mcp-server-git (git repository operations) time/ Py mcp-server-time (timezone queries and conversion) diff --git a/README.md b/README.md index 9c388c80a4..1db4b6bbe7 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ These servers aim to demonstrate MCP features and the official SDKs. - **[Filesystem](src/filesystem)** - Secure file operations with configurable access controls. - **[Git](src/git)** - Tools to read, search, and manipulate Git repositories. - **[Memory](src/memory)** - Knowledge graph-based persistent memory system. -- **[Sequential Thinking](src/sequentialthinking)** - Dynamic and reflective problem-solving through thought sequences. - **[Time](src/time)** - Time and timezone conversion capabilities. ### Archived diff --git a/package-lock.json b/package-lock.json index 632d3404ad..a98bee27b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,7 @@ "dependencies": { "@modelcontextprotocol/server-everything": "*", "@modelcontextprotocol/server-filesystem": "*", - "@modelcontextprotocol/server-memory": "*", - "@modelcontextprotocol/server-sequential-thinking": "*" + "@modelcontextprotocol/server-memory": "*" } }, "node_modules/@babel/helper-string-parser": { @@ -204,10 +203,6 @@ "resolved": "src/memory", "link": true }, - "node_modules/@modelcontextprotocol/server-sequential-thinking": { - "resolved": "src/sequentialthinking", - "link": true - }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz", @@ -704,23 +699,6 @@ "@types/node": "*" } }, - "node_modules/@types/yargs": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", - "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@vitest/coverage-v8": { "version": "4.1.8", "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.8.tgz", @@ -1052,123 +1030,6 @@ "node": ">=18" } }, - "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, "node_modules/content-disposition": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", @@ -1374,15 +1235,6 @@ "node": ">= 0.4" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -1735,15 +1587,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -1988,15 +1831,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2955,15 +2789,6 @@ "node": ">= 0.10" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3739,83 +3564,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/zod": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", @@ -3900,28 +3648,6 @@ "typescript": "^5.6.2", "vitest": "^4.1.8" } - }, - "src/sequentialthinking": { - "name": "@modelcontextprotocol/server-sequential-thinking", - "version": "0.6.2", - "license": "SEE LICENSE IN LICENSE", - "dependencies": { - "@modelcontextprotocol/sdk": "^1.30.0", - "chalk": "^5.3.0", - "yargs": "^17.7.2", - "zod": "^4.0.0" - }, - "bin": { - "mcp-server-sequential-thinking": "dist/index.js" - }, - "devDependencies": { - "@types/node": "^22", - "@types/yargs": "^17.0.32", - "@vitest/coverage-v8": "^4.1.8", - "shx": "^0.4.0", - "typescript": "^5.3.3", - "vitest": "^4.1.8" - } } } } diff --git a/package.json b/package.json index ab0b8c8800..ad120d76c5 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "dependencies": { "@modelcontextprotocol/server-everything": "*", "@modelcontextprotocol/server-memory": "*", - "@modelcontextprotocol/server-filesystem": "*", - "@modelcontextprotocol/server-sequential-thinking": "*" + "@modelcontextprotocol/server-filesystem": "*" }, "overrides": { "qs": ">=6.15.2", diff --git a/src/sequentialthinking/Dockerfile b/src/sequentialthinking/Dockerfile deleted file mode 100644 index f1a88195bc..0000000000 --- a/src/sequentialthinking/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM node:22.12-alpine AS builder - -COPY src/sequentialthinking /app -COPY tsconfig.json /tsconfig.json - -WORKDIR /app - -RUN --mount=type=cache,target=/root/.npm npm install - -RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev - -FROM node:22-alpine AS release - -COPY --from=builder /app/dist /app/dist -COPY --from=builder /app/package.json /app/package.json -COPY --from=builder /app/package-lock.json /app/package-lock.json - -ENV NODE_ENV=production - -WORKDIR /app - -RUN npm ci --ignore-scripts --omit-dev - -ENTRYPOINT ["node", "dist/index.js"] diff --git a/src/sequentialthinking/README.md b/src/sequentialthinking/README.md deleted file mode 100644 index b6b853aa56..0000000000 --- a/src/sequentialthinking/README.md +++ /dev/null @@ -1,222 +0,0 @@ -# Sequential Thinking MCP Server - -An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process. - -Published on npm as [`@modelcontextprotocol/server-sequential-thinking`](https://www.npmjs.com/package/@modelcontextprotocol/server-sequential-thinking). - -## Features - -- Break down complex problems into manageable steps -- Revise and refine thoughts as understanding deepens -- Branch into alternative paths of reasoning -- Adjust the total number of thoughts dynamically -- Generate and verify solution hypotheses - -## Tool - -### sequential_thinking - -Facilitates a detailed, step-by-step thinking process for problem-solving and analysis. - -**Inputs:** -- `thought` (string): The current thinking step -- `nextThoughtNeeded` (boolean): Whether another thought step is needed -- `thoughtNumber` (integer): Current thought number -- `totalThoughts` (integer): Estimated total thoughts needed -- `isRevision` (boolean, optional): Whether this revises previous thinking -- `revisesThought` (integer, optional): Which thought is being reconsidered -- `branchFromThought` (integer, optional): Branching point thought number -- `branchId` (string, optional): Branch identifier -- `needsMoreThoughts` (boolean, optional): If more thoughts are needed - -## Usage - -The Sequential Thinking tool is designed for: -- Breaking down complex problems into steps -- Planning and design with room for revision -- Analysis that might need course correction -- Problems where the full scope might not be clear initially -- Tasks that need to maintain context over multiple steps -- Situations where irrelevant information needs to be filtered out - -In practice, you do not call `sequential_thinking` directly by hand unless your client exposes raw tool calls. Instead, connect the server to an MCP-aware host and ask the model to think through a problem step by step. The host can then decide to call the tool one or more times while it works. - -### What it looks like in use - -Example prompts that typically benefit from this tool: - -- `Plan a database migration from PostgreSQL 14 to 16, list risks, and revise the plan if downtime exceeds 5 minutes.` -- `Debug why this deployment only fails in production and show your reasoning step by step.` -- `Compare three architecture options for a file sync engine and branch if one assumption turns out to be wrong.` - -### How to tell it is working - -If your host or inspector shows tool activity, you should see repeated calls to `sequential_thinking` with fields such as: - -- `thought` -- `thoughtNumber` -- `totalThoughts` -- `nextThoughtNeeded` - -When the reasoning changes course, you may also see revision or branching fields like `isRevision`, `revisesThought`, `branchFromThought`, or `branchId`. - -### Quick manual verification - -After installing the server in your MCP host: - -1. Restart or reload the host so it reconnects to the server. -2. Confirm the `sequential_thinking` tool appears in the host's MCP tool list or inspector. -3. Ask the host to solve a non-trivial problem in a step-by-step way. -4. Verify that the host invokes the tool multiple times instead of returning a one-shot answer. - -## Configuration - -### Usage with Claude Desktop - -Add this to your `claude_desktop_config.json`: - -#### npx - -```json -{ - "mcpServers": { - "sequential-thinking": { - "command": "npx", - "args": [ - "-y", - "@modelcontextprotocol/server-sequential-thinking" - ] - } - } -} -``` - -On Windows, use `cmd /c` to launch `npx`: - -```json -{ - "mcpServers": { - "sequential-thinking": { - "command": "cmd", - "args": [ - "/c", - "npx", - "-y", - "@modelcontextprotocol/server-sequential-thinking" - ] - } - } -} -``` - -#### docker - -```json -{ - "mcpServers": { - "sequentialthinking": { - "command": "docker", - "args": [ - "run", - "--rm", - "-i", - "mcp/sequentialthinking" - ] - } - } -} -``` - -To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`. - -### Usage with VS Code - -For quick installation, click one of the installation buttons below... - -[![Install with NPX in VS Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-sequential-thinking%22%5D%7D) [![Install with NPX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-sequential-thinking%22%5D%7D&quality=insiders) - -[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Docker-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22mcp%2Fsequentialthinking%22%5D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Docker-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22mcp%2Fsequentialthinking%22%5D%7D&quality=insiders) - -For manual installation, you can configure the MCP server using one of these methods: - -**Method 1: User Configuration (Recommended)** -Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. - -**Method 2: Workspace Configuration** -Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. - -> For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers). - -For NPX installation: - -```json -{ - "servers": { - "sequential-thinking": { - "command": "npx", - "args": [ - "-y", - "@modelcontextprotocol/server-sequential-thinking" - ] - } - } -} -``` - -On Windows, use: - -```json -{ - "servers": { - "sequential-thinking": { - "command": "cmd", - "args": [ - "/c", - "npx", - "-y", - "@modelcontextprotocol/server-sequential-thinking" - ] - } - } -} -``` - -For Docker installation: - -```json -{ - "servers": { - "sequential-thinking": { - "command": "docker", - "args": [ - "run", - "--rm", - "-i", - "mcp/sequentialthinking" - ] - } - } -} -``` - -### Usage with Codex CLI - -Run the following: - -#### npx - -```bash -codex mcp add sequential-thinking npx -y @modelcontextprotocol/server-sequential-thinking -``` - -## Building - -Docker: - -```bash -docker build -t mcp/sequentialthinking -f src/sequentialthinking/Dockerfile . -``` - -## License - -This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. diff --git a/src/sequentialthinking/__tests__/input-schema.test.ts b/src/sequentialthinking/__tests__/input-schema.test.ts deleted file mode 100644 index 4ff7be663c..0000000000 --- a/src/sequentialthinking/__tests__/input-schema.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { describe, it, expect, beforeAll, afterAll } from 'vitest'; -import { existsSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { Client } from '@modelcontextprotocol/sdk/client/index.js'; -import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; - -const packageRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '..'); -const distIndexPath = path.join(packageRoot, 'dist', 'index.js'); - -// Regression coverage for #4651: nextThoughtNeeded must stay in the advertised -// `required` array, and string coercion must keep accepting "True"/"FALSE" -// while rejecting anything else. Runs against the built server so it checks -// the schema the SDK actually emits, not the zod object. -describe.skipIf(!existsSync(distIndexPath))('sequentialthinking input schema', () => { - let client: Client; - - beforeAll(async () => { - const transport = new StdioClientTransport({ - command: process.execPath, - args: [distIndexPath], - cwd: packageRoot, - stderr: 'pipe', - }); - client = new Client({ name: 'input-schema-test', version: '0.0.0' }); - await client.connect(transport); - }); - - afterAll(async () => { - await client?.close(); - }); - - it('advertises nextThoughtNeeded as required', async () => { - const { tools } = await client.listTools(); - const tool = tools.find(t => t.name === 'sequentialthinking'); - expect(tool).toBeDefined(); - expect(tool!.inputSchema.required).toEqual( - expect.arrayContaining(['thought', 'nextThoughtNeeded', 'thoughtNumber', 'totalThoughts']) - ); - }); - - it('rejects a call that omits nextThoughtNeeded', async () => { - const result = await client.callTool({ - name: 'sequentialthinking', - arguments: { thought: 't', thoughtNumber: 1, totalThoughts: 1 }, - }); - expect(result.isError).toBe(true); - expect(JSON.stringify(result.content)).toMatch(/nextThoughtNeeded/); - }); - - it.each(['True', 'FALSE', 'true', 'false'])('accepts the string %s', async (value) => { - const result = await client.callTool({ - name: 'sequentialthinking', - arguments: { thought: 't', nextThoughtNeeded: value, thoughtNumber: 1, totalThoughts: 1 }, - }); - expect(result.isError).toBeFalsy(); - }); - - it.each(['yes', '', '1'])('rejects the string %j', async (value) => { - const result = await client.callTool({ - name: 'sequentialthinking', - arguments: { thought: 't', nextThoughtNeeded: value, thoughtNumber: 1, totalThoughts: 1 }, - }); - expect(result.isError).toBe(true); - }); -}); diff --git a/src/sequentialthinking/__tests__/lib.test.ts b/src/sequentialthinking/__tests__/lib.test.ts deleted file mode 100644 index 2114c5ec18..0000000000 --- a/src/sequentialthinking/__tests__/lib.test.ts +++ /dev/null @@ -1,308 +0,0 @@ -import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; -import { SequentialThinkingServer, ThoughtData } from '../lib.js'; - -// Mock chalk to avoid ESM issues -vi.mock('chalk', () => { - const chalkMock = { - yellow: (str: string) => str, - green: (str: string) => str, - blue: (str: string) => str, - }; - return { - default: chalkMock, - }; -}); - -describe('SequentialThinkingServer', () => { - let server: SequentialThinkingServer; - - beforeEach(() => { - // Disable thought logging for tests - process.env.DISABLE_THOUGHT_LOGGING = 'true'; - server = new SequentialThinkingServer(); - }); - - // Note: Input validation tests removed - validation now happens at the tool - // registration layer via Zod schemas before processThought is called - - describe('processThought - valid inputs', () => { - it('should accept valid basic thought', () => { - const input = { - thought: 'This is my first thought', - thoughtNumber: 1, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const result = server.processThought(input); - expect(result.isError).toBeUndefined(); - - const data = JSON.parse(result.content[0].text); - expect(data.thoughtNumber).toBe(1); - expect(data.totalThoughts).toBe(3); - expect(data.nextThoughtNeeded).toBe(true); - expect(data.thoughtHistoryLength).toBe(1); - }); - - it('should accept thought with optional fields', () => { - const input = { - thought: 'Revising my earlier idea', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: true, - isRevision: true, - revisesThought: 1, - needsMoreThoughts: false - }; - - const result = server.processThought(input); - expect(result.isError).toBeUndefined(); - - const data = JSON.parse(result.content[0].text); - expect(data.thoughtNumber).toBe(2); - expect(data.thoughtHistoryLength).toBe(1); - }); - - it('should track multiple thoughts in history', () => { - const input1 = { - thought: 'First thought', - thoughtNumber: 1, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const input2 = { - thought: 'Second thought', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const input3 = { - thought: 'Final thought', - thoughtNumber: 3, - totalThoughts: 3, - nextThoughtNeeded: false - }; - - server.processThought(input1); - server.processThought(input2); - const result = server.processThought(input3); - - const data = JSON.parse(result.content[0].text); - expect(data.thoughtHistoryLength).toBe(3); - expect(data.nextThoughtNeeded).toBe(false); - }); - - it('should auto-adjust totalThoughts if thoughtNumber exceeds it', () => { - const input = { - thought: 'Thought 5', - thoughtNumber: 5, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const result = server.processThought(input); - const data = JSON.parse(result.content[0].text); - - expect(data.totalThoughts).toBe(5); - }); - }); - - describe('processThought - branching', () => { - it('should track branches correctly', () => { - const input1 = { - thought: 'Main thought', - thoughtNumber: 1, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const input2 = { - thought: 'Branch A thought', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: true, - branchFromThought: 1, - branchId: 'branch-a' - }; - - const input3 = { - thought: 'Branch B thought', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: false, - branchFromThought: 1, - branchId: 'branch-b' - }; - - server.processThought(input1); - server.processThought(input2); - const result = server.processThought(input3); - - const data = JSON.parse(result.content[0].text); - expect(data.branches).toContain('branch-a'); - expect(data.branches).toContain('branch-b'); - expect(data.branches.length).toBe(2); - expect(data.thoughtHistoryLength).toBe(3); - }); - - it('should allow multiple thoughts in same branch', () => { - const input1 = { - thought: 'Branch thought 1', - thoughtNumber: 1, - totalThoughts: 2, - nextThoughtNeeded: true, - branchFromThought: 1, - branchId: 'branch-a' - }; - - const input2 = { - thought: 'Branch thought 2', - thoughtNumber: 2, - totalThoughts: 2, - nextThoughtNeeded: false, - branchFromThought: 1, - branchId: 'branch-a' - }; - - server.processThought(input1); - const result = server.processThought(input2); - - const data = JSON.parse(result.content[0].text); - expect(data.branches).toContain('branch-a'); - expect(data.branches.length).toBe(1); - }); - }); - - describe('processThought - edge cases', () => { - it('should handle very long thought strings', () => { - const input = { - thought: 'a'.repeat(10000), - thoughtNumber: 1, - totalThoughts: 1, - nextThoughtNeeded: false - }; - - const result = server.processThought(input); - expect(result.isError).toBeUndefined(); - }); - - it('should handle thoughtNumber = 1, totalThoughts = 1', () => { - const input = { - thought: 'Only thought', - thoughtNumber: 1, - totalThoughts: 1, - nextThoughtNeeded: false - }; - - const result = server.processThought(input); - expect(result.isError).toBeUndefined(); - - const data = JSON.parse(result.content[0].text); - expect(data.thoughtNumber).toBe(1); - expect(data.totalThoughts).toBe(1); - }); - - it('should handle nextThoughtNeeded = false', () => { - const input = { - thought: 'Final thought', - thoughtNumber: 3, - totalThoughts: 3, - nextThoughtNeeded: false - }; - - const result = server.processThought(input); - const data = JSON.parse(result.content[0].text); - - expect(data.nextThoughtNeeded).toBe(false); - }); - }); - - describe('processThought - response format', () => { - it('should return correct response structure on success', () => { - const input = { - thought: 'Test thought', - thoughtNumber: 1, - totalThoughts: 1, - nextThoughtNeeded: false - }; - - const result = server.processThought(input); - - expect(result).toHaveProperty('content'); - expect(Array.isArray(result.content)).toBe(true); - expect(result.content.length).toBe(1); - expect(result.content[0]).toHaveProperty('type', 'text'); - expect(result.content[0]).toHaveProperty('text'); - }); - - it('should return valid JSON in response', () => { - const input = { - thought: 'Test thought', - thoughtNumber: 1, - totalThoughts: 1, - nextThoughtNeeded: false - }; - - const result = server.processThought(input); - - expect(() => JSON.parse(result.content[0].text)).not.toThrow(); - }); - }); - - describe('processThought - with logging enabled', () => { - let serverWithLogging: SequentialThinkingServer; - - beforeEach(() => { - // Enable thought logging for these tests - delete process.env.DISABLE_THOUGHT_LOGGING; - serverWithLogging = new SequentialThinkingServer(); - }); - - afterEach(() => { - // Reset to disabled for other tests - process.env.DISABLE_THOUGHT_LOGGING = 'true'; - }); - - it('should format and log regular thoughts', () => { - const input = { - thought: 'Test thought with logging', - thoughtNumber: 1, - totalThoughts: 3, - nextThoughtNeeded: true - }; - - const result = serverWithLogging.processThought(input); - expect(result.isError).toBeUndefined(); - }); - - it('should format and log revision thoughts', () => { - const input = { - thought: 'Revised thought', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: true, - isRevision: true, - revisesThought: 1 - }; - - const result = serverWithLogging.processThought(input); - expect(result.isError).toBeUndefined(); - }); - - it('should format and log branch thoughts', () => { - const input = { - thought: 'Branch thought', - thoughtNumber: 2, - totalThoughts: 3, - nextThoughtNeeded: false, - branchFromThought: 1, - branchId: 'branch-a' - }; - - const result = serverWithLogging.processThought(input); - expect(result.isError).toBeUndefined(); - }); - }); -}); diff --git a/src/sequentialthinking/__tests__/server-version.test.ts b/src/sequentialthinking/__tests__/server-version.test.ts deleted file mode 100644 index c7d7f5cb39..0000000000 --- a/src/sequentialthinking/__tests__/server-version.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { describe, it, expect } from 'vitest'; -import { createRequire } from 'node:module'; -import { existsSync } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; -import { Client } from '@modelcontextprotocol/sdk/client/index.js'; -import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; -import { resolvePackageVersion, SERVER_VERSION } from '../version.js'; - -const packageJson = createRequire(import.meta.url)('../package.json') as { version: string }; -const packageRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '..'); -const distVersionPath = path.join(packageRoot, 'dist', 'version.js'); -const distIndexPath = path.join(packageRoot, 'dist', 'index.js'); - -describe('server version', () => { - it('uses package.json version instead of a hardcoded string', () => { - expect(SERVER_VERSION).toBe(packageJson.version); - expect(resolvePackageVersion()).toBe(packageJson.version); - expect(SERVER_VERSION).not.toBe('0.2.0'); - }); - - // CI runs `npm test` before the dedicated build job. `npm ci` usually - // materializes dist/ via prepare, but that is not guaranteed (e.g. local - // `rm -rf dist && npm test`, or install with --ignore-scripts). - it.skipIf(!existsSync(distVersionPath))( - 'resolves package.json from the dist layout after build', - async () => { - const distModule = (await import(pathToFileURL(distVersionPath).href)) as { - SERVER_VERSION: string; - }; - expect(distModule.SERVER_VERSION).toBe(packageJson.version); - }, - ); - - it.skipIf(!existsSync(distIndexPath))( - 'stdio initialize reports package.json version in serverInfo', - async () => { - const transport = new StdioClientTransport({ - command: process.execPath, - args: [distIndexPath], - cwd: packageRoot, - stderr: 'pipe', - }); - const client = new Client({ name: 'version-smoke', version: '0.0.0' }); - - try { - await client.connect(transport); - const serverInfo = client.getServerVersion(); - expect(serverInfo?.name).toBe('sequential-thinking-server'); - expect(serverInfo?.version).toBe(packageJson.version); - expect(serverInfo?.version).not.toBe('0.2.0'); - } finally { - await client.close(); - } - }, - ); -}); diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts deleted file mode 100644 index 1ae09d1db8..0000000000 --- a/src/sequentialthinking/index.ts +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env node - -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". A union+transform, - * not z.preprocess (whose input type is `unknown`), so toJSONSchema keeps this required. */ -const coercedBoolean = z.union([z.boolean(), z.string()]).transform((val, ctx) => { - if (typeof val === "boolean") return val; - if (val.toLowerCase() === "true") return true; - if (val.toLowerCase() === "false") return false; - ctx.addIssue({ code: "custom", message: `Expected boolean or "true"/"false" string, received "${val}"` }); - return z.NEVER; -}); - -const server = new McpServer({ - name: "sequential-thinking-server", - version: SERVER_VERSION, -}); - -const thinkingServer = new SequentialThinkingServer(); - -server.registerTool( - "sequentialthinking", - { - title: "Sequential Thinking", - description: `A detailed tool for dynamic and reflective problem-solving through thoughts. -This tool helps analyze problems through a flexible thinking process that can adapt and evolve. -Each thought can build on, question, or revise previous insights as understanding deepens. - -When to use this tool: -- Breaking down complex problems into steps -- Planning and design with room for revision -- Analysis that might need course correction -- Problems where the full scope might not be clear initially -- Problems that require a multi-step solution -- Tasks that need to maintain context over multiple steps -- Situations where irrelevant information needs to be filtered out - -Key features: -- You can adjust total_thoughts up or down as you progress -- You can question or revise previous thoughts -- You can add more thoughts even after reaching what seemed like the end -- You can express uncertainty and explore alternative approaches -- Not every thought needs to build linearly - you can branch or backtrack -- Generates a solution hypothesis -- Verifies the hypothesis based on the Chain of Thought steps -- Repeats the process until satisfied -- Provides a correct answer - -Parameters explained: -- thought: Your current thinking step, which can include: - * Regular analytical steps - * Revisions of previous thoughts - * Questions about previous decisions - * Realizations about needing more analysis - * Changes in approach - * Hypothesis generation - * Hypothesis verification -- nextThoughtNeeded: True if you need more thinking, even if at what seemed like the end -- thoughtNumber: Current number in sequence (can go beyond initial total if needed) -- totalThoughts: Current estimate of thoughts needed (can be adjusted up/down) -- isRevision: A boolean indicating if this thought revises previous thinking -- revisesThought: If is_revision is true, which thought number is being reconsidered -- branchFromThought: If branching, which thought number is the branching point -- branchId: Identifier for the current branch (if any) -- needsMoreThoughts: If reaching end but realizing more thoughts needed - -You should: -1. Start with an initial estimate of needed thoughts, but be ready to adjust -2. Feel free to question or revise previous thoughts -3. Don't hesitate to add more thoughts if needed, even at the "end" -4. Express uncertainty when present -5. Mark thoughts that revise previous thinking or branch into new paths -6. Ignore information that is irrelevant to the current step -7. Generate a solution hypothesis when appropriate -8. Verify the hypothesis based on the Chain of Thought steps -9. Repeat the process until satisfied with the solution -10. Provide a single, ideally correct answer as the final output -11. Only set nextThoughtNeeded to false when truly done and a satisfactory answer is reached`, - inputSchema: { - thought: z.string().describe("Your current thinking step"), - nextThoughtNeeded: coercedBoolean.describe("Whether another thought step is needed"), - thoughtNumber: z.coerce.number().int().min(1).describe("Current thought number (numeric value, e.g., 1, 2, 3)"), - totalThoughts: z.coerce.number().int().min(1).describe("Estimated total thoughts needed (numeric value, e.g., 5, 10)"), - isRevision: coercedBoolean.optional().describe("Whether this revises previous thinking"), - revisesThought: z.coerce.number().int().min(1).optional().describe("Which thought is being reconsidered"), - branchFromThought: z.coerce.number().int().min(1).optional().describe("Branching point thought number"), - branchId: z.string().optional().describe("Branch identifier"), - needsMoreThoughts: coercedBoolean.optional().describe("If more thoughts are needed") - }, - annotations: { - readOnlyHint: true, - destructiveHint: false, - idempotentHint: true, - openWorldHint: false, - }, - outputSchema: { - thoughtNumber: z.number(), - totalThoughts: z.number(), - nextThoughtNeeded: z.boolean(), - branches: z.array(z.string()), - thoughtHistoryLength: z.number() - }, - }, - async (args) => { - const result = thinkingServer.processThought(args); - - if (result.isError) { - return result; - } - - // Parse the JSON response to get structured content - const parsedContent = JSON.parse(result.content[0].text); - - return { - content: result.content, - structuredContent: parsedContent - }; - } -); - -async function runServer() { - const transport = new StdioServerTransport(); - await server.connect(transport); - console.error("Sequential Thinking MCP Server running on stdio"); -} - -runServer().catch((error) => { - console.error("Fatal error running server:", error); - process.exit(1); -}); diff --git a/src/sequentialthinking/lib.ts b/src/sequentialthinking/lib.ts deleted file mode 100644 index 31a1098644..0000000000 --- a/src/sequentialthinking/lib.ts +++ /dev/null @@ -1,99 +0,0 @@ -import chalk from 'chalk'; - -export interface ThoughtData { - thought: string; - thoughtNumber: number; - totalThoughts: number; - isRevision?: boolean; - revisesThought?: number; - branchFromThought?: number; - branchId?: string; - needsMoreThoughts?: boolean; - nextThoughtNeeded: boolean; -} - -export class SequentialThinkingServer { - private thoughtHistory: ThoughtData[] = []; - private branches: Record = {}; - private disableThoughtLogging: boolean; - - constructor() { - this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true"; - } - - private formatThought(thoughtData: ThoughtData): string { - const { thoughtNumber, totalThoughts, thought, isRevision, revisesThought, branchFromThought, branchId } = thoughtData; - - let prefix = ''; - let context = ''; - - if (isRevision) { - prefix = chalk.yellow('🔄 Revision'); - context = ` (revising thought ${revisesThought})`; - } else if (branchFromThought) { - prefix = chalk.green('🌿 Branch'); - context = ` (from thought ${branchFromThought}, ID: ${branchId})`; - } else { - prefix = chalk.blue('💭 Thought'); - context = ''; - } - - const header = `${prefix} ${thoughtNumber}/${totalThoughts}${context}`; - const border = '─'.repeat(Math.max(header.length, thought.length) + 4); - - return ` -┌${border}┐ -│ ${header} │ -├${border}┤ -│ ${thought.padEnd(border.length - 2)} │ -└${border}┘`; - } - - public processThought(input: ThoughtData): { content: Array<{ type: "text"; text: string }>; isError?: boolean } { - try { - // Validation happens at the tool registration layer via Zod - // Adjust totalThoughts if thoughtNumber exceeds it - if (input.thoughtNumber > input.totalThoughts) { - input.totalThoughts = input.thoughtNumber; - } - - this.thoughtHistory.push(input); - - if (input.branchFromThought && input.branchId) { - if (!this.branches[input.branchId]) { - this.branches[input.branchId] = []; - } - this.branches[input.branchId].push(input); - } - - if (!this.disableThoughtLogging) { - const formattedThought = this.formatThought(input); - console.error(formattedThought); - } - - return { - content: [{ - type: "text" as const, - text: JSON.stringify({ - thoughtNumber: input.thoughtNumber, - totalThoughts: input.totalThoughts, - nextThoughtNeeded: input.nextThoughtNeeded, - branches: Object.keys(this.branches), - thoughtHistoryLength: this.thoughtHistory.length - }, null, 2) - }] - }; - } catch (error) { - return { - content: [{ - type: "text" as const, - text: JSON.stringify({ - error: error instanceof Error ? error.message : String(error), - status: 'failed' - }, null, 2) - }], - isError: true - }; - } - } -} diff --git a/src/sequentialthinking/package.json b/src/sequentialthinking/package.json deleted file mode 100644 index a668a47fd9..0000000000 --- a/src/sequentialthinking/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@modelcontextprotocol/server-sequential-thinking", - "version": "0.6.2", - "description": "MCP server for sequential thinking and problem solving", - "license": "SEE LICENSE IN LICENSE", - "mcpName": "io.github.modelcontextprotocol/server-sequential-thinking", - "author": "Model Context Protocol a Series of LF Projects, LLC.", - "homepage": "https://modelcontextprotocol.io", - "bugs": "https://github.com/modelcontextprotocol/servers/issues", - "repository": { - "type": "git", - "url": "https://github.com/modelcontextprotocol/servers.git" - }, - "type": "module", - "bin": { - "mcp-server-sequential-thinking": "dist/index.js" - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsc && shx chmod +x dist/*.js", - "prepare": "npm run build", - "watch": "tsc --watch", - "test": "vitest run --coverage" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "^1.30.0", - "chalk": "^5.3.0", - "yargs": "^17.7.2", - "zod": "^4.0.0" - }, - "devDependencies": { - "@types/node": "^22", - "@types/yargs": "^17.0.32", - "@vitest/coverage-v8": "^4.1.8", - "shx": "^0.4.0", - "typescript": "^5.3.3", - "vitest": "^4.1.8" - } -} diff --git a/src/sequentialthinking/tsconfig.json b/src/sequentialthinking/tsconfig.json deleted file mode 100644 index d2d86555b0..0000000000 --- a/src/sequentialthinking/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "." - }, - "include": [ - "./**/*.ts" - ], - "exclude": [ - "**/*.test.ts", - "vitest.config.ts" - ] -} diff --git a/src/sequentialthinking/version.ts b/src/sequentialthinking/version.ts deleted file mode 100644 index 1ab7d8f2fd..0000000000 --- a/src/sequentialthinking/version.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { createRequire } from 'node:module'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -/** - * Resolve this package's version from package.json. - * - * Works both from source (`src/sequentialthinking/`) and from the published - * layout (`dist/`), where package.json lives one directory up. - */ -export function resolvePackageVersion(): string { - const require = createRequire(import.meta.url); - const moduleDir = path.dirname(fileURLToPath(import.meta.url)); - const candidates = [ - path.join(moduleDir, 'package.json'), - path.join(moduleDir, '..', 'package.json'), - ]; - - for (const candidate of candidates) { - try { - const pkg = require(candidate) as { version?: string }; - if (pkg.version) { - return pkg.version; - } - } catch { - // Try the next candidate when running from dist/ or source. - } - } - - throw new Error('Could not locate package.json for server version'); -} - -export const SERVER_VERSION = resolvePackageVersion(); diff --git a/src/sequentialthinking/vitest.config.ts b/src/sequentialthinking/vitest.config.ts deleted file mode 100644 index d414ec8f52..0000000000 --- a/src/sequentialthinking/vitest.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vitest/config'; - -export default defineConfig({ - test: { - globals: true, - environment: 'node', - include: ['**/__tests__/**/*.test.ts'], - coverage: { - provider: 'v8', - include: ['**/*.ts'], - exclude: ['**/__tests__/**', '**/dist/**'], - }, - }, -});