MCP Reference Server
A comprehensive reference implementation demonstrating all features of the Model Context Protocol (MCP) specification using chuk-mcp-server.
π Certified 100% MCP Specification Compliant - See COMPLIANCE.md
Overview
This repository provides complete, working examples of every MCP feature defined in the official specification. It serves as:
π Reference Documentation - See how each MCP feature works
β Spec Compliance Examples - Validate MCP implementations
π Learning Resource - Understand the MCP protocol
π§ͺ Testing Tool - Test MCP clients against spec features
Specification Versions
Version | Status | Features |
2025-06-18 | β 100% Implemented & Tested | Core spec: Tools, Resources, Prompts, Sampling, Logging |
2025-11-25 | π Reference Examples Only | Tasks (experimental), Enhanced Auth, Tool Calling in Sampling, Icons, Enhanced Elicitation |
2024-11-05 | π Documented | Initial specification (superseded by 2025-06-18) |
β οΈ Important: MCP 2025-11-25 examples (12, 13, 14) are reference implementations showing how the spec SHOULD work. The features are not yet implemented in chuk-mcp-server. Icons are embedded as text/emojis, and elicitation features are documented in docstrings.
Current Testing: All compliance tests validate against MCP 2025-06-18 (core specification)
MCP Features Demonstrated
β Core Protocol (JSON-RPC 2.0)
All examples use proper JSON-RPC 2.0 message formatting implemented by chuk-mcp-server.
β Lifecycle
initialize- Connection and capability negotiationinitializednotificationping- Health check (bidirectional)
β Server Capabilities
Tools (tools/list, tools/call)
Basic tools with various parameter types
Tools with complex schemas
Tools with progress reporting
Tools with error handling
Dynamic tool registration
notifications/tools/list_changed
Resources (resources/*)
Static resources
Dynamic resources with URI templates
Resource subscriptions
Binary resources (images, audio)
Text resources (markdown, JSON, code)
notifications/resources/updatednotifications/resources/list_changed
Prompts (prompts/list, prompts/get)
Static prompts
Prompts with arguments
Multi-message prompts
Prompt templates
notifications/prompts/list_changed
β Client Capabilities
Sampling (sampling/createMessage)
Server-initiated LLM requests
Multi-turn conversations
System prompts
Model preferences
Roots (roots/list)
Filesystem root queries
notifications/roots/list_changed
β Utilities
Logging (logging/setLevel)
Debug, info, warning, error levels
notifications/message- Log output
Progress
notifications/progress- Long-running operation updatesProgress tokens
Completion (completion/complete)
Argument autocompletion
Context-aware suggestions
Cancellation
notifications/cancelled- Request cancellation
Project Structure
Quick Start
Installation
Run Examples
Example Catalog
1. Minimal Server
The simplest possible MCP server with one tool.
2. Basic Tools
Demonstrates all tool parameter types:
String, integer, number, boolean
Arrays and objects
Optional and required parameters
Default values
3. Advanced Tools
Complex nested schemas
Progress reporting during execution
Error handling patterns
Tool result content types (text, images, embedded resources)
4. Basic Resources
Static resources with various MIME types
List resources
Read resource content
Text and binary resources
5. Advanced Resources
URI templates (
file://logs/{date})Resource subscriptions
Resource update notifications
Dynamic resource generation
6. Basic Prompts
Simple prompts
Prompts with arguments
Multi-message prompts
7. Advanced Prompts
Parameterized prompt templates
Dynamic prompt generation
Prompt argument validation
8. Sampling
Server requests LLM completion from client
Multi-turn conversations
System prompts and preferences
9. Logging & Progress
Log level configuration
Progress notifications for long operations
Progress tokens
10. Completion
Argument autocompletion
Context-aware suggestions
11. Full Server
Complete server with ALL features enabled - the ultimate reference.
Testing with MCP Inspector
All examples work with MCP Inspector:
Configure Inspector:
Transport: HTTP or STDIO
URL:
http://localhost:8000/mcp(for HTTP)Command:
python examples/11_full_server.py(for STDIO)
Specification Mapping
Each example includes comments mapping features to the official MCP specification:
Spec Compliance
This reference server aims for 100% compliance with the MCP specification:
β Proper JSON-RPC 2.0 formatting
β Capability negotiation
β Content type support (text, image, audio, embedded resources)
β Error codes and handling
β Notifications
β Pagination
β Progress reporting
β Cancellation
Testing
Run Compliance Demo
Interactive demo that tests full MCP spec compliance:
Run Test Suite
MCP 2025-11-25 Feature Status
Test the implementation status of new features:
Results: 3 passed (description, defaults), 5 xfailed (icons, elicitation modes)
Documentation
specs/- Detailed documentation for each spec versionexamples/README.md- Guide to all examplesEach example file contains extensive inline documentation
Contributing
Contributions should:
Map to specific MCP specification sections
Include spec version and reference URLs
Add tests
Update documentation
Resources
License
MIT License
Built with chuk-mcp-server - The protocol implementation is already done, this repo just demonstrates all the features! π
This server cannot be installed