Partner API base path is /api/v1 on https://api.dcast.pro. This site documents the live surface; use the Quickstart QA curls to validate keys and routes.

Connect Codex to DCAST

Let OpenAI Codex work in your DCAST account from the terminal: import videos, create live streams, make videos paid and put players on your website. DCAST is a remote MCP server at https://api.dcast.pro/mcp. Codex signs in to it with your DCAST account, and you choose how much it may do.

What you need

  • A DCAST account at dcast.pro. Every plan can connect, including the free one. What the agent can do follows your plan exactly as on the website and in the API: storage, streaming hours and features.
  • Codex CLI on your computer. OpenAI documents that the Codex extension for code editors uses the same configuration.

Set up the connection

In a terminal, run the command below. Codex adds the dcast server and opens the DCAST sign-in page in your browser. If no browser opens, sign in with codex mcp login dcast --no-browser as described under "On a server or over SSH" below.

codex mcp add dcast --url https://api.dcast.pro/mcp
  1. Your browser opens the DCAST sign-in page on dcast.tv. Sign in with your DCAST email and password. If your account was created on dcast.pro, the page moves to dcast.pro, with your email filled in, and asks for your password again.
  2. DCAST shows which app wants to connect to your account and asks how much you allow. Choose Manage streams and videos if it should upload videos and run streams for you, or View only if it should only look. Then press Allow selected access.
  3. The browser shows Authentication complete. You may close this window. and the terminal shows Successfully logged in to MCP server 'dcast'. Run codex mcp list: the dcast line says enabled and OAuth.

Check the connection

Start codex in the terminal and ask: "How much storage do I have left on DCAST?" Codex calls get_storage_quota and tells you how much storage you have used and how much your plan includes. Typing /mcp in Codex lists your MCP servers, dcast among them.

Example requests

Write as you would to a colleague. Each request acts on your own DCAST account:

  • "Import https://example.com/talk.mp4 into DCAST as a link-only video and give me the embed code when it is ready."
  • "Make my video Spring workshop paid and set the price to 9 dollars." This needs a payment gateway connected under Monetization in your DCAST dashboard.
  • "Create a live stream called Sunday service and give me the server address and stream key for my encoder."
  • "Add a live player and chat for my DCAST stream to the event page."
  • "Write a webhook endpoint that marks a lesson as ready when its DCAST video has finished processing."

On a server or over SSH

Where no browser can open, run codex mcp login dcast --no-browser. Codex prints a sign-in link. Open it on any device, sign in and allow access, then copy the full address from the browser's address bar (it starts with http://127.0.0.1), paste it into the terminal and press Enter. The terminal hides what you paste, so nothing appears on screen. The page itself may fail to load; Codex needs only its address.

In config.toml

codex mcp add writes this entry into ~/.codex/config.toml. You can also add it by hand and then run codex mcp login dcast to sign in.

[mcp_servers.dcast]
url = "https://api.dcast.pro/mcp"

With an API key instead of signing in

You can also connect with a DCAST Partner API key that you create in your DCAST account under API keys. The key's own access level (read only, standard, full) applies. Keep the key in the environment variable DCAST_API_KEY, as below, and never write it into the file or the repository.

codex mcp add dcast --url https://api.dcast.pro/mcp --bearer-token-env-var DCAST_API_KEY
[mcp_servers.dcast]
url = "https://api.dcast.pro/mcp"
bearer_token_env_var = "DCAST_API_KEY"

The command writes this entry into config.toml, or you can add it by hand. Codex reads the key from DCAST_API_KEY in the environment of the terminal where you start it; the file holds only the name of the variable, never the key.

Authorization

On the DCAST consent page you choose how much the assistant may do:

  • View only: it sees everything open to an assistant in your account, such as videos, streams and statistics, and changes nothing.
  • Manage streams and videos: it can also run streams and restreams, and upload and edit videos and playlists.
  • Customize manually: you set the level for each area yourself, for example Streams, Videos, Rooms or Webhooks.

Payments and payouts, API keys and adding or removing team members are never available to an assistant, whatever you choose.

If you allowed less than a request needs, DCAST refuses it with a message such as This connection may not manage streams yet and asks the assistant to give you a link. Open the link, allow the missing access and ask again.

To disconnect, remove the key named DCAST connector (OAuth) from your DCAST API keys. The assistant then gets no further access: every tool call is refused with DCAST connection is no longer active.

codex mcp logout dcast removes the sign-in stored on your computer, and codex mcp login dcast signs in again.

Troubleshooting

The sign-in page asks for my password a second time

That is expected when your account was created on dcast.pro: the sign-in moves from dcast.tv to dcast.pro, where your email is already filled in. Enter your password there and continue.

The assistant says the connection may not do something yet

You allowed less than the request needs, for example View only before asking for an upload or a new stream. Open the link the assistant gives you, allow the missing access, then ask again.

Paid access needs a payment gateway connected under Monetization in your DCAST dashboard. Until then the request is refused with NO_PAYOUT_GATEWAY. Connect the gateway and ask again.

"DCAST connection is no longer active"

The connection was removed from your DCAST API keys. Connect again with the steps above.

Rules for the agent

They tell the agent how to use the DCAST tools and how to put a player on a page so that it looks right: the embed code exactly as the tool returns it, poster images in a list and one player on the page. Put this text into AGENTS.md in the root of your project, or into ~/.codex/AGENTS.md to apply it to every project.

# Working with DCAST

DCAST hosts, transcodes and delivers video and live streams for the connected DCAST account. It does not generate video.
The `dcast` MCP server works on that account with the access the user granted.

## Before writing code

- Call `dcast_get_recipe` first (no argument lists the recipes). Follow a recipe's steps in order.
- Call `dcast_search_docs` for anything you are about to rely on: fields, limits, plans, errors, webhooks. Use only what it returns; never invent endpoints, fields, embed markup or limits.
- For any operation without a named tool: `dcast_find_operation` to find it, `dcast_describe_operation` for the exact request, then `dcast_read_operation` (GET), `dcast_call_operation` (POST/PUT/PATCH) or `dcast_delete_operation` (DELETE).
- When you write integration code, take the method, path, fields and headers from `dcast_describe_operation`. The Partner API base is `https://api.dcast.pro/api/v1`.

## Embed codes and addresses

- Players and chat go on a page only as returned by `get_stream_embed_codes` or `get_video_embed_code`. Never write your own iframe, player URL or ingest address.
- Ids, playback links and ingest addresses always come from a tool answer.

## Putting a player on a page

- Paste the code exactly as returned. Use `responsive` (it fills its container's width in the video's shape); `iframe` only for one fixed pixel size (set by width/height).
- The chat skin is asked for, not edited in: on a dark website call get_stream_embed_codes with `theme` `dark` (or `auto`) and paste that answer; never add `?theme=` by hand.
- Never wrap the player in your own frame, border, rounded or fixed-height box, nor set width, height, border-radius or object-fit on the iframe: that cuts off the picture or the controls.
- For a smaller player put `responsive` into a narrower container (e.g. `max-width: 480px`), never a fixed height.
- Several videos on a page: show posters (`thumbnailUrl` from list_videos or get_video) with titles and load the player only for the clicked video: one player on the page, above the list or in a dialog.
- Every embedded player starts playing by itself, muted, once loaded, so never put several player iframes in a grid or list.
- Titles, descriptions and posters come from the API; never invent them.

## Secrets

- A DCAST Partner API key (`pk_...`) is a server-side secret. Read it from an environment variable in server code. A website gets its key from the DCAST site connector: call `ask_site_access` (recipe `website-with-my-videos`); the user clicks Allow and the key lands in the site's environment. Never ask the user to create, copy or paste a key. Never put it in browser code, in a repository, in `mcp.json` as plain text or in a chat answer.
- Stream keys are secret. Call `reveal_stream_key` only when the user asks for the encoder key, and never write a stream key into code or a file.

## Changes and deletes

- Look with `list_*` / `get_*` tools. Create or change only what the user asked for.
- Call `delete_*` tools and `dcast_delete_operation` only after the user confirms; a delete cannot be undone.

## Uploads

- `create_video_upload` returns an upload link; the file bytes go from the user's machine or server straight to that link, never through the chat. `import_video_from_url` takes a direct file link.
- Follow processing with `get_video_status` no more often than every 10 seconds.

## Errors and plan limits

- An error answer carries `code`, `message` and `howToFix`; do what `howToFix` says.
- The errors an operation can answer are listed in `dcast_describe_operation` (`errors`) and every error answer carries `howToFix`: do what it says; no need to look the error up on the website.
- A plan limit names the limit: ask `dcast_search_docs` which plan raises it and tell the user. Do not retry the same call.

Tools

Codex gets the same tools as the Claude connector: named tools for the common jobs (videos, uploads, embed codes, live streams, restreams, rooms, playlists, statistics) and tools that find, describe and call every other documented Partner API operation.

Stream keys are hidden in every answer. The agent shows one only through reveal_stream_key, and only for your own stream, when you ask for it.

What is sent

When Codex calls a tool, the tool's arguments (for example a video title or a stream id) and your access token or API key are sent to https://api.dcast.pro/mcp, which passes them to the DCAST Partner API. Nothing else from your conversation or your files is sent. Video files never travel through the connection: they go from your computer or from a link straight to DCAST.

Privacy

DCAST's privacy policy: https://dcast.pro/privacy. Your conversation in Codex is handled by OpenAI under its own privacy policy.

Support

Write to [email protected]. The REST API behind the connector is documented in the Partner API reference; its limits and error codes apply to the connector too (see Errors and limits).