How to add an MCP server to Gemini CLI
Gemini CLI was replaced by Antigravity CLI in June 2026 and stays only for enterprise licences and paid API keys. In Gemini CLI, run gemini mcp add <name> <command>, or add the server to the mcpServers block in ~/.gemini/settings.json. Type /mcp inside Gemini CLI to list servers and tools.
Note: Google replaced Gemini CLI with Antigravity CLI on 18 June 2026. Gemini CLI stays available only with Gemini Code Assist Standard or Enterprise licences and paid API keys. On Antigravity CLI, see how to add an MCP server to Antigravity CLI.
With one command
gemini mcp add playwright npx @playwright/mcp@latest
In settings.json
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "package-name"],
"env": { "API_KEY": "your-key" }
}
}
}
Use ~/.gemini/settings.json for every project, or .gemini/settings.json in a project folder for that project only.
Check it
Start Gemini CLI and type /mcp.