Extensions & MCP
New
Extend Gemini CLI with powerful Model Context Protocol (MCP) servers and custom extensions. Connect external tools, services, and APIs to enhance your AI workflow.
Model Context Protocol (MCP)
MCP is a standardized protocol that allows Gemini CLI to communicate with external tools and services. It enables dynamic tool discovery and execution, making your CLI infinitely extensible.
Dynamic Tools
Discover and use tools at runtime
External Services
Connect to APIs and databases
Real-time
Live data and instant responses
Popular MCP Servers
GitHub MCP Server
Interact with GitHub repositories, issues, and pull requests
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
}
}
Custom Python Server
Create your own tools with Python
{
"mcpServers": {
"pythonTools": {
"command": "python",
"args": ["-m", "my_mcp_server"],
"cwd": "./tools",
"env": {
"API_KEY": "$MY_API_KEY"
}
}
}
}
Configuration Examples
Multiple Server Setup
Configure multiple MCP servers for different purposes
{
"mcpServers": {
"github": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_TOKEN", "github-mcp-server"],
"env": { "GITHUB_TOKEN": "$GITHUB_TOKEN" }
},
"database": {
"command": "node",
"args": ["db-server.js"],
"cwd": "./mcp-servers/db",
"timeout": 10000
},
"analytics": {
"command": "python",
"args": ["-m", "analytics_server"],
"trust": true
}
}
}
HTTP MCP Server
Connect to HTTP-based MCP servers
{
"mcpServers": {
"webService": {
"httpUrl": "http://localhost:3000/mcp",
"timeout": 5000
}
}
}
Creating Extensions
Extension Structure
Create a gemini-extension.json file to define your extension
{
"name": "my-extension",
"version": "1.0.0",
"mcpServers": {
"my-server": {
"command": "node my-server.js"
}
},
"contextFileName": "GEMINI.md"
}