Gemini CLI MCP Setup
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-clior similar) - A bundle enabled in your MCPBundles dashboard
- Credentials connected for providers in your bundle
Time to complete: 2-3 minutes
Option A: CLI Setup (Recommended)
If you have terminal access, the fastest way to connect is via the MCPBundles CLI:
pip install mcpbundles
mcpbundles init
This automatically discovers your bundles, writes the Gemini CLI config, and handles authentication. No manual JSON editing needed.
After running mcpbundles init, restart Gemini CLI and your tools will be available.
Want more control? Use mcpbundles tools to browse available tools, or mcpbundles call <tool-name> to test a tool directly from your terminal.
Option B: Manual Setup
Step-by-Step Setup
1. Get Your Bundle URL
- Log in to MCPBundles Dashboard
- Click on the bundle you want to use
- Scroll to the "Quick Setup" section (only visible when bundle is operational)
- 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:
- Gemini CLI will prompt for authentication
- Follow the OAuth flow or provide API key
- 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:
- Go to Dashboard → Providers
- Scroll to the "Credentials" section
- Click "Add Credential" (or "Connect [Provider]" if no credentials exist) on needed providers
- Complete OAuth or add API key in the credential panel
- Select validation tool and click "Validate Now"
- 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:
- Dashboard → Providers → [Provider]
- Scroll to the "Credentials" section
- Check which account is connected
- If wrong, click "Edit" on the credential card
- In the credential panel, click "Connect with [Provider]" again and use correct account
- Re-validate the credential
- 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 (
--jsonflag) - Markdown (
--markdownflag)
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
- Browse Bundles - Explore bundles
- Connect Credentials - Set up auth
- Troubleshooting - Fix issues
Need Help?
- Not working? See Troubleshooting
- Questions? Check the FAQ
- Support: Email help@mcpbundles.com