GPT-5 MCP Server
Provides GPT-5 inference capabilities through OpenAI's API, including support for reasoning effort levels, verbosity controls, web search preview integration, and customizable system prompts and parameters.
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., "@GPT-5 MCP Serversummarize the latest AI breakthroughs with web search enabled and high reasoning effort"
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.
GPT-5 MCP Server (TypeScript)
An MCP server that exposes a gpt5_query tool for GPT-5 inference via OpenAI Responses API, with optional Web Search Preview. Supports per-call overrides for verbosity, reasoning effort, and other parameters.
Features
TypeScript MCP server using
@modelcontextprotocol/sdkgpt5_querytoolweb_search_previewintegration (optional)verbosity(low|medium|high)reasoning.effort(low|medium|high)tool_choice(auto|none),parallel_tool_callssystemprompt,model,max_output_tokens
Config via environment variables with per-call overrides
Related MCP server: GPT-MCP Bridge
Quick Start
Install dependencies
pnpm i # or npm i / yarnConfigure environment
Create .env (or export env vars):
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-5
OPENAI_MAX_RETRIES=3
OPENAI_TIMEOUT_MS=60000
REASONING_EFFORT=medium
DEFAULT_VERBOSITY=medium
WEB_SEARCH_DEFAULT_ENABLED=false
WEB_SEARCH_CONTEXT_SIZE=mediumBuild and run
pnpm run build
pnpm startFor development (watch mode):
pnpm run devUsing with MCP Clients (Claude Code, Claude Desktop)
This server speaks Model Context Protocol (MCP) over stdio and emits pure JSON to stdout, making it safe for Claude Code and Claude Desktop.
Prerequisites
Node.js 18+
OpenAI API key via
.envor environment variable
Build
pnpm run buildRun directly (recommended)
Command:
nodeArgs:
dist/cli.jsCWD: repository root (required if you want
.envto be loaded)
Example:
node dist/cli.jsAdd to Claude Code (VS Code)
Command Palette → "Claude: Manage MCP Servers"
"Add server" with:
Name:
gpt5-mcpCommand:
node(or absolute path, e.g.,/opt/homebrew/bin/node)Args: ["/absolute/path/to/gpt5-mcp-server/dist/cli.js"] (or just
gpt5-mcp-serverif installed globally)Env (choose one):
Option A (ENV_FILE):
ENV_FILE=/absolute/path/to/gpt5-mcp-server/.envOption B (explicit): set
OPENAI_API_KEY,OPENAI_MODEL,OPENAI_TIMEOUT_MS,DEFAULT_VERBOSITY,REASONING_EFFORT,WEB_SEARCH_DEFAULT_ENABLED,WEB_SEARCH_CONTEXT_SIZE
Add to Claude Desktop Edit config (e.g., macOS:
~/Library/Application Support/Claude/claude_desktop_config.json) and add:
Option A: using ENV_FILE
{
"mcpServers": {
"gpt5-mcp": {
"command": "/opt/homebrew/bin/node",
"args": ["/absolute/path/to/gpt5-mcp-server/dist/cli.js"],
"env": {
"ENV_FILE": "/absolute/path/to/gpt5-mcp-server/.env"
}
}
}
}Option B: explicit env vars
{
"mcpServers": {
"gpt5-mcp": {
"command": "/opt/homebrew/bin/node",
"args": ["/absolute/path/to/gpt5-mcp-server/dist/cli.js"],
"env": {
"OPENAI_API_KEY": "sk-...",
"OPENAI_MODEL": "gpt-5",
"OPENAI_TIMEOUT_MS": "120000",
"DEFAULT_VERBOSITY": "medium",
"REASONING_EFFORT": "low",
"WEB_SEARCH_DEFAULT_ENABLED": "false",
"WEB_SEARCH_CONTEXT_SIZE": "medium"
}
}
}
}CLI usage
Package exposes bin(s).
Local link:
npm link→ rungpt5-mcp-serverGlobal (after publish):
npm i -g gpt5-mcp-server→gpt5-mcp-serverDirect:
node /absolute/path/to/gpt5-mcp-server/dist/cli.js
Web Search notes
Due to OpenAI constraints,
web_search_previewcannot be combined withreasoning.effort = minimal.This server automatically bumps effort to
mediumifweb_search.enabled = true.If you need strict
minimal, setweb_search.enabled = false.
Troubleshooting
JSON parse error (Unexpected token ...)
Likely extra logs on stdio. Use
node dist/cli.js, avoidnpx.
Auth error
Ensure
OPENAI_API_KEYis provided.
Timeout
Increase
OPENAI_TIMEOUT_MS(e.g., 120000).
400 with Web Search
Caused by
minimaleffort + web search. It's auto-bumped tomedium; alternatively setreasoning_effort=mediumor disableweb_search.
Tool: gpt5_query
Input schema (JSON):
{
"query": "string",
"model": "string?",
"system": "string?",
"reasoning_effort": "low|minimal|medium|high?",
"verbosity": "low|medium|high?",
"tool_choice": "auto|none?",
"parallel_tool_calls": "boolean?",
"max_output_tokens": "number?",
"web_search": {
"enabled": "boolean?",
"search_context_size": "low|medium|high?"
}
}Example call (Inspector or client):
{
"method": "tools/call",
"params": {
"name": "gpt5_query",
"arguments": {
"query": "Summarize the latest on X.",
"verbosity": "low",
"web_search": { "enabled": true, "search_context_size": "medium" }
}
}
}Defaults and behavior
model: defaults to
OPENAI_MODEL(env). Example:gpt-5.system: optional. Sent as
instructions.reasoning_effort: accepts
low|minimal|medium|high. Internallylow→minimal。Constraint: when
web_search.enabled=trueand effort isminimal, it is auto-bumped tomediumto satisfy OpenAI constraints.
verbosity: defaults to
DEFAULT_VERBOSITY(env). Sent astext.verbosity.tool_choice: default
auto.parallel_tool_calls: default
true.max_output_tokens: optional; omitted when not set.
web_search.enabled: defaults to
WEB_SEARCH_DEFAULT_ENABLED(env).web_search.search_context_size: defaults to
WEB_SEARCH_CONTEXT_SIZE(env). Allowed:low|medium|high.
Environment variable mapping
OPENAI_API_KEY(required)OPENAI_MODEL→ model defaultOPENAI_MAX_RETRIES→ OpenAI clientOPENAI_TIMEOUT_MS→ OpenAI clientREASONING_EFFORT→ reasoning_effort default (low|minimal|medium|high)DEFAULT_VERBOSITY→ verbosity default (low|medium|high)WEB_SEARCH_DEFAULT_ENABLED→ web_search.enabled default (true|false)WEB_SEARCH_CONTEXT_SIZE→ web_search.search_context_size default (low|medium|high)
Output shape
On success:
content: [{ type: "text", text: string }]On error:
isError: trueand atextitem withError: ...
Notes
If the selected model does not support certain fields (e.g.,
verbosity), they are ignored.Keep API keys out of logs. Ensure
.envis not committed.
License
MIT
日本語 (Japanese)
ツール: gpt5_query
入力スキーマ (JSON):
{
"query": "string",
"model": "string?",
"system": "string?",
"reasoning_effort": "low|minimal|medium|high?",
"verbosity": "low|medium|high?",
"tool_choice": "auto|none?",
"parallel_tool_calls": "boolean?",
"max_output_tokens": "number?",
"web_search": {
"enabled": "boolean?",
"search_context_size": "low|medium|high?"
}
}例 (Inspector など):
{
"method": "tools/call",
"params": {
"name": "gpt5_query",
"arguments": {
"query": "Summarize the latest on X.",
"verbosity": "low",
"web_search": { "enabled": true, "search_context_size": "medium" }
}
}
}既定値と挙動
model: 既定は
OPENAI_MODEL(環境変数)。例:gpt-5。system: 任意。OpenAI には
instructionsとして送信します。reasoning_effort:
low|minimal|medium|highを受け付け、内部的にlowはminimalとして扱われます。制約:
web_search.enabled=trueかつ effort=minimalの場合、OpenAI の制約に合わせて自動的にmediumに引き上げます。
verbosity: 既定は
DEFAULT_VERBOSITY(環境変数)。OpenAI にはtext.verbosityとして送信します。tool_choice: 既定は
auto。parallel_tool_calls: 既定は
true。max_output_tokens: 任意。未指定の場合は送信しません。
web_search.enabled: 既定は
WEB_SEARCH_DEFAULT_ENABLED(環境変数)。web_search.search_context_size: 既定は
WEB_SEARCH_CONTEXT_SIZE(環境変数)。許容値:low|medium|high。
環境変数マッピング
OPENAI_API_KEY(必須)OPENAI_MODEL→ model 既定OPENAI_MAX_RETRIES→ OpenAI クライアント設定OPENAI_TIMEOUT_MS→ OpenAI クライアント設定REASONING_EFFORT→ reasoning_effort 既定(low|minimal|medium|high)DEFAULT_VERBOSITY→ verbosity 既定(low|medium|high)WEB_SEARCH_DEFAULT_ENABLED→ web_search.enabled 既定(true|false)WEB_SEARCH_CONTEXT_SIZE→ web_search.search_context_size 既定(low|medium|high)
出力形式
成功時:
content: [{ type: "text", text: string }]エラー時:
isError: trueとtextにError: ...
注意
選択したモデルが特定のフィールド(例:
verbosity)をサポートしない場合、それらは無視されます。API キーはログに出力しません。
.envはコミットしないでください。
MCP Serverの使い方
このサーバーは Model Context Protocol (MCP) の標準入出力(stdio)で動作します。純粋な JSON のみを stdout に出力する設計のため、MCP Inspector / Claude Code / Claude Desktop で安全に接続できます。
前提
Node.js 18+
OpenAI APIキーが
.envもしくは環境変数で設定されていること
ビルド
pnpm run build直接起動(推奨)
コマンド:
node引数:
dist/cli.jsCWD: リポジトリのルート(
.envを読む場合は必須)
例:
node dist/cli.jsClaude Code(VS Code 拡張)に追加
VS Code のコマンドパレット → 「Claude: Manage MCP Servers」
「Add server」で次を入力:
Name:
gpt5-mcpCommand:
node(絶対パス可)Args:
["/絶対/パス/gpt5-mcp-server/dist/cli.js"](グローバル導入済みなら不要)Env(どちらか一方):
オプションA(ENV_FILE):
ENV_FILE=/絶対/パス/gpt5-mcp-server/.envオプションB(明示指定):
OPENAI_API_KEY、OPENAI_MODEL、OPENAI_TIMEOUT_MS、DEFAULT_VERBOSITY、REASONING_EFFORT、WEB_SEARCH_DEFAULT_ENABLED、WEB_SEARCH_CONTEXT_SIZE
Claude Desktop に追加 設定ファイル(例: macOS は
~/Library/Application Support/Claude/claude_desktop_config.json)を編集して以下を追記します。
オプションA: ENV_FILE を使う
{
"mcpServers": {
"gpt5-mcp": {
"command": "/opt/homebrew/bin/node",
"args": ["/絶対/パス/gpt5-mcp-server/dist/cli.js"],
"env": {
"ENV_FILE": "/絶対/パス/gpt5-mcp-server/.env"
}
}
}
}オプションB: 環境変数を明示指定
{
"mcpServers": {
"gpt5-mcp": {
"command": "/opt/homebrew/bin/node",
"args": ["/絶対/パス/gpt5-mcp-server/dist/cli.js"],
"env": {
"OPENAI_API_KEY": "sk-...",
"OPENAI_MODEL": "gpt-5",
"OPENAI_TIMEOUT_MS": "120000",
"DEFAULT_VERBOSITY": "medium",
"REASONING_EFFORT": "low",
"WEB_SEARCH_DEFAULT_ENABLED": "false",
"WEB_SEARCH_CONTEXT_SIZE": "medium"
}
}
}
}CLI の利用
パッケージには bin が含まれます。
ローカルリンク:
npm link後にgpt5-mcp-serverグローバル(公開後):
npm i -g gpt5-mcp-server→gpt5-mcp-server直接実行:
node /絶対/パス/gpt5-mcp-server/dist/cli.js
Web Search に関する注意
OpenAI の制約により、
web_search_previewはreasoning.effort = minimalと併用できません。本サーバーは
web_search.enabled = trueの場合、自動的に effort をmediumに引き上げて呼び出します。もし
minimalを厳格に使いたい場合は、web_search.enabled = falseにしてください。
トラブルシューティング
JSON パースエラー(Unexpected token ...)
stdio に余計な出力が混ざっている可能性があります。
node dist/cli.jsを使い、npxは避けてください。.env読み込みやライブラリのログは既に抑止済みです。
認証エラー
OPENAI_API_KEYが正しく渡っているか確認。
タイムアウト
OPENAI_TIMEOUT_MSを増やす(例: 120000)。
Web Search で 400 エラー
reasoning.effort=minimalとweb_searchの併用不可が原因。自動的にmediumに上げますが、明示的にmediumを指定するか、web_searchを無効化してください。
Available Tools
1 toolgpt5_queryC
Query GPT-5 with optional Web Search Preview. Supports verbosity and reasoning effort.
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Supports verbosity and reasoning effort' which hints at configurable behavior, but doesn't describe what the tool actually does (e.g., sends a query to GPT-5, returns a response), potential side effects, rate limits, authentication needs, or output format. For a query tool with no annotation coverage, this leaves significant gaps in understanding its operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and to the point with two sentences: 'Query GPT-5 with optional Web Search Preview. Supports verbosity and reasoning effort.' It's front-loaded with the core purpose and adds supporting features efficiently. However, it could be more structured by explicitly stating the tool's action and result.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (1 parameter with nested objects, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how errors are handled, or the full scope of parameters. The mention of optional features adds some context, but overall, it lacks sufficient detail for a tool with multiple configurable options and no structured documentation elsewhere.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 1 parameter (an object with multiple nested properties), but schema description coverage is 0%, meaning none of the parameters have descriptions in the schema. The description mentions 'verbosity and reasoning effort' which maps to two of the nested parameters, but doesn't explain the other parameters (e.g., query, model, system, tool_choice, etc.) or their purposes. With low coverage, the description fails to compensate adequately, leaving most parameters undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool 'Query GPT-5 with optional Web Search Preview' which provides a clear verb ('Query') and resource ('GPT-5'), but it's somewhat vague about what 'Query' entails compared to other possible interactions. It mentions 'Supports verbosity and reasoning effort' which adds context but doesn't fully specify the core functionality beyond querying. With no sibling tools, differentiation isn't needed, but the purpose could be more specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It mentions optional features like Web Search Preview, verbosity, and reasoning effort, but doesn't explain when these should be applied. With no sibling tools, this is less critical, but still lacks any usage context or recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- Changed
gpt5_query2 fields changed- added
Input schema / $schemaAdded value: +"http://json-schema.org/draft-07/schema#" - added
Input schema / additionalPropertiesAdded value: +false
1 tool update
- First observed
gpt5_query
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'gpt5_query' has a clear and distinct purpose, making it impossible for an agent to misselect between tools.
The naming is trivially consistent as there is only one tool. It follows a clear verb_noun pattern ('gpt5_query'), and with no other tools to compare, there are no deviations or inconsistencies in naming conventions.
A single tool is generally too few for most server purposes, as it limits functionality and flexibility. For a server named 'GPT-5 MCP Server', which suggests a domain of AI querying and interaction, having only one tool feels thin and under-scoped, potentially causing agents to lack necessary operations.
The tool surface is severely incomplete for the inferred domain of AI querying. While 'gpt5_query' handles queries, there are obvious gaps such as no tools for managing conversations, handling different models, or performing related tasks like summarization or translation, which are typical in such domains.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Free OpenAI-compatible inference with signed provenance receipts and 3 focused MCP tools.
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.201MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables Claude and other MCP-compatible tools to communicate with OpenAI's GPT models (GPT-5, GPT-5-mini, o3) with conversation history and session management. Features advanced controls like reasoning effort settings, token tracking, and parallel conversation sessions for efficient AI workflows.7-
- AlicenseAqualityCmaintenanceProvides access to OpenAI's ChatGPT API with web search capabilities for Claude and other MCP clients. Supports various GPT models with configurable parameters like reasoning effort, temperature, and streaming mode.1243MIT
- AlicenseNot gradedqualityCmaintenanceIntegrates OpenAI GPT-5 capabilities into Claude Code, providing autonomous agents for complex multi-step tasks and deep code analysis via the Codex CLI. It supports features like web search, code interpretation, and persistent file operations through a streaming MCP interface.16MIT
Appeared in Searches
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/nbrain-team/gpt5-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server