Transport Modes - UnitBuilds-CC/V.E.L.O.C.I.T.Y.-MCP GitHub Wiki

Transport Modes

The server supports 4 transport modes for different use cases.

Stdio (Default)

velocity_mcp --mode stdio

JSON-RPC v2.0 over stdin/stdout. Compatible with all MCP clients.

  • Reader thread + channel architecture (stdin reads never block shutdown)
  • Full MCP spec compliance: ping, logging/setLevel, notifications/cancelled
  • Cursor pagination on tools/list
  • Graceful shutdown via atomic flag

HTTP/SSE

velocity_mcp --mode http --addr 0.0.0.0:3000

Full HTTP transport via Axum:

Endpoint Description
/mcp JSON-RPC over HTTP POST
/mcp/stream Streamable HTTP with SSE response
/mcp/batch Batch JSON-RPC
/sse SSE for real-time streaming
/ws WebSocket upgrade
/health Health check
/performance Performance metrics (JSON)
/metrics Prometheus metrics
/sessions Session management

Features: session management (up to 1000), API key auth, CORS, TLS/HTTPS, request size limits.

WebSocket

velocity_mcp --mode ws --addr 0.0.0.0:3000

Dedicated WebSocket transport for bidirectional real-time communication.

Shared Memory

velocity_mcp --mode shmem --buffer-path nmcp_buffer.bin

Memory-mapped file IPC for ultra-low latency. Two wire formats with auto-detection:

NDA-native (binary):

[4B: "NMCP"] [32B: Merkle root] [1B: method type] [TLV: data]

JSON-RPC (backwards-compatible): Standard JSON-RPC strings.

Buffer: 64KB (4KB input + 61KB output). Win32 Events on Windows for zero-poll blocking.

Performance: 12.7M req/s at 8 threads (NDA-native).

See also: Getting-Started, Performance, Configuration