Bug
The built-in customize-opencode skill documents the field for env vars in local MCP servers as env, but the actual JSON Schema (https://opencode.ai/config.json, $defs/McpLocalConfig) requires environment`.
Since McpLocalConfig has additionalProperties: false, the env key is silently ignored. Result: the spawned MCP process starts without the documented env vars, which in many servers causes an immediate crash and the agent reports the opaque error MCP error -32000: Connection closed.
Where the skill is wrong
The skill body (shown to the model when invoked) contains this example:
"mcp": {
"playwright": {
"type": "local",
"command": ["npx", "-y", "@playwright/mcp"],
"enabled": true,
"env": { "BROWSER": "chromium" } // <- wrong key
}
}
And in the prose section "MCP servers":
"mcp": {
"playwright": {
"type": "local",
"command": ["npx", "-y", "@playwright/mcp"],
"enabled": true,
"env": { "BROWSER": "chromium" } // <- wrong key
},
...
}
The field name in both should be environment, per the published schema.
Reproduction
- Configure a local MCP server using the skill's example shape:
"mcp": {
"google-calendar": {
"type": "local",
"command": ["/opt/homebrew/bin/google-calendar-mcp"],
"enabled": true,
"env": { "GOOGLE_OAUTH_CREDENTIALS": "/path/to/keys.json" }
}
}
opencode mcp list → ✗ failed / MCP error -32000: Connection closed.
- Change
env → environment → ✓ connected.
Suggested fix
Replace env with environment in both customize-opencode skill examples. Similar in spirit to the already-fixed #29611 — the skill is the primary source of truth models see, so any drift from the schema propagates silently into broken configs.
Environment
- opencode 1.18.7
- macOS (darwin arm64)
- Discovered while wiring
@cocal/google-calendar-mcp — works fine after correcting the key.
Bug
The built-in
customize-opencodeskill documents the field for env vars in local MCP servers asenv, but the actual JSON Schema (https://opencode.ai/config.json, $defs/McpLocalConfig) requiresenvironment`.Since
McpLocalConfighasadditionalProperties: false, theenvkey is silently ignored. Result: the spawned MCP process starts without the documented env vars, which in many servers causes an immediate crash and the agent reports the opaque errorMCP error -32000: Connection closed.Where the skill is wrong
The skill body (shown to the model when invoked) contains this example:
And in the prose section "MCP servers":
The field name in both should be
environment, per the published schema.Reproduction
opencode mcp list→✗ failed / MCP error -32000: Connection closed.env→environment→✓ connected.Suggested fix
Replace
envwithenvironmentin bothcustomize-opencodeskill examples. Similar in spirit to the already-fixed #29611 — the skill is the primary source of truth models see, so any drift from the schema propagates silently into broken configs.Environment
@cocal/google-calendar-mcp— works fine after correcting the key.