Enables AI clients to access OpenAI text, image, speech, transcription, embeddings, and moderation models.
Also known as DanCommitsGit/openai-mcp, @dancommitsgit/openai-mcp
- Stars
- 0
- Tools
- 10
- Downloads, 30 days
- 1,073
- Latest version
- —
- Last commit
- Oct 29, 2026
- License
- MIT
What is OpenAI MCP?
OpenAI enables AI clients to access OpenAI text, image, speech, transcription, embeddings, and moderation models. It exposes 10 tools, such as generate_text, count_tokens, generate_image.
Summary generated from the project's README
About OpenAI MCP server
Accessing OpenAI models directly from Claude, Cursor, or VS Code is what this server enables for developers. It provides a bridge to various OpenAI capabilities including text generation, image creation, speech synthesis, and audio transcription. By connecting your OpenAI API key through an MCP client, you can use these specialized tools within your existing coding or chat environment.
Control is a central feature of this setup. Every tool remains inactive until you explicitly define its specific model via environment variables. This allows you to select exact model IDs for tasks like generating text, creating embeddings, or performing moderation. You can even use a wildcard to permit any model for a specific category.
When working with multimedia, the server handles the heavy lifting by saving generated images and speech files to your local system. It supports inputs via local file paths or URLs, making it easy to process existing assets. The server requires Node.js 20 or higher to run locally via npx.
What you can do with it
- 1Generate and edit visual assetsAsk the AI to create new images from text prompts or modify existing ones.
- 2Process audio filesConvert spoken audio into written text or translate foreign language audio into English.
- 3Manage token usageCalculate how many tokens a specific text request will consume before sending it.
- 4Content safety checksVerify if a piece of text contains potentially harmful content using moderation models.
Written from the project's README. Every use case is checked against a quote from it.
How to install OpenAI MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall OpenAI MCP in Claude Code
$ claude mcp add openai-mcp -- npx -y @dancommitsgit/openai-mcpInstall OpenAI MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"openai-mcp": {
"command": "npx",
"args": [
"-y",
"@dancommitsgit/openai-mcp"
]
}
}
}Install OpenAI MCP in VS Code
.vscode/mcp.json
{
"servers": {
"openai-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dancommitsgit/openai-mcp"
]
}
}
}Install OpenAI MCP in VS Code CLI
$ code --add-mcp '{"name":"openai-mcp","type":"stdio","command":"npx","args":["-y","@dancommitsgit/openai-mcp"]}'Install OpenAI MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"openai-mcp": {
"command": "npx",
"args": [
"-y",
"@dancommitsgit/openai-mcp"
]
}
}
}Install OpenAI MCP in Codex
$ codex mcp add openai-mcp -- npx -y @dancommitsgit/openai-mcpInstall OpenAI MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.openai-mcp] command = "npx" args = ["-y", "@dancommitsgit/openai-mcp"]
Install OpenAI MCP in Gemini CLI
$ gemini mcp add -s user openai-mcp npx -- -y @dancommitsgit/openai-mcpInstall OpenAI MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"openai-mcp": {
"command": "npx",
"args": [
"-y",
"@dancommitsgit/openai-mcp"
]
}
}
}OpenAI MCP tools 10
Detected from the READMEgenerate_textcount_tokensgenerate_imageedit_imagegenerate_speechtranscribe_audiotranslate_audiocreate_embeddingscreate_moderationlist_models
Configuration
OPENAI_API_KEYOPENAI_MCP_EMBEDDING_MODELSOPENAI_MCP_IMAGE_MODELSOPENAI_MCP_MODERATION_MODELSOPENAI_MCP_SPEECH_MODELSOPENAI_MCP_TEXT_MODELSOPENAI_MCP_TRANSCRIPTION_MODELSOPENAI_MCP_TRANSLATION_MODELS
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachabledancommitsgit/openai-mcp is public and reachablegithub.com/dancommitsgit/openai-mcp ↗Pass
- Package names this repository as its source@dancommitsgit/openai-mcp names dancommitsgit/openai-mcp as sourcenpmjs.com/package/@dancommitsgit/openai-mcp ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @dancommitsgit/openai-mcpnpmjs.com/package/@dancommitsgit/openai-mcp/v/1.2.0#provenan ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-29github.com/dancommitsgit/openai-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @dancommitsgit/openai-mcpPass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model10 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubopenai-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.
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-mcp
Add 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 build
Then 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 |
|---|---|---|
generate_text |
OPENAI_MCP_TEXT_MODELS |
Send a prompt, optional instructions, images, and web search to an OpenAI model |
count_tokens |
OPENAI_MCP_TEXT_MODELS |
Count the input tokens a generate_text request would use |
generate_image |
OPENAI_MCP_IMAGE_MODELS |
Generate one or more images from a text prompt |
edit_image |
OPENAI_MCP_IMAGE_MODELS |
Edit or combine existing images using a text prompt |
generate_speech |
OPENAI_MCP_SPEECH_MODELS |
Convert text to spoken audio |
transcribe_audio |
OPENAI_MCP_TRANSCRIPTION_MODELS |
Transcribe audio from a URL or local file |
translate_audio |
OPENAI_MCP_TRANSLATION_MODELS |
Translate audio from a URL or local file into English text |
create_embeddings |
OPENAI_MCP_EMBEDDING_MODELS |
Get vector embeddings for one or more pieces of text |
create_moderation |
OPENAI_MCP_MODERATION_MODELS |
Check text for potentially harmful content |
list_models |
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.
OpenAI MCP questions
How do I add OpenAI MCP to Claude Code?
Run claude mcp add openai-mcp -- npx -y @dancommitsgit/openai-mcp in your terminal. Add --scope user to make it available in every project.
How do I add OpenAI MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does OpenAI MCP provide?
It exposes 10 tools, including generate_text, count_tokens, generate_image, edit_image, generate_speech.
How do I enable specific OpenAI models?
Each tool is enabled by setting its corresponding model variable in the environment configuration; omitting a setting leaves that tool disabled.
Where are generated images and speech files saved?
Generated and edited images and generated speech are saved to your operating system's temporary directory unless a specific output path is provided by the client.
What happens if my OpenAI API key is invalid?
An error is reported during the first tool call rather than when the server initially starts.
Can I use local files for audio or images?
Yes, images and audio can be provided using either URLs or local file paths.