home / mcp / openai web search mcp server

OpenAI Web Search MCP Server

Provides real-time web search capabilities to MCP clients using OpenAI web_search_preview.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bitibi-openai-websearch-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "openai-websearch-mcp-server"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You run an MCP server that adds real-time web search capabilities to your AI workflows. This OpenAI Web Search MCP Server enables models to perform live web lookups via OpenAI's web_search_preview feature, giving you current information from across the internet through the MCP protocol.

How to use

Install and run the server, then connect your MCP clients to access a web search tool named web_search. Use real-time searches to supplement model responses with up-to-date internet results. In practice, you can chain web_search with your prompts to gather sources, verify claims, or monitor breaking news, all within your MCP-enabled workflow.

How to install

Prerequisites: Node.js and npm must be installed on your system. You can verify by running node -v and npm -v.

Install or run the MCP server using either of the following options.

npx openai-websearch-mcp-server
```

```bash
npm install -g openai-websearch-mcp-server

Additional setup and usage notes

Set up your environment and run the server locally. The server defaults to port 3000; you can override this with the PORT environment variable.

Environment variables are used to authorize with OpenAI. Example: set your API key in the environment before starting the server.

Configuration for MCP clients (example)

{
  "mcpServers": {
    "openai_websearch": {
      "command": "npx",
      "args": [
        "-y",
        "openai-websearch-mcp-server"
      ],
      "env": {
        "OPENAI_API_KEY": "your_api_key"
      }
    }
  }
}

Security and usage notes

Keep your OpenAI API key secure. Do not expose it in public code or shared configurations. Consider using environment-based secret management and rotation practices.

Available tools

web_search

Web search tool that uses OpenAI's web_search_preview to fetch real-time results from the internet for your prompts.