如何将 GitMCP Docs 远程 MCP 连接到 Gemini CLI
约 1 分钟即可把 GitMCP 的远程 MCP 服务端接入 Gemini CLI。如需排查 OAuth / 401 问题,可先用 OAuth 2.1 调试器体检端点。
Streamable HTTPhttps://gitmcp.io/docs
Install in Cursor →
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"gitmcp": {
"url": "https://gitmcp.io/docs"
}
}
}claude mcp add --transport http gitmcp https://gitmcp.io/docs
Install in VS Code →
Or add to .vscode/mcp.json:
{
"servers": {
"gitmcp": {
"type": "http",
"url": "https://gitmcp.io/docs"
}
}
}- Open Settings → Connectors (Integrations) → Add Custom Connector.
- Paste the endpoint URL:
https://gitmcp.io/docs - No authentication needed — tools are available immediately.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"gitmcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://gitmcp.io/docs"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"gitmcp": {
"serverUrl": "https://gitmcp.io/docs"
}
}
}Add to ~/.kiro/settings/mcp.json (or .kiro/settings/mcp.json in your workspace), then reopen Kiro's Agent panel to pick up the server:
{
"mcpServers": {
"gitmcp": {
"url": "https://gitmcp.io/docs"
}
}
}Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:
[mcp_servers.gitmcp] url = "https://gitmcp.io/docs"
Add to cline_mcp_settings.json (Cline → MCP Servers → Configure), or paste it via Cline's MCP marketplace file:
{
"mcpServers": {
"gitmcp": {
"type": "streamableHttp",
"url": "https://gitmcp.io/docs"
}
}
}Add to ~/.gemini/settings.json under mcpServers — httpUrl for Streamable HTTP, url for legacy SSE:
{
"mcpServers": {
"gitmcp": {
"httpUrl": "https://gitmcp.io/docs"
}
}
}接入步骤
- 编辑设置文件 — 打开
~/.gemini/settings.json。 - 添加服务端 — 在
mcpServers中加入"gitmcp": { "httpUrl":https://gitmcp.io/docs}。 - 完成认证 — 无需认证——GitMCP Docs MCP 为免密公开端点。
- 验证 — 在 在线 Inspector 中粘贴
https://gitmcp.io/docs并运行 initialize + tools/list 验证连通性。
🧰 工具预览(5)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| match_common_libs_owner_repo_mapping ~147 tok | 🟠 Write | Match a library name to an owner/repo. Don't use it if you have an owner and repo already. Use this first if only a library name was provided. If found - you can use owner and repo to call other tools. If not found - try to use the library name directly in other tools. | library*: string |
| fetch_generic_documentation ~115 tok | 🟢 Read | Fetch documentation for any GitHub repository by providing owner and project name | owner*: stringrepo*: string |
| search_generic_documentation ~155 tok | 🟢 Read | Semantically search in documentation for any GitHub repository by providing owner, project name, and search query. Useful for specific queries. | owner*: stringrepo*: stringquery*: string |
| search_generic_code ~185 tok | 🟢 Read | Search for code in any GitHub repository by providing owner, project name, and search query. Returns matching files. Supports pagination with 30 results per page. | owner*: stringrepo*: stringquery*: stringpage: number |
| fetch_generic_url_content ~118 tok | 🟢 Read | Generic tool to fetch content from any absolute URL, respecting robots.txt rules. Use this to retrieve referenced urls (absolute urls) that were mentioned in previously fetched documentation. | url*: string |