Skip to main content
Glama

OpenAI GPT MCP Server

A local Model Context Protocol server that provides OpenAI GPT text generation over standard input/output.

Prerequisites

  • Node.js 18 or newer

  • An OpenAI API key

Related MCP server: gpt-mcp

Install and build

npm install
npm run build

Copy .env.example to .env and set your API key:

OPENAI_API_KEY=your_api_key

OPENAI_MODEL is optional and defaults to gpt-5. OPENAI_IMAGE_MODEL is optional and defaults to gpt-image-2.

MCP client configuration

Build first, then add this server to your MCP client's configuration. Replace <absolute-path-to-repository> with the absolute path to your clone.

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

Tool: generate_text

Required input:

  • prompt: text to send to the model.

Optional inputs:

  • instructions: system-level behavior for the response.

  • model: a GPT model ID, overriding OPENAI_MODEL.

  • max_output_tokens: maximum response size, from 1 through 16,384.

The server uses the OpenAI Responses API and returns generated text to the MCP client. It never writes API keys to output or logs.

Tool: generate_image

Generates one PNG image and returns it directly to the MCP client.

  • prompt (required): detailed image description.

  • model (optional): image model ID, overriding OPENAI_IMAGE_MODEL.

  • size (optional): 1024x1024, 1536x1024, or 1024x1536.

  • quality (optional): low, medium, or high.

Image generation consumes OpenAI API credits separately from Claude usage.

Run directly

npm start

For interactive inspection:

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