Skip to content
Limited timeStarter is now $9 a month instead of $20.See plans
charmotion

How to Configure a Remote Animation MCP Server in OpenAI Codex CLI

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: How to Configure a Remote Animation MCP Server in OpenAI Codex CLI, with Charmotion demo characters

To add a remote HTTP MCP server to Codex CLI, declare it as a table in config.toml with a url key, then run codex mcp login if it uses OAuth. Codex reads ~/.codex/config.toml globally, and a trusted project can add .codex/config.toml. Once connected, Codex can call the UI animation tools that the server exposes.

Key takeaways

  • Codex CLI declares each MCP server as a [mcp_servers.] table in config.toml.
  • A remote HTTP server needs only a url key, while a local server uses command and args.
  • OAuth servers sign in with codex mcp login, and mcp_oauth_callback_port sets a fixed callback port when a provider requires one.
  • Project files at .codex/config.toml load only for trusted projects, so the global file is the safer default.
  • Confirm the setup with codex mcp list, codex mcp get and one read-only tool call.

Already have a character or logo? See examples in real app screens: splash, onboarding, loading and empty-state screens, with the animation that plays in each.

What does a remote HTTP MCP server add to Codex CLI?

The Model Context Protocol (MCP) lets an AI client call tools that live in a separate server. Codex CLI supports two kinds of server. A local stdio server runs as a command on your machine, with a command and args entry in config.toml. A remote server is reached over HTTP, and the entry needs only a URL.

For remote servers, MCP's Streamable HTTP transport uses OAuth 2.1 for login. The MCP server acts as an OAuth resource server, and a separate authorization server handles login and issues tokens. When a request is not authorized, the server answers with HTTP 401 and a WWW-Authenticate Bearer header that points to protected resource metadata under /.well-known/oauth-protected-resource. That metadata tells the client which authorization servers the MCP server trusts.

In practice, an OAuth server means you do not paste a secret into a file. The client follows the metadata to the sign-in service, and you complete the login in your browser. For a UI animation server, the tools are the part you use day to day: they create, preview and export assets while you keep working in your code.

Use a remote server when the tools run on someone else's infrastructure or when several projects and teammates should share one service. Use a local server when the tool needs files on your disk. The same remote setup works in other clients too, as shown in the Claude Code guide.

Where does the Codex MCP config file live?

Codex reads MCP servers from TOML configuration files. The global file is ~/.codex/config.toml, and every project on your machine can use what it declares. A project can also add .codex/config.toml inside its folder, but that file loads only when the project is trusted.

The Codex CLI and the IDE extension share the same config.toml, so a server you add for one appears in the other. You can edit the file by hand, or use the codex mcp command, which adds and manages entries and has subcommands to list, get and remove servers. This guide edits the file directly so that every key stays visible.

FileScopeWhen it loads
~/.codex/config.tomlAll projectsAlways
.codex/config.tomlOne repositoryOnly for a trusted project

TOML has one ordering rule that catches people out. Top-level keys, such as mcp_oauth_callback_port, must appear before the first [table] header in the file. Anything written after a table header belongs to that table, so a misplaced key is silently read as part of the server entry.

How to add a remote HTTP MCP server to OpenAI Codex CLI for UI animations?

A remote server needs one table and one key. Replace the name and the URL with the values from your server's setup page. The name becomes the handle you use with codex mcp commands, so keep it short and lowercase.

[mcp_servers.animation]
url = "https://your-server.example/mcp"

Do not add a command key to a remote entry. The command key belongs to local stdio servers, which run a program on your machine. For comparison, a local server looks like this:

[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

Both kinds can live in one file. Each [mcp_servers.name] table is independent, so you can mix a local tool with a remote animation server. The only rule is that every server name must be unique.

Put the remote entry in the global file if you want it in every project. Put it in .codex/config.toml only when one repository needs it, and remember that the project must be trusted for that file to load. A shared team server is usually easier to manage in the global file, because each developer adds it once.

How do you sign in to an OAuth animation server from Codex?

After the entry exists, run the login command with the server's name:

codex mcp login animation

The command runs the OAuth flow for the HTTP server and completes the browser sign-in. Run codex mcp logout to clear the stored login for that server, which helps when you switch accounts or want to test the sign-in again.

Some OAuth providers insist on a fixed callback address. For those, set mcp_oauth_callback_port at the top of config.toml to a port that is free on your machine. The number below is an example, and it must come before the table header:

mcp_oauth_callback_port = 8787

[mcp_servers.animation]
url = "https://your-server.example/mcp"

The authorization features listed for HTTP-based MCP servers include OAuth 2.1, Proof Key for Code Exchange (PKCE), Protected Resource Metadata and Resource Indicators. You do not need to configure these yourself. The server and its authorization service handle them, and Codex only needs the sign-in step to finish.

If a server page gives you a token instead of a sign-in flow, check that page for the exact key name before you add anything to the file. Secrets should not be committed to version control.

How do you check that Codex can reach the server?

Run three checks in order. Each one narrows down where a problem sits.

  1. Run codex mcp list to confirm the entry is loaded. If the name is missing, the table header is wrong or the project file is not loading.
  2. Run codex mcp get animation to see the URL and settings Codex has read for that entry. Compare the URL with the one on your server's page.
  3. Start Codex and ask it to call one of the server's tools. Begin with a read-only tool, such as one that reports account status, before you run anything that creates assets.
SymptomLikely causeFix
Server missing from codex mcp listWrong table name, or a project file in an untrusted folderCheck the header, or move the entry to ~/.codex/config.toml
Login fails or never completesCallback port blocked or already in useFree the port, or set mcp_oauth_callback_port to another value
Tools missing after loginEntry saved in a different config file than the one Codex loadedRun codex mcp get and compare the file and URL

A clean list output does not prove the tools work. Only a real tool call shows that the URL, sign-in and permissions all line up, so do that test before you wire the server into code.

What does a UI animation workflow look like after setup?

Once the connection works, the server's tools handle the asset steps and Codex handles the integration code. A typical run for a mascot or logo looks like this:

  • Create or pick the character, either from an image you already have or from one the server designs for you.
  • Choose the animations the interface needs, such as launch, loading, happy, sad or idle.
  • Fetch the set, which returns download links and integration notes for coding assistants.
  • Export the video copies you need for marketing, or for places where a runtime file cannot play.

Charmotion's remote MCP server, at https://charmotion.app/mcp, follows this pattern. Its tools include design_character, create_character_set, add_animations, get_character_set, export_videos and get_account. Animated previews and guide search are free without an account. Designs and animations use the plan on your account, and get_account shows what is left before you run a large batch.

The get_character_set result includes an AI_README for the coding assistant. Codex can read it when it writes the app code, so the app sets a mood number such as happy or loading on the Rive file instead of switching video files. For the app side of that work, see React Native, websites and Rive state machines. Full tool and plan details are on the MCP server page.

How to add a remote HTTP MCP server to OpenAI Codex CLI for UI animations

  1. Get the server URL. Copy the endpoint address from the server's setup page. It is a full https:// address that ends in the path the server publishes.
  2. Open the config file. Edit ~/.codex/config.toml to use the server in every project, or .codex/config.toml inside a trusted project to limit it to one repository.
  3. Add the server table. Add a [mcp_servers.name] table with a url key. Choose a short, unique name, because the codex mcp commands refer to it.
  4. Sign in if the server uses OAuth. Run codex mcp login with the server name and finish the browser sign-in. Set mcp_oauth_callback_port above the first table if the provider needs a fixed callback port.
  5. Confirm the entry. Run codex mcp list and codex mcp get with the server name to confirm the entry is loaded with the URL you expect.
  6. Test one tool call. Start Codex and ask it to call a read-only tool, such as one that reports account status, before any tool that creates assets.

Frequently asked questions

Can one config file mix a local server and a remote server?

Yes. Each server is its own [mcp_servers.name] table, so one file can list a command-based server beside a url-based one. Names must be unique because codex mcp get and codex mcp remove refer to them. Local servers run as programs on your machine, while remote servers are reached over HTTP, so they behave differently when your network or sign-in changes.

Will the server appear in the Codex IDE extension too?

It should. The CLI and the IDE extension read the same config.toml, so an entry added in one shows in the other. Confirm the entry from a terminal with codex mcp list, then check the available tools inside the extension.

Why does a server in my project folder not load?

Project files at .codex/config.toml load only when the project is trusted. If the entry is ignored, confirm the project's trust status, or move the server into ~/.codex/config.toml so it loads in every project.

Do I need an API key for a remote animation server?

That depends on the server. OAuth servers sign in with codex mcp login and need no key in the file. Check the server's own setup page for any other method before you add credentials to config.toml, and keep secrets out of files you commit to version control.

Sources

Related guides