Gemini MCP Integration with Claude Code | Composio
For AI agents: how to sign up
If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev.
Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.
How to integrate Gemini MCP with Claude Code
Connect Claude Code to Gemini MCP. Summarize this research article in 100 words, generate a creative image of a futuristic city, and more using natural language, with authentication handled for you.
Gemini
No Auth
Gemini is Google's multimodal AI platform for generating text, video, and rich chat completions. It's a one-stop shop for advanced AI content creation and intelligent automation.
7 Tools
Managed auth
Connect Gemini without auth hassles
We manage OAuth, API keys, token refresh, and scopes — you just build.
Introduction
Markdown
Manage your Gemini directly from Claude Code with zero worries about OAuth hassles, API-breaking issues, or reliability and security concerns.
You can do this in two different ways:
- Via Composio Connect - Direct and easiest approach
- Via Composio SDK - Programmatic approach with more control
Also integrate Gemini with
ChatGPT Work Antigravity OpenAI Agents SDK Claude Agent SDK Claude Cowork Codex Kimi Code Grok Build Cursor VS Code OpenCode OpenClaw Hermes CLI Google ADK LangChain Vercel AI SDK Mastra AI LlamaIndex CrewAI Pydantic AI AutoGen
Why use Composio?
- Only one MCP URL to connect multiple apps with Claude Code with zero auth hassles.
- Programmatic tool calling allows LLMs to write its code in a remote workbench to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
- Handling Large tool responses out of LLM context to minimize context rot.
- Dynamic just-in-time access to 20,000 tools across 1000+ other Apps for cross-app workflows. It loads the tools you need, so LLMs aren't overwhelmed by tools you don't need.
Connecting Gemini to Claude Code using Composio
- Add the Composio MCP to Claude
Terminal
Generate MCP URL
- Start Claude Code
bash
Copy
claude
- Open your MCP list
bash
Copy
/mcp
Select Composio and click on Authenticate
This will redirect you to the Composio OAuth page. Complete the flow by authorizing Composio and you're all set.
What is the Gemini MCP server, and what's possible with it?
The Gemini MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Gemini account. It provides structured and secure access to Gemini's multimodal AI features, so your agent can generate text, images, and videos, analyze content, and manage model resources on your behalf.
- Text and content generation: Instruct your agent to create high-quality, customized text using Gemini's advanced generative models—great for brainstorming, drafting, or summarizing information.
- Creative image and video generation: Ask the agent to generate original images or high-quality videos from text prompts using Gemini 2.5 Flash and Veo models, with fine control over style and format.
- Embedding and semantic analysis: Let your agent transform any text into rich semantic embeddings for similarity search, clustering, or classification tasks.
- Model discovery and optimization: Have the agent list available Gemini and Veo models, check their capabilities, and select the best fit for your project or workflow.
- Efficient resource management: Enable the agent to track video generation operations, download final assets, and optimize prompt inputs by counting tokens—all without manual intervention.
Connecting Gemini via Composio SDK
Composio SDK is the underlying technology that powers these integrations. It provides a universal gateway with full programmatic control. You can programmatically generate an MCP URL with the app you need (hereGemini) for even more tool search precision. It's secure and reliable.
How the Composio SDK works
The Composio SDK follows a three-phase workflow:
- Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
- Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
- Execution: Executes the action using the authenticated connection.
Step-by-step Guide
Step by step10 STEPS
1
Prerequisites
Before starting, make sure you have:
- Claude Pro, Max, or API billing enabled Anthropic account
- Composio API Key
- A Gemini account
- Basic knowledge of Python or TypeScript
2
Install Claude Code
bash
Copy
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
To install Claude Code, use one of the following methods based on your operating system:
3
Set up Claude Code
bash
Copy
cd your-project-folder
claude
Open a terminal, go to your project folder, and start Claude Code:
- Claude Code will open in your terminal
- Follow the prompts to sign in with your Anthropic account
- Complete the authentication flow
- Once authenticated, you can start using Claude Code
4
Set up environment variables
bash
Copy
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
Create a .env file in your project root with the following variables:
COMPOSIO_API_KEYauthenticates with Composio (get it from Composio dashboard)USER_IDidentifies the user for session management (use any unique identifier)
5
Install Composio library
TypescriptPython
Copy
npm install @composio/core dotenv
Install the Composio TypeScript library to create MCP sessions.
@composio/coreprovides the core Composio functionalitydotenvloads environment variables from your.envfile
6
Generate Composio MCP URL
TypescriptPython
Copy
import 'dotenv/config';
import { Composio } from '@composio/core';
const { COMPOSIO_API_KEY, USER_ID } = process.env;
if (!COMPOSIO_API_KEY || !USER_ID) {
throw new Error('COMPOSIO_API_KEY and USER_ID required in .env');
}
const composioClient = new Composio({ apiKey: COMPOSIO_API_KEY });
const composioSession = await composioClient.create(USER_ID, {
toolkits: ['gemini'],
});
const composioMcpUrl = composioSession?.mcp.url;
console.log(`MCP URL: ${composioMcpUrl}`);
console.log(`\nUse this command to add to Claude Code:`);
console.log(`claude mcp add --transport http gemini-composio \