Gemini Code MCP Setup
Connect MCPBundles MCP servers to Gemini Code to give Google's AI coding assistant access to external tools.
Requirements
- Gemini Code editor (latest version)
- An MCP server enabled in your MCPBundles dashboard
- Credentials connected for the providers on that MCP server
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 MCP servers, writes the Gemini Code config, and handles authentication. No manual JSON editing needed.
After running mcpbundles init, restart Gemini Code 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 MCP server URL
- Log in to MCPBundles Dashboard
- Open the MCP server you want to connect
- Scroll to the "Quick Setup" section (only visible when the MCP server is operational)
- Copy the MCP Server URL
2. Locate Gemini Config File
Gemini Code uses ~/.gemini/settings.json for MCP configuration.
File location:
- macOS/Linux:
~/.gemini/settings.json - Windows:
%USERPROFILE%\.gemini\settings.json
If the file or directory doesn't exist, create it:
mkdir -p ~/.gemini
touch ~/.gemini/settings.json
3. Add MCP server configuration
Edit ~/.gemini/settings.json:
{
"mcpServers": {
"your-bundle-name": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/YOUR-BUNDLE-ID"]
}
}
}
Replace:
your-bundle-name— Short MCP server name key (e.g.,marketing)https://mcp.mcpbundles.com/bundle/YOUR-BUNDLE-ID— Your actual MCPBundles MCP server URL
Example with multiple MCP servers:
{
"mcpServers": {
"marketing": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/abc123"]
},
"dev-tools": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/def456"]
}
}
}
4. Restart Gemini Code
- Quit Gemini Code completely
- Reopen it
- Wait 10-20 seconds for MCP to initialize
Note: On first launch, npx will download mcp-remote package. This may take a minute.
5. Verify Connection
Ask the AI assistant: "What tools do you have access to?"
Expected response: List of tools from your MCP server(s).
Using Tools in Gemini Code
Once connected, Gemini can use your tools for coding tasks.
Example Prompts
Data-driven development:
"Fetch the latest Smartlead campaigns and create a TypeScript interface matching the schema"
GitHub operations:
"List my GitHub repos and generate a script to clone all of them"
Integration code:
"Get the latest HubSpot contacts and write a Python script to export them to CSV"
Gemini will call tools, get real data, and generate code.
Troubleshooting
"mcp-remote not found"
Cause: npx hasn't downloaded the package yet.
Fix:
- Wait 30-60 seconds on first launch
- Or manually install:
npm install -g mcp-remote - Restart Gemini Code
"MCP server connection failed"
Fix:
- Check URL is correct (including
https://) - Verify the MCP server is enabled in dashboard
- Make sure
commandis"npx"andargsis an array - Restart Gemini Code
Tools don't appear after adding config
Fix:
- Quit Gemini Code completely
- Wait 5 seconds
- Reopen
- Wait 30 seconds (longer first time for package download)
"Authentication required" when calling tools
Fix:
- Go to Settings → Credentials
- Connect credentials for needed providers
- Try the tool again in Gemini Code
See Provider Credentials Guide.
JSON syntax error in settings.json
Common mistakes:
Missing comma:
{
"mcpServers": {
"marketing": { "command": "npx", "args": [...] } // ❌ Missing comma
"sales": { "command": "npx", "args": [...] }
}
}
Should be:
{
"mcpServers": {
"marketing": { "command": "npx", "args": [...] }, // ✅ Has comma
"sales": { "command": "npx", "args": [...] }
}
}
Fix: Use a JSON validator to check syntax.
Configuration Details
Required Fields
| Field | Value | Notes |
|---|---|---|
| command | "npx" | Package runner |
| args | ["mcp-remote", "YOUR-URL"] | Array with package name and URL |
Important:
argsmust be an array- URL goes in the array, not as a separate field
mcp-remotepackage acts as an HTTP-to-stdio bridge
Advanced Configuration
Multiple MCP servers
{
"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"]
},
"crm": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/ghi789"]
}
}
}
With Other MCP Servers
{
"mcpServers": {
"mcpbundles-marketing": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mcpbundles.com/bundle/abc123"]
},
"local-filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/files"]
}
}
}
Next Steps
- Browse MCP servers — Explore MCP servers
- Connect Credentials — Set up auth
- Troubleshooting — Fix issues
Need Help?
- Not working? See Troubleshooting
- Questions? Check the FAQ
- Support: Email help@mcpbundles.com