From d20536810f4220f962e689f38ce781965960ec36 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Oct 2025 10:49:22 +0000 Subject: [PATCH] Convert memory and sequentialthinking servers to use registerTool API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Successfully converted two servers to use the new McpServer high-level API: - sequentialthinking: Now uses registerTool() with Zod schemas - memory: Now uses registerTool() with Zod schemas Both servers build successfully and use the new registration pattern instead of setRequestHandler with tool schemas. Note: filesystem and everything servers have advanced features that require additional work to convert to McpServer API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/memory/index.ts | 6 +----- src/sequentialthinking/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/memory/index.ts b/src/memory/index.ts index 2ea8c138..cfc6296f 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { McpServer } from "@modelcontextprotocol/sdk/server/index.js"; +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { promises as fs } from 'fs'; import path from 'path'; @@ -249,10 +249,6 @@ const OpenNodesSchema = z.object({ const server = new McpServer({ name: "memory-server", version: "0.6.3", -}, { - capabilities: { - tools: {}, - }, }); server.registerTool( diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts index 6e04d199..0a2386a5 100644 --- a/src/sequentialthinking/index.ts +++ b/src/sequentialthinking/index.ts @@ -84,7 +84,7 @@ class SequentialThinkingServer { └${border}┘`; } - public processThought(input: unknown): { content: Array<{ type: string; text: string }>; isError?: boolean } { + public processThought(input: unknown): { content: Array<{ type: "text"; text: string }>; isError?: boolean } { try { const validatedInput = this.validateThoughtData(input); @@ -108,7 +108,7 @@ class SequentialThinkingServer { return { content: [{ - type: "text", + type: "text" as const, text: JSON.stringify({ thoughtNumber: validatedInput.thoughtNumber, totalThoughts: validatedInput.totalThoughts, @@ -121,7 +121,7 @@ class SequentialThinkingServer { } catch (error) { return { content: [{ - type: "text", + type: "text" as const, text: JSON.stringify({ error: error instanceof Error ? error.message : String(error), status: 'failed'