Skip to main content

Gemini CLI Integration

Connect your MCP bundles to Gemini CLI to use Google's AI assistant from the command line.

Requirements

  • Gemini CLI installed (npm install -g @google/gemini-cli or similar)
  • A bundle enabled in your MCPBundles dashboard
  • Credentials connected for providers in your bundle

Time to complete: 2-3 minutes


Step-by-Step Setup

1. Get Your Bundle URL

  1. Log in to MCPBundles Dashboard
  2. Click on the bundle you want to use
  3. Copy the MCP Server URL

2. Configure Gemini CLI

Gemini CLI may auto-discover MCP servers or require manual configuration.

Check if Gemini CLI has an MCP configuration file (similar to Gemini Code).

If configuration file exists:

Edit it to add your bundle (see Gemini Code Integration for format).

If auto-discovery:

Gemini CLI might discover bundles automatically if they're configured system-wide.


3. List Available MCP Servers

In Gemini CLI, run:

/mcp list

Your bundle should appear in the list.


4. Authenticate When Prompted

The first time a tool is called that needs credentials:

  1. Gemini CLI will prompt for authentication
  2. Follow the OAuth flow or provide API key
  3. Credentials are stored for future use

5. Verify Tools Are Available

Ask Gemini:

What tools do you have access to?

Expected response: List of tools from your bundle(s).


Using Tools in Gemini CLI

Once connected, Gemini can use your tools in command-line interactions.

Example Prompts

Data retrieval:

"Check my Smartlead campaigns and show the top 3 by reply rate"

GitHub operations:

"List my GitHub repos and tell me which ones have the most stars"

CRM tasks:

"Add John Doe (john@example.com) to HubSpot as a new contact"

Gemini will call the tools and display results in the terminal.


Troubleshooting

"/mcp command not found"

Cause: Outdated Gemini CLI or command not supported.

Fix:

  • Update Gemini CLI to the latest release
  • Check release notes for MCP support

Bundle doesn't appear in "/mcp list"

Cause: Configuration not loaded or file location wrong.

Fix:

  • Check if config file exists at ~/.gemini/settings.json (or equivalent)
  • Verify the bundle is added correctly
  • Restart Gemini CLI

"Authentication required" when calling tools

Fix:

  1. Go to Dashboard → Providers
  2. Connect credentials for needed providers
  3. Try the tool again in Gemini CLI

See Provider Credentials Guide.


Tools work but return empty data

Cause: Connected to wrong account or no data exists.

Fix:

  1. Dashboard → Providers → [Provider]
  2. Check which account is connected
  3. If wrong, click Reconnect and use correct account
  4. Verify data exists in the provider's app

Configuration Details

Gemini CLI likely uses the same config format as Gemini Code.

See: Gemini Code Integration for detailed config examples.


CLI-Specific Features

Scripting

You can pipe commands to Gemini CLI:

echo "List my Smartlead campaigns" | gemini

Useful for:

  • Automation scripts
  • Cron jobs
  • CI/CD pipelines

Output Formats

Gemini CLI may support different output formats:

  • Plain text (default)
  • JSON (--json flag)
  • Markdown (--markdown flag)

Check gemini --help for available options.


Advanced Usage

Multiple Bundles

Configure multiple bundles in ~/.gemini/settings.json:

{
"mcpServers": {
"marketing": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/abc123"]
},
"dev": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/def456"]
}
}
}

All tools from all bundles will be available in the CLI.


Environment-Specific Bundles

Use different bundles for different environments:

Production:

{
"mcpServers": {
"prod": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/prod-id"]
}
}
}

Staging: Switch the config to use staging bundle.


Next Steps


Need Help?