Skip to content

MCP tools fail to load when outputSchema contains unresolved refs #26529

Closed

Description

@nicolascancino

Description

OpenCode can mark an MCP server as failed even when the server is reachable and tools/list responds, if one tool's outputSchema contains a reference the MCP SDK cannot resolve.

Observed with Google Stitch MCP on OpenCode 1.14.41:

ERROR service=mcp key=stitch error=can't resolve reference #/$defs/ScreenInstance from id # failed to get tools from client

The server responds to initialize and tools/list, but OpenCode fails while validating/dereferencing the tool schema and then reports the whole MCP server as failed.

Plugins

None relevant.

OpenCode version

1.14.41

Steps to reproduce

  1. Configure Google Stitch as a remote MCP server.
  2. Run opencode mcp list --log-level DEBUG --print-logs.
  3. Observe that the Stitch MCP transport connects, then tool loading fails on an outputSchema $ref.

Screenshot and/or share link

ERROR service=mcp key=stitch error=can't resolve reference #/$defs/ScreenInstance from id # failed to get tools from client

Operating System

macOS

Terminal

zsh

Activity

  1. github-actions commented on May 9, 2026

    @github-actions
    Contributor

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

    Consider adding your information to one of those issues instead.

  2. shiju-tectaliya commented on May 9, 2026

    @shiju-tectaliya

    stitch-mcp-auto (universal, with auto-setup & OAuth)
    npx -p stitch-mcp-auto stitch-mcp-auto-setup

    OpenCode config:
    `{
    "$schema": "https://opencode.ai/config.json",
    "mcp": {
    "stitch": {
    "type": "local",
    "command": ["npx", "-y", "stitch-mcp-auto"],
    "enabled": true,
    "timeout": 120000,
    "environment": {
    "STITCH_API_KEY": "{env:STITCH_API_KEY}"
    }
    }
    }
    }

    Prompt: Diagnose stitch mcp server`

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

Metadata

Metadata

Assignees

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