openai-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENAI_ORG_ID | No | Organization ID. | |
| OPENAI_API_KEY | Yes | Required. Your OpenAI API key. | |
| OPENAI_BASE_URL | No | Alternative endpoint (Azure, gateway, proxy). Defaults to OpenAI's default. | |
| OPENAI_PROJECT_ID | No | Project ID. | |
| OPENAI_MCP_OUTPUT_DIR | No | Where generated files are written. | <tmp>/openai-mcp |
| OPENAI_MCP_TIMEOUT_MS | No | Per-request timeout in milliseconds. | 120000 |
| OPENAI_MCP_MAX_RETRIES | No | Retries for transient failures. | 2 |
| OPENAI_MCP_ALLOWED_DIRS | No | Colon-separated absolute dirs the server may read from. Defaults to the output directory only. | |
| OPENAI_DEFAULT_TEXT_MODEL | No | Default text model. | gpt-5.6-terra |
| OPENAI_DEFAULT_IMAGE_MODEL | No | Default image model. | gpt-image-2 |
| OPENAI_DEFAULT_SPEECH_MODEL | No | Default speech model. | gpt-4o-mini-tts |
| OPENAI_DEFAULT_EMBEDDING_MODEL | No | Default embedding model. | text-embedding-3-small |
| OPENAI_DEFAULT_MODERATION_MODEL | No | Default moderation model. | omni-moderation-latest |
| OPENAI_DEFAULT_TRANSCRIPTION_MODEL | No | Default transcription model. | gpt-transcribe |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| openai_generate_textA | Generate text with an OpenAI model through the Responses API — OpenAI's current interface for single-turn and chained generation. Use this as the default text tool. It supports plain prompting, system instructions, reasoning effort control, forced JSON output and multi-turn chaining via previous_response_id. Args:
Returns (JSON format): { "id": string, // response ID, usable as previous_response_id when store=true "model": string, // model that actually served the request "status": string | null, // e.g. "completed" or "incomplete" "output_text": string, // the generated text "usage": { "input_tokens": number|null, "output_tokens": number|null, "total_tokens": number|null } } Examples:
Error Handling:
|
| openai_chat_completionA | Send an explicit list of chat messages to an OpenAI model through the Chat Completions API. Use this when you already hold a structured conversation history (system/user/assistant turns) and want it sent verbatim. For new single-prompt generations prefer openai_generate_text. Args:
Returns (JSON format): { "id": string, // completion ID "model": string, // model that served the request "finish_reason": string | null, // "stop", "length", "content_filter", ... "content": string, // assistant reply text "refusal": string | null, // set when the model declined "usage": { "input_tokens": number|null, "output_tokens": number|null, "total_tokens": number|null } } Examples:
Error Handling:
|
| openai_list_modelsA | List the model IDs the configured API key has access to, optionally filtered by substring. Call this before guessing a model ID — OpenAI adds, renames and retires models regularly, and access differs per project. The response also reports the model IDs this server uses by default for each capability. Args:
Returns (JSON format): { "total": number, // number of models matching the filter "count": number, // models in this response "offset": number, // current pagination offset "models": [ { "id": string, "owned_by": string, "created_at": string } // created_at is ISO 8601 UTC ], "has_more": boolean, "next_offset": number, // present only when has_more is true "defaults": { "text": string, "image": string, "embedding": string, "transcription": string, "speech": string, "moderation": string } } Examples:
Error Handling:
|
| openai_generate_imageA | Create one or more images from a text prompt and write them to disk. Images are never returned inline — the tool saves each file and reports its absolute path, so the agent's context stays small. Args:
Returns (JSON format): { "model": string, "count": number, "images": [ { "index": number, "path": string, "bytes": number } ], "revised_prompt": string | null // prompt rewrite the model applied, when reported } Examples:
Error Handling:
|
| openai_edit_imageA | Edit or extend existing images according to a text instruction, optionally restricted to a masked region. Source images are read from disk (only from directories listed in OPENAI_MCP_ALLOWED_DIRS) and results are written back to disk. Args:
Returns (JSON format): { "model": string, "count": number, "images": [ { "index": number, "path": string, "bytes": number } ], "revised_prompt": string | null } Examples:
Error Handling:
|
| openai_transcribe_audioA | Transcribe a local audio file to text. The file is read from disk (only from directories listed in OPENAI_MCP_ALLOWED_DIRS) and uploaded to OpenAI. Supported containers include mp3, mp4, m4a, wav, webm, flac and ogg; the API limit is 25 MB per file. Args:
Returns (JSON format): { "model": string, "text": string, // full transcript "language": string | null, // detected or supplied language "duration_seconds": number | null, // audio length when reported "source_file": string // canonical path that was read } Examples:
Error Handling:
|
| openai_text_to_speechA | Turn text into spoken audio and write the result to disk. The audio is never returned inline — the tool reports the absolute path of the generated file. Args:
Returns (JSON format): { "model": string, "voice": string, "path": string, // absolute path of the written audio file "bytes": number, // file size "format": string // container that was written } Examples:
Error Handling:
|
| openai_create_embeddingsA | Turn texts into embedding vectors for semantic search, clustering or deduplication. By default the vectors are written to a JSON file and only the path plus metadata are returned, because a single vector holds up to 3072 floats. Set return_vectors=true for small batches when the numbers are needed directly. Args:
Returns (JSON format): { "model": string, "count": number, // number of vectors produced "dimensions": number, // length of each vector "file_path": string | null, // where the vectors were written "usage": { "input_tokens": number|null, "total_tokens": number|null }, "vectors": number[][] // present only when return_vectors is true } The written JSON file has the shape: { "model": "text-embedding-3-small", "created_at": "2026-08-23T14:05:00.000Z", "count": 2, "dimensions": 1536, "items": [ { "index": 0, "text_preview": "…", "embedding": [0.0123, -0.0456] } ] } Examples:
Error Handling:
|
| openai_moderate_contentA | Check text against OpenAI's moderation policy and report which categories it triggers. Use this before publishing or forwarding user-supplied text, or to explain why a generation was refused. Args:
Returns (JSON format): { "model": string, "flagged": boolean, // true when any category was triggered "flagged_categories": string[], // e.g. ["violence", "harassment/threatening"] "scores": { "": number } // confidence per category, 0.0-1.0 } Examples:
Error Handling:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Each tool maps to a distinct OpenAI capability (text, chat history, images, audio, embeddings, moderation, model discovery). openai_generate_text and openai_chat_completion are the only potentially confusable pair, but their descriptions clearly separate single-prompt/chaining from explicit message histories.
All tools share an openai_ prefix and snake_case, with mostly verb_noun names like generate_text, edit_image, list_models. openai_chat_completion and openai_text_to_speech break the verb_noun pattern slightly because they mirror API endpoint names, but the convention remains predictable.
9 tools is appropriate for an OpenAI API surface: one tool per major modality (text, image, audio, embeddings, moderation) plus model discovery. No tool feels redundant or missing at the count level.
The set covers text generation, chat completions, image generation/editing, transcription, speech synthesis, embeddings, and moderation, which are the core OpenAI workflows. Minor gaps exist—notably no vision/analysis of image inputs and no fine-tuning/batch management—but agents can accomplish typical tasks without dead ends.