From a1f4643b90b54f8b26794b48dda97311dce7b56c Mon Sep 17 00:00:00 2001 From: jubnl Date: Tue, 5 May 2026 15:37:59 +0200 Subject: [PATCH] docs: document ChatGPT MCP + Cloudflare Bot Fight Mode issue --- wiki/MCP-Setup.md | 10 ++++++++++ wiki/Troubleshooting.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/wiki/MCP-Setup.md b/wiki/MCP-Setup.md index 2ff069ea..1d4dc6c0 100644 --- a/wiki/MCP-Setup.md +++ b/wiki/MCP-Setup.md @@ -41,6 +41,16 @@ Claude Desktop connects via `mcp-remote`. After creating an OAuth client using t When the client starts it opens your browser to the TREK consent screen to complete the OAuth flow. +### ChatGPT + +ChatGPT's custom MCP connector supports Dynamic Client Registration (DCR) — no pre-created client is required: + +1. In ChatGPT, open **Settings → Connected Apps → Add a custom app**. +2. Set the **MCP Server URL** to `https:///mcp`. +3. ChatGPT will automatically discover TREK's OAuth metadata, register itself, and redirect you to the TREK consent screen to approve access. + +> **Cloudflare users:** If your TREK instance is behind Cloudflare and you are on the **free plan**, you must disable **Bot Fight Mode** (`Security → Bots → Bot Fight Mode → Off`). ChatGPT's backend uses a Python HTTP client (`aiohttp`) whose TLS fingerprint is classified as a bot by Cloudflare. Because the free plan does not support path-based bot exceptions, the feature must be disabled globally. On **Pro and above**, create a WAF custom rule (position #1) that skips Bot Fight Mode for paths `/oauth/*`, `/.well-known/*`, and `/mcp`. + ### Cursor, VS Code, Windsurf, and Zed Clients that support `mcp-remote` can connect in one of two ways. diff --git a/wiki/Troubleshooting.md b/wiki/Troubleshooting.md index aae97181..98f63c98 100644 --- a/wiki/Troubleshooting.md +++ b/wiki/Troubleshooting.md @@ -240,6 +240,37 @@ Restart the container after adding the variable. Once set, clicking **Connect** --- +## ChatGPT MCP connector: "Dynamic client registration failed" / 403 + +**Cause:** ChatGPT's MCP backend runs on OpenAI's datacenter IPs and uses a Python HTTP client (`aiohttp`). Cloudflare's **Bot Fight Mode** identifies the TLS fingerprint of this client as bot traffic and blocks the request at the edge — before it ever reaches your server. Because the request is dropped by Cloudflare, nothing appears in TREK's logs. + +This affects the OAuth Dynamic Client Registration (`/oauth/register`), the `/mcp` endpoint, and the OAuth metadata endpoints (`/.well-known/*`). + +**Fix — Cloudflare free plan:** + +Disable Bot Fight Mode entirely: + +**Security → Bots → Bot Fight Mode → Off** + +The free plan does not support path-based exceptions, so the feature must be turned off globally. Your TREK data remains protected by its own authentication — Bot Fight Mode is not a substitute for application-level auth. + +**Fix — Cloudflare Pro and above (Super Bot Fight Mode):** + +Create a WAF custom rule at **position #1** (rules fire in order — it must be first): + +``` +Expression: + (http.request.uri.path contains "/oauth/") or + (http.request.uri.path contains "/.well-known/") or + (http.request.uri.path eq "/mcp") + +Action: Skip → All remaining custom rules + Bot Fight Mode +``` + +Ensure the **"Bot Fight Mode"** checkbox in the Skip action is checked, not just "All remaining custom rules." + +--- + ## MCP integration: "Too many requests" or "Session limit reached" **Cause:** Each user is limited to 300 MCP requests per minute and 20 concurrent sessions by default. Exceeding either limit returns a `429` response.