# @dancommitsgit/openai-mcp [Health: Active]

**Category:** 🗣️ Conversational AI  
**Repository:** https://github.com/DanCommitsGit/openai-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 630  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dancommitsgit-openai-mcp

## Description
MCP server that gives Claude, Cursor and other MCP clients access to OpenAI text, image, speech, transcription, embeddings and moderation

## Tools
Capabilities this server exposes over MCP:

- **generate_text** — Send a prompt to an OpenAI model and return its text reply. Pass images to ask a vision-capable model about them
- **count_tokens** — Count the input tokens a generate_text request would use, without running the model
- **generate_image** — Generate an image from a text prompt using an OpenAI image model. By default returns the local file path(s) the image was saved to rather than inline image data; set returnAs to 'base64' for inline data instead
- **edit_image** — Edit or combine existing images using a text prompt and an OpenAI image model. By default returns the local file path(s) the result was saved to rather than inline image data; set returnAs to 'base64' for inline data instead
- **create_embeddings** — Get vector embeddings for one or more pieces of text
- **list_models** — List available OpenAI models. Returns configured models unless a tool allows any model
- **generate_speech** — Convert text to spoken audio using an OpenAI text-to-speech model. By default returns the local file path the audio was saved to rather than inline data; set returnAs to 'base64' for inline audio instead
- **transcribe_audio** — Transcribe spoken audio to text using an OpenAI speech-to-text model
- **translate_audio** — Translate spoken audio in any supported language into English text using an OpenAI speech-to-text model. Output may occasionally come back untranslated, in its original language
- **create_moderation** — Check text for potentially harmful content using an OpenAI moderation model. Returns, for each input, whether it was flagged plus per-category flags and scores

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "openai-mcp": {
    "command": "npx",
    "args": ["-y","@dancommitsgit/openai-mcp"],
    "env": {
      "OPENAI_API_KEY": "",
      "OPENAI_MCP_TEXT_MODELS": "",
      "OPENAI_MCP_IMAGE_MODELS": "",
      "OPENAI_MCP_EMBEDDING_MODELS": "",
      "OPENAI_MCP_SPEECH_MODELS": "",
      "OPENAI_MCP_TRANSCRIPTION_MODELS": "",
      "OPENAI_MCP_TRANSLATION_MODELS": "",
      "OPENAI_MCP_MODERATION_MODELS": ""
    }
  }
}
```

**Requires environment variables:** `OPENAI_API_KEY`, `OPENAI_MCP_TEXT_MODELS`, `OPENAI_MCP_IMAGE_MODELS`, `OPENAI_MCP_EMBEDDING_MODELS`, `OPENAI_MCP_SPEECH_MODELS`, `OPENAI_MCP_TRANSCRIPTION_MODELS`, `OPENAI_MCP_TRANSLATION_MODELS`, `OPENAI_MCP_MODERATION_MODELS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What @dancommitsgit/openai-mcp does

@dancommitsgit/openai-mcp makes several OpenAI API capabilities available through MCP. It can generate text with optional instructions, images, and web search; estimate the input tokens for a text request; create or edit images; synthesize speech; transcribe audio; translate audio into English; create vector embeddings; inspect text for potentially harmful content; and list available models.

The server is useful when an MCP-compatible assistant needs to call OpenAI models without building separate client-side integrations for each API category. Image and speech generation produce files. Audio inputs for transcription and translation can come from either URLs or local paths.

## How it works

The package runs as an MCP server over standard input and output. A client starts it with `npx`, or runs the compiled JavaScript entry point after building from source. Every capability except `list_models` is gated by its corresponding model environment variable. A setting can contain a comma-separated list of permitted model IDs, while `*` allows any model for that tool.

The server checks the API key when the first tool request is made rather than during startup. Calls using models outside the configured list are rejected. Generated image and speech files go to the operating system temporary directory unless the client supplies an `outputPath`; tool responses include the resulting file path.

## Setup and configuration

Node.js 20 or newer and an OpenAI API key are required. The package can be launched with:

```json
{
  "command": "npx",
  "args": ["-y", "@dancommitsgit/openai-mcp"],
  "env": {
    "OPENAI_API_KEY": "sk-...",
    "OPENAI_MCP_TEXT_MODELS": "gpt-5.4-nano",
    "OPENAI_MCP_IMAGE_MODELS": "gpt-image-2.5-flare",
    "OPENAI_MCP_EMBEDDING_MODELS": "text-embedding-3-small",
    "OPENAI_MCP_SPEECH_MODELS": "gpt-4o-mini-tts",
    "OPENAI_MCP_TRANSCRIPTION_MODELS": "gpt-4o-mini-transcribe",
    "OPENAI_MCP_TRANSLATION_MODELS": "whisper-1",
    "OPENAI_MCP_MODERATION_MODELS": "omni-moderation-latest"
  }
}
```

Only add the model variables for capabilities the client should be allowed to use. Claude Desktop reads its configuration from the platform-specific `claude_desktop_config.json` location, Cursor supports project or user MCP configuration, and VS Code uses `.vscode/mcp.json`. Claude Code can register the server with `claude mcp add` and the stdio transport. To build locally, clone the repository, run `npm install`, then `npm run build`; point the client to `build/index.js` with Node.js.

## Tools and capabilities

- `generate_text`: Sends prompts, instructions, images, and web-search requests to an OpenAI model.
- `count_tokens`: Estimates tokens for a `generate_text` request.
- `generate_image`: Creates one or more images.
- `edit_image`: Modifies or combines existing images from a text instruction.
- `generate_speech`: Converts text into audio.
- `transcribe_audio`: Produces a transcript from a URL or local file.
- `translate_audio`: Converts audio from a URL or local file into English text.
- `create_embeddings`: Returns vector embeddings for text inputs.
- `create_moderation`: Checks text for potentially harmful content.
- `list_models`: Lists models and is always available.

## Limitations and notes

This is an unofficial project and is not affiliated with OpenAI. A missing or invalid API key appears as an error on the first tool call. Tool access depends on the configured model allowlists, and generated image or speech output is written to a temporary location unless an output path is supplied.

_Full upstream README: https://allmcps.com/mcp/dancommitsgit-openai-mcp/readme_

