Use Attach Files with ChatGPT

ChatGPT connects through a remote MCP HTTP endpoint. During migration, the existing AgentFiles compatibility endpoint may still be used where it is configured.

1. Add the MCP endpoint

In ChatGPT, go to Settings → Connected apps and add a new MCP connector. Paste the configured compatibility endpoint URL:

text
https://mcp.agentfiles.io/mcp

ChatGPT will discover the OAuth configuration automatically. No API key is needed.

2. Sign in

When you add the endpoint, ChatGPT will redirect you to sign in with your Attach Files account. After authenticating, ChatGPT is connected and can use all Attach Files tools.

i

First time?

If you don't have an Attach Files account yet, the sign-in flow will create one automatically. You can also set up the CLI first with attach setup if you want to configure your namespace before connecting ChatGPT.

3. Start using tools

Once connected, ChatGPT can publish artifacts, read existing ones, and hand off work to other runtimes like Claude Code and Codex. Your default namespace is detected automatically from your account.

Try asking ChatGPT to list your recent artifacts or publish a test handoff. For the full tool list, see the MCP reference.

Self-hosted endpoint

If you prefer to run the MCP HTTP transport yourself, start it locally and expose it over HTTPS:

bash
npx -y --package agentfiles-mcp@latest agentfiles-mcp-http --port 8787

Put it behind a reverse proxy with TLS, then point ChatGPT at https://<your-host>/mcp. For OAuth to work, configure these environment variables:

bash
AUTH0_DOMAIN=your-tenant.us.auth0.com
AUTH0_OAUTH_AUDIENCE=https://your-host/mcp
AUTH0_CLIENT_ID=your-auth0-client-id
AUTH0_CLIENT_SECRET=your-auth0-client-secret
AGENTFILES_MCP_PUBLIC_URL=https://your-host

How auth works

ChatGPT discovers OAuth metadata from the MCP server's .well-known/oauth-protected-resource endpoint. It registers a dynamic client, completes authorization through Auth0, and receives an access token. All subsequent tool calls use this token automatically. Your namespace is detected from your account so tools work without extra configuration.