@@ -9,7 +9,8 @@ This repository is a **comprehensive educational curriculum for MCP development*
99## Development Commands
1010
1111### Core Development
12- - ` npm install ` - Install dependencies
12+
13+ - ` npm install ` - Install dependencies
1314- ` npm start ` - Run the MCP server (` dist/server.js --stdio ` )
1415- ` npm run dev ` - Development mode with auto-reload
1516- ` npm run build ` - Build TypeScript to JavaScript
@@ -18,43 +19,56 @@ This repository is a **comprehensive educational curriculum for MCP development*
1819- ` npm run clean ` - Remove dist directory
1920
2021### Testing & Quality
22+
2123- ` npm run lint ` - Run ESLint
2224- ` npm run lint:fix ` - Fix linting issues
25+ - ` npm run lint:ci ` - Run ESLint with zero warnings enforced
2326- ` npm run typecheck ` - TypeScript type checking
2427- ` npm run format ` - Format code with Prettier
2528- ` npm run format:check ` - Check code formatting
29+ - ` npm run check:quick ` - Quick verification (typecheck + lint: ci + format: check )
30+ - ` npm run check:deep ` - Deep verification with auto-fixes
31+ - ` npm run pipeline ` - Full pipeline (clean + typecheck + lint: fix + lint: ci + format + format: check + build)
32+ - ` npm run smoke:stdio ` - Test STDIO server startup/shutdown
33+ - ` npm run all ` - Complete pipeline + smoke test
2634
2735### MCP Inspection
28- - ` npx @modelcontextprotocol/inspector --cli "node dist/server.js --stdio" --method tools/list ` - List all 8 tools with schemas
36+
37+ - ` npx @modelcontextprotocol/inspector --cli "node dist/server.js --stdio" --method tools/list ` - List all 8 tools with schemas
2938- ` npx @modelcontextprotocol/inspector --cli "node dist/server.js --stdio" --method prompts/list ` - List all 3 prompts
3039- ` npx @modelcontextprotocol/inspector --cli "node dist/server.js --stdio" --method resources/list ` - List all 4 resources
3140- ` npx @modelcontextprotocol/inspector --cli "node dist/server.js --stdio" --method resources/read --uri "calculator://constants" ` - Read specific resource
3241
3342### Manual Testing
43+
3444- ` 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
3545
3646## Architecture
3747
3848### MCP SDK Implementation
49+
3950The project provides a ** single, production-ready MCP server implementation** :
4051
4152- ** ` dist/server.js ` ** - MCP SDK server using standard ` registerTool() ` , ` registerResource() ` , ` registerPrompt() ` APIs
4253- Implements standard MCP protocol with ` tools/list ` , ` tools/call ` , ` resources/list ` , ` prompts/list ` methods
4354- Compatible with all MCP clients and registries including Smithery
4455
4556### MCP Advanced Features Implementation
57+
4658- ** 8 Tools** : ` calculate ` , ` batch_calculate ` , ` advanced_calculate ` , ` demo_progress ` , ` solve_math_problem ` , ` explain_formula ` , ` calculator_assistant ` , ` maintenance_mode `
4759- ** 3 Prompts** : ` explain-calculation ` , ` generate-problems ` , ` calculator-tutor ` (all with completable arguments)
4860- ** 4 Resources** : ` calculator://constants ` , ` calculator://stats ` , ` formulas://library ` , ` calculator://history/{id} ` (with completion support)
4961- ** Advanced SDK Features** : Progress notifications, interactive elicitation, dynamic lifecycle management, completable arguments
5062
5163### State Management Architecture
64+
5265- ** Process Memory** : All state (calculation history, request counters, uptime) stored in-memory
5366- ** Per-Process Isolation** : State resets when process exits (by design for STDIO transport)
5467- ** History Limit** : Maximum 50 calculation entries stored
5568- ** Resource Limits** : Batch operations limited to 100 items
5669
5770### Protocol Architecture
71+
5872- ** STDIO Transport** : Pure stdin/stdout communication with newline-delimited JSON-RPC
5973- ** Progress Notifications** : Real-time progress updates using ` sendNotification ` with ` notifications/progress ` method
6074- ** Interactive Elicitation** : Dynamic user input collection via ` server.server.elicitInput() ` for ambiguous requests
@@ -68,20 +82,23 @@ The project provides a **single, production-ready MCP server implementation**:
6882** Important** : This is a complete educational curriculum designed for the MCP community, not just a code example.
6983
7084### Learning Structure
85+
7186- ** 3-Week Structured Path** : Fundamentals → Advanced Patterns → Production Readiness
7287- ** 4 Progressive Exercises** : From basic statistics to advanced interactive tools
7388- ** 12 Key Takeaways** : Specific learning outcomes covering all MCP concepts
7489- ** Comprehensive Best Practices** : Deep dive into SDK patterns and common pitfalls
7590- ** Production Deployment** : Real-world deployment and monitoring guidance
7691
7792### Build Process & Quality
93+
78941 . TypeScript source files in ` src/ ` contain the full implementation
79952 . ` npm run build ` compiles to ` dist/server.js ` (production-ready)
80963 . Code is formatted with Prettier and validated with ESLint
81974 . Zero warnings/errors policy maintained
82985 . Use ` npm start ` or ` node dist/server.js --stdio ` to run the server
8399
84100### Educational Content Structure
101+
85102- ** Core Learning Objectives** : 5 major areas (Architecture, Security, Protocol, Performance, Type Safety)
86103- ** Advanced SDK Features** : Progress notifications, elicitation, lifecycle, completion
87104- ** Testing & Validation** : Comprehensive testing strategy with MCP Inspector
@@ -90,6 +107,7 @@ The project provides a **single, production-ready MCP server implementation**:
90107- ** Hands-on Exercises** : Progressive exercises building complexity
91108
92109### SDK Patterns Demonstrated
110+
93111- ** Progress Notifications** : Access ` sendNotification ` from handler's second parameter
94112- ** Interactive Elicitation** : Use ` server.server.elicitInput() ` for dynamic user input
95113- ** Tool Lifecycle** : Store handles from ` registerTool() ` for runtime management
@@ -99,13 +117,15 @@ The project provides a **single, production-ready MCP server implementation**:
99117## Testing Strategy
100118
101119The test suite validates MCP server functionality:
120+
102121- ** Integration Tests** : Test the MCP SDK server functionality
103122- ** Unit Tests** : Validate individual calculator operations
104123- ** API Tests** : Ensure MCP protocol compliance
105124
106125## Message Protocol Specifics
107126
108127### Standard MCP Protocol Format
128+
109129```
110130→ {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculate","arguments":{"a":5,"b":3,"op":"add"}}}
111131{"result":{"content":[{"type":"text","text":"5 + 3 = 8"}]},"jsonrpc":"2.0","id":1}
@@ -123,59 +143,69 @@ The test suite validates MCP server functionality:
123143## Progressive Exercise Curriculum
124144
125145### Exercise 1: Statistics Tool (Type Safety & Registration)
146+
126147- Goal: Master tool registration and type safety
127148- Task: Implement mean, median, mode, standard deviation
128149- Learning: Zod schemas, edge case handling
129150
130- ### Exercise 2: Persistent History (Resource Management)
151+ ### Exercise 2: Persistent History (Resource Management)
152+
131153- Goal: Advanced resource management
132154- Task: File-based history persistence with reload
133155- Learning: Async operations, resource lifecycle
134156
135157### Exercise 3: Unit Conversion (Functionality Extension)
136- - Goal: Extend server capabilities systematically
158+
159+ - Goal: Extend server capabilities systematically
137160- Task: Multi-unit conversion tool (length, weight, temperature)
138161- Learning: Complex business logic, conversion matrices
139162
140163### Exercise 4: Guided Calculation (Advanced Interactive Features)
164+
141165- Goal: Master all advanced SDK features combined
142166- Task: Multi-step wizard with elicitation, progress, and lifecycle management
143167- Learning: Complete integration of advanced patterns
144168
145169## Advanced SDK Implementation Highlights
146170
147171### Progress Notifications
172+
148173``` typescript
149174// Correct pattern: Access sendNotification from second parameter
150175async (params , { sendNotification }) => {
151- await sendNotification ({
152- method: " notifications/progress" ,
153- params: { progressToken: id , progress: 50 , message: " Halfway" }
154- });
155- }
176+ await sendNotification ({
177+ method: ' notifications/progress' ,
178+ params: { progressToken: id , progress: 50 , message: ' Halfway' },
179+ });
180+ };
156181```
157182
158183### Interactive Elicitation
184+
159185``` typescript
160186// Correct pattern: Use server.server for base Server instance
161187const result = await server .server .elicitInput ({
162- message: " Need more information" ,
163- requestedSchema: { /* JSON Schema */ }
188+ message: ' Need more information' ,
189+ requestedSchema: {
190+ /* JSON Schema */
191+ },
164192});
165193```
166194
167195### Dynamic Lifecycle Management
196+
168197``` typescript
169198// Correct pattern: Store handles for runtime control
170199const toolHandle = server .registerTool (/* ... */ );
171200toolHandle .disable (); // Automatically sends tools/list_changed
172201```
173202
174203### Completable Arguments
204+
175205``` typescript
176206// Correct pattern: Wrap schemas with completable
177207argsSchema : {
178- topic : completable (z .string (), async (value ) => suggestions )
208+ topic : completable (z .string (), async (value ) => suggestions );
179209}
180210```
181211
@@ -184,14 +214,17 @@ argsSchema: {
184214This repository embodies the principle: ** "Learn by building a world-class implementation."**
185215
186216### What Makes This Special
217+
187218- ** Complete Curriculum** : Not just code, but a full learning experience
188219- ** Community Resource** : Built for the entire MCP development community
189220- ** Progressive Learning** : From basics to advanced patterns with guided exercises
190221- ** Production Quality** : Real-world standards with zero technical debt
191222- ** Best Practices** : Hard-won insights from building world-class MCP servers
192223
193224### Learning Outcomes
225+
194226After completing this curriculum, developers will master:
227+
1952281 . All 8 MCP tools with advanced features
1962292 . 4 different resource types with completion support
1972303 . Interactive prompts with completable arguments
@@ -206,7 +239,7 @@ The repository represents the gold standard for MCP education - a complete learn
206239After completing this curriculum, developers will master:
207240
2082411 . ** Direct Zod schema usage** - No JSON Schema conversion needed
209- 2 . ** Type safety throughout** - Let TypeScript do the work
242+ 2 . ** Type safety throughout** - Let TypeScript do the work
2102433 . ** Simple state management** - Circular buffers over complex stores
2112444 . ** Protocol compliance** - Always use McpError
2122455 . ** Clean architecture** - Single responsibility principle
@@ -222,4 +255,4 @@ After completing this curriculum, developers will master:
222255
223256** Built with ❤️ as an educational reference for the MCP community**
224257
225- This repository exists to accelerate MCP adoption by providing a complete, world-class learning experience. It demonstrates that building sophisticated MCP servers is achievable when you trust the SDK, follow best practices, and focus on user experience over complexity.
258+ This repository exists to accelerate MCP adoption by providing a complete, world-class learning experience. It demonstrates that building sophisticated MCP servers is achievable when you trust the SDK, follow best practices, and focus on user experience over complexity.
0 commit comments