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.
You can run this package directly using npx:
npx openai-websearch-mcp-server
Or install it globally:
npm install -g openai-websearch-mcp-server
This server is designed to be used with MCP (Model Context Protocol) clients. Here's how to set it up with different clients:
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.
export OPENAI_API_KEY='your-api-key-here'
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
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.
To set up the development environment:
npm install
npm run dev
To build the package:
npm run build
MIT
Seamless access to top MCP servers powering the future of AI integration.