FreeMyGPT — HTTP gateway that lets ChatGPT (and any LLM) drive any local MCP server via simple GET requests. Hybrid: MCP stdio backends by default, Codex CLI and other runtimes via bundled adapters.
Project description
FreeMyGPT
Free ChatGPT from its sandbox. FreeMyGPT is a tiny HTTP gateway that lets ChatGPT (and any other LLM with an HTTP fetcher) drive any local MCP server — Gr0m_Mem, Codex CLI, Kali MCP, Home Assistant MCP, or anything else that speaks the Model Context Protocol — using nothing but simple GET requests. No Custom GPT Actions, no GitHub plugin, no OAuth dance, no POST bodies.
ChatGPT ──GET──► FreeMyGPT ──stdio──► MCP server (any)
└─────► Codex CLI (subprocess)
Why
- ChatGPT's built-in browse tool can read URLs but cannot send POST requests or custom headers. Everyone else's "let ChatGPT call your API" guide assumes Custom GPT Actions. FreeMyGPT assumes you do not have that option.
- Local MCP servers are powerful (Gr0m_Mem, the Kali server, Home Assistant, Codex) but they only speak stdio. They cannot be reached from a ChatGPT conversation by default.
- FreeMyGPT is the thinnest possible layer between them: a FastAPI app that spawns each MCP server on first use, forwards
call_toolrequests, and returns the result as JSON in the HTTP response. Bearer token auth via?token=…query param so ChatGPT can pass it without setting headers.
Architecture
- HTTP frontend (FastAPI, stdio) — GET-only, JSON responses
- Hybrid backends:
mcp— any stdio MCP server (officialmcpPython SDK client)codex— bundled wrapper that spawnscodex exec <prompt>and exposes a singlechattool, so Codex looks like any other MCP backend from the HTTP side
- Bearer token auth — required on every endpoint except
/healthz, read from an env var, matched in constant time - Session store — SQLite; stores chat transcripts so ChatGPT can poll long-running sessions without losing history
- One config file — YAML with an
authblock and abackendsmap; seeconfig.example.yaml
HTTP surface
GET /healthz (no auth)
GET /backends ?token=...
GET /{backend}/tools ?token=...
GET /{backend}/call/{tool} ?token=...&arg1=...&arg2=...
GET /{backend}/sessions/new ?token=...&label=...
GET /{backend}/sessions/{sid}/send ?token=...&message=...
GET /{backend}/sessions/{sid}/poll ?token=...&since=<id>
GET /{backend}/sessions/{sid}/close ?token=...
Tool arguments are passed as query parameters. Simple scalars (strings, ints, floats, bools) are coerced automatically. For structured arguments, pass them as a JSON blob in args_json:
GET /gr0m_mem/call/mem_record_decision?token=...&args_json={"subject":"db","decision":"Postgres","rationale":"concurrent writes"}
Base64 string and file arguments
ChatGPT's built-in browse tool can only emit GET requests with URL-safe query strings, so callers can't upload binary files or send text that contains reserved characters (&, =, %, newlines) directly. FreeMyGPT accepts base64 through two reserved suffix conventions:
?foo_b64=<urlsafe-b64>— decoded as a UTF-8 string and assigned toargs["foo"]. Use for long text payloads or content with reserved URL characters.?foo_file_b64=<urlsafe-b64>— decoded as raw bytes. Assigned toargs["foo"]as{"bytes": b"...", "name": str, "mime": str, "size": int}. Companion params?foo_file_name=and?foo_file_mime=are optional metadata.
Both accept standard Base64 (+//) and URL-safe Base64 (-/_), padded or unpadded. Binary bytes in a *_b64 param (not *_file_b64) return a 400 with a clear pointer at the correct form.
Example — sending a PNG to a tool that builds a captioned image:
# PNG bytes are base64-encoded first:
IMG=$(base64 -i hero.png | tr -d '\n')
# Then sent as a single GET:
curl -G "https://<tunnel>/mytool/call/caption" \
--data-urlencode "token=<yours>" \
--data-urlencode "image_file_b64=$IMG" \
--data-urlencode "image_file_name=hero.png" \
--data-urlencode "image_file_mime=image/png" \
--data-urlencode "caption=release day"
If both a plain value and its base64 variant are sent for the same key, the base64 form wins (explicit intent) and the plain form is preserved under <key>_plain for debugging.
Quick start
pip install freemygpt
# 1. Make a token
export FREEMYGPT_TOKEN="$(freemygpt new-token)"
# 2. Write a config
mkdir -p ~/.freemygpt
cp $(python -c "import freemygpt, os; print(os.path.join(os.path.dirname(freemygpt.__file__), '..', '..', 'config.example.yaml'))") ~/.freemygpt/config.yaml
# edit to enable the backends you want
# 3. Sanity check
freemygpt doctor
# 4. Run
freemygpt serve --host 127.0.0.1 --port 8933
Exposing it to ChatGPT
ChatGPT needs to reach the gateway over the public internet. Pick any reverse tunnel:
Option A — Cloudflare Tunnel (recommended, free, no account required for quick tunnels)
brew install cloudflared
cloudflared tunnel --url http://127.0.0.1:8933
Cloudflared prints a https://<random>.trycloudflare.com URL. Paste it into your ChatGPT conversation with the token appended:
https://<random>.trycloudflare.com/gr0m_mem/call/mem_wakeup?token=<your token>
ChatGPT will browse the URL and inline the JSON response.
Option B — Tailscale Funnel
If your machine is already on Tailscale, enable Funnel on port 8933 and use the *.ts.net hostname. Token auth still applies.
Option C — ngrok
ngrok http 8933
Same idea.
Using it from a ChatGPT conversation
Once the URL is live and the token is in the query string, a ChatGPT conversation looks like:
You: Fetch
https://tunnel.example.com/gr0m_mem/call/mem_wakeup?token=XYZand summarize the response.ChatGPT: (browses the URL, receives the JSON snapshot) You're Michael, a software engineer on macOS; active project is the FreeMyGPT launch; recent decisions locked in: Postgres for the database (concurrent writes), Clerk over Auth0 (better DX), SQLite FTS5 is the zero-dep default for Gr0m_Mem.
Because the responses are plain JSON, any LLM with an HTTP fetcher (Claude browsing, Gemini's google_search_retrieval, local Llama with a URL-fetching tool, etc.) can use the exact same URLs.
Security posture
- Bearer token required on every authenticated endpoint, compared in constant time
- Gateway refuses to start if the configured env var is empty
- Every backend runs as a subprocess of the gateway — no network listener exposed
- Session state in SQLite with
PRAGMA foreign_keys=ON; sessions delete their messages on close SECURITY.mddocuments private vulnerability reporting via GitHub advisories- Branch protection on every long-lived branch (no force pushes, no deletions, linear history)
- CI runs ruff, mypy
--strict, and the full test suite on every push
See SECURITY.md for the full disclosure policy and out-of-scope list.
Status
v0.1.0 alpha. API surface is stable; the wire format ({"text": ..., "structured": ..., "is_error": ...}) is not expected to change. Breaking changes will bump the minor version until v1.0.
License
MIT — see LICENSE.
Contact
Maintained by Michael Adam Groberman.
- GitHub: @MichaelAdamGroberman
- LinkedIn: michael-adam-groberman
For security reports, use GitHub private vulnerability advisories (see SECURITY.md) — do not use LinkedIn DMs for sensitive disclosures.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file freemygpt-0.1.1.tar.gz.
File metadata
- Download URL: freemygpt-0.1.1.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d2ff3ff72f8990ddfbd105d4e6dd3ed406f864a2c677ac9924bd4003241d39
|
|
| MD5 |
3e16b990962ed36d141efdfa97b1f299
|
|
| BLAKE2b-256 |
0547805bf8112ca75b4220ab902a7c959a0db1ecf9b8d7db5fb7738dcf01a207
|
Provenance
The following attestation bundles were made for freemygpt-0.1.1.tar.gz:
Publisher:
release.yml on MichaelAdamGroberman/FreeMyGPT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freemygpt-0.1.1.tar.gz -
Subject digest:
89d2ff3ff72f8990ddfbd105d4e6dd3ed406f864a2c677ac9924bd4003241d39 - Sigstore transparency entry: 1259258948
- Sigstore integration time:
-
Permalink:
MichaelAdamGroberman/FreeMyGPT@53902560806ef88d5d2671c3c7509e7de54fc032 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MichaelAdamGroberman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@53902560806ef88d5d2671c3c7509e7de54fc032 -
Trigger Event:
push
-
Statement type:
File details
Details for the file freemygpt-0.1.1-py3-none-any.whl.
File metadata
- Download URL: freemygpt-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5be6745aa6f4752a855b64fc7684811fdbd8873e320e3572ea4e55423a5dc394
|
|
| MD5 |
5a72a27af59b4e0ce42a5284a768cc59
|
|
| BLAKE2b-256 |
795105200acb400de8346c7ee95697a4fa252f00acf4341fa135ae0ee151d5fc
|
Provenance
The following attestation bundles were made for freemygpt-0.1.1-py3-none-any.whl:
Publisher:
release.yml on MichaelAdamGroberman/FreeMyGPT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freemygpt-0.1.1-py3-none-any.whl -
Subject digest:
5be6745aa6f4752a855b64fc7684811fdbd8873e320e3572ea4e55423a5dc394 - Sigstore transparency entry: 1259259183
- Sigstore integration time:
-
Permalink:
MichaelAdamGroberman/FreeMyGPT@53902560806ef88d5d2671c3c7509e7de54fc032 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MichaelAdamGroberman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@53902560806ef88d5d2671c3c7509e7de54fc032 -
Trigger Event:
push
-
Statement type: