Skip to main content
Glama
Gemini Docs MCP Server

Gemini Docs MCP Server

by philschmid

Gemini Docs MCP Server

A remote HTTP MCP server that provides tools to search and retrieve Google Gemini API documentation. The server exposes the MCP protocol at the /mcp endpoint and can be deployed to Cloud Run or other containerized platforms. It also supports local stdio mode for development.

  • Search Documentation: Full-text search across all Gemini documentation pages.

  • Get Capabilities: List available documentation pages or retrieve content for a specific page.

  • Get Current Model: Quickly access documentation for current Gemini models.

  • Automatic Updates: Scrapes and updates documentation on server startup.

sequenceDiagram
    participant Client as MCP Client / IDE
    participant Server as FastMCP Server
    participant DB as SQLite Database

    Client->>Server: call_tool("search_documentation", queries=["embeddings"])
    Server->>DB: Full-Text Search for "embeddings"
    DB-->>Server: Return matching documentation
    Server-->>Client: Return formatted results

How it Works

  1. Ingestion: On startup, the server fetches https://ai.google.dev/gemini-api/docs/llms.txt to get a list of all available documentation pages.

  2. Processing: It then concurrently fetches and processes each page, extracting the text content.

  3. Indexing: The processed content is stored in a local SQLite database with a Full-Text Search (FTS5) index for efficient querying.

  4. Searching: When you use the search_documentation tool, the server queries this SQLite database to find the most relevant documentation pages.

Related MCP server: Gemini Docs MCP Server

Installation

Option 1: Use uvx (Recommended)

You can use uvx to run the server directly without explicit installation. This is the easiest way to get started.

uvx --from git+https://github.com/philschmid/gemini-api-docs-mcp gemini-docs-mcp

Option 2: Install directly from GitHub

You can install the package directly from GitHub using pip:

pip install git+https://github.com/philschmid/gemini-api-docs-mcp.git

Option 3: Manual Installation (for development)

git clone https://github.com/philschmid/gemini-api-docs-mcp.git
cd gemini-api-docs-mcp
pip install -e .
cd ..
rm -rf gemini-api-docs-mcp

Usage

Running as a Remote HTTP Server

The server runs as an HTTP server and exposes the MCP protocol at the /mcp endpoint. It respects the PORT environment variable (defaults to 8080).

# Set port (optional, defaults to 8080)
export PORT=8080

# Run the server
gemini-docs-mcp

The server will be accessible at http://localhost:8080/mcp (or your configured port).

Docker Deployment

Build and run the Docker container:

# Build the image
docker build -t gemini-docs-mcp .

# Run the container
docker run -p 8080:8080 gemini-docs-mcp

Cloud Run Deployment

Deploy to Google Cloud Run:

# Build and deploy
gcloud run deploy gemini-docs-mcp \
  --source . \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated

The server will be accessible at https://<your-service-url>/mcp.

Running in Stdio Mode (Local)

If you don't set the PORT environment variable, the server runs in stdio mode for local MCP clients:

# Don't set PORT - runs in stdio mode
gemini-docs-mcp

Configuration

The database is stored at:

  • /tmp/gemini-api-docs/database.db in containerized environments

  • ~/.mcp/gemini-api-docs/database.db in local environments

You can override this by setting the GEMINI_DOCS_DB_PATH environment variable.

Using with an MCP Client

For remote HTTP servers, configure your MCP client to connect via HTTP:

{
  "mcpServers": {
    "gemini-docs": {
      "url": "https://<your-service-url>/mcp"
    }
  }
}

For local development with stdio (if supported by your client):

{
  "mcpServers": {
    "gemini-docs": {
      "command": "gemini-docs-mcp"
    }
  }
}

Tools

  • search_documentation(queries: list[str]): Performs a full-text search on Gemini documentation for the given list of queries (max 3).

  • get_capability_page(capability: str = None): Get a list of capabilities or content for a specific one.

  • get_current_model(): Get documentation for current Gemini models.

License

MIT

Test Results

We run a comprehensive evaluation harness to ensure the MCP server provides accurate and up-to-date code examples. The tests cover both Python and TypeScript SDKs.

Metric

Value

Total Tests

117

Passed

114

Failed

3

Last updated: 2025-11-03 13:29:01

You can find the detailed test results in tests/result.json.

Available Tools

3 tools
get_capability_pageA

Retrieves the full content of a specific documentation page by its exact title. You can call can this tool WITHOUT arguments first to see a master list of all available page titles. Then, call it again with the exact title you need.

Inputs: capability (required). Returns: result

get_current_modelA

Shortcut tool to explicitly retrieve the canonical 'Gemini Models' documentation page. Use this to fast-track finding details about available model variants (Pro, Flash, etc.), their capabilities, versioning, and context window sizes.

Inputs: no named parameters. Returns: result

search_documentationA

Performs a standard keyword search on Gemini API documentation. CRITICAL: This is a naive keyword search, NOT semantic. Long queries will FAIL. You MUST use VERY SHORT keyword based queries (max 1-3 keywords) focusing only on the most unique terms. Break complex questions into separate, simple queries. It will return the full documentation page for a capability or feature.

Inputs: queries (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 3 tools

    Disambiguation4/5

    Tools are mostly distinct: get_capability_page retrieves any page by title (and can list all titles), get_current_model is a shortcut for the models page (overlapping with get_capability_page), and search_documentation does keyword search. The overlap between get_current_model and get_capability_page causes minor ambiguity.

    Naming Consistency4/5

    All tools use snake_case and follow a verb_noun pattern (get_ or search_). The nouns are descriptive but not uniformly structured (capability_page vs current_model vs documentation). Naming is mostly consistent with minor variation.

    Tool Count3/5

    Three tools is on the low side for a documentation server, but the tools are versatile: get_capability_page doubles as a list tool, and get_current_model is a convenience. The count feels thin but not severely inadequate.

    Completeness4/5

    The set covers key actions: listing pages, retrieving a specific page, searching. Minor gaps like missing page hierarchy or section-level navigation exist, but the ability to list all pages via get_capability_page without arguments mitigates the need for an explicit list tool.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables users to search and fetch Google's Gemini API documentation directly within an MCP-compliant environment. It provides structured access to guides and references for features like function calling, embeddings, and text generation.
      2
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to fetch, index, and perform semantic RAG-based searches on API documentation from various sources. It provides tools for hybrid search and collection management, allowing users to access up-to-date documentation from projects like Gemini and FastMCP.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Indexes documentation sites by base URL and serves keyword search, optional semantic search, and Markdown page retrieval as MCP tools, all from a single SQLite file.
      -