Skip to main content
A transport defines how an MCP client (your AI coding agent) communicates with an MCP server. add-mcp supports all three transport types defined by the MCP specification and writes the correct config format for each one into the target agent’s configuration file.

Transport overview

HTTP (streamable HTTP)

Streamable HTTP is the default transport for remote servers. When your source starts with http:// or https://, add-mcp automatically configures the server entry with "type": "http" (or the equivalent field for the target agent). You do not need to pass any flag:
Most modern agents — including Cursor, Claude Code, Codex, Gemini CLI, VS Code, and OpenCode — support streamable HTTP.

SSE (Server-Sent Events)

SSE is an older MCP transport that some servers still use. It is deprecated by the MCP specification but remains widely supported across agents. Pass --transport sse (or --type sse) to use it:
The --transport and --type options are aliases — they behave identically. Use whichever feels more natural in your workflow.

stdio

stdio is used for local MCP servers: npm packages and shell commands that run as child processes. add-mcp detects these automatically based on the source format — no flag is needed:
When the source is a package or command, add-mcp generates a config entry with command, args, and optionally env fields — the standard stdio shape expected by all agents.

How add-mcp infers source type

add-mcp inspects the raw input string to decide which source type (and therefore which transport) applies:
Any input starting with http:// or https:// is treated as a remote server. The transport defaults to http; pass --transport sse to override.

Agent transport compatibility

All agents except Claude Desktop support all three transport types. Claude Desktop is stdio only — it can only run local MCP servers through its config file. If you attempt to install a remote server (HTTP or SSE) to Claude Desktop, add-mcp will show an error and direct you to use the in-app Settings → Connectors interface instead.
Claude Desktop does not support HTTP or SSE transports via its config file. To connect Claude Desktop to a remote MCP server, use the Connectors section in the application’s settings.

Adding headers and environment variables

For remote servers you can attach authentication headers with --header:
For stdio servers you can pass environment variables with --env and extra arguments with --args:
Both flags are repeatable and can be combined in the same command.