Skip to content

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

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"
    

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions