Forráskód Böngészése

Fix a broken example in the MCP documentation and add more clarity (#1322)

Michael Hanson 7 hónapja
szülő
commit
81fb1b313e
1 módosított fájl, 27 hozzáadás és 2 törlés
  1. 27 2
      packages/web/src/content/docs/docs/mcp-servers.mdx

+ 27 - 2
packages/web/src/content/docs/docs/mcp-servers.mdx

@@ -18,7 +18,7 @@ You can define MCP servers in your opencode config under `mcp`.
 
 
 ### Local
 ### 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"
 ```json title="opencode.json"
 {
 {
@@ -31,7 +31,7 @@ Add local MCP servers under `mcp` with `"type": "local"`.
       "environment": {
       "environment": {
         "MY_ENV_VAR": "my_env_var_value"
         "MY_ENV_VAR": "my_env_var_value"
       }
       }
-    }, {
+    },
     "my-different-local-mcp-server": {
     "my-different-local-mcp-server": {
       "type": "local",
       "type": "local",
       "command": ["bun", "x", "my-other-mcp-command"],
       "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"
+      }
+    }
+  }
+}