Wrapper
by rnaefe
README.md
# ChatGPT Wrapper
**I ran out of Codex usage, so I literally wrapped ChatGPT.**
Connect your own ChatGPT account to coding agents through **MCP**. Wrapper runs locally, queues tasks in SQLite and sends requests over HTTP. Use your own ChatGPT web session; no automated browser runtime or Chromium installation is needed.
## Current source status
Version **0.7.0-dev.2 is unpublished**. One live public text task completed through production MCP, web HTTP preparation/message submission, `v1` SSE decoding and SQLite persistence in **4.767 seconds**. The successful session required a fresh cookie and matching short-lived Sentinel bundle. Cookie login and refresh are fixture-covered and passed one isolated live check with a matching captured cookie, User-Agent and model; no message was submitted, and remote logout remains unverified. Login without a captured User-Agent received HTTP 403 from ChatGPT's web session endpoint. A photo-stage file registration, signed upload and acknowledgement completed (HTTP 200, 201 and 200), but the conversation POST returned HTTP 403 while the captured requirements had about 65 seconds remaining by their recorded expiry. No retry was attempted; this does not establish why the provider rejected it. Model-side file or image recognition remains unverified. Search, image generation/analysis/editing and conversation continuation lack live capability evidence. See the [capability evidence matrix](docs/CAPABILITY_STATUS.md) and [HTTP transport details](docs/HTTP_TRANSPORT.md).
Published npm 0.6.0 predates this HTTP-only migration. Build the current source using [source installation](docs/INSTALLATION.md), then configure web authentication:
```sh
# First-time setup uses an existing signed-in ChatGPT browser session.
node dist/cli.js auth login --cookie-stdin --model "MODEL_SLUG" < /absolute/path/private-cookie.txt
node dist/cli.js auth-status
node dist/cli.js status
```
`auth` verifies the existing web session. The existing `auth --token-stdin` path accepts a bearer credential through standard input. `auth login` reads a full ChatGPT browser-session Cookie header from standard input; it does not accept an email/password or open a browser. Replace `MODEL_SLUG` with the backend model slug from your own session. If required by your session, pass `--user-agent` with the value captured from that same authorized ChatGPT request; it is stored and reused by refresh/logout. The command validates the cookie through ChatGPT's web session and identity endpoints, then stores the cookie and bearer in the private session file. Keep any file or pipe used for cookie input private and never paste credentials into chat or command arguments.
`auth refresh` obtains a fresh bearer using the stored cookie and updates the private session file. It does not refresh Sentinel requirements, proof, or conduit values; a task may still need a fresh authorized capture. `auth-status` reports local configuration only and does not test whether ChatGPT will accept a message. See [HTTP transport details](docs/HTTP_TRANSPORT.md) for logout and session limitations.
## What it does
- MCP task submission, status, waiting, cancellation and result retrieval.
- Durable SQLite tasks and batches, progress snapshots and local diagnostics.
- Direct HTTP requests using a private ChatGPT web session.
- Selected file and image transfer has a live registration/upload/acknowledgement check. Search and image generation/analysis/editing have candidate HTTP paths with fixture coverage; model-side behavior remains unverified.
- Backend model-slug selection and conversation-parent verification before follow-ups.
- Explicit failures without automatic prompt retries or browser fallback.
```mermaid
flowchart LR
A[Coding agent] --> B[MCP server]
B --> C[Local SQLite queue]
C --> D[HTTP worker]
D --> E[ChatGPT web endpoint]
E --> F[Validated result]
F --> A
```
Wrapper returns results to your MCP client; the client handles planning, source files, applying changes and reviewing generated output. Wrapper does not execute generated code or edit your repository.
## Useful commands
After building the source:
```sh
node dist/cli.js doctor
node dist/cli.js status
node dist/cli.js watch <task-id>
node dist/cli.js stop
```
`auth-status` shows safe local web credential configuration without tokens or a network request. `node dist/cli.js auth logout` signs out the stored ChatGPT session wherever its cookies are used and removes local credentials only after remote signout succeeds. `auth logout --local-only` removes local credentials without contacting ChatGPT. `get_status` reports provider `chatgpt-web-api` and HTTP transport. `api-import --har /absolute/path/capture.har` imports HAR; `api-import --capture /absolute/path/capture.txt` imports Network text; and `api-import --capture /absolute/path/capture.proxymanlogv2` imports a Proxyman archive. Keep captures private; fresh captures may be needed as requirements expire.
Treat HAR captures, session files and local tokens as credentials. Prompts and results remain in the private task store; prompts are sent to ChatGPT. Account limits and verification requirements still apply. [Security and privacy](docs/SECURITY.md).
User-supplied image URLs require exact host entries in `ALLOWED_IMAGE_HOSTS`. Signed URLs returned by the authenticated ChatGPT file endpoints accept the observed one-label `*.oaiusercontent.com` hosts by default; exact per-direction overrides are available for other hosts. HTTPS on the standard port and redirect refusal apply to both flows. ChatGPT credentials are never sent to asset hosts.
## Documentation
- [Install, configure, update or uninstall](docs/INSTALLATION.md)
- [HTTP setup, evidence and limitations](docs/HTTP_TRANSPORT.md)
- [Capability status and live evidence](docs/CAPABILITY_STATUS.md)
- [Use the MCP tools](docs/MCP.md)
- [Troubleshooting](docs/TROUBLESHOOTING.md)
- [Architecture](docs/ARCHITECTURE.md)
- [Roadmap](docs/ROADMAP.md)
- [Contributing](CONTRIBUTING.md)
Report problems with a minimal public reproduction; never attach credentials, HAR captures or private task data. [Open an issue](https://github.com/rnaefe/chatgpt-wrapper/issues/new/choose) · [Report a security issue privately](https://github.com/rnaefe/chatgpt-wrapper/security/advisories/new).
Licensed under **[GPL-3.0](LICENSE)**.
This server cannot be deployed
Maintenance
ActivityNo data
ResponsivenessOutdated data