openai-mcp
Use OpenAI models from any MCP client for text, images, speech, audio transcription/translation, embeddings, and moderation.
Generate text from prompts, optionally with images, instructions, and web search.
Count input tokens for a prospective text request.
Generate one or more images from a prompt, saved to a file or returned as base64.
Edit or combine existing images with a prompt and optional mask.
Convert text to speech with selectable voice, speed, and audio format.
Transcribe audio from a URL or local file.
Translate spoken audio into English text.
Create vector embeddings for text.
Check text for potentially harmful content.
List available OpenAI models.
Provides tools for using OpenAI models: generating text (with optional instructions and image inputs), counting input tokens, generating and editing images, text-to-speech, audio transcription and translation, creating text embeddings, and content moderation. Generated images and speech are saved to files, and each capability is enabled by configuring the allowed models.
openai-mcp
Use OpenAI models from Claude, Cursor and any other MCP client: text, images, speech, transcription, embeddings and moderation.
Features
Each tool stays off until you set its model variable, so you choose which models the client can use. Only
list_modelsis always available.Generated and edited images and generated speech are saved to files.
Images and audio can be given as URLs or local file paths.
Related MCP server: OpenAI MCP Server
Setup
Requires Node.js 20 or higher and an OpenAI API key.
Each tool is enabled by its own model setting. Omit a setting to leave that tool disabled. Separate multiple model IDs with commas, or use * to allow any model. Replace sk-... with your OpenAI API key.
{
"mcpServers": {
"openai-mcp": {
"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"
}
}
}
}A missing or invalid API key is reported as an error on the first tool call, not when the server starts. A request for a model that is not in the tool's list is rejected.
claude mcp add --scope user --env OPENAI_API_KEY=sk-... --env OPENAI_MCP_TEXT_MODELS=gpt-5.4-nano --env OPENAI_MCP_IMAGE_MODELS=gpt-image-2.5-flare --transport stdio openai-mcp -- npx -y @dancommitsgit/openai-mcpAdd one more --env for each other model setting in the JSON above. Keep --transport stdio after the last --env, or the server name is read as another variable.
This also applies to the Code tab in the Claude desktop app. Drop --scope user to make the server available only in the current project.
For the regular chat app. If you use the Code tab in the desktop app, use the Claude Code command instead.
Open Settings → Developer → Edit Config, paste the JSON above into claude_desktop_config.json, and restart Claude Desktop. The file is at ~/Library/Application Support/Claude/ on macOS and %APPDATA%\Claude\ on Windows.
Save the JSON above as .cursor/mcp.json in your project, or as ~/.cursor/mcp.json to use it in every project.
Add the server to .vscode/mcp.json. VS Code asks for the API key the first time the server starts and stores it securely. Add other OPENAI_MCP_*_MODELS entries as in the JSON above.
{
"inputs": [
{
"type": "promptString",
"id": "openai-api-key",
"description": "OpenAI API key",
"password": true
}
],
"servers": {
"openai-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@dancommitsgit/openai-mcp"],
"env": {
"OPENAI_API_KEY": "${input:openai-api-key}",
"OPENAI_MCP_TEXT_MODELS": "gpt-5.4-nano",
"OPENAI_MCP_IMAGE_MODELS": "gpt-image-2.5-flare"
}
}
}
}Build from source
git clone https://github.com/DanCommitsGit/openai-mcp.git
cd openai-mcp
npm install
npm run buildThen point your client at the compiled entry point, keeping the same env as above:
{
"command": "node",
"args": ["/PATH/TO/openai-mcp/build/index.js"]
}See CONTRIBUTING.md to run the tests and open a pull request.
Tools
Tool | Needs | Description |
|
| Send a prompt, optional instructions, images, and web search to an OpenAI model |
|
| Count the input tokens a |
|
| Generate one or more images from a text prompt |
|
| Edit or combine existing images using a text prompt |
|
| Convert text to spoken audio |
|
| Transcribe audio from a URL or local file |
|
| Translate audio from a URL or local file into English text |
|
| Get vector embeddings for one or more pieces of text |
|
| Check text for potentially harmful content |
| None | List available models |
Image and speech tools save files to your OS temp directory, unless the client passes outputPath, and return the file path.
This is an unofficial project and is not affiliated with OpenAI.
Available Tools
10 toolscount_tokensCount tokensARead-only
Count the input tokens a generate_text request would use, without running the model
Inputs: model (required), prompt (required), images, webSearch, +1 more.
create_embeddingsCreate embeddingsCRead-only
Get vector embeddings for one or more pieces of text
Inputs: input (required), model (required).
create_moderationCreate moderationARead-only
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
Inputs: input (required), model (required).
edit_imageEdit imageADestructive
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
Inputs: model (required), images (required), prompt (required), n, +4 more.
generate_imageGenerate imageADestructive
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
Inputs: model (required), prompt (required), n, size, +2 more.
generate_speechGenerate speechADestructive
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
Inputs: input (required), model (required), speed, voice, +4 more.
generate_textGenerate textARead-only
Send a prompt to an OpenAI model and return its text reply. Pass images to ask a vision-capable model about them
Inputs: model (required), prompt (required), images, webSearch, +1 more.
list_modelsList modelsARead-only
List available OpenAI models. Returns configured models unless a tool allows any model
Inputs: no named parameters.
transcribe_audioTranscribe audioBRead-only
Transcribe spoken audio to text using an OpenAI speech-to-text model
Inputs: file (required), model (required), format, prompt, +1 more.
translate_audioTranslate audioARead-only
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
Inputs: file (required), model (required), format, prompt.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools target clearly distinct OpenAI capabilities: text generation, token counting, embeddings, moderation, image generation/editing, model listing, and speech generation/transcription/translation. The only mild overlap is transcribe_audio versus translate_audio, since both convert speech to text, though the descriptions make the translation-to-English distinction reasonably clear.
All names are snake_case and follow a verb_noun structure, which is highly predictable. There is a minor inconsistency in verb choice between create_embeddings/create_moderation and generate_text/generate_image/generate_speech, but the pattern remains readable.
Ten tools is a well-scoped set for an OpenAI API wrapper, covering major modalities without obvious filler. Each tool maps to a recognizable OpenAI capability and earns its place.
The surface covers text generation, vision input, token counting, embeddings, moderation, image generation/editing, model listing, TTS, transcription, and translation. Minor gaps exist around other OpenAI API areas such as fine-tuning, files, or assistants, but core model-inference workflows are well covered.
Maintenance
Related MCP Connectors
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Hosted OpenAI Ads MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that lets you seamlessly use OpenAI's models right from Claude.1319 npm77MIT
- AlicenseCqualityDmaintenanceEnables integration with OpenAI models through the MCP protocol, supporting concise and detailed responses for use with Claude Desktop.13MIT
- AlicenseNot gradedqualityDmaintenanceA universal server that enables MCP-compatible clients (like Claude Desktop, Cursor, VS Code) to access OpenAI's APIs for chat completions, image generation, embeddings, and model listing through a standardized interface.33 npm7MIT
- AlicenseAqualityDmaintenanceEnables Claude to directly invoke OpenAI's chat models (GPT-4o, GPT-4o-mini, o1-preview, o1-mini) through a Model Context Protocol integration, allowing users to query and compare responses from different AI models within Claude Desktop.11MIT