In Model Context Protocol (MCP), AI tools (clients) connect to MCP servers to extend their capabilities. There are two primary transport protocols (Stdio and SSE) and five common ways these servers are packaged and executed.
1. Transport Protocols (How they communicate)
A. Stdio (Standard Input/Output)
- How it works: The AI client launches the MCP server as a local background subprocess. They communicate by reading and writing JSON-RPC messages directly to stdin and stdout.
- Pros: Secure (local only), zero network setup, fast.
- Cons: The server must be installed on the same machine as the AI client.
B. SSE (Server-Sent Events over HTTP)
- How it works: The MCP server runs as an active web server (local or remote). The AI client connects to it over HTTP.
- Pros: Allows hosting servers in the cloud, sharing servers among multiple clients, and running them in remote environments (like Kubernetes or VMs).
- Cons: Requires network configuration and security authentication (e.g., API keys, OAuth).
2. The 5 Execution Methods (How they are launched)
When using the Stdio transport, the AI client launches the server subprocess. Here are the 5 standard ways this is configured:
1️⃣ Node.js Package Runner (npx)
- Used For: JavaScript/TypeScript MCP servers.
- How it works: Uses Node’s package runner to download, cache, and run the server without globally installing it.
- Example Config (
user-settings.yml):mcp_servers: chrome-devtools: command: "npx" # (npx.cmd on Windows) args: ["-y", "chrome-devtools-mcp"]
2️⃣ Python Package Runner (uvx or pip / python)
- Used For: Python-based MCP servers.
- How it works:
uvx(from Astral’suv) is the modern, extremely fast Python equivalent tonpx. It creates an ephemeral virtual environment, installs the package, and runs it. Alternatively, standard Python can run a script directly. - Example Config (
user-settings.yml):mcp_servers: git-helper: command: "uvx" args: ["mcp-server-git"]
3️⃣ Pre-compiled Native Binaries (Go, Rust, PyInstaller)
- Used For: Compiled languages (Go, Rust) or Python apps compiled into standalone executables (e.g., using PyInstaller).
- How it works: The server is distributed as a single native executable file (like a
.exeon Windows or a binary on Linux). It runs instantly with zero runtime dependencies (no Node or Python required). - Example Config (Local
ssh-mcpbinary):mcp_servers: ssh: command: "C:/path/to/ssh-mcp.exe" args: []
4️⃣ Docker Containers (docker run)
- Used For: Sandboxed and isolated execution.
- How it works: The AI tool runs a Docker command that launches a container. The standard I/O is piped through the container. This is excellent for databases or filesystems because it keeps your host machine safe.
- Example Config:
mcp_servers: sqlite: command: "docker" args: ["run", "-i", "--rm", "mcp/sqlite"]
5️⃣ Remote SSE Web Servers (HTTP/SSE)
- Used For: Remote APIs, database integrations, or cloud services.
- How it works: Instead of spawning a local command, the client connects to a URL endpoint.
- Example Config:
Some clients (like Claude Desktop) support a URL configuration:
{ "mcpServers": { "my-cloud-db": { "url": "https://mcp.mycompany.internal/sse" } } }