Skip to content

The open source coding agent.

TypeScript

docs: mcp

Dax Raadc738e26438f1
diff --git a/README.md b/README.md
index 5bc09bd4843..ddbf6545c7b 100644
--- a/README.md
+++ b/README.md
@@ -56,3 +56,22 @@ Project configuration is optional. You can place an `opencode.json` file in the
```
#### MCP
+
+```json title="opencode.json"
+{
+ "$schema": "http://opencode.ai/config.json",
+ "mcp": {
+ "localmcp": {
+ "type": "local",
+ "command": ["bun", "x", "my-mcp-command"],
+ "environment": {
+ "MY_ENV_VAR": "my_env_var_value"
+ }
+ },
+ "remotemcp": {
+ "type": "remote",
+ "url": "https://my-mcp-server.com"
+ }
+ }
+}
+```
diff --git a/opencode.json b/opencode.json
index aa640e8d494..3404b141fef 100644
--- a/opencode.json
+++ b/opencode.json
@@ -1,3 +1,16 @@
{
- "$schema": "http://opencode.ai/config.json"
+ "$schema": "http://opencode.ai/config.json",
+ "mcp": {
+ "localmcp": {
+ "type": "local",
+ "command": ["bun", "x", "my-mcp-command"],
+ "environment": {
+ "MY_ENV_VAR": "my_env_var_value"
+ }
+ },
+ "remotemcp": {
+ "type": "remote",
+ "url": "https://my-mcp-server.com"
+ }
+ }
}