You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Streamline MCP server to single SDK implementation
- Remove custom STDIO server implementation (server-stdio.js)
- Update all configurations to use standard MCP SDK server (dist/server.js --stdio)
- Simplify README and CLAUDE.md to focus on single, production-ready implementation
- Update package.json scripts and entry points
- Remove custom protocol tests and references
- Ensure compatibility with Smithery registry and all MCP clients
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+15-24Lines changed: 15 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This repository implements a **learning-edition MCP calculator server using STDIO transport**. It demonstrates the Model Context Protocol (MCP) with newline-delimited JSON-RPC communication over stdin/stdout, showcasing both modern MCP SDK usage and custom JSON-RPC implementation patterns.
7
+
This repository implements a **learning-edition MCP calculator server using STDIO transport**. It demonstrates the Model Context Protocol (MCP) with standard JSON-RPC communication over stdin/stdout using the official MCP SDK.
8
8
9
9
## Development Commands
10
10
11
11
### Core Development
12
12
-`npm install` - Install dependencies
13
-
-`npm start` - Run the production STDIO server (`dist/server-stdio.js`)
13
+
-`npm start` - Run the MCP server (`dist/server.js --stdio`)
14
14
-`npm run dev` - Development mode with auto-reload
15
15
-`npm run build` - Build TypeScript to JavaScript (may fail due to legacy API usage)
16
16
-`npm run clean` - Remove dist directory
@@ -24,24 +24,22 @@ This repository implements a **learning-edition MCP calculator server using STDI
24
24
-`npm run typecheck` - TypeScript type checking
25
25
26
26
### MCP Inspection
27
-
-`npx @modelcontextprotocol/inspector --cli node dist/mcp-server.js --method tools/list` - List all 7 tools with schemas
28
-
-`npx @modelcontextprotocol/inspector --cli node dist/mcp-server.js --method prompts/list` - List all 3 prompts
29
-
-`npx @modelcontextprotocol/inspector --cli node dist/mcp-server.js --method resources/list` - List all 4 resources
-`echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculate","arguments":{"a":7,"b":6,"op":"multiply"}}}' | node dist/mcp-server.js` - Test MCP SDK server
34
-
-`echo '{"jsonrpc":"2.0","id":1,"method":"calculate","params":{"a":7,"b":6,"op":"multiply"}}' | node dist/server-stdio.js` - Test custom JSON-RPC server
33
+
-`echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculate","arguments":{"a":7,"b":6,"op":"multiply"}}}' | node dist/server.js --stdio` - Test MCP SDK server
35
34
36
35
## Architecture
37
36
38
-
### Dual Server Implementation
39
-
The project provides **two functional server implementations**:
37
+
### MCP SDK Implementation
38
+
The project provides a **single, production-ready MCP server implementation**:
40
39
41
-
1.**`dist/mcp-server.js`** - Modern MCP SDK server using `registerTool()`, `registerResource()`, `registerPrompt()` APIs
42
-
2.**`dist/server-stdio.js`** - Custom newline-delimited JSON-RPC server with manual message handling
43
-
44
-
Both servers implement the same 7 tools, 3 prompts, and 4 resources but use different communication protocols.
40
+
-**`dist/server.js`** - MCP SDK server using standard `registerTool()`, `registerResource()`, `registerPrompt()` APIs
41
+
- Implements standard MCP protocol with `tools/list`, `tools/call`, `resources/list`, `prompts/list` methods
42
+
- Compatible with all MCP clients and registries including Smithery
Copy file name to clipboardExpand all lines: README.md
+18-32Lines changed: 18 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
12
12
## 🎯 Overview
13
13
14
-
This repository demonstrates a **learning-edition MCP calculator server using STDIO transport**. It is a reference implementation for the classic local pipe transport, where the server runs as a child process and communicates with a parent process via `stdin` and `stdout` using newline-delimited JSON-RPC messages.
14
+
This repository demonstrates a **learning-edition MCP calculator server using STDIO transport**. It showcases the Model Context Protocol (MCP) SDK implementation with standard `tools/list`and `tools/call` methods, communicating via `stdin` and `stdout` using JSON-RPC messages.
15
15
16
16
This transport is the most performant and secure option for local inter-process communication (IPC).
17
17
@@ -52,19 +52,14 @@ sequenceDiagram
52
52
Note over Client,Server: Communication is full-duplex, concurrent, and newline-delimited.
53
53
```
54
54
55
-
### Dual Server Implementations for Learning
55
+
### MCP SDK Implementation
56
56
57
-
This repository contains two distinct server implementations to illustrate different levels of abstraction:
57
+
This repository contains a single, production-ready MCP server implementation:
58
58
59
-
1.**High-Level (SDK-based): `dist/server.js`**
60
-
- Built using the official `@modelcontextprotocol/sdk`.
61
-
- Uses high-level abstractions like `server.registerTool()` and `server.registerResource()`.
62
-
- Represents the standard, recommended approach for building MCP servers.
63
-
64
-
2.**Low-Level (Manual): `dist/server-stdio.js`**
65
-
- A from-scratch implementation of the newline-delimited JSON-RPC protocol.
0 commit comments