Skip to main content

Transport Types

add-mcp supports all three MCP transport types: HTTP, SSE, and stdio. The transport type determines how your coding agent communicates with the MCP server.

Overview

TransportTypeUse CaseDefault For
HTTPRemoteStreamable HTTP connectionsRemote URLs (default)
SSERemoteServer-Sent Events (legacy)Remote URLs (with --transport sse)
stdioLocalStandard input/outputnpm packages & commands

HTTP Transport

Streamable HTTP is the default transport for remote MCP servers.

When to Use

  • Modern remote MCP servers
  • Production deployments
  • Servers requiring streaming responses

Configuration

HTTP is the default transport for remote URLs:
# HTTP is used by default for remote URLs
npx add-mcp https://mcp.example.com/mcp

# Explicitly specify HTTP transport
npx add-mcp https://mcp.example.com/mcp --transport http

Example

# Install remote MCP server with HTTP transport (default)
npx add-mcp https://mcp.context7.com/mcp

# With authentication
npx add-mcp https://mcp.example.com/mcp --header "Authorization: Bearer $TOKEN"

Generated Configuration

For agents like VS Code, Zed, and Codex, the type field is set to "http":
{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "https://mcp.example.com/mcp"
    }
  }
}
For agents like Cursor and OpenCode, the type field is optional and may be omitted.

SSE Transport

Server-Sent Events (SSE) is a legacy transport type supported by some MCP servers.

When to Use

  • Legacy MCP servers that don’t support HTTP transport
  • Servers explicitly requiring SSE connections
  • Backward compatibility with older MCP implementations

Configuration

Specify SSE transport with the --transport sse flag:
# Use SSE transport for remote servers
npx add-mcp https://mcp.example.com/sse --transport sse

# Alternative: --type flag
npx add-mcp https://mcp.example.com/sse --type sse

Example

# Install remote MCP server with SSE transport
npx add-mcp https://mcp.example.com/sse --transport sse

# With authentication
npx add-mcp https://mcp.example.com/sse --transport sse --header "Authorization: Bearer $TOKEN"

Generated Configuration

For most agents, the type field is set to "sse":
{
  "mcpServers": {
    "my-server": {
      "type": "sse",
      "url": "https://mcp.example.com/sse"
    }
  }
}
For Goose, SSE is transformed to "sse" type:
extensions:
  - name: my-server
    type: sse
    uri: https://mcp.example.com/sse
    enabled: true

stdio Transport

Standard input/output (stdio) is used for local MCP servers that run as child processes.

When to Use

  • npm packages (e.g., @modelcontextprotocol/server-postgres)
  • Local command-line scripts
  • Development and testing
  • Any MCP server that runs locally

Configuration

stdio transport is automatically used for non-URL sources:
# npm package (uses stdio automatically)
npx add-mcp @modelcontextprotocol/server-postgres

# Full command with arguments
npx add-mcp "npx -y @org/mcp-server --flag value"

# Node.js script
npx add-mcp "node /path/to/server.js --port 3000"

Example

# Install npm package as MCP server
npx add-mcp @modelcontextprotocol/server-postgres

# Install with custom arguments
npx add-mcp "npx -y mcp-server-github --token $GITHUB_TOKEN"

Generated Configuration

For stdio servers, the configuration includes command and args:
{
  "mcpServers": {
    "server-postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"]
    }
  }
}

Transport Compatibility

Not all agents support all transport types:

Claude Desktop

Only supports stdio transport. Claude Desktop does not support remote (HTTP/SSE) servers through its config file. If you try to install a remote server to Claude Desktop:
npx add-mcp https://mcp.example.com/mcp -a claude-desktop
You’ll receive this message:
Claude Desktop only supports local (stdio) servers via its config file. Add remote servers through Settings → Connectors in the app instead.

All Other Agents

All other supported agents (Cursor, VS Code, Claude Code, Codex, OpenCode, Gemini CLI, Goose, GitHub Copilot CLI, Zed) support all three transports: stdio, HTTP, and SSE.

Specifying Transport Type

Use the --transport or --type flag to explicitly set the transport:
# Using --transport
npx add-mcp https://mcp.example.com/mcp --transport http
npx add-mcp https://mcp.example.com/sse --transport sse

# Using --type (alias)
npx add-mcp https://mcp.example.com/mcp --type http
npx add-mcp https://mcp.example.com/sse --type sse

Valid Options

  • http - Streamable HTTP (default for remote URLs)
  • sse - Server-Sent Events
The stdio transport is automatically used for local packages and commands - you cannot specify it explicitly.

Transport Validation

When you specify agents with --agent or --all, add-mcp validates that the selected agents support the required transport:
# This will error because Claude Desktop doesn't support HTTP
npx add-mcp https://mcp.example.com/mcp -a claude-desktop

# This will skip Claude Desktop and continue with other agents
npx add-mcp https://mcp.example.com/mcp --all
With the --all flag, add-mcp will warn about unsupported agents but continue with compatible ones:
⚠ Skipping agents that don't support http transport: Claude Desktop
ℹ Claude Desktop only supports local (stdio) servers via its config file.
  Add remote servers through Settings → Connectors in the app instead.

Agent-Specific Configuration

Different agents may transform the transport configuration slightly:

Goose

Goose uses streamable_http for HTTP and sse for SSE:
extensions:
  - name: my-server
    type: streamable_http  # HTTP transport
    uri: https://mcp.example.com/mcp
    enabled: true

  - name: another-server
    type: sse  # SSE transport
    uri: https://mcp.example.com/sse
    enabled: true

Cursor and OpenCode

Cursor and OpenCode don’t always require the type field for remote servers:
{
  "mcpServers": {
    "my-server": {
      "url": "https://mcp.example.com/mcp"
    }
  }
}

Other Agents

Most agents (VS Code, Codex, Zed, etc.) require the type field:
{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "https://mcp.example.com/mcp"
    }
  }
}
  • Agents - See which agents support which transports
  • Scopes - Understand project vs global installation

Build docs developers (and LLMs) love