Skip to content

cli: show which config sources were loaded (and why) in mcp list / debug config #60015

Open

Description

@niebloomj

Summary

When OPENCODE_CONFIG_DIR is set, the global ~/.config/opencode folder is silently skipped (see #32825). Users can't easily tell which config folders and files OpenCode actually loaded, so MCP servers, agents or skills go missing with no explanation.

Proposal

  • opencode mcp list: when no servers come from the default global folder, print a short header naming the folders it read, e.g. config: /path/a (OPENCODE_CONFIG_DIR), /project/.opencode.
  • opencode debug config: list folders that were skipped and the reason, e.g. ~/.config/opencode skipped: replaced by OPENCODE_CONFIG_DIR.
  • Optionally, a warning when an older OpenCode version earlier on PATH differs from the one the background service runs.

Why

I spent a while debugging "MCP server not connecting". The server worked fine; it simply wasn't in any config OpenCode read. An older binary earlier on PATH reported it as connected, which added to the confusion.

Environment

  • opencode 2.2.0 (desktop + Homebrew CLI)
  • macOS 25.6.0 arm64, zsh
  • Plugins: one third-party plugin, unrelated

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @niebloomj! You're asking OpenCode to show which config sources it actually used:

    • opencode mcp list would name the folders it read.
    • opencode debug config would also list folders it skipped and why (e.g. ~/.config/opencode replaced by OPENCODE_CONFIG_DIR).
    • Optionally, a warning when the binary on PATH is a different version from the background service.

    Today debug config only prints the merged result, so it can't explain why something is missing. Maintainers will consider this.

    Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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