MCP AI Bridge
The MCP AI Bridge server provides secure access to OpenAI and Google Gemini AI models through Claude Code.
Query OpenAI Models: Access GPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-3.5 Turbo, and other models using the
ask_openaitoolQuery Google Gemini Models: Interact with Gemini Pro, Gemini 1.5 Pro, and Gemini 1.5 Flash via the
ask_geminitoolCustomization Options: Control parameters like temperature for response generation
Server Information: Retrieve status, configuration, available models, and security settings with the
server_infotoolSecurity Features: Input validation, rate limiting (100 requests/minute), API key validation, and secure error handling
Flexible Configuration: Support for environment variables,
.envfiles, and Claude Code configuration
Integrates with the dotenv library to securely load API keys and configuration from environment files, supporting both global and local configurations.
Enables interaction with Google Gemini models including Gemini Pro, Gemini 1.5 Pro, and Gemini 1.5 Flash through the ask_gemini tool with customizable parameters.
Uses Node.js as the runtime environment for the MCP server, providing the foundation for API integrations and server functionality.
Provides access to OpenAI's language models including GPT-4, GPT-4 Turbo, and GPT-3.5 Turbo through the ask_openai tool with customizable parameters like temperature.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP AI Bridgecompare GPT-4o and Gemini 1.5 Pro for summarizing technical documentation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP AI Bridge
A secure Model Context Protocol (MCP) server that bridges Claude Code with OpenAI and Google Gemini APIs.
Features
OpenAI Integration: Access GPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-4, and reasoning models (o1, o1-mini, o1-pro, o3-mini)
Gemini Integration: Access Gemini 1.5 Pro, Gemini 1.5 Flash, and vision models with latest capabilities
Security Features:
Enhanced Input Validation: Multi-layer validation with sanitization
Content Filtering: Blocks explicit, harmful, and illegal content
Prompt Injection Detection: Identifies and blocks manipulation attempts
Rate Limiting: Prevents API abuse with configurable limits
Secure Error Handling: No sensitive information exposure
API Key Validation: Format validation for API keys
Configurable Security Levels: Basic, Moderate, and Strict modes
Robust Error Handling: Specific error types with detailed messages
Structured Logging: Winston-based logging with configurable levels
Flexible Configuration: Control temperature and model selection for each request
Related MCP server: Gemini MCP Server
Installation
Clone or copy the
mcp-ai-bridgedirectory to your preferred locationInstall dependencies:
cd mcp-ai-bridge
npm installConfigure your API keys using ONE of these methods:
Option A: Use global .env file in your home directory (Recommended)
Create or edit
~/.envfileAdd your API keys:
OPENAI_API_KEY=your_openai_api_key_here GOOGLE_AI_API_KEY=your_google_ai_api_key_here
Option B: Use local .env file
Create a
.envfile in the mcp-ai-bridge directory:cp .env.example .envAdd your API keys to this local
.envfile
Option C: Use environment variables in Claude Code config
Configure directly in the Claude Code settings (see Configuration section)
The server will check for environment variables in this order:
~/.env(your home directory)./.env(local to mcp-ai-bridge directory)System environment variables
Optional Configuration Variables:
# Logging level (error, warn, info, debug) LOG_LEVEL=info # Server identification MCP_SERVER_NAME=AI Bridge MCP_SERVER_VERSION=1.0.0 # Security Configuration SECURITY_LEVEL=moderate # disabled, basic, moderate, strict # Content Filtering (granular controls) BLOCK_EXPLICIT_CONTENT=true # Master content filter toggle BLOCK_VIOLENCE=true # Block violent content BLOCK_ILLEGAL_ACTIVITIES=true # Block illegal activity requests BLOCK_ADULT_CONTENT=true # Block adult/sexual content # Injection Detection (granular controls) DETECT_PROMPT_INJECTION=true # Master injection detection toggle DETECT_SYSTEM_PROMPTS=true # Detect system role injections DETECT_INSTRUCTION_OVERRIDE=true # Detect "ignore instructions" attempts # Input Sanitization (granular controls) SANITIZE_INPUT=true # Master sanitization toggle REMOVE_SCRIPTS=true # Remove script tags and JS LIMIT_REPEATED_CHARS=true # Limit DoS via repeated characters # Performance & Flexibility ENABLE_PATTERN_CACHING=true # Cache compiled patterns for speed MAX_PROMPT_LENGTH_FOR_DEEP_SCAN=1000 # Skip deep scanning for long prompts ALLOW_EDUCATIONAL_CONTENT=false # Whitelist educational content WHITELIST_PATTERNS= # Comma-separated regex patterns to allow
Configuration in Claude Code
Method 1: Using Claude Code CLI (Recommended)
Use the interactive MCP setup wizard:
claude mcp addOr add the server configuration directly:
claude mcp add-json ai-bridge '{"command": "node", "args": ["/path/to/mcp-ai-bridge/src/index.js"]}'Method 2: Manual Configuration
Add the following to your Claude Code MCP settings. The configuration file location depends on your environment:
Claude Code CLI: Uses
settings.jsonin the configuration directory (typically~/.claude/or$CLAUDE_CONFIG_DIR)Claude Desktop: Uses
~/.claude/claude_desktop_config.json
For Claude Desktop compatibility:
{
"mcpServers": {
"ai-bridge": {
"command": "node",
"args": ["/path/to/mcp-ai-bridge/src/index.js"],
"env": {
"OPENAI_API_KEY": "your_openai_api_key",
"GOOGLE_AI_API_KEY": "your_google_ai_api_key"
}
}
}
}Alternatively, if you have the .env file configured, you can omit the env section:
{
"mcpServers": {
"ai-bridge": {
"command": "node",
"args": ["/path/to/mcp-ai-bridge/src/index.js"]
}
}
}Method 3: Import from Claude Desktop
If you already have this configured in Claude Desktop, you can import the configuration:
claude mcp add-from-claude-desktopAvailable Tools
1. ask_openai
Query OpenAI models with full validation and security features.
Parameters:
prompt(required): The question or prompt to send (max 10,000 characters)model(optional): Choose from 'gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4', 'o1', 'o1-mini', 'o1-pro', 'o3-mini', 'chatgpt-4o-latest', and other available models (default: 'gpt-4o-mini')temperature(optional): Control randomness (0-2, default: 0.7)
Security Features:
Input validation for prompt length and type
Temperature range validation
Model validation
Rate limiting (100 requests per minute by default)
2. ask_gemini
Query Google Gemini models with full validation and security features.
Parameters:
prompt(required): The question or prompt to send (max 10,000 characters)model(optional): Choose from 'gemini-1.5-pro-latest', 'gemini-1.5-pro-002', 'gemini-1.5-pro', 'gemini-1.5-flash-latest', 'gemini-1.5-flash', 'gemini-1.5-flash-002', 'gemini-1.5-flash-8b', 'gemini-1.0-pro-vision-latest', 'gemini-pro-vision' (default: 'gemini-1.5-flash-latest')temperature(optional): Control randomness (0-1, default: 0.7)
Security Features:
Input validation for prompt length and type
Temperature range validation
Model validation
Rate limiting (100 requests per minute by default)
3. server_info
Get comprehensive server status and configuration information.
Returns:
Server name and version
Available models for each service
Security settings (rate limits, validation status)
Configuration status for each API
Usage Examples
In Claude Code, you can use these tools like:
mcp__ai-bridge__ask_openai
prompt: "Explain the concept of recursion in programming"
model: "gpt-4o"
temperature: 0.5
mcp__ai-bridge__ask_gemini
prompt: "What are the key differences between Python and JavaScript?"
model: "gemini-1.5-flash-latest"
mcp__ai-bridge__server_infoDebugging MCP Server
If you encounter issues with the MCP server, you can use Claude Code's debugging features:
# Enable MCP debug mode for detailed error information
claude --mcp-debug
# Check MCP server status and tools
claude
# Then use the /mcp slash command to view server detailsTesting
The project includes comprehensive unit tests and security tests. To run tests:
# Run all tests (including security tests)
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverageTest Coverage
Unit tests for all server functionality
Security tests for input validation and rate limiting
Integration tests for API interactions
Error handling tests
Mock-based testing to avoid real API calls
Troubleshooting
Common Issues
"API key not configured" error: Make sure you've added the correct API keys to your
.envfile or Claude Code config"Invalid OpenAI API key format" error: OpenAI keys must start with 'sk-'
"Rate limit exceeded" error: Wait for the rate limit window to reset (default: 1 minute)
"Prompt too long" error: Keep prompts under 10,000 characters
Module not found errors: Run
npm installin the mcp-ai-bridge directoryPermission errors: Ensure the index.js file has execute permissions
Logging issues: Set LOG_LEVEL environment variable (error, warn, info, debug)
Claude Code Specific Troubleshooting
MCP server not loading:
Use
claude --mcp-debugto see detailed error messagesCheck server configuration with
/mcpslash commandVerify the server path is correct and accessible
Ensure Node.js is installed and in your PATH
Configuration issues:
Use
claude mcp addfor interactive setupCheck
CLAUDE_CONFIG_DIRenvironment variable if using custom config locationFor timeouts, configure
MCP_TIMEOUTandMCP_TOOL_TIMEOUTenvironment variables
Server startup failures:
Check if the server process can start independently:
node /path/to/mcp-ai-bridge/src/index.jsVerify all dependencies are installed
Check file permissions on the server directory
Security Features
Enhanced Security Protection
Multi-Layer Input Validation: Type, length, and content validation
Content Filtering: Blocks explicit, violent, illegal, and harmful content
Prompt Injection Detection: Identifies and prevents manipulation attempts including:
Instruction override attempts ("ignore previous instructions")
System role injection ("system: act as...")
Template injection ({{system}}, <|system|>, [INST])
Suspicious pattern detection
Input Sanitization: Removes control characters, scripts, and malicious patterns
Rate Limiting: 100 requests per minute by default to prevent API abuse
API Key Validation: Format validation for API keys before use
Secure Error Handling: No stack traces or sensitive information in error messages
Structured Logging: All operations are logged with appropriate levels
Security Levels
Basic: Minimal filtering, allows most content
Moderate (Default): Balanced protection with reasonable restrictions
Strict: Maximum protection, blocks borderline content
Granular Security Configuration
Security Levels:
disabled- No security checks (maximum performance)basic- Essential protection only (good performance)moderate- Balanced protection (default, good balance)strict- Maximum protection (may impact performance)
Individual Feature Controls:
# Master toggles
SECURITY_LEVEL=moderate
BLOCK_EXPLICIT_CONTENT=true
DETECT_PROMPT_INJECTION=true
SANITIZE_INPUT=true
# Granular content filtering
BLOCK_VIOLENCE=true # "how to kill", violence
BLOCK_ILLEGAL_ACTIVITIES=true # "how to hack", illegal acts
BLOCK_ADULT_CONTENT=true # Sexual/adult content
# Granular injection detection
DETECT_SYSTEM_PROMPTS=true # "system: act as admin"
DETECT_INSTRUCTION_OVERRIDE=true # "ignore previous instructions"
# Granular sanitization
REMOVE_SCRIPTS=true # Remove <script> tags
LIMIT_REPEATED_CHARS=true # Prevent character flooding
# Performance optimization
ENABLE_PATTERN_CACHING=true # Cache patterns for speed
MAX_PROMPT_LENGTH_FOR_DEEP_SCAN=1000 # Skip intensive checks on long prompts
# Flexibility options
ALLOW_EDUCATIONAL_CONTENT=true # Whitelist "research about", "explain"
WHITELIST_PATTERNS="educational,academic" # Custom regex patternsPerformance Considerations:
Pattern caching reduces regex compilation overhead
Long prompts (>1000 chars) get lighter scanning in basic mode
Early termination stops checking after finding issues
Granular controls let you disable unneeded checks
Best Practices
Never commit your
.envfile to version controlKeep your API keys secure and rotate them regularly
Consider setting usage limits on your API accounts
Monitor logs for unusual activity
Use the rate limiting feature to control costs
Validate the server configuration using the
server_infotool
Rate Limiting
The server implements sliding window rate limiting:
Default: 100 requests per minute
Configurable via environment variables
Per-session tracking
Graceful error messages with reset time information
Available Tools
3 toolsask_geminiC
Ask Google Gemini AI a question
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The prompt to send to Gemini | |
| model | No | The model to use (default: gemini-1.5-flash-latest) | gemini-1.5-flash-latest |
| temperature | No | Temperature for response generation (0-1) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. 'Ask Google Gemini AI a question' implies a read-only query operation, but provides no information about rate limits, authentication requirements, response formats, error handling, or any behavioral characteristics. The description is minimal and lacks essential operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just 5 words, front-loading the essential information with zero wasted words. It efficiently communicates the core purpose without unnecessary elaboration. Every word earns its place in this minimal but complete statement of function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters, no annotations, and no output schema, the description is insufficiently complete. While concise, it lacks critical context about behavioral characteristics, output format, error conditions, and differentiation from sibling tools. The agent would need to rely heavily on schema information alone, which is inadequate for proper tool selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the input schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Ask') and target resource ('Google Gemini AI'), making the purpose immediately understandable. It distinguishes from 'ask_openai' by specifying the AI provider, though it doesn't explicitly mention the sibling differentiation. The description is specific enough to understand what the tool does without being tautological.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus the 'ask_openai' sibling tool. There's no mention of differences in capabilities, cost, performance, or appropriate use cases between Gemini and OpenAI. The agent receives no help in choosing between these two similar tools beyond the provider name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ask_openaiB
Ask OpenAI GPT models a question
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The prompt to send to OpenAI | |
| model | No | The model to use (default: gpt-4o-mini) | gpt-4o-mini |
| temperature | No | Temperature for response generation (0-2) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the basic action but doesn't mention rate limits, authentication requirements, cost implications, response format, or error handling. For a tool that likely involves API calls with potential constraints, this leaves significant behavioral aspects undocumented.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a straightforward tool and front-loads the essential information. Every word earns its place in this minimal but complete statement.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters, no annotations, and no output schema, the description provides only basic purpose information. It doesn't address behavioral aspects, return values, error conditions, or usage constraints. Given the complexity of interacting with external AI models and the lack of structured metadata, the description is insufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, providing complete parameter documentation. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('ask') and target resource ('OpenAI GPT models'), making the purpose immediately understandable. It distinguishes from the sibling 'ask_gemini' by specifying OpenAI rather than Google's model. However, it doesn't specify what type of question or interaction this enables (e.g., chat completion, text generation), leaving some ambiguity about the exact operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (when you need to query OpenAI models) but doesn't explicitly state when to use this versus the 'ask_gemini' sibling tool. There's no guidance on prerequisites, limitations, or alternative scenarios. The implied differentiation is present but not articulated clearly enough for optimal agent decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
server_infoB
Get server status and configuration
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information ('Get'), implying a read-only operation, but doesn't disclose any behavioral traits such as authentication requirements, rate limits, error conditions, or what specific data is returned. This is a significant gap for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'server status and configuration' entails (e.g., uptime, version, settings), how the data is returned, or any prerequisites. For a tool with no structured data support, this leaves critical gaps in understanding its behavior and output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for tools with no parameters, as there's nothing to compensate for.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Get') and resource ('server status and configuration'). It distinguishes what information is retrieved, though it doesn't explicitly differentiate from sibling tools like 'ask_gemini' or 'ask_openai', which appear to serve different purposes (querying AI models vs. server diagnostics).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description implies usage for checking server state but doesn't specify scenarios (e.g., troubleshooting, monitoring) or exclusions, leaving the agent to infer context without explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
- First observed
ask_gemini - First observed
ask_openai - First observed
server_info
TDQS
Each tool has a clearly distinct purpose: ask_gemini and ask_openai target different AI providers with no overlap in functionality, while server_info serves a completely separate administrative role. There is no ambiguity that could lead to misselection between these tools.
All tools follow a consistent verb_noun pattern with snake_case naming: ask_gemini, ask_openai, and server_info. The naming is predictable and readable throughout the set, with no deviations in style or convention.
With only 3 tools, the set feels thin for a server named 'MCP AI Bridge', which suggests broader AI integration capabilities. While the tools cover basic querying and server info, the scope might be underdeveloped, lacking operations like model listing, configuration updates, or multi-turn conversations.
The tool surface covers basic AI querying and server status, but there are notable gaps for a comprehensive AI bridge. Missing operations include listing available models, managing API keys, handling conversation contexts, or supporting other AI providers beyond Gemini and OpenAI, which limits agent workflows.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude to collaborate with Google's Gemini AI models, providing tools for question answering, code review, brainstorming, test generation, and explanations.MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude to interact with Google's Gemini AI models, allowing users to ask Gemini questions directly from Claude.2-
- AlicenseNot gradedqualityFmaintenanceAn enhanced Model Context Protocol server that enables Claude to seamlessly collaborate with multiple AI models (Gemini, OpenAI, local models) for code analysis and development tasks, maintaining context across conversations.2254Apache 2.0
- AlicenseCqualityDmaintenanceA Model Context Protocol server that exposes OpenAI and Gemini AI models through a single interface, allowing tools like Claude Code and Cursor to access multiple AI providers with built-in usage analytics.2753275MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fakoli/mcp-ai-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server