Token导航 LogoToken导航TokenDH.com
Gpt 4o Search MCP logo
AI代理stdio官方级别未说明来源级核验

Gpt 4o Search MCP

MCP Server

一个通过MCP协议提供OpenAI GPT-4o搜索预览模型访问的服务,适用于需要集成高级搜索功能的开发场景。

工具数

1

提示词数

0

GitHub Stars

2

资源数

0
搜索功能PythonOpenAI集成Docker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jedarden

提供方

jedarden

最后核验

2026/5/17 20:23

运行时

Docker

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

docker run --env-file .env -p 8000:8000 my-python-app

详细介绍

项目概述

模型上下文协议(MCP)服务器,使OpenAI的gpt-4o-search-preview模型可以通过MCP访问。

  • app/app.py:主要应用程序入口点。
  • requirements.txt:列出运行应用程序所需的Python依赖项。
  • :在Docker容器中构建和运行应用程序的说明。
  • .env.example:示例环境变量文件。将此复制到 .env 并根据需要更新值。

______________________________________________________________________

部署说明

1.环境变量

在运行应用程序之前,请设置环境变量:

  1. 复制 .env.example.env:
   cp .env.example .env
  1. 编辑 .env 并根据您的环境需要更新这些值。

2.使用Docker部署

  1. 构建Docker镜像:
   docker build -t my-python-app -f dockerfile .
  1. 运行容器:
   docker run --env-file .env -p 8000:8000 my-python-app

3.使用Python(virtualenv)进行部署

  1. 创建并激活虚拟环境:
   python3 -m venv venv
   source venv/bin/activate
  1. 安装依赖项:
   pip install -r requirements.txt
  1. 设置环境变量(请参见 .env.example).
  2. 运行应用程序:
   python app/app.py

______________________________________________________________________

示例:使用roo代码连接到MCP

下面是一个示例配置块 gpt-4o-search MCP服务:

"gpt-4o-search": {
  "url": "http://link-to-where-service-is-hosted:8000/sse",
  "transport": "http",
  "alwaysAllow": [
    "search"
  ],
  "timeout": 300
}

Python示例:执行“搜索”操作

以下Python代码演示了如何使用上述配置连接到MCP服务,并使用roo代码原理执行“搜索”操作。此示例使用 requests 库向MCP端点发送搜索请求。

from mcp import MCPClient

# Initialize the MCP client for the gpt-4o-search server
client = MCPClient("http://link-to-where-service-is-hosted:8000/sse")

# Perform a "search" operation
result = client.tool("search", {"query": "What is Model Context Protocol?"})

print("Search result:", result)
### Explanation

- **MCPClient**: The official `mcp` Python library provides the `MCPClient` class to connect to an MCP server.
- **client = MCPClient(...)**: Initializes the client with the URL of the gpt-4o-search MCP server.
- **client.tool("search", {...})**: Performs the "search" operation by specifying the tool name and parameters as a dictionary.
- **Result**: The result of the search operation is printed.

---
# Notes

- Only perform the work outlined above and do not deviate from these instructions.
- For further details, refer to the individual files and comments within the codebase.```

目录标签

目录标签

搜索功能PythonOpenAI集成Docker模型服务本地部署MCP协议

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Docker

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP