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
@@ -100,6 +101,9 @@ Enable secrets with `/sync-enable-secrets` or set `"includeSecrets": true`:
100
101
-`~/.local/share/opencode/mcp-auth.json`
101
102
- Any extra paths in `extraSecretPaths` (allowlist)
102
103
104
+
MCP API keys stored inside `opencode.json(c)` are **not** committed by default. To allow them
105
+
in a private repo, set `"includeMcpSecrets": true` (requires `includeSecrets`).
106
+
103
107
### Sessions (private repos only)
104
108
105
109
Sync your OpenCode sessions (conversation history from `/sessions`) across machines by setting `"includeSessions": true`. This requires `includeSecrets` to also be enabled since sessions may contain sensitive data.
@@ -146,6 +150,22 @@ Create a local-only overrides file at:
146
150
147
151
Overrides are merged into the runtime config and re-applied to `opencode.json(c)` after pull.
148
152
153
+
### MCP secret scrubbing
154
+
155
+
If your `opencode.json(c)` contains MCP secrets (for example `mcp.*.headers` or `mcp.*.oauth.clientSecret`), opencode-synced will automatically:
156
+
157
+
1. Move the secret values into `opencode-synced.overrides.jsonc` (local-only).
158
+
2. Replace the values in the synced config with `{env:...}` placeholders.
159
+
160
+
This keeps secrets out of the repo while preserving local behavior. On other machines, set the matching environment variables (or add local overrides).
161
+
If you want MCP secrets committed (private repos only), set `"includeMcpSecrets": true` alongside `"includeSecrets": true`.
162
+
163
+
Env var naming rules:
164
+
165
+
- If the header name already looks like an env var (e.g. `CONTEXT7_API_KEY`), it is used directly.
166
+
- Otherwise: `OPENCODE_MCP_<SERVER>_<HEADER>` (uppercase, non-alphanumerics become `_`).
167
+
- OAuth client secrets use `OPENCODE_MCP_<SERVER>_OAUTH_CLIENT_SECRET`.
0 commit comments