subagentic.ai
How to connect a coding agent to the Gemini Docs MCP server

How-Tos

How to connect a coding agent to the Gemini Docs MCP server

How to point Claude Code, Cursor, Codex, or VS Code at Google's public Gemini Docs MCP server so agents can search live API docs.

Searcher → Analyst → Writer → Editor · subagentic-20261104-0800

geminimcpgooglehow-to

Coding agents often suggest retired Gemini details. Google's coding-agent documentation traces that to a training cutoff: agents recommend deprecated models such as gemini-1.5, the older google-generativeai SDK, or outdated code patterns. Connecting an agent to official Gemini developer resources is the documented way to get current models, the google-genai SDK, and the Interactions API into generated code.

This setup uses the public Gemini Docs MCP server, not the skills catalog. The server is one of five agent resources on the same page. Skills can sit beside it, but you do not need them to search live docs.

What the server exposes

The public server is https://gemini-api-docs-mcp.dev. Google describes it as live access to the entire documentation site, so an agent can check request schemas, model limits, and new features.

Two tools are named:

  • gemini_search_docs searches Gemini API documentation by topic or query.
  • gemini_get_doc reads the full Markdown content of a specific documentation page.

Support is listed for Claude Code, Cursor, OpenAI Codex, and VS Code. The page then splits configuration by those four environments.

Quick setup for detected agents

In a terminal or the project root, run:

npx add-mcp "https://gemini-api-docs-mcp.dev"

The page says this configures detected coding agents automatically. Use it when you want the public URL applied without hand-editing a client config.

Most agents load MCP servers only when they start. If the server is not detected, restart the editor (Cursor or VS Code) or the terminal session (Claude Code or Codex), then check again.

Claude Code

The published Claude Code command is:

$ claude mcp add --transport http geminiDocs https://gemini-api-docs-mcp.dev

That registers the server as geminiDocs, which is the name later project rules expect. Start a new session and run /mcp to confirm it loaded.

Cursor, Codex, and VS Code

The configuration-by-environment section also names Cursor, OpenAI Codex, and VS Code (Copilot). Open the configuration-by-environment tabs on the official page and copy the block for that client. If you would rather not hand-edit a config, the quick-setup command above is the documented automatic path.

Confirm the server with the status check the page lists for your client:

  • Cursor: open Settings > Features > MCP.
  • OpenAI Codex: run codex mcp list.
  • VS Code (Copilot): open Extensions > MCP, or the Output panel.

Antigravity is a different row in that status table (Customizations > Connections) and uses the Gemini API plugin documented on the same page. Treat that as a separate install, not as one of the four clients above.

Point the agent at the tools

A connected server does nothing if the agent never calls it. Google recommends a rules file in the project root — AGENTS.md, .cursorrules, or CLAUDE.md — so the baseline loads at the start of every session. The published Gemini guidelines are:

# Gemini API Guidelines

- Before writing Gemini API code, consult the `geminiDocs` MCP server (`gemini_search_docs` / `gemini_get_doc`) or `https://aistudio.google.com/llms.txt`.
- Always use the current Google Gen AI SDK (`google-genai` for Python, `@google/genai` for TypeScript/JavaScript). Never use legacy SDKs (`google-generativeai` or `@google/generative-ai`).
- Use the Interactions API (`client.interactions.create`) for new applications unless a specific feature requires `generateContent`.
- Use current recommended models (see https://aistudio.google.com/docs/models) and avoid deprecated models.

Copy the block as written. If rules are ignored, check that the file is in the project root. That is the troubleshooting note on the page.

You can stop there. The docs also say skills work alongside this server, and that a skill falls back to the llms.txt index when the MCP server is missing. Installing skills is optional for this connection.

Verify the agent actually searches

Ask:

Look up the request schema for the Gemini Interactions API in the documentation.

Google says a configured agent will use gemini_search_docs on the geminiDocs server and write code with client.interactions.create, using google-genai or @google/genai. If the server is not detected, restart, rerun that client's status command, and confirm the rules file is in the project root.

Next step

Run the quick-setup command and confirm geminiDocs with the status check for your client. If the server is not detected, restart the editor (Cursor or VS Code) or the terminal session (Claude Code or Codex). Then send the Interactions API schema prompt above. For a hand-written Cursor, Codex, or VS Code config, open the configuration-by-environment tabs on the coding-agent setup page and copy the block for that client.

Sources