Skip to main content

using openai websearch as mcp server

Project description

OpenAI WebSearch MCP Servr

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.

Available Tools

  • web_search - Call openai websearch as tool.
    • Required arguments:
      • type (string): web_search_preview
      • search_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.

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run openai-websearch-mcp.

Using PIP

Alternatively you can install openai-websearch-mcp via pip:

pip install openai-websearch-mcp

After installation, you can run it as a script using:

python -m openai-websearch-mcp

Configuration

Configure for Claude.app

Add 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", "mcp_openai_websearch"],
    "env": {
        "OPENAI_API_KEY": "your-api-key-here"
    }
  }
}

Configure for Zed

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", "mcp_openai_websearch"],
    "env": {
        "OPENAI_API_KEY": "your-api-key-here"
    }
  }
},

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx openai-websearch-mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_openai_websearch-0.1.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_openai_websearch-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_openai_websearch-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b30a518715c0b9ddbd654e7c68c09392aaf512a85200458202fd6079bbf3f2
MD5 78831be6c49d3d5b08b14a92de8e0a31
BLAKE2b-256 6866694484d026b2b602c7a9a6e959ef2b6fc9c717f55d527fb07361495a7b89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page