Skip to content

tui: MCP servers not visible in TUI despite appearing in mcp list #36623

Closed

Description

@pyforgedev

Summary

MCP servers configured in ~/.config/opencode/opencode.json are detected and functional via CLI (opencode2 mcp list, opencode2 api) but are not visible or accessible in the TUI. The MCP tools work when called programmatically but the TUI session does not surface them.

Environment

  • opencode version: 0.0.0-next-15402 (next channel)
  • OS: Linux 6.6.114.1-microsoft-standard-WSL2 x86_64
  • Terminal: VSCode integrated terminal, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/bash
  • Active plugins: None

Reproduction

  1. Add a remote MCP server (context7) to ~/.config/opencode/opencode.json:
    "mcp": {
      "servers": {
        "context7": {
          "type": "remote",
          "url": "https://mcp.context7.com/mcp",
          "headers": {
            "CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
          },
          "disabled": false
        }
      }
    }
  2. Run opencode2 mcp list → shows ✓ context7 connected with 2 tools
  3. Run opencode2 to open TUI → MCP tools are not visible/accessible to the agent
  4. MCP tools work via execute (programmatic call succeeds), confirming the server is functional
  5. Log shows "mcp connected" server=context7 tools=2 only when triggered by CLI mcp list commands, not during the TUI service session

Expected Behavior

MCP server tools should be available to the agent in TUI sessions so users can interact with them through conversation.

Actual Behavior

TUI does not surface MCP tools despite opencode2 mcp list confirming the server is connected. The background service (run ID from logs) processes events from a different location (/tmp/nomcp) and does not show MCP connections in its session.

Additional Context

  • Config file is the global ~/.config/opencode/opencode.json
  • Restarting the service (opencode2 service restart) does not resolve the issue
  • opencode2 --standalone not yet tested
  • Log excerpts:
    timestamp=... level=INFO run=58bc73f2 message="mcp connected" server=context7 tools=2
    timestamp=... level=WARN run=58bc73f2 message="failed to list MCP resources" server=context7 error="MCP error -32001: Request timed out"
    

Activity

  1. github-actions commented on Jul 13, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • [BUG] MCP tools connected but not exposed to agent #33027: Same symptoms — MCP tools show as connected via mcp list but are not exposed to the agent in TUI sessions, with the same reproduction pattern (global config, stdio/remote transport, programmatic calls work but TUI does not surface tools).
  2. pyforgedev commented on Jul 13, 2026

    @pyforgedev
    Author

    Confirmed: The shared background service retains stale cached config even after opencode2 service stop && sleep 2 && opencode2 service start. opencode2 --standalone works correctly — MCP tools appear in standalone mode. The bug is in the shared service's config reload/caching, not the TUI client.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions