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:

  1. Via Composio Connect - Direct and easiest approach
  2. 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?

Connecting Gemini to Claude Code using Composio

  1. Add the Composio MCP to Claude

Terminal

Generate MCP URL

  1. Start Claude Code

bash

Copy

claude
  1. Open your MCP list

bash

Copy

/mcp
  1. Select Composio and click on Authenticate

  2. 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.

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:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Step by step10 STEPS

1

Prerequisites

Before starting, make sure you have:

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:

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:

5

Install Composio library

TypescriptPython

Copy

npm install @composio/core dotenv

Install the Composio TypeScript library to create MCP sessions.

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 \