mcp-openai-extended
Extended MCP server for OpenAI with support for GPT-5 family, Codex models, and automatic API endpoint selection, enabling chat interactions via the openai_chat tool.
README
MCP OpenAI Extended
Extended Model Context Protocol (MCP) server for OpenAI with GPT-5 family support, including specialized Codex models.
Features
- ✅ GPT-5 family support (gpt-5, gpt-5.1, gpt-5.2, chat-latest/pro/mini/nano/codex variants)
- ✅ GPT-4o and o1 series support
- ✅ Responses API support for Codex models (
*codex*) - ✅ Automatic API endpoint selection (Responses API for codex, Chat Completions for others)
- ✅ Works with Claude Desktop, Claude Code, and any MCP-compatible client
Supported Models
GPT-5 Family
gpt-5-codex- Specialized for code and design reviews (default, uses Responses API)gpt-5.3-codexgpt-5.3-codex-sparkgpt-5.2-chat-latestgpt-5.2-progpt-5.2gpt-5.2-codexgpt-5.1-chat-latestgpt-5.1-codexgpt-5.1-codex-minigpt-5.1-codex-maxgpt-5.1gpt-5-chat-latestcodex-mini-latestgpt-5-progpt-5gpt-5-minigpt-5-nano
Note: Newer Codex model IDs may require account-level access before they work in API requests.
GPT-4 Series
gpt-4o- GPT-4 Omnigpt-4o-mini- Smaller GPT-4o
o1 Series
o1- Reasoning modelo1-preview- Reasoning model previewo1-mini- Smaller reasoning model
Installation
NPM (Recommended)
npm install -g @kent013/mcp-openai-extended
Via npx (GitHub)
npx github:kent013/mcp-openai-extended
Local Development
git clone https://github.com/kent013/mcp-openai-extended.git
cd mcp-openai-extended
npm install
npm run build
Configuration
⚠️ Security Warning
NEVER commit your API key to version control!
- Keep your
OPENAI_API_KEYin environment variables or secure configuration files - Add configuration files containing API keys to
.gitignore - If you accidentally commit an API key, revoke it immediately at https://platform.openai.com/api-keys
- Rotate your API keys regularly
Claude Desktop / Claude Code
Add to your .mcp.json or claude_desktop_config.json:
{
"mcpServers": {
"openai": {
"command": "npx",
"args": ["-y", "@kent013/mcp-openai-extended"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}
Local Development
{
"mcpServers": {
"openai": {
"command": "node",
"args": ["/path/to/mcp-openai-extended/dist/index.js"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}
Usage
The server provides a single tool: openai_chat
Default model is gpt-5-codex (automatically uses Responses API).
Example: Design Review with GPT-5.2 Codex (Default)
{
"name": "openai_chat",
"arguments": {
"messages": [
{
"role": "system",
"content": "You are an experienced system architect."
},
{
"role": "user",
"content": "Review this code:\n\n```php\n$user = User::find($id);\nMail::to($user->email)->send(new TestMail());\n```"
}
]
// model defaults to "gpt-5-codex"
}
}
Example: General Reasoning with GPT-5 Chat Latest
{
"name": "openai_chat",
"arguments": {
"messages": [
{
"role": "user",
"content": "Explain quantum computing in simple terms"
}
],
"model": "gpt-5-chat-latest"
}
}
API Endpoints
This server automatically selects the appropriate OpenAI API endpoint:
- Responses API (
/v1/responses): For Codex models (*codex*) - Chat Completions API (
/v1/chat/completions): For all other models (gpt-4o, gpt-5-chat-latest, etc.)
Environment Variables
OPENAI_API_KEY(required): Your OpenAI API key
Getting Your API Key
- Visit https://platform.openai.com/api-keys
- Create a new API key
- Store it securely - never share or commit it to version control
- Set appropriate usage limits to prevent unexpected charges
Best Practices
- Use environment-specific API keys (development, staging, production)
- Enable usage alerts in your OpenAI account
- Regularly review API usage and rotate keys
- Use OpenAI's API key restrictions feature to limit key permissions
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/index.js
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Credits
Based on mcp-openai by mzxrai.
Extended to support GPT-5 family and specialized models.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。