Skip to main content
Glama

OpenAI GPT MCP Server

一个本地 Model Context Protocol 服务器,通过标准输入/输出提供 OpenAI GPT 文本生成功能。

前置条件

  • Node.js 18 或更高版本

  • 一个 OpenAI API 密钥

Related MCP server: gpt-mcp

安装与构建

npm install
npm run build

.env.example 复制为 .env,然后设置你的 API 密钥:

OPENAI_API_KEY=your_api_key

OPENAI_MODEL 是可选的,默认值为 gpt-5OPENAI_IMAGE_MODEL 也是可选的,默认值为 gpt-image-2

MCP 客户端配置

先构建,然后将此服务器添加到你的 MCP 客户端配置中。请将 <absolute-path-to-repository> 替换为你克隆仓库的绝对路径。

{
  "mcpServers": {
    "openai-gpt": {
      "command": "node",
      "args": ["<absolute-path-to-repository>\\dist\\index.js"]
    }
  }
}

工具:generate_text

必需输入:

  • prompt:要发送给模型的文本。

可选输入:

  • instructions:响应的系统级行为。

  • model:GPT 模型 ID,用于覆盖 OPENAI_MODEL

  • max_output_tokens:最大响应长度,范围为 1 到 16,384。

该服务器使用 OpenAI Responses API,并将生成的文本返回给 MCP 客户端。它绝不会将 API 密钥写入输出或日志。

工具:generate_image

生成一张 PNG 图片,并将其直接返回给 MCP 客户端。

  • prompt(必需):详细的图片描述。

  • model(可选):图片模型 ID,用于覆盖 OPENAI_IMAGE_MODEL

  • size(可选):1024x10241536x10241024x1536

  • quality(可选):lowmediumhigh

图片生成会单独消耗 OpenAI API 额度,与 Claude 的使用量分开计算。

直接运行

npm start

用于交互式检查:

npm run inspect
Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • MCP server for OpenAI Sora AI video generation

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/boghyjunior-dot/openai-image-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server