MCP server for searching Google Gemini API documentation
Project description
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
- Ingestion: On startup, the server fetches
https://ai.google.dev/gemini-api/docs/llms.txtto get a list of all available documentation pages. - Processing: It then concurrently fetches and processes each page, extracting the text content.
- Indexing: The processed content is stored in a local SQLite database with a Full-Text Search (FTS5) index for efficient querying.
- Searching: When you use the
search_documentationtool, the server queries this SQLite database to find the most relevant documentation pages.
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.dbin containerized environments~/.mcp/gemini-api-docs/database.dbin 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_philschmid_gemini_docs_mcp-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_philschmid_gemini_docs_mcp-0.1.0.tar.gz
- Upload date:
- Size: 112.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b92d731eec481204f98871b5c27367034e392e0ccad7c8fcbc51d6519de050c4
|
|
| MD5 |
d8e27402d7b9f6c099e5bdfa2e8fd810
|
|
| BLAKE2b-256 |
c1feb64fd153ddfb1c0b616c8d7caa7288fa145741d545426d47f278b6c7cfa9
|
File details
Details for the file iflow_mcp_philschmid_gemini_docs_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_philschmid_gemini_docs_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa8d4767965f2f836b5c1516a71bca54f1ee597cdfacc8a71677161ad42a3986
|
|
| MD5 |
dc5e3edda0c5923b16869a7f0040f68c
|
|
| BLAKE2b-256 |
7cb86dc19fb683595a3fbdfd86f75050b7f6025a3f3c49e06b17bb9e88bdc863
|