Skip to content

Transport Modes

The server automatically selects the appropriate transport mode based on configuration.

Automatic Mode Selection

ConfigurationTransport ModeEndpointsUse Case
PORT env var presentHTTP (Dual)/sse and /mcpWeb clients, HTTP-based MCP
No PORT env varstdioN/ACLI tools, direct MCP
stdio argumentstdio (forced)N/AOverride PORT when set

HTTP Mode (Dual Transport)

When PORT is set, the server starts an Express HTTP server providing both endpoints simultaneously:

  • /mcp — StreamableHTTP (recommended for modern clients)
  • /sse — Server-Sent Events (backwards compatibility)

Features:

  • Session management and reconnection
  • Perfect for web-based MCP clients
  • Supports TLS termination (direct or via reverse proxy)

stdio Mode

Direct stdin/stdout communication:

  • No HTTP server required
  • Optimal for command-line tools
  • Lower resource usage
  • Used by most desktop MCP clients (Claude Desktop, VS Code, Cursor)

Forcing stdio Mode

If PORT is set but you need stdio mode:

bash
npx @structured-world/gitlab-mcp stdio

The stdio argument overrides the PORT environment variable.

Released under the Apache 2.0 License.