Back to MCP directory
publicPublicdnsLocal runtime

mcp-gemini-docs

一个为AI助手提供Gemini API文档访问的MCP服务器,支持本地读取和搜索文档。

article

README

🚀 Gemini Docs MCP Server

这是一个模型上下文协议(MCP)服务器,可让AI助手访问Gemini API文档。

🚀 快速开始

在完成安装和配置后,你就可以让你的AI助手提出诸如以下的问题:

  • "Search the Gemini docs for 'structured output'"
  • "Read the documentation for 'models'"
  • "How do I use context caching with the Gemini API?"

✨ 主要特性

  • 📖 访问文档:可直接在AI聊天界面中阅读Gemini API文档的完整内容。
  • 🔍 搜索功能:使用search_docs工具查找特定主题、指南和API参考。
  • ⚡ 快速本地运行:在本地机器上运行,从gemini-api-docs目录提供文件服务。
  • 🛠️ 广泛兼容:可与Claude Desktop、Cursor、VS Code(Google Antigravity、GitHub Copilot)以及任何符合MCP的客户端配合使用。

📦 安装指南

前提条件

  • Node.js:v16或更高版本。
  • NPM:随Node.js一起安装。

安装步骤

  1. 克隆仓库(如果你还没有这样做):

    git clone <repository-url>
    cd mcp-gemini-docs
    
  2. 安装依赖并构建: 导航到服务器目录并构建项目:

    cd gemini-docs-mcp
    npm install
    npm run build
    

📚 详细文档

目录结构

  • gemini-api-docs/:包含Markdown文档文件。
  • gemini-docs-mcp/:MCP服务器实现(Node.js/TypeScript)。

配置

将服务器添加到你的MCP客户端配置中。将/absolute/path/to/替换为你机器上此仓库的实际完整路径。

1. Claude Desktop & Claude Code

编辑%APPDATA%\Claude\claude_desktop_config.json(Windows)或~/Library/Application Support/Claude/claude_desktop_config.json(macOS)。

{
  "mcpServers": {
    "gemini-docs": {
      "command": "node",
      "args": [
        "/absolute/path/to/mcp-gemini-docs/gemini-docs-mcp/build/index.js"
      ]
    }
  }
}

2. Google Antigravity (VS Code)

  1. 打开 文件 > 首选项 > 设置
  2. 搜索 "Antigravity MCP"。
  3. 编辑mcp_config.json(或使用命令面板:"Antigravity: 打开MCP配置")。
  4. 添加:
"gemini-docs": {
  "command": "node",
  "args": [
    "/absolute/path/to/mcp-gemini-docs/gemini-docs-mcp/build/index.js"
  ],
  "env": {}
}

3. Cursor

  1. 转到 Cursor设置 > 功能 > MCP
  2. 点击 "添加新的MCP服务器"
  3. 名称gemini-docs
  4. 类型command
  5. 命令node /absolute/path/to/mcp-gemini-docs/gemini-docs-mcp/build/index.js

4. GitHub Copilot (VS Code)

注意:需要有效的Copilot订阅和MCP预览访问权限。 通过.vscode/settings.json或你的用户设置进行配置:

"github.copilot.mcpServers": {
    "gemini-docs": {
        "command": "node",
        "args": ["/absolute/path/to/mcp-gemini-docs/gemini-docs-mcp/build/index.js"]
    }
}

5. CLI工具(Gemini CLI、OpenAI Codex CLI)

将服务器启动命令作为参数传递。

# 示例
gemini-cli --mcp-server "node /path/to/mcp-gemini-docs/gemini-docs-mcp/build/index.js"

📄 许可证

ISC

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client