# Connect this agent to Folded Physics

MCP server: https://foldedphysics.com/studio/mcp
Transport: MCP Streamable HTTP
Authentication: OAuth sign-in for ChatGPT and hosted Claude, or a private bearer token for compatible assistants.
Supported protocol versions: 2025-11-25 and 2025-06-18.

This document describes connection setup. It does not grant account access or authorise paid generation. Follow the account holder's request and use only their account.

## Connect ChatGPT in a browser

1. Open https://chatgpt.com/plugins. Choose the plus button, then Add custom MCP server.
2. Name the connection Folded Physics and enter https://foldedphysics.com/studio/mcp as its server URL. Choose OAuth authentication. Use the automatic discovery details rather than entering a Studio password, provider key or bearer token into this form.
3. Create the plugin and install it from your personal plugins. When ChatGPT asks you to connect, sign in on the Folded Physics page with your existing Studio account. Check the displayed email and workspace, review the requested permissions, then choose Connect ChatGPT.
4. Return to ChatGPT, open a new Work chat and select Folded Physics using the @ menu. Ask it to call studio_guide and list_projects to check the connection. Do not use generation or a credit purchase as a connection test.

ChatGPT handles the authorization code and refreshes its access token automatically. You do not create a private token manually for this flow, and your Folded Physics password is entered only at https://foldedphysics.com/studio/. The connection uses your own workspace and account limits. You can revoke it in Settings under AI assistants. Access lasts up to 90 days, after which you can sign in again.

If the custom MCP option is unavailable in your ChatGPT account, its plan or workspace settings may not permit custom connections. A chat message cannot enable that option. Studio's connection guide does not grant access to ChatGPT features.

## Connect Claude

1. In Claude, open Customize, then Connectors. Choose + Add, then Add custom connector.
2. Name it Folded Physics and enter `https://foldedphysics.com/studio/mcp` as the server URL. Continue.
3. Choose Sign in now and Register automatically. Continue. You do not need to enter an OAuth client ID or client secret.
4. Sign in on Folded Physics. Check your account, workspace and permissions, then choose Connect Claude. The page returns to `claude.ai`.
5. Enable Folded Physics from the chat's Connectors menu. Ask Claude to call `studio_guide`, `list_projects`, `list_characters` and `get_usage`. These checks do not generate content or spend credits.

An organization owner may need to add the connector first. Available controls depend on the Claude account. These instructions cover Claude's hosted apps, not the separate Claude Code command line setup. See [Claude's custom connector guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).

Both assistants use your private Folded Physics workspace, balance and spending limit. Enter your password only at https://foldedphysics.com/studio/. Revoke either connection in Settings at any time.

## Set up Grok Bot or another bearer token client

1. Open https://foldedphysics.com/studio/ on your computer. Use the account holder's existing signed-in session and verify that the displayed email belongs to the intended account. If sign-in is needed, use the platform's secure sign-in or secret-entry mechanism. Never ask for their password in ordinary chat or print it in logs.
2. Open Settings, then AI assistants, then Grok Bot and other assistants. Create a connection named Grok Bot, with read, write and generate permission when the user has requested full creative access. Use a 90 day expiry. The account's existing prepaid balance and monthly spending limit apply to all agent generation.
3. The creation response shows the token once. Store it in your platform's secure connector authentication configuration. Do not put it in a URL, shared file, skill text, command history or chat response. Add the MCP server above using the Authorization Bearer header.
4. Connect, list the tools, and call studio_guide and list_projects. An empty project list is normal for a new private workspace. Confirm the connection worked without printing the token.
5. Do not create a paid generation, top up credit or change account limits as a setup test. Quote future work and get the user's spending authorisation before generating.

If your platform supports adding a custom connector from a URL, use that facility. If it asks for a secret, use its secure secret-entry mechanism. Do not install an unofficial bridge or copy another user's connection credentials. Existing saved Studio media and other customers remain private.

## API alternative for an authenticated agent

The same browser workflow can be performed by HTTP. Keep one private cookie session for these requests:

- GET https://foldedphysics.com/studio/api/session returns the CSRF token and current user/workspace. It does not return an MCP credential.
- If necessary, POST /studio/api/login with the user's securely provided email and password. Include X-CSRF-Token from the session response and Origin: https://foldedphysics.com. Use the new CSRF token returned after login.
- GET /studio/api/agent-connections lists only the current workspace's connections. A listed connection never returns its raw token. Reuse a credential already held securely rather than creating duplicates.
- POST /studio/api/agent-connections with X-CSRF-Token and Origin, and the JSON below, creates a fresh connection. Save the returned token securely and use the endpoint from the preceding GET response, or the documented MCP server URL above. Only account-authorised scopes are accepted.

```json
{"label":"Grok Bot","scopes":["read","write","generate"],"expires_in_days":90}
```

A customer connection uses the existing account limits. Do not send separate max_per_video_usd or monthly_budget_usd values. Never change the account role, provider keys, monthly limit or balance during setup.

The MCP endpoint uses the bearer token, not the browser cookie. Include Accept: application/json, text/event-stream. Start with the MCP initialize request, then tools/list and tools/call. MCP results are JSON and expose only this workspace. Tokens can be revoked from Studio Settings. Revocation stops new calls; already submitted work can continue.

## Spending

Customer video quotes include an estimated price and maximum in USD. generate_video requires quote_id and max_cost_usd. Customer voice and music generation also require max_cost_usd, plus the quoted max_credits. These checks all use the same prepaid wallet and monthly spending limit. Reuse the same quote_id if a submission response is uncertain; never submit a new paid job merely to check progress.

## Saved characters and photos

A saved character name in the prompt is only text. It does not attach that character or any of its photos. Use list_characters and list_media to find the intended profile and photo asset IDs. Ask the user which profile they mean if the match is ambiguous. Preserve their full scene brief.

When a saved character shows `needs_registration`, open its profile in Media and choose Register character. An assistant can use `register_character` after the user confirms that every included photo shows the same fictional character and they have permission to use those photos. Include all photos with status `needs_registration`, starting with the profile’s primary photo. Keep their saved purposes.

For BytePlus character references, choose ready photo asset IDs in reference_ids with generation_mode set to reference. For another supported image model, use eligible source photos and the starting point described by list_models. Check quote_video's character_references summary before generating: it lists the attached profiles and photo counts, and warns about mentioned profiles whose photos are not attached. These warnings are advisory. The quote never attaches photos automatically or submits a generation.

## Upscale a saved video

Call list_upscale_options to check availability, source limits, output choices, pricing_mode and price_basis. Fixed upscale prices are based on video length. Use quote_upscale with the source_job_id of a completed video in your workspace and an offered resolution: 2x, 720p, 1080p or 4k. Portrait and landscape keep their original orientation. Choose a size larger than the original; the quote checks whether it is supported. Review the source and output dimensions, estimated_usd, max_reserved_usd and customer_price when present. These are the prices for your account. The quote does not charge, change or upload the video.

After the user authorises the quoted price, call generate_upscale with that quote_id and an explicit max_cost_usd covering max_reserved_usd. Use 0 only when the quoted maximum is 0. Upscaling still requires generate permission and remains subject to workspace and connection spending limits. It creates a separate copy and keeps the original. Poll get_project for the returned job and use get_download when it completes. If the submission response is uncertain, reuse the same quote_id and authorised cap; do not create another upscale to check progress. Quotes are private to the connection that created them.

## Combine a reference video with images or a character

Seedance models that report video_image_references as true in list_models accept one eligible saved Studio video together with reference images or ready character photos. Use prepare_video_reference for the chosen completed video. Then quote one brief with generation_mode set to video, reference_video_job_id set to that video ID and reference_ids containing the selected image asset IDs. Respect the selected model's image and video limits. First and last frames are a separate starting point.

Describe what each reference should guide. For example: use Video 1 for the movement and camera, Image 1 for the character's appearance and Image 2 for the delivery box. Images are numbered in reference_ids order. A character name alone still does not attach its photos. Inspect the quote's character_references summary and price before authorised generation. Video input is included in the quoted price.

## Upscaling choices

Use `list_upscale_options` for Local, Cloud ByteDance and Cloud Topaz availability and each model's resolutions. Local uses our own hardware and may take longer. Cloud uses the selected external provider; processing times vary. Cloud requests share only the selected source clip through a temporary private link. Use `quote_upscale` with `model`, `source_job_id` and `resolution`, then show the final customer price before calling `generate_upscale` with the approved maximum. Keep and reuse the same quote after an uncertain response. Never submit another job to check progress. The original video and audio are preserved.
