本 MCP 服务器借助 Model Context Protocol 实现对 OpenAI 网络搜索功能的访问。在 AI 助手与用户对话时,它能够进行网络搜索,提供可能不在助手训练数据中的最新信息。该服务器可安装并配置用于 Claude.app 或 Zed 编辑器。
此 MCP 服务器能让 AI 助手在对话时搜索网络,为用户提供最新信息。下面为你介绍不同工具的安装与配置方法。
⚠️ 重要提示
使用此命令是否可以自动更新配置文件(推荐)
OPENAI_API_KEY=sk-xxxx uv run --with uv --with openai-websearch-mcp openai-websearch-mcp-install
其中,sk-xxxx 是你的 API 密钥,你可以从 OpenAI 的开放平台 获取。
即将推出
即将推出
请确保已安装 uvx 后再进行安装。
将以下内容添加到你的 Claude 设置中:
"mcpServers": {
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
openai-websearch-mcp:pip install openai-websearch-mcp
"mcpServers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
将以下内容添加到你的 Zed settings.json 中:
"context_servers": [
"openai-websearch-mcp": {
"command": "uvx",
"args": ["openai-websearch-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
],
"context_servers": {
"openai-websearch-mcp": {
"command": "python",
"args": ["-m", "openai_websearch_mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key-here"
}
}
},
web_search - 作为工具调用 OpenAI 网络搜索。
type (字符串):web_search_previewsearch_context_size (字符串):上下文窗口大小的高层次指导。可以是 low、medium 或 high,其中 medium 是默认值。user_location (对象或 null)
type (字符串):用户的定位类型,始终为 approximate。city (字符串):用户所在城市的自由文本输入,例如 San Francisco。country (字符串):用户的两个字母 ISO 国家代码,例如 US。region (字符串):用户所在地区的自由文本输入,例如 California。timezone (字符串):用户的 IANA 时区,例如 America/Los_Angeles。你可以使用 MCP 检查器来调试服务器。对于 uvx 安装:
npx @modelcontextprotocol/inspector uvx openai-websearch-mcp