fix: Remote MCP type shows 'connected' but silently fails to register tools #6811

Open
opened 2026-02-16 18:05:20 -05:00 by yindo · 3 comments
Owner

Originally created by @chindris-mihai-alexandru on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When configuring an MCP server with "type": "remote", OpenCode shows the server as "connected" in the MCP status, but tools are silently not registered and unavailable. There is no error message in the UI or logs indicating the failure.

This is different from previously fixed issues #834 and #1595, which produced clear error messages like "MCP server failed to start".

Steps to Reproduce

  1. Configure a remote MCP server using SSE endpoint in ~/.config/opencode/opencode.json:
{
  "mcp": {
    "exa": {
      "type": "remote",
      "url": "https://mcp.exa.ai/mcp?exaApiKey=YOUR_KEY"
    }
  }
}
  1. Start OpenCode TUI
  2. Check MCP status - shows "connected" (green checkmark)
  3. Try to use any Exa tools - they are not available
  4. Check logs at ~/.local/share/opencode/log/ - no error messages about Exa

Expected Behavior

Either:

  • Tools should be registered and available when status shows "connected"
  • OR an error message should be displayed when tool registration fails

Actual Behavior

  • MCP status shows "connected" (implying success)
  • Tools are silently not registered
  • No error in UI or logs
  • User has no indication anything is wrong until they try to use the tools

Workaround

Using "type": "local" with npx works correctly:

{
  "mcp": {
    "exa": {
      "type": "local",
      "command": ["npx", "-y", "exa-mcp-server"],
      "environment": {
        "EXA_API_KEY": "your-key"
      }
    }
  }
}

Environment

Related Issues

  • #834 - Remote MCP servers using SSE fail to start (CLOSED - had clear error messages)
  • #1595 - MCP remote servers not configurable (CLOSED - had clear error messages)

This issue is distinct because the connection appears to succeed but tool registration silently fails.

Suggested Fix

When type: "remote" connection completes, verify that tools were actually registered. If tool registration fails, either:

  1. Display an error message to the user
  2. Update the MCP status to indicate partial failure
  3. Log a warning with troubleshooting guidance
Originally created by @chindris-mihai-alexandru on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description When configuring an MCP server with `"type": "remote"`, OpenCode shows the server as "connected" in the MCP status, but tools are silently not registered and unavailable. There is no error message in the UI or logs indicating the failure. This is different from previously fixed issues #834 and #1595, which produced clear error messages like "MCP server failed to start". ## Steps to Reproduce 1. Configure a remote MCP server using SSE endpoint in `~/.config/opencode/opencode.json`: ```json { "mcp": { "exa": { "type": "remote", "url": "https://mcp.exa.ai/mcp?exaApiKey=YOUR_KEY" } } } ``` 2. Start OpenCode TUI 3. Check MCP status - shows "connected" (green checkmark) 4. Try to use any Exa tools - they are not available 5. Check logs at `~/.local/share/opencode/log/` - no error messages about Exa ## Expected Behavior Either: - Tools should be registered and available when status shows "connected" - OR an error message should be displayed when tool registration fails ## Actual Behavior - MCP status shows "connected" (implying success) - Tools are silently not registered - No error in UI or logs - User has no indication anything is wrong until they try to use the tools ## Workaround Using `"type": "local"` with npx works correctly: ```json { "mcp": { "exa": { "type": "local", "command": ["npx", "-y", "exa-mcp-server"], "environment": { "EXA_API_KEY": "your-key" } } } } ``` ## Environment - **OpenCode version**: 1.1.25 - **OS**: macOS 15.7.4 (Darwin arm64) - **MCP server tested**: Exa (https://mcp.exa.ai/mcp) ## Related Issues - #834 - Remote MCP servers using SSE fail to start (CLOSED - had clear error messages) - #1595 - MCP remote servers not configurable (CLOSED - had clear error messages) This issue is distinct because the connection appears to succeed but tool registration silently fails. ## Suggested Fix When `type: "remote"` connection completes, verify that tools were actually registered. If tool registration fails, either: 1. Display an error message to the user 2. Update the MCP status to indicate partial failure 3. Log a warning with troubleshooting guidance
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of or related to an existing issue. Please check:

  • #8990: MCP servers showing as disabled - Similar issue where MCP servers appear configured but don't work properly (v1.1.24+)

Also note that there have been recent infrastructure improvements:

  • #6878: Exa MCP endpoint previously had timeout and connectivity issues, which may be related to remote MCP server problems
  • #8406: Remote MCP servers can hang with non-standard SSE/HTTP - timeout/connection handling could cause silent failures

These issues may provide context for debugging the silent tool registration failure you're experiencing.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of or related to an existing issue. Please check: - #8990: MCP servers showing as `disabled` - Similar issue where MCP servers appear configured but don't work properly (v1.1.24+) Also note that there have been recent infrastructure improvements: - #6878: Exa MCP endpoint previously had timeout and connectivity issues, which may be related to remote MCP server problems - #8406: Remote MCP servers can hang with non-standard SSE/HTTP - timeout/connection handling could cause silent failures These issues may provide context for debugging the silent tool registration failure you're experiencing.
Author
Owner

@socrabytes commented on GitHub (Jan 23, 2026):

I encountered similar error as well:

Side Note: I tested these MCP's about two days ago and they functioned properly except for the fact that my ZAI dashboard never saw the MCP tool usage. This was using the same configuration below but without the oauth config option being present.
Image

Global opencode.jsonc :

{
    "$schema": "https://opencode.ai/config.json",
    "mcp": {
        "zread": {
            "type": "remote",
            "url": "https://api.z.ai/api/mcp/zread/mcp",
            "enabled": true,
            "oauth": false,
            "headers": {
                "Authorization": "Bearer your_api_key"
            }
        }
    }
}

Logs containing mcp:

INFO  2026-01-23T18:55:57 +1ms service=mcp key=zread type=remote found
INFO  2026-01-23T18:55:57 +0ms service=server method=GET path=/mcp request
INFO  2026-01-23T18:55:57 +1ms service=server status=started method=GET path=/mcp request
INFO  2026-01-23T18:55:58 +506ms service=server status=completed duration=846 method=GET path=/mcp request
@socrabytes commented on GitHub (Jan 23, 2026): I encountered similar error as well: > Side Note: I tested these MCP's about two days ago and they functioned properly except for the fact that my ZAI dashboard never saw the MCP tool usage. This was using the same configuration below but without the `oauth` config option being present. <img width="623" height="406" alt="Image" src="https://github.com/user-attachments/assets/e363f198-ccf0-4a23-8a98-4ce4c34752d8" /> Global `opencode.jsonc` : ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "zread": { "type": "remote", "url": "https://api.z.ai/api/mcp/zread/mcp", "enabled": true, "oauth": false, "headers": { "Authorization": "Bearer your_api_key" } } } } ``` Logs containing `mcp`: ```txt INFO 2026-01-23T18:55:57 +1ms service=mcp key=zread type=remote found INFO 2026-01-23T18:55:57 +0ms service=server method=GET path=/mcp request INFO 2026-01-23T18:55:57 +1ms service=server status=started method=GET path=/mcp request INFO 2026-01-23T18:55:58 +506ms service=server status=completed duration=846 method=GET path=/mcp request ```
Author
Owner

@vxnuaj commented on GitHub (Feb 12, 2026):

Receiving similar error on my end.

@vxnuaj commented on GitHub (Feb 12, 2026): Receiving similar error on my end.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6811