Skip to main content
Glama
by fmangot
index.ts1.74 kB
#!/usr/bin/env node /** * Sequential Thinking MCP Server - Stdio Version * For Claude Desktop and other stdio-based MCP clients */ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'; import { SequentialThinkingManager } from './lib.js'; import { ALL_TOOLS } from './tools/definitions.js'; import { handleToolCall } from './tools/handlers.js'; // Initialize the sequential thinking manager const thinkingManager = new SequentialThinkingManager(); // Create the MCP server const server = new Server( { name: 'sequential-thinking-mvp-server', version: '1.0.0', }, { capabilities: { tools: {}, }, } ); // Handle tool listing server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: ALL_TOOLS }; }); // Handle tool calls server.setRequestHandler(CallToolRequestSchema, async (request) => { return handleToolCall(request.params, thinkingManager); }); // Start the server async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error('Sequential Thinking MCP Server v1.0.0 running on stdio'); console.error('Ready for MCP protocol messages on stdin/stdout'); } main().catch((error) => { console.error('Fatal error:', error); process.exit(1); }); // Graceful shutdown process.on('SIGINT', () => { console.error('\nShutting down...'); thinkingManager.destroy(); process.exit(0); }); process.on('SIGTERM', () => { console.error('\nShutting down...'); thinkingManager.destroy(); process.exit(0); });

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fmangot/Mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server