get/mcp/indexSearch ⌘K

How to add an MCP server to Gemini CLI

To add an MCP server to Gemini CLI, run gemini mcp add <name> <command> [args] for a local package; add -e KEY=value for each secret.

Steps

  1. Run gemini mcp add <name> <command> [args] for a local package; add -e KEY=value for each secret.
  2. For a hosted server use gemini mcp add --transport http <name> <url>, with --header for each secret header.
  3. Check it with gemini mcp list.

Checked against Gemini CLI's official MCP documentation on 2026-12-01.

Copy-paste examples

Example: Playwright MCP (local package)

Gemini CLI
gemini mcp add playwright-mcp npx -y @playwright/mcp

From the Playwright MCP server page.

Example: GitHub (hosted (remote) server)

Gemini CLI
gemini mcp add --transport http github-mcp-server https://api.githubcopilot.com/mcp/

From the GitHub server page.

Find a server

Every server page on getmcpindex has a ready-made setup for Gemini CLI under Set up in your MCP client. Search all servers, browse categories or remote servers.