Call OpenAI websearch to retrieve up-to-date information from the web
OpenAI WebSearch MCP provides access to OpenAI's web search functionality through the Model Context Protocol. It allows AI assistants to search the web during conversations, providing up-to-date information that may not be available in the assistant's training data. This MCP server acts as a bridge between AI assistants and the OpenAI API, enabling real-time web search capabilities. It can be easily configured for use with Claude.app, Zed editor, and other MCP-compatible clients.
There are two main ways to install the OpenAI WebSearch MCP:
This method automatically installs and configures the MCP server:
OPENAI_API_KEY=sk-xxxx uv run --with uv --with openai-websearch-mcp openai-websearch-mcp-install
Replace sk-xxxx
with your OpenAI API key, which you can obtain from the OpenAI platform.
uvx
is installed on your systemInstall the package using pip:
pip install openai-websearch-mcp
Configure your AI client settings as shown in the configuration section below.
Add the following to your Claude settings:
Using uvx:
"mcpServers": {
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
Using pip installation:
"mcpServers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
Add to your Zed settings.json:
Using uvx:
"context_servers": [
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
],
Using pip installation:
"context_servers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
},
You can use the MCP inspector to debug the server:
npx @modelcontextprotocol/inspector uvx openai-websearch-mcp
This will help you identify any issues with the MCP server configuration or operation.