MCP Integrations
All three tools support the Model Context Protocol — but they configure, discover, and expose it in completely different ways. This module maps the config syntax, extension ecosystems, and the surprising portability story: a server built for Claude Code works in Gemini CLI with zero changes.
What is MCP?
BEFORE: Every AI tool had its own proprietary plugin system. To give Claude access to your database, you wrote Anthropic-specific tool definitions. The same work, done again in a different format, for Gemini. Every integration was siloed.
PAIN: The result was the same integration work multiplied by the number of AI tools your team uses. Three AI tools meant three separate database connectors, three separate GitHub integrations, three separate Slack bots — all doing the same thing.
MAPPING: MCP (Model Context Protocol) is Anthropic's open standard that creates a universal interface. An MCP server exposes capabilities once, in a standard format. Any MCP client — Claude Code, Gemini CLI, Cursor — can connect to it without changes to the server. Write once, use everywhere.
Claude Code MCP Configuration
Claude Code's MCP configuration lives in .claude/settings.json under the mcpServers key. It supports two transport types: stdio (local process) and HTTP/SSE (remote server).
{
"mcpServers": {
"postgres-reader": {
"command": "node",
"args": ["./mcp-servers/postgres-reader/index.js"],
"env": {
"DATABASE_URL": "${env:DATABASE_URL}"
}
},
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "${env:GITHUB_TOKEN}"
}
},
"remote-stripe": {
"type": "http",
"url": "https://mcp.stripe.com/v1",
"headers": {
"Authorization": "Bearer ${env:STRIPE_KEY}"
}
}
},
"permissions": {
"allow": ["mcp__postgres-reader__query", "mcp__github__list_prs"]
}
}
Claude Code also supports hooks that can intercept MCP tool calls, enabling patterns like logging all database queries or blocking writes to production tables:
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__postgres-reader__*",
"hooks": [
{
"type": "command",
"command": "node ./scripts/log-db-query.js"
}
]
}
]
}
}
Gemini CLI MCP Configuration
Gemini CLI defines MCP servers in the ## MCP Servers section of your GEMINI.md file. It also has a native extension system with gemini extensions install for Google partner integrations, and uses OAuth 2.0 for remote servers that require user authentication.
## MCP Servers
### postgres-reader (local stdio)
command: node ./mcp-servers/postgres-reader/index.js
env:
DATABASE_URL: $DATABASE_URL
### stripe (remote OAuth)
url: https://mcp.stripe.com/v1
auth: oauth2
scopes: [read:charges, read:customers]
## Extensions
Installed extensions (via gemini extensions install):
- @google/mcp-figma (Figma design token access)
- @google/mcp-postman (API testing via Postman collections)
- @google/mcp-workspace (Google Docs, Sheets, Gmail)
# Install a Google partner extension
gemini extensions install @google/mcp-figma
# List installed extensions
gemini extensions list
# Remove an extension
gemini extensions remove @google/mcp-figma
# Install a custom MCP server as an extension
gemini extensions install --path ./mcp-servers/my-server/
# Extensions show up automatically as tools in your Gemini session
# No restart needed
Gemini CLI has first-party integrations with Google Workspace (Docs, Sheets, Gmail, Drive), Figma, Postman, and other enterprise tools. These are available via gemini extensions install @google/mcp-* and are maintained by Google. Claude Code can access many of the same services via MCP servers, but they are not bundled — you install them separately (e.g., npx -y @anthropic/mcp-server-github).
GitHub Copilot MCP — IDE vs CLI
This is where the distinction between GitHub Copilot in VS Code and GitHub Copilot CLI is sharpest. GitHub Copilot MCP support exists — but only in the IDE, not in the CLI.
| Surface | MCP Support | Configuration |
|---|---|---|
| VS Code Copilot Chat | Yes — full MCP client | github.copilot.chat.mcp.servers in VS Code settings.json |
| JetBrains Copilot | Yes — MCP client | IDE settings under Copilot MCP configuration |
gh copilot suggest |
No — CLI has no MCP support | N/A — CLI does not connect to MCP servers |
gh copilot explain |
No — CLI has no MCP support | N/A |
// ~/.vscode/settings.json (VS Code only — NOT available in gh copilot CLI)
{
"github.copilot.chat.mcp.servers": {
"postgres-reader": {
"command": "node",
"args": ["./mcp-servers/postgres-reader/index.js"],
"env": {
"DATABASE_URL": "${env:DATABASE_URL}"
}
}
}
}
// In the terminal (gh copilot):
// gh copilot suggest "query the users table for inactive accounts"
// → MCP is NOT available — Copilot CLI has no database context
// → Suggested command: psql $DATABASE_URL -c "SELECT ..."
// → You run it manually
If you need MCP-powered Copilot in your workflow, use VS Code's Copilot Chat panel — not gh copilot. The gh copilot CLI is a separate product that predates Copilot's MCP support and has not been updated to include it. For terminal-based MCP usage, Claude Code and Gemini CLI are the correct tools.
Same MCP Server: Two Configs Side-by-Side
Here is the exact same Postgres reader MCP server configured for both Claude Code and Gemini CLI. Notice how similar the underlying concepts are — the differences are purely syntactic (JSON vs YAML-in-markdown).
{
"mcpServers": {
"postgres-reader": {
"command": "node",
"args": [
"./mcp-servers/postgres-reader/index.js"
],
"env": {
"DATABASE_URL": "${env:DATABASE_URL}",
"MAX_ROWS": "1000"
}
}
}
}
## MCP Servers
### postgres-reader
command: node
args:
- ./mcp-servers/postgres-reader/index.js
env:
DATABASE_URL: $DATABASE_URL
MAX_ROWS: "1000"
Both configs reference the same command, args, and env fields. The MCP server code itself is completely unchanged. This means your investment in writing and testing an MCP server is reusable across both tools — and across any other MCP-compatible client (Cursor, Continue, etc.).
Extension Ecosystems Compared
Beyond MCP, each tool has its own extension mechanism. These differ significantly in what they enable beyond the basic MCP protocol.
- PreToolUse: intercept before any tool call
- PostToolUse: react to tool results
- Notification: custom terminal messages
- Stop: trigger when Claude stops
- Configured in .claude/settings.json
- Run any shell command or script
- gemini extensions install @pkg
- Google Workspace (Docs, Sheets, Gmail)
- Figma, Postman, Stripe (partner)
- Custom via local MCP server path
- OAuth 2.0 for remote auth
- npm-style package registry
- No hook system in CLI
- No extension manager in CLI
- gh CLI extensions (non-AI) supported
- IDE plugins available (VS Code)
- GitHub Actions automation
- MCP: VS Code only, not CLI
Because hooks can run any shell script before or after a tool call, you can use them to: automatically run tests after every file write, post a Slack message when Claude completes a task, validate that database queries only target read replicas, or log all tool calls to an audit trail. This makes Claude Code hooks a lightweight automation framework — more powerful than Gemini CLI's extension system for custom enterprise workflows.
MCP Portability: Write Once, Use Everywhere
The most practically important property of MCP: a custom server you write for Claude Code works with Gemini CLI, Cursor, Continue, and any other MCP client — with zero changes to the server code. Only the config file changes.
// WHAT: A custom MCP server that reads Postgres tables
// WHY: Write once — works with Claude Code, Gemini CLI, Cursor, VS Code Copilot
// GOTCHA: Run 'npm install @modelcontextprotocol/sdk pg' first
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
import pg from 'pg';
// WHAT: Create the MCP server — tools are registered below
const server = new McpServer({ name: 'postgres-reader', version: '1.0.0' });
const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
// WHAT: Register a tool — AI clients call this tool by its name
// WHY: Any MCP-compatible client (Claude Code, Gemini, Cursor) discovers
// this tool automatically when connected to this server
server.tool(
'query_table',
'Read rows from a Postgres table (read-only)',
{
table_name: z.string().describe('Table name to query'),
limit: z.number().max(1000).default(50).describe('Max rows to return'),
where: z.string().optional().describe('Optional WHERE clause (no semicolons)'),
},
async ({ table_name, limit, where }) => {
// GOTCHA: Never allow raw SQL injection — only allow table name + WHERE
const allowedTables = process.env.ALLOWED_TABLES?.split(',') ?? [];
if (!allowedTables.includes(table_name)) {
return { content: [{ type: 'text', text: `Table '${table_name}' not in allowlist` }] };
}
const whereClause = where ? `WHERE ${where.replace(/;/g, '')}` : '';
const result = await pool.query(
`SELECT * FROM ${table_name} ${whereClause} LIMIT $1`,
[limit],
);
return {
content: [{
type: 'text',
text: JSON.stringify(result.rows, null, 2),
}],
};
},
);
// WHAT: Start listening on stdio transport
// This is the same transport that both Claude Code and Gemini CLI use
const transport = new StdioServerTransport();
await server.connect(transport);
| Field | Claude Code (.claude/settings.json) | Gemini CLI (GEMINI.md) |
|---|---|---|
| Server name | "postgres-reader": { ... } (JSON key) |
### postgres-reader (markdown heading) |
| Command | "command": "node" |
command: node |
| Arguments | "args": ["./index.js"] |
args:\n - ./index.js |
| Env vars | "env": { "KEY": "${env:KEY}" } |
env:\n KEY: $KEY |
| Server code | Unchanged ★ | Unchanged ★ |
You now understand MCP's portability story and how each tool implements it:
- Claude Code: JSON config in .claude/settings.json, hooks for pre/post tool interception, stdio and HTTP transports.
- Gemini CLI: YAML-in-markdown in GEMINI.md, npm-style extension registry, OAuth 2.0 for remote servers, Google partner extensions.
- Copilot CLI: No MCP in the CLI — MCP lives in VS Code. The terminal
gh copilotdoes not connect to MCP servers. - Portability: the MCP server code is identical for both tools — only the 6-line config block changes.
Next: M08 covers CI/CD automation — how each tool integrates with GitHub Actions, deployment pipelines, and automated workflows.
Knowledge Check
Five questions on MCP configuration, portability, and tool ecosystems.
gh copilot suggest to query their Postgres database via an MCP server they've already built. What will happen?stdio and http MCP transport types in Claude Code?