OpenAI Universal Model MCP
Provides tools for interacting with the OpenAI Platform API, including dynamic model discovery and recommendation, text/reasoning/vision via Responses, Chat Completions, image generation and editing, audio transcription and speech generation, embeddings, moderation, Realtime and GPT-Live session creation, file upload, and an allowlisted REST inference endpoint.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenAI Universal Model MCP List the OpenAI models I can use and recommend one for coding"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenAI Universal Model MCP
OpenAI Platform 的通用模型 MCP + Agent Skills 專案。 以動態探索為核心,讓 Codex、Claude Desktop、Cursor、VS Code 及其他 MCP Host 可以使用同一個 MCP Server 呼叫帳號有權限使用的 OpenAI API 模型。
專案版本:0.1.2 · 文件與能力登錄檔核對日期:2026-11-08
設計目標
不硬編碼可用模型清單:每次透過
GET /v1/models取得目前 API Key 可見的模型。能力與端點分離:Models API 不會提供完整能力規格,因此以官方文件建立能力登錄檔,未知模型一律標示
unknown,不猜測。依任務選擇 API:Responses、Chat Completions、Images、Audio、Embeddings、Moderation、Realtime、GPT-Live 各自使用正確端點。
尊重帳號權限:模型可見不等於所有端點都可用;實際呼叫由 API 權限驗證。
安全預設:API Key 只從環境變數或本機
.env讀取;不接受工具參數傳入 Key;產生檔案限制在 artifact 目錄;進階 REST 工具採 endpoint allowlist。Agent-first / Human-friendly:MCP tools 供代理呼叫,Skills 提供選型規則,人類可以用 PowerShell 和 MCP Inspector 驗證。
Related MCP server: Bay Run
功能總覽
Area | MCP tools | API surface |
Discovery |
|
|
Routing |
| Live model list + capability registry |
File input |
|
|
Text / reasoning / vision |
|
|
Chat/audio-compatible models |
|
|
Image generation |
|
|
Image editing |
|
|
File transcription |
|
|
Speech generation |
|
|
Embeddings |
|
|
Moderation |
|
|
Realtime |
|
|
Realtime translation |
|
|
GPT-Live |
|
|
Advanced |
| Allowlisted inference endpoints only |
Diagnostics |
|
|
The server also exposes the openai://model-capabilities resource and choose_openai_model prompt.
1. Requirements
Windows 10/11, macOS, or Linux
Python 3.11+
uvpackage manager (recommended)An OpenAI Platform project API key with the required model permissions and billing configured
This is an API integration, not a bridge to ChatGPT's consumer model selector. ChatGPT product access does not automatically make every ChatGPT model available through the API; the official catalog explicitly separates ChatGPT-only models from API-recommended models. API usage is subject to the Platform project, endpoint permissions, rate limits, and API billing. Eligible ChatGPT Pro and Business subscriptions may claim separate API credits by linking an eligible subscription to an API organization; those credits do not expand ChatGPT or signed-in Codex usage limits.
2. Install on Windows (PowerShell)
Unzip the project, open PowerShell in the project directory, then run:
Set-ExecutionPolicy -Scope Process Bypass
.\scripts\install.ps1The installer runs uv sync --extra dev and creates .env from .env.example if needed.
Edit .env:
notepad .envSet your key:
OPENAI_API_KEY=sk-proj-REPLACE_WITH_YOUR_KEY
OPENAI_TIMEOUT_SECONDS=180
OPENAI_ARTIFACT_DIR=artifactsDo not put a real key in Git, screenshots, prompts, or MCP tool arguments.
3. Verify API access
.\scripts\test.ps1
.\scripts\run.ps1For an interactive tool test (requires Node.js/npx for MCP Inspector):
uv run mcp dev src/openai_universal_model_mcp/server.py --with-editable .Call openai_health_check, then openai_list_models. Use openai_inspect_model before selecting a model for a non-standard endpoint.
4. Connect to Codex
Copy the example from examples/codex-config.toml into your Codex config.toml, and replace the project directory with the actual absolute path.
Example:
[mcp_servers.openai_universal_models]
command = "uv"
args = [
"--directory",
"D:\\AI\\openai-universal-model-mcp",
"run",
"python",
"-m",
"openai_universal_model_mcp.server"
]
# Codex does not forward arbitrary environment variables to MCP servers.
# Needed only when the key is in the OS environment instead of .env.
env_vars = ["OPENAI_API_KEY"]The recommended launch command is uv run python -m openai_universal_model_mcp.server. This avoids package-relative imports failing when a server file is loaded as a standalone script.
Restart Codex after editing the MCP configuration. The MCP process reads the .env file in the project root; a key already set in the process environment takes precedence.
5. Connect to Claude Code / Claude Desktop / Cursor / VS Code
Claude Code (user scope, available in every project):
claude mcp add --scope user openai-universal-models -- uv --directory D:/path/to/openai-universal-model-mcp run python -m openai_universal_model_mcp.server
claude mcp listFor the other hosts, see:
examples/claude-desktop-config.jsonexamples/cursor-mcp.json
Replace the example path with the absolute project path. Host configuration formats can vary by version; keep the command and arguments aligned with the host's current MCP documentation.
6. Agent usage examples
Find all visible models
Call openai_list_models with include_shutdown=false.Select a reasoning model
Call openai_recommend_model(task="reasoning", budget_preference="balanced").
Then call openai_inspect_model with the recommended model ID.Use a model directly
Call openai_create_response:
- model: gpt-6.1-sol
- input_text: Explain Rust ownership with a small example.
- reasoning_effort: medium
- max_output_tokens: 1200Generate an image
Call openai_generate_image:
- model: gpt-image-2.6-sunburst
- prompt: A cinematic photorealistic miniature greenhouse at dawn.
- size: auto
- quality: high
- output_format: pngThe generated file is written to artifacts/ by default. GPT Image 2.6 supports complexity controls, SVG output, and animated GIF output. For a 16-frame GIF at 120 ms per frame, set output_format=gif, frame_count=16, frame_duration_ms=120, and optionally complexity=high. The Image API accepts GIF output for generation and edits; SVG is generation-only and requires n=1.
Call openai_generate_image:
- model: gpt-image-2.6-sunburst
- prompt: A seamless looping cinematic chibi character animation, fixed camera, consistent character and background.
- output_format: gif
- frame_count: 16
- frame_duration_ms: 120
- complexity: highUse a local PDF or image as model input
First call openai_upload_file with confirm_upload=true only after the user explicitly authorizes sending the file to OpenAI Platform. Then reference the returned file_id in openai_create_response using the appropriate input_file or input_image item.
Analyze an image with a general model
Use openai_create_response with input_json containing a Responses API message whose content includes input_text and input_image. Supply a supported HTTPS image URL, a data: URL, or a previously uploaded file ID. For example:
[
{
"role": "user",
"content": [
{"type": "input_text", "text": "Describe this image."},
{"type": "input_image", "image_url": "https://example.com/image.jpg", "detail": "high"}
]
}
]Transcribe audio
Call openai_transcribe_audio:
- file_path: D:\\recordings\\meeting.wav
- model: gpt-transcribe
- response_format: jsonCreate embeddings
Call openai_create_embeddings:
- model: text-embedding-3-small
- input_text: The source text to embed.
- include_vectors: false7. Skills
Skills are in skills/. They are written in English for consistent agent execution and include Traditional Chinese trigger phrases so Chinese-language users can invoke them naturally.
openai-platform-universal: main routing and operating policyopenai-model-discovery: dynamic catalog and lifecycle checksopenai-model-routing: task-to-model and endpoint selectionopenai-image-generation: image creation and editingopenai-audio-realtime: transcription, speech, Realtime, GPT-Liveopenai-embeddings-safety: embeddings and moderationopenai-api-extension: safe extension policy for new endpoints
Use AGENTS.md as the project-level instruction file for coding agents. To install the bundled skills into a Codex-style skills directory, run .\scripts\install-skills.ps1 or pass an explicit -TargetPath for another agent runtime.
8. Important compatibility boundaries
/v1/modelsreturns model identifiers and basic fields; it does not return full modalities, context windows, pricing, or endpoint compatibility.A model being listed does not guarantee the current project can use every endpoint or feature.
shutdown_dateis checked before recommending a model. A listed model with a past shutdown date is excluded from recommendations by default.Unknown model IDs remain discoverable but are marked with unknown capability metadata. Do not infer endpoint compatibility from the name alone.
Realtime and GPT-Live are persistent media sessions. MCP tools create an ephemeral client secret or return an SDP answer; the application must establish and maintain the actual WebRTC/WebSocket audio stream.
Speech generation models and endpoint support can change. Pass a currently supported model ID and verify it against the current official audio docs.
The safe REST tool allows only a fixed set of inference endpoints and model discovery. It does not expose destructive, organization-admin, billing, or arbitrary URL access.
9. Tests and quality gates
uv run pytest
uv run ruff check .
uv run python -m compileall srcUnit tests cover registry status, recommendation filtering, model ID validation, endpoint allowlisting, and output path containment. Live API tests are intentionally opt-in because they can incur charges.
10. Official references
The model catalog and API docs change over time. Treat the following official documentation as the source of truth:
Model catalog: https://developers.openai.com/api/docs/models/all
API credits for eligible ChatGPT subscribers: https://developers.openai.com/api/docs/guides/chatgpt-api-credits
Models guide: https://developers.openai.com/api/docs/models
List models: https://developers.openai.com/api/reference/resources/models/methods/list
Retrieve model: https://developers.openai.com/api/reference/resources/models/methods/retrieve
Responses API: https://developers.openai.com/api/reference/resources/responses/methods/create
Image generation: https://developers.openai.com/api/docs/guides/image-generation
Transcription: https://developers.openai.com/api/docs/guides/transcription
Embeddings: https://developers.openai.com/api/docs/guides/embeddings
Moderation: https://developers.openai.com/api/docs/guides/moderation
Realtime client secrets: https://developers.openai.com/api/reference/resources/realtime/subresources/client_secrets/methods/create
GPT-Live session creation: https://developers.openai.com/api/reference/resources/live/methods/create
Official MCP Python SDK: https://py.sdk.modelcontextprotocol.io/
Project status: Initial implementation package. Live model access, organization approvals, and endpoint compatibility must be verified with the user's own API key. No API calls are made during installation or unit tests.
Available Tools
18 toolsopenai_create_chat_completionC
Call Chat Completions for models or audio workflows that require that API surface.
Inputs: model (required), messages_json (required), audio_json, temperature, +4 more. Returns: object
openai_create_embeddingsB
Create text embeddings. Vector values are omitted by default to keep MCP responses compact.
Inputs: model (required), dimensions, input_json, input_text, +1 more. Returns: object
openai_create_live_sessionC
Create a GPT-Live WebRTC session from an SDP offer and return the SDP answer.
Inputs: sdp_offer (required), model, session_json, safety_identifier. Returns: object
openai_create_realtime_client_secretC
Create a short-lived Realtime client secret. The main API key is never returned.
Inputs: model, session_json, session_type, safety_identifier, +1 more. Returns: object
openai_create_realtime_translation_secretC
Create a short-lived client secret for the Realtime Translation API.
Inputs: session_json (required), safety_identifier, expires_in_seconds. Returns: object
openai_create_responseC
Call the Responses API for text, reasoning, image input, tools, or structured output.
Inputs: model (required), store, input_json, input_text, +10 more. Returns: object
openai_edit_imageC
Edit one local image with a GPT Image model. An optional alpha mask may be supplied.
Inputs: model (required), prompt (required), image_path (required), size, +10 more. Returns: object
openai_generate_imageC
Generate images with GPT Image 2.x; supports 2.6 complexity and GIF frame controls.
Inputs: model (required), prompt (required), n, size, +10 more. Returns: object
openai_generate_speechC
Generate speech audio and save it locally. Supply a model supported by the current speech endpoint.
Inputs: model (required), input_text (required), speed, voice, +3 more. Returns: object
openai_get_modelC
Retrieve one model record from GET /v1/models/{model_id}.
Inputs: model_id (required). Returns: object
openai_health_checkA
Check local configuration and connectivity to the OpenAI Platform API.
Inputs: no named parameters. Returns: object
openai_inspect_modelB
Inspect live API visibility plus locally documented capabilities and compatible endpoints.
Inputs: model_id (required). Returns: object
openai_list_modelsB
List model IDs visible to this API key. Filter shutdown models unless explicitly requested.
Inputs: limit, query, include_shutdown. Returns: object
openai_moderate_contentC
Classify text or supported image inputs with the Moderations API.
Inputs: model, input_json, input_text. Returns: object
openai_recommend_modelB
Recommend an available model for a supported task using the live model list and curated priorities.
Inputs: task (required), budget_preference. Returns: object
openai_safe_api_requestC
Advanced JSON REST call restricted to approved model and inference endpoints; no destructive methods.
Inputs: path (required), method (required), body_json, query_json. Returns: object
openai_transcribe_audioC
Transcribe a local audio/video file using the Audio Transcriptions API.
Inputs: file_path (required), model, prompt, language, +1 more. Returns: object
openai_upload_fileB
Upload a local file to OpenAI Files for Responses input. Requires explicit confirm_upload=true.
Inputs: file_path (required), confirm_upload. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools map to clearly distinct resources/actions (image generate vs edit, transcribe vs speech, moderation vs embeddings). There is mild overlap between openai_inspect_model, openai_get_model, openai_list_models, and openai_recommend_model, and between openai_create_response, openai_create_chat_completion, and openai_safe_api_request, but descriptions do enough to separate them. The three realtime secret/session tools are close cousins but still distinguishable by intent.
All names share the openai_ prefix and overwhelmingly follow verb_noun (create_response, generate_image, transcribe_audio, list_models). A few deviate in form—openai_health_check and openai_safe_api_request read as noun/adjective phrases rather than verb_noun—but the pattern remains predictable overall.
18 tools is on the heavier side, but the server spans models, files, responses, chat, images, audio, embeddings, moderation, and realtime, so each tool covers a genuinely different API surface. Only the model-introspection group (inspect/get/list/recommend) feels slightly padded.
Core inference surfaces are well covered, but file handling is a dead end: openai_upload_file has no list, retrieve, or delete counterpart. Broader OpenAI lifecycle areas such as batches, fine-tuning, and vector stores/assistants are absent, so agents hitting those needs will fall back to safe_api_request or fail.
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- -licenseCqualityNot gradedmaintenanceEnables interaction with OpenAI-compatible APIs (like Ollama) through MCP tools. Provides access to chat completions, model listings, and embeddings generation from local or remote OpenAI-style endpoints.3-
- FlicenseNot gradedqualityCmaintenanceEnables agents to discover, evaluate, and serve task-specialist models (embeddings, reranking, classification, extraction) with OpenAI-compatible endpoints and MCP tools for routing, embedding, reranking, and extraction.-
- AlicenseAqualityCmaintenanceIntegrates OpenAI APIs into MCP-compatible clients, providing tools for text generation, chat completions, model discovery, image creation/editing, audio transcription, speech synthesis, embeddings, and content moderation.9MIT
- AlicenseAqualityCmaintenanceEnables interaction with OpenAI-compatible model proxy APIs through MCP, supporting text generation, vision understanding, and image generation with automatic model discovery and routing.3MIT