MCP Server file: failed to unmarshall config: decoding #652

Closed
opened 2026-02-16 17:27:44 -05:00 by yindo · 2 comments
Owner

Originally created by @tne-ops on GitHub (Jul 11, 2025).

Originally assigned to: @thdxr on GitHub.

Are there some syntax differences between the mcp json you accept and what others do. I have the same mcpServers working in Roo Code, Claude Code and Gemini Code but not in opencode:

The error is:

Error: failed to unmarshal config: decoding failed due to the following error(s):
'MCPServers[context7].Env[0]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[default_minimum_tokens:]

The offending mcpServer contents in .opencode.json is and it looks like the env key has this problem. In fact every entry with a env key generates the:

    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"],
      "env": {
        "DEFAULT_MINIMUM_TOKENS": ""
      },
      "disabled": false,
      "alwaysAllow": ["resolve-library-id", "get-library-docs"]
    },
Originally created by @tne-ops on GitHub (Jul 11, 2025). Originally assigned to: @thdxr on GitHub. Are there some syntax differences between the mcp json you accept and what others do. I have the same mcpServers working in Roo Code, Claude Code and Gemini Code but not in opencode: The error is: ``` Error: failed to unmarshal config: decoding failed due to the following error(s): 'MCPServers[context7].Env[0]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[default_minimum_tokens:] ``` The offending mcpServer contents in .opencode.json is and it looks like the env key has this problem. In fact every entry with a env key generates the: ``` "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"], "env": { "DEFAULT_MINIMUM_TOKENS": "" }, "disabled": false, "alwaysAllow": ["resolve-library-id", "get-library-docs"] }, ```
yindo closed this issue 2026-02-16 17:27:44 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@richtong commented on GitHub (Jan 8, 2026):

how do we reopen this issue?

@richtong commented on GitHub (Jan 8, 2026): how do we reopen this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#652