by ConechoAI
This project provides an MCP server for integrating OpenAI's web search functionality into AI assistants like Claude.app and Zed editor, enabling them to access up-to-date information from the web.
openai-websearch-mcp
is a Python-based Model Context Protocol (MCP) server that allows AI assistants to utilize OpenAI's web_search
tool. This enables AI models to perform real-time web searches during conversations, providing them with current information beyond their training data.
There are two primary methods for installing and configuring openai-websearch-mcp
:
For Claude.app, you can use the following command, which also auto-updates the configuration file:
OPENAI_API_KEY=sk-xxxx uv run --with uv --with openai-websearch-mcp openai-websearch-mcp-install
Replace sk-xxxx
with your actual OpenAI API key.
1. Using uvx
:
Ensure uvx
is installed. Then, add the following to your Claude settings (e.g., settings.json
):
"mcpServers": {
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
For Zed editor, add to your settings.json
:
"context_servers": [
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
],
2. Using pip
installation:
First, install the package via pip:
pip install openai-websearch-mcp
Then, modify your Claude settings:
"mcpServers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
For Zed editor, modify your settings.json
:
"context_servers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
},
web_search
tool.search_context_size
(low, medium, high) and user_location
(city, country, region, timezone) for refined search results.Q: What is the OPENAI_API_KEY
and where can I get it?
A: The OPENAI_API_KEY
is your authentication key for accessing OpenAI's services. You can obtain it from OpenAI's platform.
Q: How can I debug the openai-websearch-mcp
server?
A: For uvx
installations, you can use the MCP inspector:
npx @modelcontextprotocol/inspector uvx openai-websearch-mcp
Q: Are there plans for integration with other AI tools like Cursor and Windsurf?
A: Yes, the README indicates that integration with Cursor and Windsurf is "Coming soon."
Q: What are the required arguments for the web_search
tool?
A: The required arguments are type
(always web_search_preview
) and search_context_size
(low, medium, or high). Optionally, user_location
can be provided with details like city, country, region, and timezone.
This MCP server provides access to OpenAI's websearch functionality through the Model Context Protocol. It allows AI assistants to search the web during conversations with users, providing up-to-date information that may not be available in the assistant's training data. The server can be installed and configured for use with Claude.app or Zed editor.
!!Can using this command auto update configure file(Recommend)
OPENAI_API_KEY=sk-xxxx uv run --with uv --with openai-websearch-mcp openai-websearch-mcp-install
sk-xxxx is your API key. You can get it from openai's open platform
Conming soon
Conming soon
web_search
- Call openai websearch as tool.
type
(string): web_search_previewsearch_context_size
(string): High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.user_location
(object or null)
type
(string): The type of location > approximation. Always approximate.city
(string): Free text input for the city of the user, e.g. San Francisco.country
(string): The two-letter ISO country code of the user, e.g. US.region
(string): Free text input for the region of the user, e.g. California.timezone
(string): The IANA timezone of the user, e.g. America/Los_Angeles.Please make sure uvx
is installed before installation
Add to your Claude settings:
1、Using uvx
"mcpServers": {
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
2、Using pip installation
1)install openai-websearch-mcp
via pip:
pip install openai-websearch-mcp
2)modify your Claude settings
"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. For uvx installations:
npx @modelcontextprotocol/inspector uvx openai-websearch-mcp
Please log in to share your review and rating for this MCP.