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

mcp-ask-gemini

v0.1.0

Published

MCP server enabling LLMs to consult with Google's Gemini models for additional insights and alternative perspectives

Readme

mcp-ask-gemini

An MCP server that enables LLMs to consult with Google's Gemini models for additional insights, analysis, or alternative perspectives. This allows AI assistants to leverage multiple LLM capabilities by querying Gemini models through the official @google/generative-ai SDK.

Use Cases

This MCP server enables powerful LLM-to-LLM consultation scenarios:

  • Second Opinion: Get alternative perspectives on complex problems
  • Specialized Analysis: Leverage Gemini's strengths for specific domains
  • Cross-Model Validation: Compare responses between different AI models
  • Enhanced Reasoning: Use Gemini as a reasoning partner for complex tasks
  • Research Assistance: Consult Gemini for additional insights during research

Features

  • Executable via npx (no install required)
  • Accepts API key, model name, and optional system prompt
  • Temperature, topP, maxTokens, and stripThinkingTags with sensible defaults
  • Implements exactly one MCP tool: ask_gemini
  • Robust error handling for API/auth/network/rate limit issues
  • TypeScript, MCP stdio transport

Installation

You can run directly with npx:

  • npx mcp-ask-gemini --api-key $GOOGLE_API_KEY --model models/gemini-2.5-flash-lite

Or install locally:

  • npm install mcp-ask-gemini
  • npx mcp-ask-gemini --api-key $GOOGLE_API_KEY --model models/gemini-2.5-flash-lite

Configuration

You can pass configuration via CLI flags or environment variables. Defaults live in config/defaults.json, and everything there is user-overridable.

Required:

  • --api-key or env API_KEY
  • --model or env MODEL (e.g., models/gemini-2.5-flash-lite, models/gemini-2.5-pro). Defaults to config/defaults.json if not provided.

Optional:

  • --system-prompt or env SYSTEM_PROMPT (defaults to config/defaults.json)
  • --temperature or env TEMPERATURE (number; defaults to config/defaults.json)
  • --topP or env TOPP (number; defaults to config/defaults.json)
  • --maxTokens or env MAXTOKENS (number; defaults to config/defaults.json)
  • --stripThinkingTags or env STRIPTHINKINGTAGS (boolean; defaults to config/defaults.json). Strips ... and ... blocks.

Examples:

  • npx mcp-ask-gemini --api-key $GOOGLE_API_KEY --model gemini-1.5-pro
  • API_KEY=$GOOGLE_API_KEY MODEL=models/gemini-2.5-flash-lite npx mcp-ask-gemini
  • API_KEY=$GOOGLE_API_KEY MODEL=models/gemini-2.5-flash-lite SYSTEM_PROMPT="You are a helpful assistant." npx mcp-ask-gemini
  • API_KEY=$GOOGLE_API_KEY npx mcp-ask-gemini (uses default model and generation settings)

MCP Tool: ask_gemini

The server exposes a single tool that allows LLMs to consult with Gemini models:

  • name: ask_gemini
  • input: { prompt: string }
  • output: Gemini model text response (or an error message with isError=true)

JSON Schema Examples

Tool Request:

{
  "method": "tools/call",
  "params": {
    "name": "ask_gemini",
    "arguments": {
      "prompt": "What are the key differences between transformer and RNN architectures?"
    }
  }
}

Successful Response:

{
  "content": [
    {
      "type": "text",
      "text": "Transformers and RNNs differ in several key ways:\n\n1. **Architecture**: Transformers use self-attention mechanisms while RNNs process sequences step-by-step...\n\n2. **Parallelization**: Transformers can process all tokens simultaneously, while RNNs must process sequentially..."
    }
  ]
}

Error Response:

{
  "content": [
    {
      "type": "text",
      "text": "Authentication error with Google Gemini API. Please verify your API key. Details: Invalid API key provided"
    }
  ],
  "isError": true
}

Using with MCP clients

This server uses stdio transport, so configure your MCP client to launch the command and connect via stdio.

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "ask-gemini": {
      "command": "npx",
      "args": [
        "mcp-ask-gemini",
        "--api-key",
        "your-google-api-key-here",
        "--model",
        "gemini-1.5-pro"
      ]
    }
  }
}

MCP Inspector Configuration

  • Command: npx
  • Args: ["mcp-ask-gemini", "--api-key", "$GOOGLE_API_KEY", "--model", "models/gemini-2.5-flash-lite"]

Environment Variable Configuration

{
  "mcpServers": {
    "ask-gemini": {
      "command": "npx",
      "args": [
        "mcp-ask-gemini"
      ],
      "env": {
        "API_KEY": "your-google-api-key-here",
        "MODEL": "gemini-1.5-pro",
        "SYSTEM_PROMPT": "You are a helpful research assistant.",
        "TEMPERATURE": "0.7"
      }
    }
  }
}

Error Handling

The server returns useful messages for:

  • Invalid API keys (authentication errors)
  • Invalid or unavailable model names
  • Rate limiting / quota exceeded
  • Network / connectivity issues

Development

  • npm install
  • npm run build
  • node dist/cli.js --api-key $GOOGLE_API_KEY --model models/gemini-2.5-flash-lite

Environment Variables

  • API_KEY: Google Gemini API key
  • MODEL: Gemini model name
  • SYSTEM_PROMPT: Optional system prompt
  • TEMPERATURE: Optional number override
  • TOPP: Optional number override
  • MAXTOKENS: Optional number override
  • STRIPTHINKINGTAGS: Optional boolean override (1/0, true/false, yes/no)

License

MIT