You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 70e8a0f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: services/site/src/docs/content/mcp-servers.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ Use configuration for other process options such as a working directory:
119
119
|`disabled`| No | Prevents connection when `true`. Defaults to `false`. |
120
120
|`codemode`| No | Set to `false` to expose tools directly instead of through Code Mode. Defaults to `true`. |
121
121
|`timeout`| No | Per-server timeout overrides. |
122
-
|`protocol`| No |`legacy` (default), `auto`, or `2026-07-28`. See [Protocol version](#protocol-version). |
122
+
|`protocol`| No |`auto` (default), `legacy`, or `2026-07-28`. See [Protocol version](#protocol-version). |
123
123
|`pool`| No | Share one connection across directories. Defaults to `false`. See [Shared connections](#shared-connections). |
124
124
125
125
Use `{env:NAME}` for environment substitution. Shell expressions such as `$NAME` are not expanded in JSON strings:
@@ -175,7 +175,7 @@ Use configuration for other options. Store secrets in environment variables rath
175
175
|`disabled`| No | Prevents connection when `true`. Defaults to `false`. |
176
176
|`codemode`| No | Set to `false` to expose tools directly instead of through Code Mode. Defaults to `true`. |
177
177
|`timeout`| No | Per-server timeout overrides. |
178
-
|`protocol`| No |`legacy` (default), `auto`, or `2026-07-28`. See [Protocol version](#protocol-version). |
178
+
|`protocol`| No |`auto` (default), `legacy`, or `2026-07-28`. See [Protocol version](#protocol-version). |
179
179
|`pool`| No | Share one connection across directories. Defaults to `false`. See [Shared connections](#shared-connections). |
180
180
181
181
Use `oauth: false` only when the server exclusively uses an API key or another header credential:
@@ -335,17 +335,17 @@ Timeouts are positive integer milliseconds. Set defaults under `mcp.timeout`; a
335
335
336
336
## Protocol version
337
337
338
-
OpenCode opens every server with the classic MCP `initialize` handshake by default. Set a server's `protocol` to talk to one built on the 2026-07-28 revision:
338
+
OpenCode probes every server for the 2026-07-28 revision by default and falls back to the classic MCP `initialize` handshake when the server does not support it. Set a server's `protocol` to `legacy` to skip the probe:
339
339
340
340
```jsonc title="opencode.jsonc"
341
341
{
342
342
"$schema":"https://opencode.ai/config.json",
343
343
"mcp": {
344
344
"servers": {
345
-
"modern": {
345
+
"older": {
346
346
"type":"remote",
347
347
"url":"https://mcp.example.com/mcp",
348
-
"protocol":"auto",
348
+
"protocol":"legacy",
349
349
},
350
350
},
351
351
},
@@ -354,11 +354,11 @@ OpenCode opens every server with the classic MCP `initialize` handshake by defau
354
354
355
355
| Value | Behavior |
356
356
| --- | --- |
357
-
|`legacy`| Default. Sends `initialize` and speaks protocol revisions up to 2025-11-25. |
358
-
|`auto`|Probes with `server/discover` for the 2026-07-28 revision and falls back to `legacy` when the server does not support it. |
357
+
|`auto`| Default. Probes with `server/discover` for the 2026-07-28 revision and falls back to `legacy` when the server does not support it, including when a remote server answers the probe with an HTTP 5xx error. |
358
+
|`legacy`|Sends `initialize` and speaks protocol revisions up to 2025-11-25. |
359
359
|`2026-07-28`| Requires the 2026-07-28 revision. The connection fails against older servers. |
360
360
361
-
Probing a local `legacy`server adds a short-lived extra process and can wait up to the startup timeout when the server ignores unknown requests, so keep `auto` scoped to servers that need it.
361
+
Probing an older local server adds a short-lived extra process and can wait up to the startup timeout when the server ignores unknown requests, so set `legacy` on servers you know predate the 2026-07-28 revision.
362
362
363
363
## Shared connections
364
364
@@ -379,7 +379,7 @@ One OpenCode server can have many directories open, and each one connects to eve
379
379
}
380
380
```
381
381
382
-
- Only connections on the 2026-07-28 revision are shared. With `pool` set, an unset `protocol` means `auto`. A server that answers with an older revision, or one set to `legacy`, keeps one connection per directory.
382
+
- Only connections on the 2026-07-28 revision are shared. A server that answers with an older revision, or one set to `legacy`, keeps one connection per directory.
383
383
- Directories share a connection only when everything that changes it matches: the URL, headers, OAuth settings and signed-in account for a remote server, and the command, working directory and environment for a local one. Timeouts and `protocol` must match too. The server's name doesn't need to, but sign-ins are stored per name, so an OAuth server is shared only under the same name.
384
384
- A local server is shared only between directories on this machine, not ones in a workspace. Sharing it across projects needs a fixed `cwd`, such as `"~"`. Without one it runs in each project's folder, so each project gets its own and OpenCode logs a warning.
385
385
- A shared connection has no roots. When a tool asks for input, the request appears in the directory that called it.
0 commit comments