Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-openai

通过MCP协议在Claude中直接查询OpenAI模型的服务

article

README

🚀 OpenAI MCP 服务器

OpenAI MCP 服务器可通过 MCP 协议直接从 Claude 查询 OpenAI 模型,为用户提供便捷的查询方式。

preview

🚀 快速开始

🔧 设置

需将以下内容添加到claude_desktop_config.json

{
  "mcpServers": {
    "openai-server": {
      "command": "python",
      "args": ["-m", "src.mcp_server_openai.server"],
      "env": {
        "PYTHONPATH": "C:/path/to/your/mcp-server-openai",
        "OPENAI_API_KEY": "your-key-here"
      }
    }
  }
}

💻 开发

git clone https://github.com/pierrebrunelle/mcp-server-openai
cd mcp-server-openai
pip install -e .

🧪 测试

# 从项目根目录运行测试
pytest -v test_openai.py -s

# 示例测试输出:
Testing OpenAI API call...
OpenAI Response: Hello! I'm doing well, thank you for asking...
PASSED

📄 许可证

本项目采用 MIT License。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client