Skip to main content
Glama
nbrain-team

GPT-5 MCP Server

by nbrain-team

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/sdk

  • gpt5_query tool

    • web_search_preview integration (optional)

    • verbosity (low|medium|high)

    • reasoning.effort (low|medium|high)

    • tool_choice (auto|none), parallel_tool_calls

    • system prompt, model, max_output_tokens

  • Config via environment variables with per-call overrides

Related MCP server: GPT-MCP Bridge

Quick Start

  1. Install dependencies

pnpm i # or npm i / yarn
  1. Configure 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=medium
  1. Build and run

pnpm run build
pnpm start

For development (watch mode):

pnpm run dev

Using 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 .env or environment variable

  1. Build

pnpm run build
  1. Run directly (recommended)

  • Command: node

  • Args: dist/cli.js

  • CWD: repository root (required if you want .env to be loaded)

Example:

node dist/cli.js
  1. Add to Claude Code (VS Code)

  • Command Palette → "Claude: Manage MCP Servers"

  • "Add server" with:

    • Name: gpt5-mcp

    • Command: node (or absolute path, e.g., /opt/homebrew/bin/node)

    • Args: ["/absolute/path/to/gpt5-mcp-server/dist/cli.js"] (or just gpt5-mcp-server if installed globally)

    • Env (choose one):

      • Option A (ENV_FILE): ENV_FILE=/absolute/path/to/gpt5-mcp-server/.env

      • Option B (explicit): set OPENAI_API_KEY, OPENAI_MODEL, OPENAI_TIMEOUT_MS, DEFAULT_VERBOSITY, REASONING_EFFORT, WEB_SEARCH_DEFAULT_ENABLED, WEB_SEARCH_CONTEXT_SIZE

  1. 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"
      }
    }
  }
}
  1. CLI usage

  • Package exposes bin(s).

    • Local link: npm link → run gpt5-mcp-server

    • Global (after publish): npm i -g gpt5-mcp-servergpt5-mcp-server

    • Direct: node /absolute/path/to/gpt5-mcp-server/dist/cli.js

  1. Web Search notes

  • Due to OpenAI constraints, web_search_preview cannot be combined with reasoning.effort = minimal.

  • This server automatically bumps effort to medium if web_search.enabled = true.

  • If you need strict minimal, set web_search.enabled = false.

  1. Troubleshooting

  • JSON parse error (Unexpected token ...)

    • Likely extra logs on stdio. Use node dist/cli.js, avoid npx.

  • Auth error

    • Ensure OPENAI_API_KEY is provided.

  • Timeout

    • Increase OPENAI_TIMEOUT_MS (e.g., 120000).

  • 400 with Web Search

    • Caused by minimal effort + web search. It's auto-bumped to medium; alternatively set reasoning_effort=medium or disable web_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. Internally lowminimal

    • Constraint: when web_search.enabled=true and effort is minimal, it is auto-bumped to medium to satisfy OpenAI constraints.

  • verbosity: defaults to DEFAULT_VERBOSITY (env). Sent as text.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 default

  • OPENAI_MAX_RETRIES → OpenAI client

  • OPENAI_TIMEOUT_MS → OpenAI client

  • REASONING_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: true and a text item with Error: ...

Notes

  • If the selected model does not support certain fields (e.g., verbosity), they are ignored.

  • Keep API keys out of logs. Ensure .env is 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 を受け付け、内部的に lowminimal として扱われます。

    • 制約: 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: truetextError: ...

注意

  • 選択したモデルが特定のフィールド(例: verbosity)をサポートしない場合、それらは無視されます。

  • API キーはログに出力しません。.env はコミットしないでください。

MCP Serverの使い方

このサーバーは Model Context Protocol (MCP) の標準入出力(stdio)で動作します。純粋な JSON のみを stdout に出力する設計のため、MCP Inspector / Claude Code / Claude Desktop で安全に接続できます。

前提

  • Node.js 18+

  • OpenAI APIキーが .env もしくは環境変数で設定されていること

  1. ビルド

pnpm run build
  1. 直接起動(推奨)

  • コマンド: node

  • 引数: dist/cli.js

  • CWD: リポジトリのルート(.env を読む場合は必須)

例:

node dist/cli.js
  1. Claude Code(VS Code 拡張)に追加

  • VS Code のコマンドパレット → 「Claude: Manage MCP Servers」

  • 「Add server」で次を入力:

    • Name: gpt5-mcp

    • Command: node(絶対パス可)

    • Args: ["/絶対/パス/gpt5-mcp-server/dist/cli.js"](グローバル導入済みなら不要)

    • Env(どちらか一方):

      • オプションA(ENV_FILE): ENV_FILE=/絶対/パス/gpt5-mcp-server/.env

      • オプションB(明示指定): OPENAI_API_KEYOPENAI_MODELOPENAI_TIMEOUT_MSDEFAULT_VERBOSITYREASONING_EFFORTWEB_SEARCH_DEFAULT_ENABLEDWEB_SEARCH_CONTEXT_SIZE

  1. 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"
      }
    }
  }
}
  1. CLI の利用

  • パッケージには bin が含まれます。

    • ローカルリンク: npm link 後に gpt5-mcp-server

    • グローバル(公開後): npm i -g gpt5-mcp-servergpt5-mcp-server

    • 直接実行: node /絶対/パス/gpt5-mcp-server/dist/cli.js

  1. Web Search に関する注意

  • OpenAI の制約により、web_search_previewreasoning.effort = minimal と併用できません。

  • 本サーバーは web_search.enabled = true の場合、自動的に effort を medium に引き上げて呼び出します。

  • もし minimal を厳格に使いたい場合は、web_search.enabled = false にしてください。

  1. トラブルシューティング

  • JSON パースエラー(Unexpected token ...)

    • stdio に余計な出力が混ざっている可能性があります。node dist/cli.js を使い、npx は避けてください。

    • .env 読み込みやライブラリのログは既に抑止済みです。

  • 認証エラー

    • OPENAI_API_KEY が正しく渡っているか確認。

  • タイムアウト

    • OPENAI_TIMEOUT_MS を増やす(例: 120000)。

  • Web Search で 400 エラー

    • reasoning.effort=minimalweb_search の併用不可が原因。自動的に medium に上げますが、明示的に medium を指定するか、web_search を無効化してください。

Available Tools

1 tool
gpt5_queryC

Query GPT-5 with optional Web Search Preview. Supports verbosity and reasoning effort.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputYes

TDQS

C2.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters1/5

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.

Purpose3/5

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.

Usage Guidelines2/5

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. 1 tool updatev1.0.0
    • Changedgpt5_query2 fields changed
      • addedInput schema / $schema
        Added value: +"http://json-schema.org/draft-07/schema#"
      • addedInput schema / additionalProperties
        Added value: +false
  2. 1 tool update
    • First observedgpt5_query

TDQS

C2.7/5.0

Scored across 1 tool

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.
    201
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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
    -
  • A
    license
    A
    quality
    C
    maintenance
    Provides 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.
    1
    24
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Integrates 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.
    16
    MIT

Latest Blog Posts

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