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

@luutuankiet/gemini-mcp

v0.1.4

Published

MCP proxy that transforms tool schemas for Gemini compatibility. Wraps any MCP server (stdio/SSE/HTTP) and fixes $ref, $defs, anyOf, title, default — so Gemini can call tools correctly.

Readme

@luutuankiet/gemini-mcp

Drop-in MCP proxy that makes any MCP server work with Gemini.

Gemini implements a strict subset of JSON Schema (OpenAPI 3.0-flavored). When MCP servers use common JSON Schema patterns — $ref, $defs, anyOf, additionalProperties, title, default — Gemini either silently degrades parameters to STRING or returns hard 400 errors.

This proxy sits between your MCP client and any MCP server, transparently transforming tool schemas so Gemini can call them correctly.

The Problem

✕ Error discovering tools from awslabs.aws-api-mcp-server:
  can't resolve reference #/$defs/ProgramInterpretationResponse from id #
400 Bad Request: reference to undefined schema at properties.target_object.anyOf.1

These failures affect every Pydantic-based MCP server (AWS, Snowflake, etc.) and many TypeScript servers (Notion, etc.). The root cause: Gemini's API doesn't support standard JSON Schema features that MCP servers use heavily.

| Pattern | What Happens in Gemini | Affected Servers | |---------|----------------------|------------------| | $ref / $defs | Hard 400 error — "can't resolve reference" | All Python/Pydantic MCP servers | | anyOf[T, null] | Hard 400 — "undefined schema" | Pydantic Optional[T] fields | | anyOf with $ref inside | Double failure — unresolved ref + union | Snowflake, AWS | | title, default | Silent degradation or rejected | All Pydantic servers | | additionalProperties | Schema validation conflict | Notion, complex TS servers | | allOf / oneOf | Not supported in Gemini Schema | Servers using composition |

References:

How It Works

gemini-mcp wraps any MCP server (stdio, SSE, or HTTP) and intercepts tools/list responses. Before returning tool schemas to the client, it applies a 7-phase transformation pipeline:

MCP Client ←→ gemini-mcp ←→ Any MCP Server
                  ↕
         Schema Transform
         (tools/list only)

| Phase | Transform | Why | |-------|-----------|-----| | 1 | Dereference $ref → inline definitions | Gemini can't resolve $ref, degrades to STRING | | 2 | Remove $defs / definitions | Cleanup after Phase 1 | | 3 | anyOf[T, null]{type: T, nullable: true} | Gemini doesn't understand null unions | | 3b | oneOfanyOf, allOf → merge | Gemini only supports anyOf | | 4 | constenum | Not in Gemini Schema spec | | 5 | exclusiveMinimum/Maximumminimum/maximum | Not in Gemini Schema spec | | 6 | Strip forbidden keys (title, default, additionalProperties, etc.) | Cause silent degradation or 400s | | 7 | Remove if/then/else conditionals | Not supported |

All transforms are lossless for tool calling — they only affect schema metadata, not the actual parameter values passed to tools.

Quick Start

With Claude Desktop / Cursor / Windsurf

Replace mcp-remote (or any stdio-based wrapper) with gemini-mcp:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": [
        "@luutuankiet/gemini-mcp",
        "https://remote.mcp.server/sse"
      ]
    }
  }
}

With a local stdio server

Wrap any existing stdio MCP server:

{
  "mcpServers": {
    "aws-api": {
      "command": "npx",
      "args": [
        "@luutuankiet/gemini-mcp",
        "uvx",
        "awslabs.aws-api-mcp-server@latest"
      ],
      "env": {
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Gemini CLI

{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": [
        "@luutuankiet/gemini-mcp",
        "npx",
        "@notionhq/notion-mcp-server"
      ],
      "env": {
        "NOTION_API_TOKEN": "..."
      }
    }
  }
}

CLI Flags

All mcp-remote flags are supported (this package is a superset of mcp-remote):

| Flag | Description | |------|-------------| | --header "Key: Value" | Custom headers for remote servers | | --transport <strategy> | http-first (default), sse-first, http-only, sse-only | | --allow-http | Allow HTTP (non-TLS) connections | | --debug | Write debug logs to ~/.mcp-auth/{hash}_debug.log | | --silent | Suppress default logs | | --ignore-tool <pattern> | Filter tools by name (supports wildcards) | | --resource <url> | Isolate OAuth sessions for multi-tenant setups | | --host <hostname> | OAuth callback host (default: localhost) | | --auth-timeout <seconds> | OAuth callback timeout (default: 30) | | --enable-proxy | Use HTTP_PROXY/HTTPS_PROXY env vars | | --static-oauth-client-metadata <json\|@file> | Custom OAuth client metadata | | --static-oauth-client-info <json\|@file> | Pre-registered OAuth client info |

Testing

# Unit tests (134 tests covering all transform phases)
pnpm test:unit

# E2E tests (requires network — tests against real MCP servers)
cd test && pnpm install && pnpm test

Architecture

src/
├── proxy.ts              # CLI entrypoint — stdio ↔ remote proxy
├── client.ts             # Debug client mode
└── lib/
    ├── transforms.ts     # 🔑 Gemini schema transform pipeline (7 phases)
    ├── transforms.test.ts # 134 unit tests for transforms
    ├── utils.ts          # Transport, proxy logic, mcpProxy()
    ├── coordination.ts   # OAuth lazy auth coordinator
    ├── node-oauth-client-provider.ts  # OAuth client implementation
    └── types.ts          # Shared types

Credits

Built on top of mcp-remote by Glen Maddern. The proxy infrastructure (stdio ↔ SSE/HTTP bridge, OAuth flows) comes from mcp-remote — this package adds the Gemini schema compatibility layer.

License

MIT