Skip to content

customize-opencode skill: MCP local config uses env but schema requires environment #39135

Description

@VictorBlancoTech

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

  1. 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" }
  }
}
  1. opencode mcp list✗ failed / MCP error -32000: Connection closed.
  2. Change envenvironment✓ 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions