Skip to content

Commit 81fb1b3

Browse files
Fix a broken example in the MCP documentation and add more clarity (anomalyco#1322)
1 parent 3a7a2a8 commit 81fb1b3

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

packages/web/src/content/docs/docs/mcp-servers.mdx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can define MCP servers in your opencode config under `mcp`.
1818

1919
### Local
2020

21-
Add local MCP servers under `mcp` with `"type": "local"`.
21+
Add local MCP servers using `"type": "local"` within the MCP object. Multiple MCP servers can be added. The key string for each server can be any arbitrary name.
2222

2323
```json title="opencode.json"
2424
{
@@ -31,7 +31,7 @@ Add local MCP servers under `mcp` with `"type": "local"`.
3131
"environment": {
3232
"MY_ENV_VAR": "my_env_var_value"
3333
}
34-
}, {
34+
},
3535
"my-different-local-mcp-server": {
3636
"type": "local",
3737
"command": ["bun", "x", "my-other-mcp-command"],
@@ -62,3 +62,28 @@ Add remote MCP servers under `mcp` with `"type": "remote"`.
6262
}
6363
}
6464
```
65+
66+
Local and remote servers can be used together within the same `mcp` config object.
67+
68+
```json title="opencode.json"
69+
{
70+
"$schema": "https://opencode.ai/config.json",
71+
"mcp": {
72+
"my-local-mcp-server": {
73+
"type": "local",
74+
"command": ["bun", "x", "my-mcp-command"],
75+
"enabled": true,
76+
"environment": {
77+
"MY_ENV_VAR": "my_env_var_value"
78+
}
79+
},
80+
"my-remote-mcp": {
81+
"type": "remote",
82+
"url": "https://my-mcp-server.com",
83+
"enabled": true,
84+
"headers": {
85+
"Authorization": "Bearer MY_API_KEY"
86+
}
87+
}
88+
}
89+
}

0 commit comments

Comments
 (0)