MM

mzxrai/mcp-openai

分析与监控

本页由 AI 翻译,技术细节请以原文为准。 查看原文

77 stars 26 forks 质量 64 趋势 0MIT

mzxrai/mcp-openai 是从 https://github.com/mzxrai/mcp-openai. 导入的 MCP 服务器候选

概览

mzxrai/mcp-openai 是从 https://github.com/mzxrai/mcp-openai. 导入的 MCP 服务器候选

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,允许你直接从Claude无缝使用OpenAI的模型。

特色

  • 与OpenAI聊天模型的直接集成
  • 支持多种型号,包括:
  • GPT-4O
  • GPT-40-MINI
  • O1预览
  • O1-Mini
  • 简单的消息传递接口
  • 基本错误处理

先修条件

  • Node.js >= 18(包括npm和npx)
  • Claude桌面应用
  • OpenAI API 密钥

安装

首先,确保你安装了 Claude Desktop 应用,并且已经申请了 OpenAI API 密钥。

将此条目添加到你的claude_desktop_config.json(在Mac上,你可以在~/Library/Application\ Support/Claude/claude_desktop_config.json找到):

这个配置让Claude Desktop能在你需要时启动OpenAI MCP服务器。

用途

只要开始和Claude聊天,想用OpenAI的模型时,就让Claude用。

例如,你可以说,

或者,

服务器目前支持以下模型:

  • GPT-4O(默认)
  • GPT-40-MINI
  • O1预览
  • O1-Mini

工具

  1. openai_chat
  • 向OpenAI的聊天完成API发送消息
  • 论点:
  • messages:消息数组(必需)

本页由 AI 翻译,技术细节请以原文为准。

README

MCP OpenAI Server

A Model Context Protocol (MCP) server that lets you seamlessly use OpenAI’s models right from Claude.

Features

  • Direct integration with OpenAI’s chat models
  • Support for multiple models including:
    • gpt-4o
    • gpt-4o-mini
    • o1-preview
    • o1-mini
  • Simple message passing interface
  • Basic error handling

Prerequisites

Installation

First, make sure you’ve got the Claude Desktop app installed and you’ve requested an OpenAI API key.

Add this entry to your claude_desktop_config.json (on Mac, you’ll find it at ~/Library/Application\ Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mcp-openai": {
      "command": "npx",
      "args": ["-y", "@mzxrai/mcp-openai@latest"],
      "env": {
        "OPENAI_API_KEY": "your-api-key-here (get one from https://platform.openai.com/api-keys)"
      }
    }
  }
}

This config lets Claude Desktop fire up the OpenAI MCP server whenever you need it.

Usage

Just start chatting with Claude and when you want to use OpenAI’s models, ask Claude to use them.

For example, you can say,

Can you ask o1 what it thinks about this problem?

or,

What does gpt-4o think about this?

The server currently supports these models:

  • gpt-4o (default)
  • gpt-4o-mini
  • o1-preview
  • o1-mini

Tools

  1. openai_chat
    • Sends messages to OpenAI’s chat completion API
    • Arguments:
      • messages: Array of messages (required)
      • model: Which model to use (optional, defaults to gpt-4o)

Problems

This is alpha software, so may have bugs. If you have an issue, check Claude Desktop’s MCP logs:

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

Development

# Install dependencies
pnpm install

# Build the project
pnpm build

# Watch for changes
pnpm watch

# Run in development mode
pnpm dev

Requirements

  • Node.js >= 18
  • OpenAI API key

Verified Platforms

  • [x] macOS
  • [ ] Linux

License

MIT

Author

mzxrai

在 GitHub 查看完整 README

安装

npx -y @mzxrai/mcp-openai@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-openai": { "command": "npx", "args": ["-y", "@mzxrai/mcp-openai@latest"], "env": { "OPENAI_API_KEY": "your-api-key-here (get one from https://platform.openai.com/api-keys)" } } } }