setup-chatgpt

A setup command for an MCP server that lets Claude Code ask ChatGPT for mathematical second opinions during Lean 4 formalisation.

In plain words
What is it for?
Use it to configure the server and its command for sending self-contained mathematics questions.
Why use it?
It gives you another source of advice when checking a mathematical claim, choosing a proof approach, finding Mathlib APIs, or getting unstuck.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/cbirkbeck/mathlib-quality/setup-chatgpt
Clone the repo
git clone --depth 1 https://github.com/CBirkbeck/mathlib-quality
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,649 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.02649
Opus 5 $0.00008 $0.01324
Sonnet 5 $0.00003 $0.00530
Haiku 4.5 $0.00002 $0.00265

Measured 2d ago against content hash e2cd039af5c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-chatgpt scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { execFile } from "node:child_process";
commands/setup-chatgpt.md · 309 lines

How it starts

The opening of the file, as written. The whole thing — 309 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/setup-chatgpt - Set Up the ChatGPT MCP Server

Set up an MCP server that lets Claude Code query ChatGPT for mathematical second opinions during Lean 4 formalization work.

Usage

/setup-chatgpt

No arguments needed. This command will guide you through setup.

What This Does

The chatgpt-math MCP server provides a single tool:

  • ask_chatgpt_math - Ask ChatGPT a self-contained mathematics question. Useful for getting a second opinion on proof strategies, verifying mathematical claims, finding Mathlib API hints, or getting unstuck on formalization problems.

Parameters:

  • question (required) - The mathematical question. Must be self-contained with all definitions, context, and notation included.
  • model (optional) - Model to use. Default: gpt-5.6-sol.
  • reasoning_effort (optional) - minimal, low, medium, high, xhigh, or max (default). Always use the highest the model supports; the ceiling is model-specific — gpt-5.4 tops out at xhigh, gpt-5.6-sol supports max.

Prerequisites

  1. ChatGPT desktop app (Codex CLI) - The server calls ChatGPT via the Codex CLI bundled with the ChatGPT desktop application.

    • macOS: Install from https://chatgpt.com/download (or the Mac App Store).
    • After install, the binary should be at: /Applications/ChatGPT.app/Contents/Resources/codex or /Applications/Codex.app/Contents/Resources/codex.
    • You must be signed in with a ChatGPT Plus/Pro subscription.
  2. Node.js (>= 18) - The MCP server runs on Node.js.

    node --version   # Should be >= 18
    

Setup Workflow

Step 1: Find the Codex Binary

Locate the Codex CLI binary. Check these paths in order:

ls /Applications/ChatGPT.app/Contents/Resources/codex 2>/dev/null
ls /Applications/Codex.app/Contents/Resources/codex 2>/dev/null

If neither exists, tell the user to install the ChatGPT desktop app first. Store the path as CODEX_BIN.

Step 2: Create the MCP Server

Read the full file on GitHub · 309 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 309 lines · 16 tokens per session scan A e2cd039af5c2

Subscribe to this mod's changes

setup-chatgpt is a command published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 13d ago), licensed MIT. It adds 16 tokens to every session and 2,649 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.