Skip to content

MCP Parser Fails on JSON Schema $ref References (Google Stitch) #1652

Description

@jdinix

Bug Report: MCP Parser Fails on JSON Schema $ref References (Google Stitch)

Description

MiMoCode's MCP client fails to load tools from remote MCP servers that use complex JSON Schema $ref and $defs references in their tool input schemas.

Affected MCP Server

Google Stitch - https://stitch.googleapis.com/mcp

Google Stitch is Google's AI design tool that provides an MCP server for programmatic access.

Error

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

Steps to Reproduce

  1. Add Google Stitch MCP to config:
{
  "mcp": {
    "Google Stitch": {
      "type": "remote",
      "url": "https://stitch.googleapis.com/mcp"
    }
  }
}
  1. Run mimo mcp list
  2. Observe the "Failed to get tools" error

Expected Behavior

MiMoCode should parse JSON Schema $ref and $defs references and resolve them correctly, allowing MCP servers with complex schemas to work.

Actual Behavior

The parser fails with can't resolve reference #/$defs/ScreenInstance from id #.

Server Verification

The server responds correctly to raw HTTP requests:

curl -X POST https://stitch.googleapis.com/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}'

Returns 14 tools including create_project, generate_screen_from_text, edit_screens, etc.

Environment

  • MiMoCode version: 0.1.5
  • OS: Linux

Additional Context

This affects any MCP server that uses JSON Schema $ref for complex type definitions. The Google Stitch schemas are particularly complex with nested references like:

  • #/$defs/ScreenInstance
  • #/$defs/DesignSystem
  • #/$defs/Screen

Metadata

Metadata

Assignees

No one assigned

    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