About OpenAI Web Search MCP Server
OpenAI Web Search MCP Server exposes real-time web search through OpenAI's Responses API. It is for MCP clients that need to submit a query to the `web_search` tool.
Key features
- 01Real-time web search
- 02`web_search` query tool
- 03Uses OpenAI Responses API
- 04Configurable server port
Use cases
- 01Search the web for current information
- 02Retrieve online results from an MCP client
MCP support
Exposes a `web_search` tool to MCP clients. The tool accepts a query and uses OpenAI's Responses API with `web_search_preview`.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEOpenAI Web Search MCP Server
A TypeScript implementation of an MCP server that provides web search functionality using OpenAI's web search preview feature. This server utilizes OpenAI's latest Responses API with the web_search_preview capability, allowing AI models to perform real-time web searches through the OpenAI API.
Installation
You can run this package directly using npx:
npx openai-websearch-mcp-server
Or install it globally:
npm install -g openai-websearch-mcp-server
Usage with MCP Clients
This server is designed to be used with MCP (Model Context Protocol) clients. Here's how to set it up with different clients:
Claude Desktop
Add the following configuration to your Claude Desktop settings:
{
"mcpServers": {
"openai_websearch": {
"command": "npx",
"args": [
"-y",
"openai-websearch-mcp-server"
],
"env": {
"OPENAI_API_KEY": "your_api_key"
}
}
}
}
Replace your_api_key with your actual OpenAI API key.
Environment Setup
- Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY='your-api-key-here'
- Run the server:
openai-websearch-mcp
By default, the server runs on port 3000. You can change this by setting the PORT environment variable:
PORT=8080 openai-websearch-mcp
API
The server provides a web search tool that can be used through the MCP protocol. The tool is named web_search and accepts a query string as input. Under the hood, it uses OpenAI's Responses API with the web_search_preview feature to perform real-time web searches, providing up-to-date information from across the internet.
Development
To set up the development environment:
- Clone the repository
- Install dependencies:
npm install - Start the development server:
npm run dev
Building
To build the package:
npm run build
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.