OpenAI Multi-Model MCP Server with Web Search Grounding
Provides grounded web search using OpenAI's GPT-5 and O3 models, including deep research models, with configurable reasoning effort, dynamic token limits, and automatic source citations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
OpenAI Multi-Model MCP Server with Web Search Grounding
Overview
A production-ready MCP (Model Context Protocol) server that integrates OpenAI's latest models (O3, GPT-5 family) with real-time web search capabilities. This implementation provides dynamic token limits, configurable reasoning effort levels, and robust timeout handling for enterprise deployment.
Related MCP server: multi-api-web-search
Features
Multi-Model Support: Access to O3-2025-04-16, GPT-5, GPT-5-mini, GPT-5-nano, and Deep Research models
Deep Research API: Advanced research capabilities with o3-deep-research and o4-mini-deep-research models
Web Search Integration: Real-time web search grounding for current information retrieval
Dynamic Token Management: Automatic scaling based on reasoning effort (4k/8k/16k tokens)
Configurable Reasoning Effort: Low, medium, and high reasoning levels for different use cases
Robust Timeout Handling: Configurable timeouts with proper error recovery mechanisms
Source Attribution: Automatic citation of web sources with URLs and titles
Production Ready: Comprehensive error handling and performance optimizations
Prerequisites
Node.js 18.0.0 or higher
OpenAI API key with access to GPT-5 and O3 models
npm or yarn package manager
Installation
Clone the repository
git clone https://github.com/[username]/openai-with-search-grounding cd openai_with_search_groundingInstall dependencies
npm installConfigure environment
cp .env.example .env # Edit .env and add your OpenAI API keyVerify installation
node index.jsExpected output:
OpenAI Multi-Model MCP server with web search grounding running
MCP Settings Configuration
Environment Variables
Create a .env file in the project root:
OPENAI_API_KEY=sk-your_openai_api_key_hereMCP Client Configuration
The MCP server operates on-demand and is automatically started by MCP clients when needed. Configure your MCP client with the following settings:
For Roo/Cline (VS Code)
Configuration File Locations:
macOS:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.jsonWindows:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
Complete Configuration:
{
"mcpServers": {
"openai-multi-model-grounded-search": {
"command": "node",
"args": [
"/absolute/path/to/openai_with_search_grounding/index.js"
],
"env": {
"OPENAI_API_KEY": "sk-your_openai_api_key_here"
},
"alwaysAllow": [
"grounded_search"
],
"timeout": 3600
}
}
}For Claude Desktop
Configuration File Locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Complete Configuration:
{
"mcpServers": {
"openai-multi-model-grounded-search": {
"command": "node",
"args": ["/absolute/path/to/openai_with_search_grounding/index.js"],
"env": {
"OPENAI_API_KEY": "sk-your_openai_api_key_here"
},
"alwaysAllow": [
"grounded_search"
]
}
}
}Important Configuration Notes:
Replace
/absolute/path/to/openai_with_search_grounding/with the actual absolute path to your project directoryReplace
sk-your_openai_api_key_herewith your actual OpenAI API keyUse forward slashes (/) in paths, even on Windows
The
timeoutparameter is optional and defaults to system settingsRestart your MCP client after configuration changes
Usage
Available Tool
grounded_search - Search for current information using OpenAI models with web search grounding
Parameters:
query(string, required): Search query for current informationmodel(string, optional): Model selection - "gpt-5", "gpt-5-mini", "gpt-5-nano", "o3-2025-04-16", "o3-deep-research", "o4-mini-deep-research" (default: "o3-2025-04-16")reasoning_effort(string, optional): Reasoning effort level - "low", "medium", "high" (default: "low")
Usage Examples
Basic Search with Default Settings
{
"method": "tools/call",
"params": {
"name": "grounded_search",
"arguments": {
"query": "latest AI developments in 2025"
}
}
}Complex Analysis with High Reasoning Effort
{
"method": "tools/call",
"params": {
"name": "grounded_search",
"arguments": {
"query": "comprehensive analysis of quantum computing breakthroughs in 2025",
"model": "o3-2025-04-16",
"reasoning_effort": "high"
}
}
}Quick Response with Lightweight Model
{
"method": "tools/call",
"params": {
"name": "grounded_search",
"arguments": {
"query": "current weather in San Francisco",
"model": "gpt-5-nano",
"reasoning_effort": "low"
}
}
}Advanced Research with Deep Research Models
{
"method": "tools/call",
"params": {
"name": "grounded_search",
"arguments": {
"query": "comprehensive analysis of renewable energy trends and policy implications",
"model": "o3-deep-research",
"reasoning_effort": "high"
}
}
}Efficient Deep Research
{
"method": "tools/call",
"params": {
"name": "grounded_search",
"arguments": {
"query": "latest developments in machine learning optimization techniques",
"model": "o4-mini-deep-research",
"reasoning_effort": "medium"
}
}
}Response Format
Today's date: 2025-01-25
Query: [your query]
Model: [selected model]
Reasoning Effort: [selected effort level]
[Comprehensive response with current information]
**Sources:**
1. Source Title - https://example.com/article
2. Another Source - https://example.com/researchToken Limits
Token limits are automatically adjusted based on reasoning effort levels:
Reasoning Effort | Token Limit | Use Case |
Low | 4,000 tokens | Quick searches, simple queries |
Medium | 8,000 tokens | Detailed research, comprehensive answers |
High | 16,000 tokens | In-depth analysis, complex topics |
Deployment
Production Deployment Considerations
Security:
Secure API key management using environment variables
Implement rate limiting to prevent abuse
Use HTTPS for all external communications
Regular security audits and dependency updates
Monitoring:
Implement comprehensive logging for debugging and monitoring
Set up error tracking and alerting systems
Monitor API usage and costs
Track performance metrics and response times
Scalability:
The server supports horizontal scaling through multiple instances
Implement load balancing for high-availability deployments
Consider caching frequently requested information
Monitor resource usage and optimize as needed
Environment Setup:
Use process managers like PM2 for production deployments
Configure proper environment variables for different stages
Implement health checks and automatic restarts
Set up backup and recovery procedures
Server Operation
The MCP server operates on-demand:
Automatically started by MCP clients when needed
Shuts down when not in use to conserve resources
No manual server management required
Supports concurrent requests from multiple clients
Troubleshooting
Authentication Issues
Verify API Key Format:
echo $OPENAI_API_KEY | grep "^sk-"Test API Connectivity:
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"Model Access Issues
Ensure your OpenAI account has access to GPT-5 and O3 models
Check API usage limits and billing status
Verify model availability in your region
Contact OpenAI support for access-related issues
Configuration Problems
MCP Connection Issues:
Verify the absolute path to
index.jsis correctEnsure Node.js version is 18 or higher
Check that environment variables are properly configured
Restart your MCP client after configuration changes
Timeout Errors:
Increase timeout values for complex queries
Use appropriate reasoning effort levels
Monitor network connection stability
Check server logs for detailed error information
Debug Mode
# Run with debug output
OPENAI_API_KEY=your-key node index.js 2>&1 | tee debug.log
# Verify server startup
node index.jsCommon Solutions
Path Issues: Use absolute paths in configuration files
Permission Errors: Ensure proper file permissions for the project directory
Network Issues: Check firewall settings and network connectivity
Dependency Issues: Run
npm installto ensure all dependencies are installed
License
This project is licensed under the MIT License - see the LICENSE file for details.
Current Version: 1.3.0
Node.js: 18+
MCP Protocol: 1.0.1
Supported Models: O3-2025-04-16, GPT-5, GPT-5-mini, GPT-5-nano, O3-Deep-Research, O4-Mini-Deep-Research
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Real-time web and scholarly search with cited answers and multi-step deep research.
Agent-native search engine with live web research optimized for AI agents.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables web search and site-specific search capabilities through the Deepsearch model. Provides unified access to broad web retrieval and targeted site search functionality within the MCP ecosystem.25Apache 2.0
- FlicenseCqualityBmaintenanceEnables MCP clients to perform web searches through multiple AI models, with dual-mode routing for fast or cited results and consensus-based multi-engine querying to cross-verify information.2-
- AlicenseNot gradedqualityCmaintenanceEnables users to run autonomous multi-stage deep research directly from MCP-compatible clients, producing cited, publication-quality technical reports from web searches and unstructured data.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI agents to search the web and obtain cited answers, step-by-step reasoning, and deep research through hosted APIs.MIT