Available Transport Modes
Stdio Mode (Default)
Stdio (standard input/output) mode is the default transport for the MCP server. It uses process communication for direct interaction between the server and client. When to use:- Desktop MCP clients (Cursor, VS Code, Claude Desktop, Windsurf, Zed)
- Command-line applications
- Local development and testing
- Single-user scenarios
- Simple setup with no network configuration
- Low latency for local communication
- No additional port management
- Secure by default (no network exposure)
- Cursor/Claude Desktop
- VS Code
- Command Line
- Docker
HTTP Mode (Streamable HTTP + Legacy SSE)
HTTP mode exposes the MCP server via HTTP/HTTPS, supporting both modern Streamable HTTP (MCP 2025-03-26) and legacy SSE (MCP 2024-11-05) protocols for maximum compatibility. When to use:- Web applications and browser-based clients
- Multi-user scenarios
- Remote access requirements
- Microservices architecture
- Load-balanced deployments
- Network-accessible for remote clients
- Supports multiple simultaneous connections
- Compatible with web browsers and HTTP clients
- Dual protocol support (modern + legacy)
- Session management with automatic cleanup
Modern Streamable HTTP Endpoints (MCP 2025-03-26)
Client-to-server requestsUsed for:
- Initialization requests (
initialize) - Tool calls and resource requests
- Session management
mcp-session-id: Session identifier (required for existing sessions)Content-Type:application/json
Server-to-client notificationsLong-lived connection for receiving server-initiated messages and notifications via Server-Sent Events (SSE).Headers:
mcp-session-id: Session identifier (required)
Session terminationCleanly closes a session and releases resources.Headers:
mcp-session-id: Session identifier (required)
Health check endpointReturns server status and timestamp. Useful for monitoring and load balancer health checks.Example:Response:
Legacy SSE Endpoints (MCP 2024-11-05)
For backwards compatibility with older MCP clients:SSE stream initializationEstablishes a Server-Sent Events connection for older clients that don’t support Streamable HTTP.Example:
Client message postingSend messages from legacy clients to the server.Query Parameters:
sessionId: Session identifier (required)
Configuration
- NPX/Node.js
- Docker
- Docker Compose
- .env Configuration
Choosing the Right Transport Mode
Use Stdio for
- Desktop MCP clients
- Local development
- Single-user setups
- Maximum security (no network exposure)
Use HTTP for
- Web applications
- Remote access
- Multi-user scenarios
- Microservices architecture
Client Compatibility
Stdio Mode Clients
- Cursor - Full support
- VS Code - Full support
- Claude Desktop - Full support
- Windsurf - Full support
- Zed - Full support
- BoltAI - Full support
HTTP Mode Clients
- Modern clients (MCP 2025-03-26+) - Use
/mcpendpoints automatically - Legacy clients (MCP 2024-11-05) - Use
/sseand/messagesendpoints - Custom integrations - Choose the appropriate protocol
The server automatically detects which protocol the client is using and routes requests accordingly. You don’t need to configure protocol selection manually.
Session Management
In HTTP mode, the server implements automatic session management:- Session Creation: Automatically created on initialization
- Session ID: Generated using UUID v4
- Session Tracking: Separate tracking for Streamable HTTP and SSE sessions
- Automatic Cleanup: Sessions are cleaned up when:
- Client sends DELETE request
- Connection is closed
- Client disconnects
Port Configuration
Port mapping examples:Troubleshooting
Stdio Mode Issues
Server not starting
Server not starting
- Check Node.js version (v18+ required)
- Verify
npxis available:npx --version - Check MCP client logs for error messages
- Try running manually:
npx -y @ahdev/dokploy-mcp
No tools showing up
No tools showing up
- Verify environment variables are set correctly
- Check DOKPLOY_URL includes
/apisuffix - Verify API token is valid
- Restart your MCP client
HTTP Mode Issues
Port already in use
Port already in use
If port 3000 is already in use:
Connection refused
Connection refused
- Verify the server is running:
curl http://localhost:3000/health - Check firewall rules aren’t blocking the port
- Ensure
MCP_TRANSPORT=httpis set - Check server logs for errors
Session errors
Session errors
If you receive “Invalid or missing session ID” errors:
- Make sure you’re sending initialization request first
- Store and reuse the session ID from initialization
- Check that session hasn’t expired or been terminated
- Verify
mcp-session-idheader is included in requests
See Also
- Environment Variables - Configure authentication and settings
- MCP Clients - Client-specific configuration guides