GPT MCP Server
# GPT MCP Server
An MCP (Model Context Protocol) server that provides access to OpenAI's models through Claude.
> [!NOTE]
> This project is strongly inspired by [yoshiko-pg/o3-search-mcp](https://github.com/yoshiko-pg/o3-search-mcp). While o3-search-mcp focuses on the o3 model, this server extends the concept to support all OpenAI models with similar web search capabilities.
## Features
- **Advanced Search with Web Capabilities** - Intelligent search and reasoning for all models (o3, GPT-5, GPT-4o, etc.)
- **Model Discovery** - List all available OpenAI models
- **Configurable Reasoning** - Adjust reasoning effort (low/medium/high)
- **Search Context Control** - Fine-tune search context size
- **Robust Error Handling** - Configurable retries and timeouts
- **Default GPT-5 Model** - Uses GPT-5 as the default model
## Installation
### Option 1: Using uvx (Recommended)
No installation needed! You can run directly with uvx:
```bash
# Run directly from GitHub
uvx --from git+https://github.com/orangekame3/gpt-mcp.git gpt-mcp
```
### Option 2: Using Claude Code (Recommended)
If you're using Claude Code, you can easily add this MCP server:
#### Method 1: Using .mcp.json file
Create a `.mcp.json` file in your project root:
```json
{
"mcpServers": {
"gpt": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/orangekame3/gpt-mcp.git",
"gpt-mcp"
],
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"OPENAI_MODEL": "gpt-5",
"REASONING_EFFORT": "minimal",
"VERBOSITY": "medium",
"OPENAI_API_TIMEOUT": "60",
"OPENAI_MAX_RETRIES": "3"
}
}
}
}
```
Replace `"your-openai-api-key"` with your actual OpenAI API key. The MCP server will be automatically available in Claude Code.
#### Method 2: Using claude mcp add command with environment variables
```bash
# Add as 'gpt' - this allows you to call it with just 'gpt'
claude mcp add gpt \
-s user \
-e OPENAI_API_KEY=your-api-key \
-e REASONING_EFFORT=minimal \
-e VERBOSITY=medium \
-e OPENAI_API_TIMEOUT=60 \
-e OPENAI_MAX_RETRIES=3 \
-e OPENAI_MODEL=gpt-5 \
-- uvx --from git+https://github.com/orangekame3/gpt-mcp.git gpt-mcp
```
After installation, you can use it directly in Claude Code:
```bash
# Ask gpt for advanced search
> Ask gpt to find the latest React best practices
# List available models
> Ask gpt to list available OpenAI models
```
## Available Tools
### advanced_search
Advanced AI search with web capabilities and reasoning.
This tool provides intelligent web search and reasoning capabilities, similar to o3's search but available for multiple OpenAI models. Perfect for:
- Finding the latest information
- Troubleshooting errors
- Discussing complex ideas or design challenges
- Research tasks requiring current data
Parameters:
- `prompt`: Your question or search query
- `model`: The model to use (default: uses environment variable OPENAI_MODEL or "gpt-5")
- `reasoning_effort`: Reasoning intensity - "minimal", "low", "medium", "high" (optional)
- `verbosity`: Output detail level - "low", "medium", "high" (optional, GPT-5 only)
- `enable_web_search`: Whether to enable web search (default: true)
### list_models
List all available OpenAI models, categorized by type (chat models and completion models).
## Environment Variables
| Variable | Required | Default | Description |
| --------------------- | -------- | --------- | ---------------------------------------------- |
| `OPENAI_API_KEY` | Yes | - | Your OpenAI API key |
| `OPENAI_MODEL` | No | `gpt-5` | Default model to use for advanced_search |
| `REASONING_EFFORT` | No | `minimal` | Reasoning intensity (minimal/low/medium/high) |
| `VERBOSITY` | No | `medium` | Output detail level (low/medium/high, GPT-5 only) |
| `OPENAI_API_TIMEOUT` | No | `60` | API timeout in seconds |
| `OPENAI_MAX_RETRIES` | No | `3` | Max retry attempts for failed requests |
## Use Cases
### 🐛 Debugging Complex Issues
```
> I'm getting a "WebSocket connection failed" error. Ask gpt to find solutions.
```
### 📚 Research with Latest Information
```
> Ask gpt to find the latest best practices for React Server Components in 2025.
```
### 🧩 Design and Architecture Discussions
```
> I want to design a real-time collaborative editor. Ask gpt with high reasoning effort to explore architectures.
```
### 🔍 Comparing Technologies
```
> Ask gpt to compare Rust vs Go for building high-performance web servers in 2025.
```
## Development
```bash
# Run the server directly
uv run gpt-mcp
# Run with Python
python -m src.server
```
## Notes
- For o3 model access, you need Tier 4 or organizational verification on OpenAI
- The `advanced_search` tool provides o3-like capabilities for all models
- Web search is simulated for non-o3 models through intelligent prompting
- All OpenAI rate limits and usage charges apply
## License
MIT
TDQS
Scored across 2 tools
list_models and advanced_search have clearly distinct purposes: one enumerates models, the other performs reasoning/web search. The only mild confusion is that advanced_search implicitly takes a model argument, so an agent might wonder whether model selection is a separate concern, but the boundary is still easy to draw.
list_models follows a verb_noun pattern, but advanced_search is an adjective_noun label with no verb, so the two names don't form a predictable convention. Both are snake_case and readable, so it's mixed rather than chaotic.
Only two tools for a server whose apparent purpose is broad GPT/OpenAI access is very thin. The pair is coherent but leaves the surface feeling minimal for the stated scope.
The server covers model discovery and a reasoning/search endpoint, but there is no plain chat/completion tool, no way to pass conversation history or system prompts, and no embeddings or token/usage utilities. Agents needing a simple non-search generation call have no direct path, though advanced_search can be coerced into that role.