gpt2agent CLAUDE.md

Repository instructions for gpt2agent, an MCP server that exposes ChatGPT account features to MCP clients. They describe its Python code, tools, tests, server command, and rules for handling temporary sessions and tokens.

In plain words
What is it for?
Building and testing gpt2agent, locating its tool modules, starting the server, and preserving its token and session safeguards.
Why use it?
They help contributors understand the project structure and avoid breaking feature restrictions or exposing account credentials.

Instructions file

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 instructions/robotlearning123/gpt2agent/claude-md
Clone the repo
git clone --depth 1 https://github.com/robotlearning123/gpt2agent
Per session 441 This file is loaded in full into every session.
When invoked 441 The same file — it is already loaded in full.
Security scan A 0 findings. 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.00441 $0.00441
Opus 5 $0.00220 $0.00220
Sonnet 5 $0.00088 $0.00088
Haiku 4.5 $0.00044 $0.00044

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

Security

Grade A, and why

gpt2agent CLAUDE.md scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 34 lines

What it actually says

gpt2agent

MCP server exposing full ChatGPT Plus/Pro account features to any MCP client.

Build & Test

pytest                    # full suite must pass; live/network tests auto-skip (SKIP_LIVE)
python -m gpt2agent run   # start MCP server (stdio)

Key Files

  • gpt2agent/server.py — MCP tool registration (25 tools), config loading
  • gpt2agent/sse.py — Async SSE client for /backend-api/conversation (chat, DR, agent, image gen, code interpreter, canvas)
  • gpt2agent/backend.py — Sync HTTP client (curl_cffi), token management, sentinel challenges
  • gpt2agent/tools/ — 10 tool modules (19 of the 25 tools; the 6 SSE chat/DR/agent tools live in server.py), each with register(mcp, client, conv=None)
  • gpt2agent/sentinel.py — POW + Turnstile solver
  • gpt2agent/install.pygpt2agent install subcommand

Critical Invariants

  • temporary=True sets history_and_training_disabled=True, which blocks image gen, code interpreter, canvas, and memory persistence. Tools that need these features MUST pass temporary=False.
  • Token reloaded from ~/.codex/auth.json or ~/.gpt2agent/token.json on each request (mtime check).
  • Never commit credentials, tokens, or .env files.
  • BackendClient is synchronous. Async tools must wrap sync calls in asyncio.to_thread().

Adding Tools

  1. Create gpt2agent/tools/<name>.py with register(mcp, client, conv=None).
  2. Add to tools/__init__.py register_all().
  3. SSE-based tools: use the conv singleton (passed from server.py).
  4. REST-based tools: use client directly (or asyncio.to_thread(client.get, ...) from async handlers).
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 · 34 lines · 441 tokens per session scan A dfe703ea86f0

Subscribe to this mod's changes

gpt2agent CLAUDE.md is an instructions file published in the GitHub repository robotlearning123/gpt2agent (47 stars, last pushed 1mo ago), licensed MIT. It adds 441 tokens to every session, about $0.0022 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.