Skip to content

Commit 7d384e9

Browse files
Document transport types and default-server functionality
- Add examples for stdio, sse, and streamable-http transport types - Document automatic server selection behavior - Show how to use default-server in config files
1 parent 90237f1 commit 7d384e9

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,73 @@ Example server configuration file:
234234
}
235235
```
236236

237+
#### Transport Types in Config Files
238+
239+
The inspector automatically detects the transport type from your config file. You can specify different transport types:
240+
241+
**STDIO (default):**
242+
```json
243+
{
244+
"mcpServers": {
245+
"my-stdio-server": {
246+
"type": "stdio",
247+
"command": "npx",
248+
"args": ["@modelcontextprotocol/server-everything"]
249+
}
250+
}
251+
}
252+
```
253+
254+
**SSE (Server-Sent Events):**
255+
```json
256+
{
257+
"mcpServers": {
258+
"my-sse-server": {
259+
"type": "sse",
260+
"url": "http://localhost:3000/sse"
261+
}
262+
}
263+
}
264+
```
265+
266+
**Streamable HTTP:**
267+
```json
268+
{
269+
"mcpServers": {
270+
"my-http-server": {
271+
"type": "streamable-http",
272+
"url": "http://localhost:3000/mcp"
273+
}
274+
}
275+
}
276+
```
277+
278+
#### Default Server Selection
279+
280+
You can launch the inspector without specifying a server name if your config has:
281+
282+
1. **A single server** - automatically selected:
283+
```bash
284+
# Automatically uses "my-server" if it's the only one
285+
npx @modelcontextprotocol/inspector --config config.json
286+
```
287+
288+
2. **A server named "default-server"** - automatically selected:
289+
```json
290+
{
291+
"mcpServers": {
292+
"default-server": {
293+
"command": "npx",
294+
"args": ["@modelcontextprotocol/server-everything"]
295+
},
296+
"other-server": {
297+
"command": "node",
298+
"args": ["other.js"]
299+
}
300+
}
301+
}
302+
```
303+
237304
> **Tip:** You can easily generate this configuration format using the **Server Entry** and **Servers File** buttons in the Inspector UI, as described in the Servers File Export section above.
238305
239306
You can also set the initial `transport` type, `serverUrl`, `serverCommand`, and `serverArgs` via query params, for example:

0 commit comments

Comments
 (0)