Skip to content

Commit 82acf2a

Browse files
authored
Merge pull request #5276 from modelcontextprotocol/v2/docs/521-readme-transports
docs: explain stdio vs Streamable HTTP in the root README
2 parents d131a87 + f26c4f7 commit 82acf2a

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ The following reference servers are now archived and can be found at [servers-ar
5555
## 🚀 Getting Started
5656

5757
### Using MCP Servers in this Repository
58-
TypeScript-based servers in this repository can be used directly with `npx`.
58+
TypeScript-based servers in this repository can be started with `npx`.
5959

6060
For example, this will start the [Memory](src/memory) server:
6161
```sh
6262
npx -y @modelcontextprotocol/server-memory
6363
```
6464

65-
Python-based servers in this repository can be used directly with [`uvx`](https://docs.astral.sh/uv/concepts/tools/) or [`pip`](https://pypi.org/project/pip/). `uvx` is recommended for ease of use and setup.
65+
Python-based servers in this repository can be started with [`uvx`](https://docs.astral.sh/uv/concepts/tools/) or [`pip`](https://pypi.org/project/pip/). `uvx` is recommended for ease of use and setup.
6666

6767
For example, this will start the [Git](src/git) server:
6868
```sh
@@ -116,13 +116,6 @@ Additional examples of using the Claude Desktop as an MCP client might look like
116116
"command": "uvx",
117117
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
118118
},
119-
"github": {
120-
"command": "npx",
121-
"args": ["-y", "@modelcontextprotocol/server-github"],
122-
"env": {
123-
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
124-
}
125-
},
126119
"postgres": {
127120
"command": "npx",
128121
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
@@ -133,6 +126,30 @@ Additional examples of using the Claude Desktop as an MCP client might look like
133126

134127
On Windows, apply the same wrapper to each `npx`-based entry above by changing `"command"` to `"cmd"` and prepending `"/c", "npx"` to the existing `args`. Leave `uvx` entries unchanged.
135128

129+
### Transports: stdio and Streamable HTTP
130+
131+
An MCP server talks to its client over a **transport**. The protocol defines two standard ones, and they run very differently:
132+
133+
| Transport | How the server runs | How a client reaches it |
134+
|---|---|---|
135+
| **stdio** | The client launches the server as a subprocess and talks to it over the process's stdin and stdout. The server opens no port. | A `command` and `args` in the client's configuration, as in the examples above |
136+
| **Streamable HTTP** | The server runs on its own as an HTTP service, and can serve many clients | A URL, such as `http://localhost:3001/mcp` |
137+
138+
**Every server in this repository serves stdio, and only [Everything](src/everything) also serves Streamable HTTP** (its README shows how to start it that way, and covers its deprecated HTTP+SSE transport too). So when you run `uvx mcp-server-git` or `npx -y @modelcontextprotocol/server-memory` in a terminal, it opens no port, prints at most a one-line startup notice, and then appears to hang. That is expected: it is waiting for a client to send it messages on stdin. You do not normally start a stdio server yourself; your MCP client starts it from its configuration and stops it when it is done.
139+
140+
To try a server without setting up a client, use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector). Given a stdio server's command, it launches the server for you and lets you browse and call its tools; given a URL, it connects to a running Streamable HTTP server:
141+
142+
```sh
143+
# A stdio server: the Inspector launches it
144+
npx @modelcontextprotocol/inspector uvx mcp-server-git
145+
146+
# A Streamable HTTP server: start it first, then connect to its URL
147+
npx @modelcontextprotocol/server-everything streamableHttp
148+
npx @modelcontextprotocol/inspector --transport http --server-url http://localhost:3001/mcp
149+
```
150+
151+
For more, see the [transport layer](https://modelcontextprotocol.io/docs/learn/architecture#transport-layer) in the MCP architecture overview, and [Transports](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports) in the specification.
152+
136153
## 🛠️ Creating Your Own Server
137154

138155
Interested in creating your own MCP server? Visit the official documentation at [modelcontextprotocol.io](https://modelcontextprotocol.io/introduction) for comprehensive guides, best practices, and technical details on implementing MCP servers.

0 commit comments

Comments
 (0)