sequential-thinking-mcp 1.0.0

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 ADDED
@@ -0,0 +1,167 @@
1
+ # Sequential Thinking MCP
2
+
3
+ A Model Context Protocol (MCP) server that provides sequential thinking and problem-solving tools for systematic analysis and planning.
4
+
5
+ ## Features
6
+
7
+ This MCP server provides four powerful tools for structured thinking:
8
+
9
+ ### 🧠 Sequential Thinking
10
+ Apply a systematic methodology to solve complex problems step-by-step with structured analysis phases.
11
+
12
+ ### 🔍 Problem Breakdown
13
+ Break down complex problems into smaller, manageable components across multiple levels of detail.
14
+
15
+ ### 📊 Problem Analysis
16
+ Analyze problems using proven frameworks:
17
+ - **SWOT Analysis**: Strengths, Weaknesses, Opportunities, Threats
18
+ - **Pros/Cons Analysis**: Weighted decision making
19
+ - **Root Cause Analysis**: 5 Whys and Fishbone diagrams
20
+ - **Decision Tree Analysis**: Probabilistic decision making
21
+
22
+ ### 📋 Step-by-Step Planning
23
+ Create detailed implementation plans with phases, milestones, and actionable tasks.
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ npm install -g sequential-thinking-mcp
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ### With MCP Clients
34
+
35
+ Add to your MCP client configuration:
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "sequential-thinking": {
41
+ "command": "sequential-thinking-mcp",
42
+ "args": []
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ### Available Tools
49
+
50
+ #### 1. Sequential Thinking
51
+ ```javascript
52
+ {
53
+ "name": "sequential_thinking",
54
+ "arguments": {
55
+ "problem": "How to improve team productivity",
56
+ "context": "Remote team of 10 developers",
57
+ "constraints": ["Budget limited to $5000", "Must implement in 3 months"],
58
+ "goals": ["Increase productivity by 20%", "Improve team satisfaction"]
59
+ }
60
+ }
61
+ ```
62
+
63
+ #### 2. Problem Breakdown
64
+ ```javascript
65
+ {
66
+ "name": "problem_breakdown",
67
+ "arguments": {
68
+ "problem": "Implement new customer onboarding system",
69
+ "levels": 3
70
+ }
71
+ }
72
+ ```
73
+
74
+ #### 3. Problem Analysis
75
+ ```javascript
76
+ {
77
+ "name": "analyze_problem",
78
+ "arguments": {
79
+ "problem": "High customer churn rate",
80
+ "approach": "root-cause"
81
+ }
82
+ }
83
+ ```
84
+
85
+ #### 4. Step-by-Step Planning
86
+ ```javascript
87
+ {
88
+ "name": "step_by_step_plan",
89
+ "arguments": {
90
+ "task": "Launch new product feature",
91
+ "details": true
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## Analysis Frameworks
97
+
98
+ ### SWOT Analysis
99
+ - **Strengths**: Internal positive factors
100
+ - **Weaknesses**: Internal negative factors
101
+ - **Opportunities**: External positive factors
102
+ - **Threats**: External negative factors
103
+
104
+ ### Root Cause Analysis
105
+ - **5 Whys**: Drill down to root causes
106
+ - **Fishbone Diagram**: Categorize contributing factors
107
+
108
+ ### Decision Tree Analysis
109
+ - **Probabilistic outcomes**: Assign probabilities to different scenarios
110
+ - **Expected value calculation**: Make data-driven decisions
111
+
112
+ ## Example Output
113
+
114
+ The tools provide structured, actionable analysis in markdown format, including:
115
+
116
+ - 📋 Clear problem definitions
117
+ - 🎯 Specific action items
118
+ - 📊 Structured frameworks
119
+ - ✅ Checkboxes for tracking progress
120
+ - 💡 Recommendations for next steps
121
+
122
+ ## Requirements
123
+
124
+ - Node.js 18.0.0 or higher
125
+ - MCP-compatible client (Claude Desktop, etc.)
126
+
127
+ ## Development
128
+
129
+ ```bash
130
+ # Clone the repository
131
+ git clone https://github.com/taybr99/sequential-thinking-mcp
132
+ cd sequential-thinking-mcp
133
+
134
+ # Install dependencies
135
+ npm install
136
+
137
+ # Build the project
138
+ npm run build
139
+
140
+ # Run in development mode
141
+ npm run dev
142
+ ```
143
+
144
+ ## Contributing
145
+
146
+ 1. Fork the repository
147
+ 2. Create a feature branch
148
+ 3. Make your changes
149
+ 4. Add tests if applicable
150
+ 5. Submit a pull request
151
+
152
+ ## License
153
+
154
+ MIT License - see LICENSE file for details.
155
+
156
+ ## Keywords
157
+
158
+ - MCP (Model Context Protocol)
159
+ - Sequential Thinking
160
+ - Problem Solving
161
+ - Analysis Framework
162
+ - Decision Making
163
+ - Planning
164
+ - SWOT Analysis
165
+ - Root Cause Analysis
166
+ - Project Management
167
+ - AI Tools
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/build/index.js ADDED
@@ -0,0 +1,295 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
5
+ const isValidSequentialThinkingArgs = (args) => typeof args === 'object' &&
6
+ args !== null &&
7
+ typeof args.problem === 'string' &&
8
+ (args.context === undefined || typeof args.context === 'string') &&
9
+ (args.constraints === undefined || Array.isArray(args.constraints)) &&
10
+ (args.goals === undefined || Array.isArray(args.goals));
11
+ const isValidBreakdownArgs = (args) => typeof args === 'object' &&
12
+ args !== null &&
13
+ typeof args.problem === 'string' &&
14
+ (args.levels === undefined || typeof args.levels === 'number');
15
+ const isValidAnalyzeArgs = (args) => typeof args === 'object' &&
16
+ args !== null &&
17
+ typeof args.problem === 'string' &&
18
+ (args.approach === undefined || ['swot', 'pros-cons', 'root-cause', 'decision-tree'].includes(args.approach));
19
+ const isValidStepByStepArgs = (args) => typeof args === 'object' &&
20
+ args !== null &&
21
+ typeof args.task === 'string' &&
22
+ (args.details === undefined || typeof args.details === 'boolean');
23
+ class SequentialThinkingServer {
24
+ constructor() {
25
+ this.server = new Server({
26
+ name: 'sequential-thinking-server',
27
+ version: '1.0.0',
28
+ }, {
29
+ capabilities: {
30
+ tools: {},
31
+ },
32
+ });
33
+ this.setupToolHandlers();
34
+ // Error handling
35
+ this.server.onerror = (error) => console.error('[MCP Error]', error);
36
+ process.on('SIGINT', async () => {
37
+ await this.server.close();
38
+ process.exit(0);
39
+ });
40
+ }
41
+ setupToolHandlers() {
42
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
43
+ tools: [
44
+ {
45
+ name: 'sequential_thinking',
46
+ description: 'Apply sequential thinking methodology to solve complex problems step-by-step',
47
+ inputSchema: {
48
+ type: 'object',
49
+ properties: {
50
+ problem: {
51
+ type: 'string',
52
+ description: 'The problem or challenge to analyze',
53
+ },
54
+ context: {
55
+ type: 'string',
56
+ description: 'Additional context about the problem',
57
+ },
58
+ constraints: {
59
+ type: 'array',
60
+ items: { type: 'string' },
61
+ description: 'Known constraints or limitations',
62
+ },
63
+ goals: {
64
+ type: 'array',
65
+ items: { type: 'string' },
66
+ description: 'Desired outcomes or goals',
67
+ },
68
+ },
69
+ required: ['problem'],
70
+ },
71
+ },
72
+ {
73
+ name: 'problem_breakdown',
74
+ description: 'Break down complex problems into smaller, manageable components',
75
+ inputSchema: {
76
+ type: 'object',
77
+ properties: {
78
+ problem: {
79
+ type: 'string',
80
+ description: 'The complex problem to break down',
81
+ },
82
+ levels: {
83
+ type: 'number',
84
+ description: 'Number of breakdown levels (default: 3)',
85
+ },
86
+ },
87
+ required: ['problem'],
88
+ },
89
+ },
90
+ {
91
+ name: 'analyze_problem',
92
+ description: 'Analyze problems using structured frameworks (SWOT, pros/cons, root cause, decision tree)',
93
+ inputSchema: {
94
+ type: 'object',
95
+ properties: {
96
+ problem: {
97
+ type: 'string',
98
+ description: 'The problem to analyze',
99
+ },
100
+ approach: {
101
+ type: 'string',
102
+ enum: ['swot', 'pros-cons', 'root-cause', 'decision-tree'],
103
+ description: 'Analysis framework to use',
104
+ },
105
+ },
106
+ required: ['problem'],
107
+ },
108
+ },
109
+ {
110
+ name: 'step_by_step_plan',
111
+ description: 'Create a detailed step-by-step plan for executing a task or solving a problem',
112
+ inputSchema: {
113
+ type: 'object',
114
+ properties: {
115
+ task: {
116
+ type: 'string',
117
+ description: 'The task or problem to create a plan for',
118
+ },
119
+ details: {
120
+ type: 'boolean',
121
+ description: 'Include detailed sub-steps and considerations',
122
+ },
123
+ },
124
+ required: ['task'],
125
+ },
126
+ },
127
+ ],
128
+ }));
129
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
130
+ try {
131
+ switch (request.params.name) {
132
+ case 'sequential_thinking':
133
+ if (!isValidSequentialThinkingArgs(request.params.arguments)) {
134
+ throw new McpError(ErrorCode.InvalidParams, 'Invalid sequential thinking arguments');
135
+ }
136
+ return await this.sequentialThinking(request.params.arguments);
137
+ case 'problem_breakdown':
138
+ if (!isValidBreakdownArgs(request.params.arguments)) {
139
+ throw new McpError(ErrorCode.InvalidParams, 'Invalid problem breakdown arguments');
140
+ }
141
+ return await this.problemBreakdown(request.params.arguments);
142
+ case 'analyze_problem':
143
+ if (!isValidAnalyzeArgs(request.params.arguments)) {
144
+ throw new McpError(ErrorCode.InvalidParams, 'Invalid analyze problem arguments');
145
+ }
146
+ return await this.analyzeProblem(request.params.arguments);
147
+ case 'step_by_step_plan':
148
+ if (!isValidStepByStepArgs(request.params.arguments)) {
149
+ throw new McpError(ErrorCode.InvalidParams, 'Invalid step by step plan arguments');
150
+ }
151
+ return await this.stepByStepPlan(request.params.arguments);
152
+ default:
153
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
154
+ }
155
+ }
156
+ catch (error) {
157
+ console.error('Tool execution error:', error);
158
+ return {
159
+ content: [
160
+ {
161
+ type: 'text',
162
+ text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
163
+ },
164
+ ],
165
+ isError: true,
166
+ };
167
+ }
168
+ });
169
+ }
170
+ async sequentialThinking(args) {
171
+ const { problem, context, constraints, goals } = args;
172
+ const sections = [
173
+ '# Sequential Thinking Analysis',
174
+ '',
175
+ '## Problem Definition',
176
+ `**Problem**: ${problem}`,
177
+ ];
178
+ if (context) {
179
+ sections.push(`**Context**: ${context}`);
180
+ }
181
+ if (constraints && constraints.length > 0) {
182
+ sections.push('**Constraints**:');
183
+ constraints.forEach(constraint => sections.push(`- ${constraint}`));
184
+ }
185
+ if (goals && goals.length > 0) {
186
+ sections.push('**Goals**:');
187
+ goals.forEach(goal => sections.push(`- ${goal}`));
188
+ }
189
+ sections.push('', '## Step-by-Step Analysis', '', '### Step 1: Information Gathering', '- What information do we have?', '- What information do we need?', '- What assumptions are we making?', '', '### Step 2: Problem Decomposition', '- Break the problem into smaller parts', '- Identify dependencies between parts', '- Prioritize components by importance/urgency', '', '### Step 3: Solution Generation', '- Brainstorm potential approaches', '- Consider multiple perspectives', '- Evaluate feasibility of each approach', '', '### Step 4: Solution Evaluation', '- Compare solutions against goals', '- Assess risks and benefits', '- Consider resource requirements', '', '### Step 5: Implementation Planning', '- Define clear next steps', '- Identify required resources', '- Set milestones and checkpoints', '', '### Step 6: Monitoring and Adjustment', '- Define success metrics', '- Plan for regular reviews', '- Prepare contingency plans', '', '## Recommended Next Actions', '1. **Immediate**: Gather additional information if needed', '2. **Short-term**: Break down the problem further using problem_breakdown tool', '3. **Medium-term**: Analyze specific aspects using analyze_problem tool', '4. **Long-term**: Create detailed implementation plan using step_by_step_plan tool');
190
+ return {
191
+ content: [
192
+ {
193
+ type: 'text',
194
+ text: sections.join('\n'),
195
+ },
196
+ ],
197
+ };
198
+ }
199
+ async problemBreakdown(args) {
200
+ const { problem, levels = 3 } = args;
201
+ const sections = [
202
+ '# Problem Breakdown Analysis',
203
+ '',
204
+ `**Main Problem**: ${problem}`,
205
+ ''
206
+ ];
207
+ for (let level = 1; level <= levels; level++) {
208
+ sections.push(`## Level ${level} Breakdown`);
209
+ switch (level) {
210
+ case 1:
211
+ sections.push('### Primary Components', '- **Technical aspects**: What technical challenges need to be addressed?', '- **Human factors**: What people-related issues are involved?', '- **Process elements**: What processes need to be considered?', '- **Resource requirements**: What resources are needed?', '- **External dependencies**: What external factors affect this problem?', '');
212
+ break;
213
+ case 2:
214
+ sections.push('### Secondary Components', '**Technical Aspects**:', '- System requirements and constraints', '- Integration challenges', '- Performance considerations', '', '**Human Factors**:', '- Stakeholder needs and expectations', '- Skills and training requirements', '- Communication needs', '', '**Process Elements**:', '- Workflow design', '- Quality assurance', '- Risk management', '', '**Resource Requirements**:', '- Budget and financial considerations', '- Time constraints', '- Equipment and tools', '', '**External Dependencies**:', '- Third-party services', '- Regulatory requirements', '- Market conditions', '');
215
+ break;
216
+ case 3:
217
+ sections.push('### Detailed Components', '**Immediate Actions Required**:', '- Research and analysis tasks', '- Stakeholder consultations', '- Resource allocation decisions', '', '**Short-term Objectives**:', '- Proof of concept development', '- Team formation and training', '- Initial implementation steps', '', '**Long-term Goals**:', '- Full solution deployment', '- Performance optimization', '- Maintenance and support', '');
218
+ break;
219
+ }
220
+ }
221
+ sections.push('## Summary', 'Use this breakdown to:', '- Focus on one component at a time', '- Identify critical path dependencies', '- Assign responsibilities to team members', '- Create detailed project timelines', '- Monitor progress systematically');
222
+ return {
223
+ content: [
224
+ {
225
+ type: 'text',
226
+ text: sections.join('\n'),
227
+ },
228
+ ],
229
+ };
230
+ }
231
+ async analyzeProblem(args) {
232
+ const { problem, approach = 'swot' } = args;
233
+ const sections = [
234
+ '# Problem Analysis',
235
+ '',
236
+ `**Problem**: ${problem}`,
237
+ `**Analysis Method**: ${approach.toUpperCase()}`,
238
+ ''
239
+ ];
240
+ switch (approach) {
241
+ case 'swot':
242
+ sections.push('## SWOT Analysis', '', '### Strengths', '- What advantages do we have?', '- What do we do well?', '- What resources do we have access to?', '- What others see as our strengths?', '', '### Weaknesses', '- What could we improve?', '- What do we do poorly?', '- What should we avoid?', '- What factors lose us opportunities?', '', '### Opportunities', '- What opportunities are available?', '- What trends could we take advantage of?', '- How can we turn strengths into opportunities?', '- What changes in environment could benefit us?', '', '### Threats', '- What threats could harm us?', '- What is our competition doing?', '- What obstacles do we face?', '- What changes in environment could threaten us?');
243
+ break;
244
+ case 'pros-cons':
245
+ sections.push('## Pros and Cons Analysis', '', '### Pros (Advantages)', '- **Benefit 1**: [Describe specific advantage]', '- **Benefit 2**: [Describe specific advantage]', '- **Benefit 3**: [Describe specific advantage]', '', '### Cons (Disadvantages)', '- **Risk 1**: [Describe specific disadvantage]', '- **Risk 2**: [Describe specific disadvantage]', '- **Risk 3**: [Describe specific disadvantage]', '', '### Neutral Factors', '- **Factor 1**: [Neither advantage nor disadvantage]', '- **Factor 2**: [Depends on implementation]', '', '### Decision Matrix', '- Weight each pro and con by importance (1-10)', '- Calculate total weighted score', '- Compare with alternatives');
246
+ break;
247
+ case 'root-cause':
248
+ sections.push('## Root Cause Analysis', '', '### Problem Symptoms', '- What are the visible effects?', '- When do these symptoms occur?', '- Who is affected by these symptoms?', '', '### 5 Whys Analysis', '1. **Why** does this problem occur?', ' - [First level cause]', '2. **Why** does that cause occur?', ' - [Second level cause]', '3. **Why** does that cause occur?', ' - [Third level cause]', '4. **Why** does that cause occur?', ' - [Fourth level cause]', '5. **Why** does that cause occur?', ' - [Root cause]', '', '### Fishbone Diagram Categories', '**People**: Human factors contributing to the problem', '**Process**: Procedural issues', '**Technology**: Technical or equipment issues', '**Environment**: External factors', '**Materials**: Resource-related issues', '**Measurement**: Data or metric issues');
249
+ break;
250
+ case 'decision-tree':
251
+ sections.push('## Decision Tree Analysis', '', '### Decision Points', '```', 'Problem: [Main Problem]', '├── Option A: [First major choice]', '│ ├── Outcome A1: [Possible result]', '│ │ ├── Probability: [%]', '│ │ └── Impact: [High/Medium/Low]', '│ └── Outcome A2: [Possible result]', '│ ├── Probability: [%]', '│ └── Impact: [High/Medium/Low]', '├── Option B: [Second major choice]', '│ ├── Outcome B1: [Possible result]', '│ │ ├── Probability: [%]', '│ │ └── Impact: [High/Medium/Low]', '│ └── Outcome B2: [Possible result]', '│ ├── Probability: [%]', '│ └── Impact: [High/Medium/Low]', '└── Option C: [Third major choice]', ' └── [Continue pattern...]', '```', '', '### Expected Value Calculation', '- **Option A**: (Probability A1 × Impact A1) + (Probability A2 × Impact A2)', '- **Option B**: (Probability B1 × Impact B1) + (Probability B2 × Impact B2)', '- **Option C**: [Continue calculation...]', '', '### Recommended Decision', '- Compare expected values', '- Consider risk tolerance', '- Account for qualitative factors');
252
+ break;
253
+ }
254
+ return {
255
+ content: [
256
+ {
257
+ type: 'text',
258
+ text: sections.join('\n'),
259
+ },
260
+ ],
261
+ };
262
+ }
263
+ async stepByStepPlan(args) {
264
+ const { task, details = false } = args;
265
+ const sections = [
266
+ '# Step-by-Step Implementation Plan',
267
+ '',
268
+ `**Task**: ${task}`,
269
+ ''
270
+ ];
271
+ if (details) {
272
+ sections.push('## Phase 1: Planning and Preparation', '### Step 1: Define Objectives', '- [ ] Clarify the end goal', '- [ ] Identify success criteria', '- [ ] Set measurable milestones', '- [ ] Determine timeline', '', '### Step 2: Gather Resources', '- [ ] Identify required skills', '- [ ] Allocate team members', '- [ ] Secure necessary tools', '- [ ] Confirm budget availability', '', '### Step 3: Risk Assessment', '- [ ] Identify potential obstacles', '- [ ] Develop mitigation strategies', '- [ ] Create contingency plans', '- [ ] Establish communication protocols', '', '## Phase 2: Execution', '### Step 4: Initial Implementation', '- [ ] Begin with pilot or prototype', '- [ ] Test core functionality', '- [ ] Gather initial feedback', '- [ ] Make necessary adjustments', '', '### Step 5: Full Deployment', '- [ ] Roll out complete solution', '- [ ] Monitor performance metrics', '- [ ] Address issues promptly', '- [ ] Document lessons learned', '', '### Step 6: Optimization', '- [ ] Analyze performance data', '- [ ] Identify improvement opportunities', '- [ ] Implement optimizations', '- [ ] Validate improvements', '', '## Phase 3: Maintenance and Review', '### Step 7: Ongoing Maintenance', '- [ ] Establish maintenance schedule', '- [ ] Train support team', '- [ ] Create documentation', '- [ ] Set up monitoring systems', '', '### Step 8: Performance Review', '- [ ] Measure against objectives', '- [ ] Gather stakeholder feedback', '- [ ] Identify areas for improvement', '- [ ] Plan future enhancements');
273
+ }
274
+ else {
275
+ sections.push('## High-Level Steps', '1. **Plan**: Define objectives and gather resources', '2. **Prepare**: Set up environment and tools', '3. **Execute**: Implement the solution step by step', '4. **Test**: Validate functionality and performance', '5. **Deploy**: Roll out to production or final environment', '6. **Monitor**: Track performance and gather feedback', '7. **Optimize**: Make improvements based on data', '8. **Maintain**: Provide ongoing support and updates', '', '## Next Steps', '- Break down each high-level step into specific tasks', '- Assign owners and deadlines to each task', '- Create a project timeline with dependencies', '- Set up regular check-ins and progress reviews');
276
+ }
277
+ sections.push('', '## Success Metrics', '- **Quality**: Define what "done" looks like', '- **Timeline**: Track progress against milestones', '- **Budget**: Monitor resource utilization', '- **Stakeholder Satisfaction**: Gather feedback regularly', '', '## Tips for Success', '- Start small and iterate', '- Communicate progress regularly', '- Be prepared to adapt the plan', '- Document decisions and lessons learned', '- Celebrate milestones and achievements');
278
+ return {
279
+ content: [
280
+ {
281
+ type: 'text',
282
+ text: sections.join('\n'),
283
+ },
284
+ ],
285
+ };
286
+ }
287
+ async run() {
288
+ const transport = new StdioServerTransport();
289
+ await this.server.connect(transport);
290
+ console.error('Sequential Thinking MCP server running on stdio');
291
+ }
292
+ }
293
+ const server = new SequentialThinkingServer();
294
+ server.run().catch(console.error);
295
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAwB5C,MAAM,6BAA6B,GAAG,CAAC,IAAS,EAAkC,EAAE,CAClF,OAAO,IAAI,KAAK,QAAQ;IACxB,IAAI,KAAK,IAAI;IACb,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;IAChC,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC;IAChE,C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KAAK,CAAC,iDAAiD,CAAC,CAAC;IACnE,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "sequential-thinking-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for sequential thinking and problem solving",
5
+ "main": "build/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "sequential-thinking-mcp": "build/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
12
+ "dev": "tsc --watch",
13
+ "start": "node build/index.js",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.15.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^20.0.0",
21
+ "typescript": "^5.0.0"
22
+ },
23
+ "keywords": [
24
+ "mcp",
25
+ "sequential-thinking",
26
+ "problem-solving",
27
+ "model-context-protocol",
28
+ "claude",
29
+ "ai",
30
+ "reasoning"
31
+ ],
32
+ "author": "taybr99",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/taybr99/sequential-thinking-mcp"
37
+ },
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ }
41
+ }
package/src/index.ts ADDED
@@ -0,0 +1,670 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import {
5
+ CallToolRequestSchema,
6
+ ErrorCode,
7
+ ListToolsRequestSchema,
8
+ McpError,
9
+ } from '@modelcontextprotocol/sdk/types.js';
10
+
11
+ interface SequentialThinkingArgs {
12
+ problem: string;
13
+ context?: string;
14
+ constraints?: string[];
15
+ goals?: string[];
16
+ }
17
+
18
+ interface BreakdownArgs {
19
+ problem: string;
20
+ levels?: number;
21
+ }
22
+
23
+ interface AnalyzeArgs {
24
+ problem: string;
25
+ approach?: 'swot' | 'pros-cons' | 'root-cause' | 'decision-tree';
26
+ }
27
+
28
+ interface StepByStepArgs {
29
+ task: string;
30
+ details?: boolean;
31
+ }
32
+
33
+ const isValidSequentialThinkingArgs = (args: any): args is SequentialThinkingArgs =>
34
+ typeof args === 'object' &&
35
+ args !== null &&
36
+ typeof args.problem === 'string' &&
37
+ (args.context === undefined || typeof args.context === 'string') &&
38
+ (args.constraints === undefined || Array.isArray(args.constraints)) &&
39
+ (args.goals === undefined || Array.isArray(args.goals));
40
+
41
+ const isValidBreakdownArgs = (args: any): args is BreakdownArgs =>
42
+ typeof args === 'object' &&
43
+ args !== null &&
44
+ typeof args.problem === 'string' &&
45
+ (args.levels === undefined || typeof args.levels === 'number');
46
+
47
+ const isValidAnalyzeArgs = (args: any): args is AnalyzeArgs =>
48
+ typeof args === 'object' &&
49
+ args !== null &&
50
+ typeof args.problem === 'string' &&
51
+ (args.approach === undefined || ['swot', 'pros-cons', 'root-cause', 'decision-tree'].includes(args.approach));
52
+
53
+ const isValidStepByStepArgs = (args: any): args is StepByStepArgs =>
54
+ typeof args === 'object' &&
55
+ args !== null &&
56
+ typeof args.task === 'string' &&
57
+ (args.details === undefined || typeof args.details === 'boolean');
58
+
59
+ class SequentialThinkingServer {
60
+ private server: Server;
61
+
62
+ constructor() {
63
+ this.server = new Server(
64
+ {
65
+ name: 'sequential-thinking-server',
66
+ version: '1.0.0',
67
+ },
68
+ {
69
+ capabilities: {
70
+ tools: {},
71
+ },
72
+ }
73
+ );
74
+
75
+ this.setupToolHandlers();
76
+
77
+ // Error handling
78
+ this.server.onerror = (error) => console.error('[MCP Error]', error);
79
+ process.on('SIGINT', async () => {
80
+ await this.server.close();
81
+ process.exit(0);
82
+ });
83
+ }
84
+
85
+ private setupToolHandlers() {
86
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
87
+ tools: [
88
+ {
89
+ name: 'sequential_thinking',
90
+ description: 'Apply sequential thinking methodology to solve complex problems step-by-step',
91
+ inputSchema: {
92
+ type: 'object',
93
+ properties: {
94
+ problem: {
95
+ type: 'string',
96
+ description: 'The problem or challenge to analyze',
97
+ },
98
+ context: {
99
+ type: 'string',
100
+ description: 'Additional context about the problem',
101
+ },
102
+ constraints: {
103
+ type: 'array',
104
+ items: { type: 'string' },
105
+ description: 'Known constraints or limitations',
106
+ },
107
+ goals: {
108
+ type: 'array',
109
+ items: { type: 'string' },
110
+ description: 'Desired outcomes or goals',
111
+ },
112
+ },
113
+ required: ['problem'],
114
+ },
115
+ },
116
+ {
117
+ name: 'problem_breakdown',
118
+ description: 'Break down complex problems into smaller, manageable components',
119
+ inputSchema: {
120
+ type: 'object',
121
+ properties: {
122
+ problem: {
123
+ type: 'string',
124
+ description: 'The complex problem to break down',
125
+ },
126
+ levels: {
127
+ type: 'number',
128
+ description: 'Number of breakdown levels (default: 3)',
129
+ },
130
+ },
131
+ required: ['problem'],
132
+ },
133
+ },
134
+ {
135
+ name: 'analyze_problem',
136
+ description: 'Analyze problems using structured frameworks (SWOT, pros/cons, root cause, decision tree)',
137
+ inputSchema: {
138
+ type: 'object',
139
+ properties: {
140
+ problem: {
141
+ type: 'string',
142
+ description: 'The problem to analyze',
143
+ },
144
+ approach: {
145
+ type: 'string',
146
+ enum: ['swot', 'pros-cons', 'root-cause', 'decision-tree'],
147
+ description: 'Analysis framework to use',
148
+ },
149
+ },
150
+ required: ['problem'],
151
+ },
152
+ },
153
+ {
154
+ name: 'step_by_step_plan',
155
+ description: 'Create a detailed step-by-step plan for executing a task or solving a problem',
156
+ inputSchema: {
157
+ type: 'object',
158
+ properties: {
159
+ task: {
160
+ type: 'string',
161
+ description: 'The task or problem to create a plan for',
162
+ },
163
+ details: {
164
+ type: 'boolean',
165
+ description: 'Include detailed sub-steps and considerations',
166
+ },
167
+ },
168
+ required: ['task'],
169
+ },
170
+ },
171
+ ],
172
+ }));
173
+
174
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
175
+ try {
176
+ switch (request.params.name) {
177
+ case 'sequential_thinking':
178
+ if (!isValidSequentialThinkingArgs(request.params.arguments)) {
179
+ throw new McpError(
180
+ ErrorCode.InvalidParams,
181
+ 'Invalid sequential thinking arguments'
182
+ );
183
+ }
184
+ return await this.sequentialThinking(request.params.arguments);
185
+
186
+ case 'problem_breakdown':
187
+ if (!isValidBreakdownArgs(request.params.arguments)) {
188
+ throw new McpError(
189
+ ErrorCode.InvalidParams,
190
+ 'Invalid problem breakdown arguments'
191
+ );
192
+ }
193
+ return await this.problemBreakdown(request.params.arguments);
194
+
195
+ case 'analyze_problem':
196
+ if (!isValidAnalyzeArgs(request.params.arguments)) {
197
+ throw new McpError(
198
+ ErrorCode.InvalidParams,
199
+ 'Invalid analyze problem arguments'
200
+ );
201
+ }
202
+ return await this.analyzeProblem(request.params.arguments);
203
+
204
+ case 'step_by_step_plan':
205
+ if (!isValidStepByStepArgs(request.params.arguments)) {
206
+ throw new McpError(
207
+ ErrorCode.InvalidParams,
208
+ 'Invalid step by step plan arguments'
209
+ );
210
+ }
211
+ return await this.stepByStepPlan(request.params.arguments);
212
+
213
+ default:
214
+ throw new McpError(
215
+ ErrorCode.MethodNotFound,
216
+ `Unknown tool: ${request.params.name}`
217
+ );
218
+ }
219
+ } catch (error) {
220
+ console.error('Tool execution error:', error);
221
+ return {
222
+ content: [
223
+ {
224
+ type: 'text',
225
+ text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
226
+ },
227
+ ],
228
+ isError: true,
229
+ };
230
+ }
231
+ });
232
+ }
233
+
234
+ private async sequentialThinking(args: SequentialThinkingArgs) {
235
+ const { problem, context, constraints, goals } = args;
236
+
237
+ const sections = [
238
+ '# Sequential Thinking Analysis',
239
+ '',
240
+ '## Problem Definition',
241
+ `**Problem**: ${problem}`,
242
+ ];
243
+
244
+ if (context) {
245
+ sections.push(`**Context**: ${context}`);
246
+ }
247
+
248
+ if (constraints && constraints.length > 0) {
249
+ sections.push('**Constraints**:');
250
+ constraints.forEach(constraint => sections.push(`- ${constraint}`));
251
+ }
252
+
253
+ if (goals && goals.length > 0) {
254
+ sections.push('**Goals**:');
255
+ goals.forEach(goal => sections.push(`- ${goal}`));
256
+ }
257
+
258
+ sections.push(
259
+ '',
260
+ '## Step-by-Step Analysis',
261
+ '',
262
+ '### Step 1: Information Gathering',
263
+ '- What information do we have?',
264
+ '- What information do we need?',
265
+ '- What assumptions are we making?',
266
+ '',
267
+ '### Step 2: Problem Decomposition',
268
+ '- Break the problem into smaller parts',
269
+ '- Identify dependencies between parts',
270
+ '- Prioritize components by importance/urgency',
271
+ '',
272
+ '### Step 3: Solution Generation',
273
+ '- Brainstorm potential approaches',
274
+ '- Consider multiple perspectives',
275
+ '- Evaluate feasibility of each approach',
276
+ '',
277
+ '### Step 4: Solution Evaluation',
278
+ '- Compare solutions against goals',
279
+ '- Assess risks and benefits',
280
+ '- Consider resource requirements',
281
+ '',
282
+ '### Step 5: Implementation Planning',
283
+ '- Define clear next steps',
284
+ '- Identify required resources',
285
+ '- Set milestones and checkpoints',
286
+ '',
287
+ '### Step 6: Monitoring and Adjustment',
288
+ '- Define success metrics',
289
+ '- Plan for regular reviews',
290
+ '- Prepare contingency plans',
291
+ '',
292
+ '## Recommended Next Actions',
293
+ '1. **Immediate**: Gather additional information if needed',
294
+ '2. **Short-term**: Break down the problem further using problem_breakdown tool',
295
+ '3. **Medium-term**: Analyze specific aspects using analyze_problem tool',
296
+ '4. **Long-term**: Create detailed implementation plan using step_by_step_plan tool'
297
+ );
298
+
299
+ return {
300
+ content: [
301
+ {
302
+ type: 'text',
303
+ text: sections.join('\n'),
304
+ },
305
+ ],
306
+ };
307
+ }
308
+
309
+ private async problemBreakdown(args: BreakdownArgs) {
310
+ const { problem, levels = 3 } = args;
311
+
312
+ const sections = [
313
+ '# Problem Breakdown Analysis',
314
+ '',
315
+ `**Main Problem**: ${problem}`,
316
+ ''
317
+ ];
318
+
319
+ for (let level = 1; level <= levels; level++) {
320
+ sections.push(`## Level ${level} Breakdown`);
321
+
322
+ switch (level) {
323
+ case 1:
324
+ sections.push(
325
+ '### Primary Components',
326
+ '- **Technical aspects**: What technical challenges need to be addressed?',
327
+ '- **Human factors**: What people-related issues are involved?',
328
+ '- **Process elements**: What processes need to be considered?',
329
+ '- **Resource requirements**: What resources are needed?',
330
+ '- **External dependencies**: What external factors affect this problem?',
331
+ ''
332
+ );
333
+ break;
334
+ case 2:
335
+ sections.push(
336
+ '### Secondary Components',
337
+ '**Technical Aspects**:',
338
+ '- System requirements and constraints',
339
+ '- Integration challenges',
340
+ '- Performance considerations',
341
+ '',
342
+ '**Human Factors**:',
343
+ '- Stakeholder needs and expectations',
344
+ '- Skills and training requirements',
345
+ '- Communication needs',
346
+ '',
347
+ '**Process Elements**:',
348
+ '- Workflow design',
349
+ '- Quality assurance',
350
+ '- Risk management',
351
+ '',
352
+ '**Resource Requirements**:',
353
+ '- Budget and financial considerations',
354
+ '- Time constraints',
355
+ '- Equipment and tools',
356
+ '',
357
+ '**External Dependencies**:',
358
+ '- Third-party services',
359
+ '- Regulatory requirements',
360
+ '- Market conditions',
361
+ ''
362
+ );
363
+ break;
364
+ case 3:
365
+ sections.push(
366
+ '### Detailed Components',
367
+ '**Immediate Actions Required**:',
368
+ '- Research and analysis tasks',
369
+ '- Stakeholder consultations',
370
+ '- Resource allocation decisions',
371
+ '',
372
+ '**Short-term Objectives**:',
373
+ '- Proof of concept development',
374
+ '- Team formation and training',
375
+ '- Initial implementation steps',
376
+ '',
377
+ '**Long-term Goals**:',
378
+ '- Full solution deployment',
379
+ '- Performance optimization',
380
+ '- Maintenance and support',
381
+ ''
382
+ );
383
+ break;
384
+ }
385
+ }
386
+
387
+ sections.push(
388
+ '## Summary',
389
+ 'Use this breakdown to:',
390
+ '- Focus on one component at a time',
391
+ '- Identify critical path dependencies',
392
+ '- Assign responsibilities to team members',
393
+ '- Create detailed project timelines',
394
+ '- Monitor progress systematically'
395
+ );
396
+
397
+ return {
398
+ content: [
399
+ {
400
+ type: 'text',
401
+ text: sections.join('\n'),
402
+ },
403
+ ],
404
+ };
405
+ }
406
+
407
+ private async analyzeProblem(args: AnalyzeArgs) {
408
+ const { problem, approach = 'swot' } = args;
409
+
410
+ const sections = [
411
+ '# Problem Analysis',
412
+ '',
413
+ `**Problem**: ${problem}`,
414
+ `**Analysis Method**: ${approach.toUpperCase()}`,
415
+ ''
416
+ ];
417
+
418
+ switch (approach) {
419
+ case 'swot':
420
+ sections.push(
421
+ '## SWOT Analysis',
422
+ '',
423
+ '### Strengths',
424
+ '- What advantages do we have?',
425
+ '- What do we do well?',
426
+ '- What resources do we have access to?',
427
+ '- What others see as our strengths?',
428
+ '',
429
+ '### Weaknesses',
430
+ '- What could we improve?',
431
+ '- What do we do poorly?',
432
+ '- What should we avoid?',
433
+ '- What factors lose us opportunities?',
434
+ '',
435
+ '### Opportunities',
436
+ '- What opportunities are available?',
437
+ '- What trends could we take advantage of?',
438
+ '- How can we turn strengths into opportunities?',
439
+ '- What changes in environment could benefit us?',
440
+ '',
441
+ '### Threats',
442
+ '- What threats could harm us?',
443
+ '- What is our competition doing?',
444
+ '- What obstacles do we face?',
445
+ '- What changes in environment could threaten us?'
446
+ );
447
+ break;
448
+
449
+ case 'pros-cons':
450
+ sections.push(
451
+ '## Pros and Cons Analysis',
452
+ '',
453
+ '### Pros (Advantages)',
454
+ '- **Benefit 1**: [Describe specific advantage]',
455
+ '- **Benefit 2**: [Describe specific advantage]',
456
+ '- **Benefit 3**: [Describe specific advantage]',
457
+ '',
458
+ '### Cons (Disadvantages)',
459
+ '- **Risk 1**: [Describe specific disadvantage]',
460
+ '- **Risk 2**: [Describe specific disadvantage]',
461
+ '- **Risk 3**: [Describe specific disadvantage]',
462
+ '',
463
+ '### Neutral Factors',
464
+ '- **Factor 1**: [Neither advantage nor disadvantage]',
465
+ '- **Factor 2**: [Depends on implementation]',
466
+ '',
467
+ '### Decision Matrix',
468
+ '- Weight each pro and con by importance (1-10)',
469
+ '- Calculate total weighted score',
470
+ '- Compare with alternatives'
471
+ );
472
+ break;
473
+
474
+ case 'root-cause':
475
+ sections.push(
476
+ '## Root Cause Analysis',
477
+ '',
478
+ '### Problem Symptoms',
479
+ '- What are the visible effects?',
480
+ '- When do these symptoms occur?',
481
+ '- Who is affected by these symptoms?',
482
+ '',
483
+ '### 5 Whys Analysis',
484
+ '1. **Why** does this problem occur?',
485
+ ' - [First level cause]',
486
+ '2. **Why** does that cause occur?',
487
+ ' - [Second level cause]',
488
+ '3. **Why** does that cause occur?',
489
+ ' - [Third level cause]',
490
+ '4. **Why** does that cause occur?',
491
+ ' - [Fourth level cause]',
492
+ '5. **Why** does that cause occur?',
493
+ ' - [Root cause]',
494
+ '',
495
+ '### Fishbone Diagram Categories',
496
+ '**People**: Human factors contributing to the problem',
497
+ '**Process**: Procedural issues',
498
+ '**Technology**: Technical or equipment issues',
499
+ '**Environment**: External factors',
500
+ '**Materials**: Resource-related issues',
501
+ '**Measurement**: Data or metric issues'
502
+ );
503
+ break;
504
+
505
+ case 'decision-tree':
506
+ sections.push(
507
+ '## Decision Tree Analysis',
508
+ '',
509
+ '### Decision Points',
510
+ '```',
511
+ 'Problem: [Main Problem]',
512
+ '├── Option A: [First major choice]',
513
+ '│ ├── Outcome A1: [Possible result]',
514
+ '│ │ ├── Probability: [%]',
515
+ '│ │ └── Impact: [High/Medium/Low]',
516
+ '│ └── Outcome A2: [Possible result]',
517
+ '│ ├── Probability: [%]',
518
+ '│ └── Impact: [High/Medium/Low]',
519
+ '├── Option B: [Second major choice]',
520
+ '│ ├── Outcome B1: [Possible result]',
521
+ '│ │ ├── Probability: [%]',
522
+ '│ │ └── Impact: [High/Medium/Low]',
523
+ '│ └── Outcome B2: [Possible result]',
524
+ '│ ├── Probability: [%]',
525
+ '│ └── Impact: [High/Medium/Low]',
526
+ '└── Option C: [Third major choice]',
527
+ ' └── [Continue pattern...]',
528
+ '```',
529
+ '',
530
+ '### Expected Value Calculation',
531
+ '- **Option A**: (Probability A1 × Impact A1) + (Probability A2 × Impact A2)',
532
+ '- **Option B**: (Probability B1 × Impact B1) + (Probability B2 × Impact B2)',
533
+ '- **Option C**: [Continue calculation...]',
534
+ '',
535
+ '### Recommended Decision',
536
+ '- Compare expected values',
537
+ '- Consider risk tolerance',
538
+ '- Account for qualitative factors'
539
+ );
540
+ break;
541
+ }
542
+
543
+ return {
544
+ content: [
545
+ {
546
+ type: 'text',
547
+ text: sections.join('\n'),
548
+ },
549
+ ],
550
+ };
551
+ }
552
+
553
+ private async stepByStepPlan(args: StepByStepArgs) {
554
+ const { task, details = false } = args;
555
+
556
+ const sections = [
557
+ '# Step-by-Step Implementation Plan',
558
+ '',
559
+ `**Task**: ${task}`,
560
+ ''
561
+ ];
562
+
563
+ if (details) {
564
+ sections.push(
565
+ '## Phase 1: Planning and Preparation',
566
+ '### Step 1: Define Objectives',
567
+ '- [ ] Clarify the end goal',
568
+ '- [ ] Identify success criteria',
569
+ '- [ ] Set measurable milestones',
570
+ '- [ ] Determine timeline',
571
+ '',
572
+ '### Step 2: Gather Resources',
573
+ '- [ ] Identify required skills',
574
+ '- [ ] Allocate team members',
575
+ '- [ ] Secure necessary tools',
576
+ '- [ ] Confirm budget availability',
577
+ '',
578
+ '### Step 3: Risk Assessment',
579
+ '- [ ] Identify potential obstacles',
580
+ '- [ ] Develop mitigation strategies',
581
+ '- [ ] Create contingency plans',
582
+ '- [ ] Establish communication protocols',
583
+ '',
584
+ '## Phase 2: Execution',
585
+ '### Step 4: Initial Implementation',
586
+ '- [ ] Begin with pilot or prototype',
587
+ '- [ ] Test core functionality',
588
+ '- [ ] Gather initial feedback',
589
+ '- [ ] Make necessary adjustments',
590
+ '',
591
+ '### Step 5: Full Deployment',
592
+ '- [ ] Roll out complete solution',
593
+ '- [ ] Monitor performance metrics',
594
+ '- [ ] Address issues promptly',
595
+ '- [ ] Document lessons learned',
596
+ '',
597
+ '### Step 6: Optimization',
598
+ '- [ ] Analyze performance data',
599
+ '- [ ] Identify improvement opportunities',
600
+ '- [ ] Implement optimizations',
601
+ '- [ ] Validate improvements',
602
+ '',
603
+ '## Phase 3: Maintenance and Review',
604
+ '### Step 7: Ongoing Maintenance',
605
+ '- [ ] Establish maintenance schedule',
606
+ '- [ ] Train support team',
607
+ '- [ ] Create documentation',
608
+ '- [ ] Set up monitoring systems',
609
+ '',
610
+ '### Step 8: Performance Review',
611
+ '- [ ] Measure against objectives',
612
+ '- [ ] Gather stakeholder feedback',
613
+ '- [ ] Identify areas for improvement',
614
+ '- [ ] Plan future enhancements'
615
+ );
616
+ } else {
617
+ sections.push(
618
+ '## High-Level Steps',
619
+ '1. **Plan**: Define objectives and gather resources',
620
+ '2. **Prepare**: Set up environment and tools',
621
+ '3. **Execute**: Implement the solution step by step',
622
+ '4. **Test**: Validate functionality and performance',
623
+ '5. **Deploy**: Roll out to production or final environment',
624
+ '6. **Monitor**: Track performance and gather feedback',
625
+ '7. **Optimize**: Make improvements based on data',
626
+ '8. **Maintain**: Provide ongoing support and updates',
627
+ '',
628
+ '## Next Steps',
629
+ '- Break down each high-level step into specific tasks',
630
+ '- Assign owners and deadlines to each task',
631
+ '- Create a project timeline with dependencies',
632
+ '- Set up regular check-ins and progress reviews'
633
+ );
634
+ }
635
+
636
+ sections.push(
637
+ '',
638
+ '## Success Metrics',
639
+ '- **Quality**: Define what "done" looks like',
640
+ '- **Timeline**: Track progress against milestones',
641
+ '- **Budget**: Monitor resource utilization',
642
+ '- **Stakeholder Satisfaction**: Gather feedback regularly',
643
+ '',
644
+ '## Tips for Success',
645
+ '- Start small and iterate',
646
+ '- Communicate progress regularly',
647
+ '- Be prepared to adapt the plan',
648
+ '- Document decisions and lessons learned',
649
+ '- Celebrate milestones and achievements'
650
+ );
651
+
652
+ return {
653
+ content: [
654
+ {
655
+ type: 'text',
656
+ text: sections.join('\n'),
657
+ },
658
+ ],
659
+ };
660
+ }
661
+
662
+ async run() {
663
+ const transport = new StdioServerTransport();
664
+ await this.server.connect(transport);
665
+ console.error('Sequential Thinking MCP server running on stdio');
666
+ }
667
+ }
668
+
669
+ const server = new SequentialThinkingServer();
670
+ server.run().catch(console.error);
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+ "esModuleInterop": true,
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "outDir": "./build",
12
+ "rootDir": "./src",
13
+ "declaration": true,
14
+ "sourceMap": true,
15
+ "resolveJsonModule": true,
16
+ "allowImportingTsExtensions": false
17
+ },
18
+ "include": [
19
+ "src/**/*"
20
+ ],
21
+ "exclude": [
22
+ "node_modules",
23
+ "build"
24
+ ]
25
+ }