mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 03:04:21 +01:00
Fix a broken example in the MCP documentation and add more clarity (#1322)
This commit is contained in:
@@ -18,7 +18,7 @@ You can define MCP servers in your opencode config under `mcp`.
|
||||
|
||||
### Local
|
||||
|
||||
Add local MCP servers under `mcp` with `"type": "local"`.
|
||||
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.
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
@@ -31,7 +31,7 @@ Add local MCP servers under `mcp` with `"type": "local"`.
|
||||
"environment": {
|
||||
"MY_ENV_VAR": "my_env_var_value"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
"my-different-local-mcp-server": {
|
||||
"type": "local",
|
||||
"command": ["bun", "x", "my-other-mcp-command"],
|
||||
@@ -62,3 +62,28 @@ Add remote MCP servers under `mcp` with `"type": "remote"`.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Local and remote servers can be used together within the same `mcp` config object.
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"mcp": {
|
||||
"my-local-mcp-server": {
|
||||
"type": "local",
|
||||
"command": ["bun", "x", "my-mcp-command"],
|
||||
"enabled": true,
|
||||
"environment": {
|
||||
"MY_ENV_VAR": "my_env_var_value"
|
||||
}
|
||||
},
|
||||
"my-remote-mcp": {
|
||||
"type": "remote",
|
||||
"url": "https://my-mcp-server.com",
|
||||
"enabled": true,
|
||||
"headers": {
|
||||
"Authorization": "Bearer MY_API_KEY"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user