gpt5mcp
Integrates OpenAI's GPT-5 models and Codex CLI to provide autonomous agents for multi-step task execution, web search capabilities, and advanced code analysis and refactoring.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gpt5mcp
MCP server for OpenAI GPT-5 API integration with Claude Code. Provides gpt5_agent and gpt5_codex tools.
Setup
Option A: npm install (recommended)
npm install -g gpt5mcp
# Basic (gpt5_agent only)
claude mcp add gpt5mcp -e OPENAI_API_KEY=sk-... -- gpt5mcp
# Full (with gpt5_codex support)
claude mcp add gpt5mcp \
-e OPENAI_API_KEY=sk-... \
-e CODEX_BIN=$(which codex) \
-- gpt5mcpOption B: From source
git clone https://github.com/cristip73/gpt5mcp.git
cd gpt5mcp
npm install
npm run build
claude mcp add gpt5mcp \
-e OPENAI_API_KEY=sk-... \
-e CODEX_BIN=$(which codex) \
-- node /absolute/path/to/gpt5mcp/build/index.jsOption C: Manual config
Create/edit ~/.claude/.mcp.json:
{
"mcpServers": {
"gpt5mcp": {
"command": "gpt5mcp",
"env": {
"OPENAI_API_KEY": "sk-...",
"CODEX_BIN": "/path/from/which/codex"
}
}
}
}Codex CLI Setup (for gpt5_codex tool)
The gpt5_codex tool requires OpenAI's Codex CLI. Skip this if you only need gpt5_agent.
# Install Codex CLI
npm install -g @openai/codex
# Find the path
which codex
# Example output: /usr/local/bin/codex
# Use this path for CODEX_BINVerify
Restart Claude Code and check:
claude mcp listYou should see gpt5mcp with tools gpt5_agent and gpt5_codex.
Environment Variables
Variable | Required | Description |
| Yes | OpenAI API key with GPT-5 access |
| No | Path to Codex CLI binary (for |
Related MCP server: Codex MCP Server
Active Tools
GPT-5 Agent (gpt5_agent)
Autonomous agent with SSE streaming that solves complex multi-step tasks. Supports tool orchestration, web search, code interpreter, and file operations.
Key Parameters:
Parameter | Default | Description |
| required | Task description |
|
| Model: |
|
|
|
|
|
|
| 10 | Max agent loops (1-20) |
| true | Enable web search |
| false | Enable code execution |
| false | Enable file read/write |
| true | Save output to |
| - | Continue previous conversation |
Examples:
{
"task": "Research the latest AI developments in 2026",
"reasoning_effort": "high",
"enable_web_search": true
}{
"task": "Analyze this Python code for performance issues",
"file_path": "/path/to/code.py",
"enable_code_interpreter": true
}GPT-5 Codex (gpt5_codex)
Deep code analysis via Codex CLI. Spawns codex binary for autonomous code editing.
Key Parameters:
Parameter | Default | Description |
| required | Task for Codex |
|
| Model: |
|
|
|
|
|
|
| - | Single file input (100KB max) |
| - | Multiple files (200KB total) |
|
|
|
Edit Modes:
research- Read-only analysis, no file changesauto_edit- Prompts before each editfull_auto- Auto-applies safe editsdangerous- No restrictions (use with caution)
Example:
{
"prompt": "Refactor this module to use async/await",
"file_path": "/path/to/module.ts",
"reasoning": "high",
"edit_mode": "auto_edit"
}Inactive Tools
Disabled by default for performance. Enable in src/tools/index.ts:
Tool | Description |
| Web search via OpenAI Responses API |
| File read/write/delete |
| Execute Python/JavaScript |
| DALL-E 3 / GPT-Image-1 |
| Define custom reusable functions |
To enable:
// src/tools/index.ts
const ACTIVE_TOOLS = {
gpt5_agent: true,
gpt5_codex: true,
image_generation: true, // ← set to true
// ...
};Then: npm run build and restart Claude Code.
Architecture
src/
├── index.ts # MCP server entry point
├── utils.ts # GPT-5 API utilities
├── types/
│ ├── responses.ts # API response types
│ └── tools.ts # Tool interface definitions
└── tools/
├── index.ts # Tool registration & activation
├── registry.ts # Tool registry (singleton)
├── base.ts # Base tool class
└── built-in/
├── gpt5-agent.ts # ✅ Active
├── gpt5-codex.ts # ✅ Active
├── web-search.ts
├── file-operations.ts
├── code-interpreter.ts
├── image-generation.ts
└── function-definition.tsStreaming Implementation
GPT-5 Agent uses SSE (Server-Sent Events) to prevent MCP timeout:
Activity timeout: 120 seconds without data
Request timeout: up to 15 minutes for complex tasks
Activated when
reasoning_effortis notnoneorminimal
Troubleshooting
Server not found:
claude mcp remove gpt5mcp
claude mcp add gpt5mcp -e OPENAI_API_KEY=sk-... -- gpt5mcpSocket hang up errors:
Ensure
.mcp.jsonpoints tobuild/index.js(notdist/)SSE streaming handles long-running requests
Codex not working:
# 1. Install Codex CLI
npm install -g @openai/codex
# 2. Find path
which codex
# 3. Re-add MCP with correct path
claude mcp remove gpt5mcp
claude mcp add gpt5mcp -e OPENAI_API_KEY=sk-... -e CODEX_BIN=$(which codex) -- gpt5mcpCredits
Originally inspired by AllAboutAI-YT. Significantly rewritten with SSE streaming, Codex CLI integration, and improved tool architecture.
Built with MCP • Powered by OpenAI GPT-5
This server cannot be deployed
Maintenance
Related MCP Connectors
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables advanced OpenAI GPT model integration with Claude through 5 specialized tools including GPT-5 reasoning, token optimization, context management, batch processing, and model comparison. Features intelligent fallback mechanisms and task-specific system prompts for enhanced AI capabilities.150 npmMIT
- FlicenseBqualityNot gradedmaintenanceAn MCP server for the OpenAI Codex CLI that provides coding assistance with multi-turn session management and reasoning depth control. It enables users to perform code analysis, generation, and refactoring through Claude with native resume support for conversational context.41,352 npm1-
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenAI Codex CLI with Claude Code via MCP, enabling code execution, analysis, fixing, and web search within Claude Code.1,352 npm1ISC
- AlicenseBqualityDmaintenanceBrings OpenAI's GPT-5 capabilities to Claude Code with advanced reasoning, cost management, conversation handling, and automatic GPT-4 fallback.81MIT