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
- 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
}
}
}
- Run
opencode2 mcp list → shows ✓ context7 connected with 2 tools
- Run
opencode2 to open TUI → MCP tools are not visible/accessible to the agent
- MCP tools work via
execute (programmatic call succeeds), confirming the server is functional
- 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"
Summary
MCP servers configured in
~/.config/opencode/opencode.jsonare 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
Reproduction
~/.config/opencode/opencode.json:opencode2 mcp list→ shows✓ context7 connectedwith 2 toolsopencode2to open TUI → MCP tools are not visible/accessible to the agentexecute(programmatic call succeeds), confirming the server is functional"mcp connected" server=context7 tools=2only when triggered by CLImcp listcommands, not during the TUI service sessionExpected 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 listconfirming 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/opencode/opencode.jsonopencode2 service restart) does not resolve the issueopencode2 --standalonenot yet tested