MCP Specification Compliance

December 5, 2025 ยท View on GitHub

How Debugssy follows the Model Context Protocol security standards

This document outlines Debugssy's compliance with the MCP Specification 2025-06-18 security best practices.

Protocol Support: 2025-03-26 and 2025-06-18 (backwards compatible)


๐Ÿ“‹ Table of Contents


Transport Implementation

Debugssy uses Streamable HTTP transport as defined in the MCP specification:

FeatureImplementation
Endpoint/mcp (POST, GET, DELETE)
ProtocolJSON-RPC 2.0 over HTTP
StreamingServer-Sent Events (SSE)
Session ManagementMCP SDK's StreamableHTTPServerTransport

๐Ÿ”’ Security Best Practices

Network Security

ProtectionStatusDescription
Localhost Bindingโœ… MUSTServer binds only to 127.0.0.1, no remote access
Origin Validationโœ… MUSTValidates Origin header to prevent DNS rebinding attacks
Supported Originsโœ… EnforcedOnly localhost, 127.0.0.1, [::1] allowed

What this means: Debugssy is unreachable from the network. Only applications running on your local machine can connect.

Authentication

FeatureStatusRationale
Token Authโšช Not ImplementedLocal-only VS Code extension, origin validation provides sufficient protection

Note: Authentication may be added in future versions for multi-user scenarios.


๐ŸŽซ Session Management

Session ID Generation

RequirementStatusImplementation
Cryptographically Secureโœ… MUSTUses crypto.randomUUID()
Globally Uniqueโœ… SHOULDUUID v4 format
Visible ASCII Onlyโœ… MUSTAlphanumeric + hyphens only
Formatโœ… Enforcedmcp-session-<uuid>

Example Session ID: mcp-session-123e4567-e89b-12d3-a456-426614174000

Security: Session IDs are unpredictable and cannot be guessed or enumerated by attackers.

Session Lifecycle

StageHTTP ResponseDescription
Initialize200 OK + Mcp-Session-Id headerSession created, ID provided to client
Active200 OKValid session ID accepted
Missing ID400 Bad RequestClient must provide Mcp-Session-Id header
Expired404 Not FoundSession no longer exists
Terminate200 OK (on DELETE)Client explicitly ends session

๐Ÿ“ฆ Protocol Version Handling

MCP-Protocol-Version Header (NEW in 2025-06-18)

Supported VersionStatusNotes
2025-06-18โœ… CurrentLatest specification
2025-03-26โœ… LegacyBackwards compatibility

Header Validation:

Client BehaviorServer Response
Sends 2025-06-18โœ… 200 OK
Sends 2025-03-26โœ… 200 OK
Sends unsupported versionโŒ 400 Bad Request
Omits headerโœ… 200 OK (assumes 2025-03-26)

Backwards Compatibility: Clients using older MCP implementations without the version header are supported.


๐Ÿ›ก๏ธ Advanced Security Features

Session Hijacking Prevention

RequirementStatusImplementation
Non-Deterministic IDsโœ… MUSTCryptographically secure UUIDs
Secure Random Generationโœ… SHOULDcrypto.randomUUID()
Session โ‰  Authenticationโœ… MUST NOTSessions track connections only

Protection: Session IDs cannot be predicted, guessed, or enumerated by attackers.

OAuth Security Patterns

PatternApplicabilityStatus
Confused DeputyMCP proxy servers forwarding to third-party APIsโšช Not Applicable (not a proxy)
Token PassthroughAccepting OAuth tokens without validationโšช Not Applicable (no OAuth)

Note: Debugssy operates exclusively within VS Code without third-party API integrations or OAuth flows.


๐Ÿ“ Protocol Details

Message Format

RequirementStatusDetails
Encodingโœ… MUSTJSON-RPC 2.0, UTF-8 encoded
Formatโœ… EnforcedAll messages follow JSON-RPC spec

HTTP Methods

MethodPurposeResponse
POSTSend JSON-RPC messages200 OK with response
GETOpen SSE stream for server messages200 OK (streaming)
DELETETerminate session200 OK

Connection Management

FeatureStatusHandled By
Multiple Connectionsโœ… SupportedMCP SDK
SSE Streamsโœ… SupportedMCP SDK
Reconnectionโœ… SupportedMCP SDK (Last-Event-ID)
Message Redeliveryโœ… SupportedMCP SDK

HTTP Status Codes

CodeMeaningWhen Used
200 OKSuccessValid requests
202 AcceptedAcknowledgedNotifications
400 Bad RequestInvalid requestMissing session ID, bad protocol version
403 ForbiddenAccess deniedInvalid origin
404 Not FoundNot foundExpired session
405 Method Not AllowedWrong methodUnsupported HTTP method
500 Internal Server ErrorServer errorUnexpected failures

โœ… Verification

Quick Health Check

curl http://localhost:3000/health

Expected response:

{
  "status": "ok",
  "server": "debugssy-mcp",
  "version": "1.2.0",
  "transportInitialized": true,
  "transport": "streamable-http",
  "protocolVersion": "2025-06-18",
  "supportedProtocolVersions": ["2025-03-26", "2025-06-18"]
}

Security Tests

Test Origin Validation
# Should reject remote origins
curl -H "Origin: http://evil-domain.com" http://localhost:3000/mcp
# Expected: 403 Forbidden
Test Session Management
  1. Initialize session โ†’ Verify Mcp-Session-Id header
  2. Use session ID in requests โ†’ Verify 200 OK
  3. Omit session ID โ†’ Verify 400 Bad Request
  4. Use expired session โ†’ Verify 404 Not Found

๐Ÿ“Š Compliance Summary

Core Requirements

RequirementPriorityStatusNotes
Streamable HTTP TransportMUSTโœ… CompliantMCP SDK implementation
Origin Header ValidationMUSTโœ… CompliantDNS rebinding protection
Localhost BindingSHOULDโœ… CompliantBinds to 127.0.0.1 only
Protocol Version HeaderMUSTโœ… CompliantSupports 2025-06-18 + 2025-03-26
Session ManagementMUSTโœ… CompliantMCP SDK session handling
Cryptographically Secure IDsSHOULDโœ… Compliantcrypto.randomUUID()
Session Hijacking PreventionMUSTโœ… CompliantNon-deterministic session IDs
JSON-RPC UTF-8MUSTโœ… CompliantAutomatic UTF-8 encoding
HTTP Method SupportMUSTโœ… CompliantPOST, GET, DELETE
Proper Status CodesMUSTโœ… Compliant200, 202, 400, 403, 404, 405, 500

OAuth-Specific Requirements

RequirementPriorityStatusNotes
Confused Deputy ProtectionMUST (if proxy)โšช N/ANot a proxy server
Token Passthrough PreventionMUST (if OAuth)โšช N/ANo OAuth implementation

Optional Features

FeaturePriorityStatusRationale
AuthenticationSHOULDโš ๏ธ Not ImplementedLocal-only extension, origin validation sufficient

Overall Compliance: โœ… Fully Compliant with MCP Specification 2025-06-18


๐Ÿ“š References

MCP Specifications

Additional Documentation


Debugssy is fully compliant with MCP 2025-06-18 security standards ๐Ÿ”’