OpenAI Multi-Model MCP Server
Click on "Install 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 Multi-Model MCP ServerUse GPT-5 to explain quantum computing"
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 Multi-Model MCP Server
A Model Context Protocol (MCP) server that enables Claude Code to interact with OpenAI's GPT-5 and GPT-5-mini models.
Features
Multi-model support: Choose between GPT-5 and GPT-5-mini per request
Advanced parameters: Support for reasoning effort, verbosity control, and system instructions
Type-safe: Built with TypeScript and Zod validation
Error handling: Comprehensive error handling with structured responses
MCP compliant: Full compatibility with MCP specification
Related MCP server: Claude Code MCP
Quick Start
Claude Code Configuration
Add to your Claude Code MCP configuration (typically in ~/.claude.json):
Option 1 - From GitHub (Recommended):
{
"mcpServers": {
"openai-multi": {
"command": "npx",
"args": ["-y", "github:vladnicula/vlads-openai-mcp-server"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key-here"
}
}
}
}Option 2 - Local installation:
{
"mcpServers": {
"openai-multi": {
"command": "node",
"args": ["/path/to/vlads-openai-mcp-server/build/index.js"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key-here"
}
}
}
}Note: Adding this configuration to the root mcpServers object will make it available in all instances of Claude Code.
Setup
If you wanna build this on your local machine, patch thing up, extend things. PRs are welcome btw.
Prerequisites
Node.js 18+
OpenAI API key
Installation
Clone or navigate to the project directory:
cd /path/to/vlads-openai-mcp-serverInstall dependencies:
npm installCreate environment configuration (for local testing only):
cp .env.example .env # Edit .env and add your OpenAI API key - only needed for MCP Inspector testingBuild the project:
npm run build
Configuration
Environment Variables
Create a .env file with:
OPENAI_API_KEY=sk-your-openai-api-key-hereUsage
Available Tools
openai_chat
Chat with OpenAI models including GPT-5 and GPT-5-mini.
Parameters:
model(required): "gpt-5" or "gpt-5-mini"input(required): String text input for the modelinstructions(optional): System-level instructionsreasoning(optional): Object witheffortproperty ("minimal", "low", "medium", "high")text(optional): Object withverbosityproperty ("low", "medium", "high")max_tokens(optional): Maximum tokens in response
Example:
// GPT-5 for complex tasks
await openai_chat({
model: "gpt-5",
input: "Explain quantum computing in detail",
instructions: "You are a helpful physics tutor",
reasoning: {
effort: "high"
},
text: {
verbosity: "high"
}
});
// GPT-5-mini for quick responses
await openai_chat({
model: "gpt-5-mini",
input: "What's the weather like?",
reasoning: {
effort: "minimal"
}
});Development
Scripts
npm run dev- Run in development mode with hot reloadnpm run build- Build for productionnpm run start- Run built versionnpm run inspector- Test with MCP Inspectornpm run test- Run tests
Testing
Use the MCP Inspector to test the server:
npm run inspectorThis will start the MCP Inspector where you can:
Test tool definitions
Try different parameter combinations
Verify error handling
Project Structure
src/
├── index.ts # Main server entry point
├── client.ts # OpenAI API client wrapper
├── tools/
│ ├── index.ts # Tool registry
│ └── chat.ts # Chat tool implementation
├── schemas/
│ └── index.ts # Zod validation schemas
└── utils/
└── env.ts # Environment validationModel Comparison
Feature | GPT-5 | GPT-5-mini |
Performance | Best | Fast |
Cost | Higher | Lower |
Context Window | 400k tokens | 400k tokens |
Verbosity Control | Yes | No |
Multi-modal | Yes | Yes |
Error Handling
The server provides structured error responses:
Validation errors: Invalid input parameters
API errors: OpenAI API issues (rate limits, auth, etc.)
Network errors: Connectivity problems
Unexpected errors: Any other failures
All errors include helpful messages and, where applicable, error codes.
Troubleshooting
Common Issues
Missing API Key
Missing required environment variable: OPENAI_API_KEYSolution: Set your OpenAI API key in the environment
Model Not Found
OpenAI API Error: The model 'gpt-5' does not existSolution: Ensure you have access to GPT-5 models in your OpenAI account
Rate Limits
OpenAI API Error: Rate limit exceededSolution: Wait and retry, or upgrade your OpenAI plan
Debug Mode
The server logs detailed information to stderr:
Request details
Response metadata
Error information
License
MIT
Contributing
Follow the existing code style
Add tests for new features
Update documentation
Ensure all tests pass
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vladnicula/vlads-openai-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server