GAP_ANALYSIS
MCP Specification Gap Analysis
Raku MCP SDK vs MCP Specification 2025-11-25
This document compares the current implementation of the Raku MCP SDK against the MCP Specification 2025-11-25 and identifies missing features.
Summary
| Category | Status | Notes |
|---|---|---|
| Base Protocol | ā Complete | JSON-RPC 2.0, lifecycle, version negotiation |
| Transports | ā Complete | Stdio, Streamable HTTP, Legacy SSE |
| Server Features | ā Complete | Tools/Resources/Prompts + pagination, templates, subscriptions, annotations |
| Client Features | ā Complete | Sampling with tools, completion, roots, elicitation |
| Utilities | ā Complete | Logging, progress, cancellation, ping |
| Authorization | ā Complete | OAuth 2.1 with PKCE, dynamic registration, M2M, enterprise IdP |
| New 2025-11-25 Features | ā Complete | Elicitation, Tasks, Sampling-with-tools, Extensions |
Table of Contents
Detailed Analysis
Base Protocol
ā Implemented
JSON-RPC 2.0 message format (
MCP::JSONRPC)Request/Response/Notification handling
ID generation
Error codes (ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError)
Notes
Lifecycle: Initialize/initialized handshake with version negotiation (server falls back to latest supported version if client's isn't recognized)
JSON-RPC batching: Not supported (removed from spec in 2025-06-18)
Transports
ā
Stdio Transport (MCP::Transport::Stdio)
Complete implementation
Proper newline-delimited JSON messages
ā
Streamable HTTP Transport (MCP::Transport::StreamableHTTP)
Full server-side implementation (POST/GET/DELETE)
Full client-side implementation
Session management (
MCP-Session-Idheader)Last-Event-IDreplay for SSE resumptionCORS handling via
allowed-originsProtocol version validation (
MCP-Protocol-Versionheader)Proper error responses per spec (400, 403, 404, 405, 406, 415)
ā
Legacy SSE Transport (MCP::Transport::SSE)
Server-side: GET
/ssefor SSE stream, POST/messagefor client messagesClient-side: connects to SSE endpoint, receives POST URL via
endpointeventOrigin validation
Single-client model (one SSE connection at a time)
Server Features
ā
Tools (MCP::Server::Tool)
Tool registration with name, description, schema
Tool calling with arguments
Builder pattern API
Tool annotations (
readOnlyHint,destructiveHint,idempotentHint,openWorldHint)outputSchemafor structured tool outputs (2025-06-18)Tool name validation (SEP-986:
^[a-zA-Z0-9_-]{1,64}$)tools/listpagination support
ā
Resources (MCP::Server::Resource)
Resource registration with URI, name, description, mimeType
Resource reading
Resource templates (URI templates with placeholders)
Resource subscriptions (
resources/subscribe,resources/unsubscribe)notifications/resources/list_changedandnotifications/resources/updatedresources/listpagination supportResource annotations (
audience,priority)
ā
Prompts (MCP::Server::Prompt)
Prompt registration with arguments
Prompt retrieval with argument substitution
prompts/listpagination supportnotifications/prompts/list_changed
Client Features
ā
Sampling (MCP::Client sampling-handler) - Implemented
sampling/createMessagehandling with full parameter supportTool definitions in sampling requests (SEP-1577)
toolChoiceparameter supportincludeContextparameter with capability validationstopReasonin responsesTool validation in sampling messages
Server-side
create-message()convenience method with tools/toolChoice/includeContext
ā Roots - Implemented
Roottype withuriand optionalnameClient-side:
rootsconfiguration optionHandles
roots/listrequests from serverset-roots()method sendsnotifications/roots/list_changedAdvertises
rootscapability (withlistChanged)
Server-side:
list-roots()method to request roots from client
ā Elicitation (2025-06-18 feature)
ElicitationCapabilitywith form/url mode supportElicitationActionenum (accept/decline/cancel)ElicitationResponsetype with contentServer-side:
elicit(message, schema)for form mode requestselicit-url(message, url, elicitation-id)for URL modenotify-elicitation-complete(elicitation-id)for completion
Client-side:
elicitation-handlercallback for handling requestsCapability negotiation with form/url modes
URLElicitationRequirederror code (-32042)
Utilities
ā Progress Tracking - Implemented
progress()method on Server with automatic_meta.progressTokenextractionproto dispatch-requestsets$*MCP-PROGRESS-TOKENdynamic variable for all handlersExplicit token parameter overrides implicit
_metatokenNo notification emitted when no token is available
Client
progress()Supply emits typedProgressobjects fromnotifications/progressTypes defined (
Progress)
ā Logging - Implemented
log()method on Server with level filteringLogLevelenum,LogEntrytype,parse-log-level,log-level-at-or-abovehelperslogging/setLevelrequest handler on Server stores and applies log levelLog notifications below configured level are suppressed
Client
set-log-level()method sendslogging/setLevelrequest
ā Cancellation - Implemented
Server tracks in-flight requests and handles
notifications/cancelledClient sends cancellation notification on timeout
Both sides have
cancel-requestmethod for explicit cancellationis-cancelledmethod for handlers to check cancellation status
ā Ping
Server responds to
pingrequestsClient has
ping()helper
ā Completion (autocomplete)
completion/completerequest handlingServer:
add-prompt-completer(),add-resource-completer()for registering completersClient:
complete-prompt(),complete-resource()convenience methodsCompletionResulttype with values, total, hasMoreAuto-truncation to 100 values per spec
completionscapability advertised when completers registered
Authorization (2025-03-26+)
ā Implemented
OAuth 2.1 authorization framework:
ā OAuth 2.1 with PKCE (S256)
ā Token refresh
ā Resource indicators (RFC 8707)
ā Authorization server metadata discovery (RFC 8414 + OIDC fallback)
ā Protected resource metadata (RFC 9728)
ā Server-side token validation with WWW-Authenticate headers
ā Client-side automatic token management and 401 retry
ā Dynamic client registration (RFC 7591)
New Features in 2025-11-25
ā Tasks (Experimental)
Long-running operation support:
Task creation with
taskhint intools/callTask states:
working,input_required,completed,failed,cancelledtasks/getfor status pollingtasks/cancelfor cancellationtasks/resultfor blocking result retrievaltasks/listfor listing all tasksnotifications/tasks/statuson state changesTool-level
execution.taskSupportvia builder
ā Extensions Framework
Extension capability negotiation via
experimentalhashExtension settings and versioning
Namespaced extension methods and notification dispatch
Server:
register-extension(),unregister-extension()Client:
register-extension(),server-extensions(),supports-extension()
ā Authorization Extensions
ā SEP-1046: OAuth client credentials (M2M) ā
OAuthM2MClientwithclient_credentialsgrantā SEP-990: Enterprise IdP policy controls ā
OAuthEnterpriseClientwith token exchange (RFC 8693) and JWT bearer grant (RFC 7523)
ā URL Mode Elicitation (SEP-1036)
elicit-url()method for URL mode requestsnotify-elicitation-complete()for completion notificationsURLElicitationRequirederror code (-32042)
ā Sampling with Tools (SEP-1577)
Tool definitions in sampling requests
Server-side agentic loops
Comparison with Python SDK
The official Python SDK implements:
| Feature | Python SDK | Raku SDK |
|---|---|---|
| Tools | ā Full | ā Full + annotations |
| Resources | ā Full + templates + subscriptions | ā Full + templates + subscriptions |
| Prompts | ā Full | ā Full |
| Sampling | ā Full + tools | ā Full + tools |
| Roots | ā Full | ā Full |
| Elicitation | ā Full + URL mode | ā Full |
| OAuth 2.1 | ā Full | ā Full |
| Streamable HTTP | ā Full client + server | ā Full |
| SSE Transport | ā Full | ā Full |
| Tasks | ā Experimental | ā Done (experimental) |
| Completion | ā Full | ā Full |
| Pagination | ā Full | ā Full |
| Extensions | ā Experimental | ā Done (experimental) |
Remaining Work
All priority items from the original roadmap have been completed, including expanded test coverage for progress tracking, error edge cases, and concurrent operations.
Protocol Version
Current implementation targets: 2025-11-25 ā
All key features for 2025-11-25 compliance are implemented.
Test Coverage Gaps
Current tests cover:
ā Types serialization (
01-types)ā JSON-RPC encoding/decoding (
02-jsonrpc)ā Builder patterns (
03-builders)ā Transport interface (
04-transport)ā Server dispatch and lifecycle (
05-server)ā Client initialization (
06-client)ā Top-level MCP exports (
07-mcp)ā Sampling validation (
08-sampling)ā HTTP transport (
09-http-transport)ā OAuth 2.1 types, PKCE, server/client handlers (
10-oauth)ā Tasks framework (
11-tasks)ā Extensions framework (
12-extensions)ā Resource templates (
13-resource-templates)ā SSE transport (
14-sse-transport)
Areas with limited test coverage:
Progress tracking (server notifications, client Supply)
Error edge cases (malformed messages, transport failures)
Concurrent operations (parallel requests, race conditions)
Conclusion
The Raku MCP SDK provides comprehensive MCP specification 2025-11-25 coverage. All transport types (Stdio, Streamable HTTP, Legacy SSE), all server features (Tools, Resources, Prompts), all client features (Sampling, Roots, Elicitation, Completion), and full OAuth 2.1 authorization are implemented. No significant gaps remain.