npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stitch-proxy-ld9

v0.2.1

Published

Zero-dependency MCP stdio compatibility proxy for Google Stitch. Normalizes JSON Schema for Kimi/Moonshot Draft 7 clients.

Downloads

411

Readme

stitch-proxy-ld9

Zero-dependency MCP compatibility proxy for Google Stitch. Normalizes JSON Schema patterns that break Moonshot Kimi and other strict Draft 7 clients.

The problem

Google Stitch MCP emits tool schemas with $ref plus sibling keywords:

{ "$ref": "#/$defs/VariantOptions", "description": "..." }

This is valid in modern JSON Schema, but Kimi/Moonshot rejects it. This proxy rewrites it to:

{ "allOf": [{ "$ref": "#/$defs/VariantOptions" }], "description": "..." }

Quick install

npm install -g stitch-proxy-ld9

Or use without installing:

npx -y stitch-proxy-ld9

Configure OpenCode

Add to ~/.config/opencode/opencode.json:

{
  "mcp": {
    "stitch-proxy-ld9": {
      "type": "local",
      "command": ["stitch-proxy-ld9"],
      "environment": {
        "STITCH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Or using an environment variable (recommended for shared machines):

{
  "mcp": {
    "stitch-proxy-ld9": {
      "type": "local",
      "command": ["stitch-proxy-ld9"],
      "environment": {
        "STITCH_API_KEY": "{env:STITCH_API_KEY}"
      }
    }
  }
}

Then export in your shell profile (.bashrc, .zshrc):

export STITCH_API_KEY="your-api-key-here"

Use

Open OpenCode and verify the MCP is connected:

/mcp

Then prompt:

usa stitch-proxy-ld9 para listar mis proyectos de Stitch
usa stitch-proxy-ld9 para listar las pantallas del proyecto X
usa stitch-proxy-ld9 para obtener el código HTML de la pantalla Y

Auth modes

API key (recommended)

export STITCH_API_KEY="your-api-key"

Access token

export STITCH_ACCESS_TOKEN="your-access-token"
export STITCH_PROJECT_ID="your-google-cloud-project-id"

Optional host override

export STITCH_HOST="https://stitch.googleapis.com/mcp"

Troubleshooting

| Symptom | Cause | Fix | |---------|-------|-----| | Missing Stitch credentials | No API key set | Set STITCH_API_KEY in config or shell | | Connection closed in /mcp | OpenCode can't see the key | Verify key is in ~/.config/opencode/opencode.json or exported in shell | | tools.function.parameters is not a valid moonshot flavored json schema | Using upstream Stitch directly | Use stitch-proxy-ld9, not stitch | | structured content error | Old version | npm install -g stitch-proxy-ld9@latest | | command not found: stitch-proxy-ld9 | Not installed globally | npm install -g stitch-proxy-ld9 |

Verify installation

# Check binary exists
which stitch-proxy-ld9

# Run tests (from repo clone)
npm test
npm run typecheck

How it works

OpenCode + Kimi
  → stitch-proxy-ld9 (local stdio MCP)
    → normalizes $ref + siblings → allOf pattern
      → Google Stitch MCP (remote)
  • Intercepts tools/list and normalizes every inputSchema
  • Forwards tools/call unchanged
  • Handles structuredContent for tools with outputSchema
  • Uses env-only auth, no secrets logged

Status

Independent compatibility proxy. Not affiliated with Google.

Google Stitch APIs are experimental. Expect changes.

License

MIT