How to integrate Heygen MCP with Codex

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Heygen logo
Codex logo
divider

Introduction

Codex is one of the most popular coding harnesses out there. And MCP makes the experience even better. With Heygen MCP integration, you can draft, triage, summarise emails, and much more, all without leaving the terminal or the app, whichever you prefer.

Also integrate Heygen with

Why use Composio?

Apart from a managed and hosted MCP server, you will get:

  • CodeAct: A dedicated workbench that allows GPT to write its code to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
  • Large tool responses: Handle them to minimise context rot.
  • Dynamic just-in-time access to 20,000 tools across 1000+ other Apps for cross-app workflows. It loads the tools you need, so GPTs aren't overwhelmed by tools you don't need.

How to install Heygen MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

What is the Heygen MCP server, and what's possible with it?

The Heygen MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Heygen account. It provides structured and secure access to your Heygen video platform, so your agent can perform actions like creating talking photos, managing video assets, personalizing video projects, and controlling streaming avatars on your behalf.

  • AI-powered video asset creation: Add new avatars, backgrounds, or other content elements directly into your Heygen library for use in video generation workflows.
  • Personalized video project management: Let your agent add contacts to personalized video projects and fetch detailed project information to streamline large-scale video personalization efforts.
  • Dynamic talking photo generation: Instantly create engaging talking photos from uploaded images, transforming static pictures into interactive, speaking content for marketing or educational use.
  • Real-time avatar streaming control: Retrieve a list of streaming avatars, generate streaming tokens, and manage live avatar sessions—including interrupting or monitoring ongoing streams for responsive, interactive experiences.
  • Audience insights and analytics: Fetch detailed audience engagement and preference data for personalized video campaigns, helping you optimize your content and targeting strategies.

Supported Tools & Triggers

Tools
Add looks to photo avatar groupTool to add additional looks (images) to an existing photo avatar group.
Add motion to photo avatarTool to add natural motion or animation to an existing photo avatar, turning a still image into a moving, lifelike one.
Check photo/look generation statusTool to retrieve the current status and details of a photo avatar or look generation by its ID.
Create a new folderTool to create a new folder under your HeyGen account.
Create knowledge baseTool to create a new knowledge base with a specified name, opening line, and custom prompt for Interactive Avatar streaming sessions.
Create photo avatar groupTool to create an avatar group which can include both AI-generated and user-uploaded photos of the avatar.
Create WebM videoTool to create a WebM format video with transparent background featuring an avatar speaking text or audio.
Delete an avatar videoTool to delete a video by its ID from HeyGen account.
Delete assetTool to delete a specific asset by its unique asset ID from HeyGen account.
Delete knowledge baseTool to delete a specific knowledge base by its ID.
Delete photo avatarTool to delete a photo avatar by its ID from HeyGen account.
Delete photo avatar groupTool to delete a photo avatar group by its ID from HeyGen account.
Delete webhook endpointTool to permanently delete a webhook endpoint from HeyGen.
Generate photo avatar photosTool to generate a personalized AI avatar based on text prompts and attribute inputs.
Generate text-to-speech audioTool to generate a speech audio file from any text input using a specified voice, powered by HeyGen's Starfish model.
Generate voice audio previewTool to generate a short audio preview with the specified voice and text.
Get current user informationTool to retrieve the profile information of the currently authenticated user.
Get training job statusTool to retrieve the current training status and details of a photo avatar training job by group ID.
Keep alive streaming sessionTool to reset the idle timeout counter for an active streaming session.
List all avatar groupsTool to retrieve a list of all available avatar groups in your HeyGen account.
List all locales for voicesTool to retrieve available locales for multilingual voices.
List assetsTool to retrieve a paginated list of all assets (images, audios, videos) created under your account.
List brand voicesTool to retrieve a list of brand glossaries created under your account.
List foldersTool to retrieve a paginated list of folders created under your account.
List avatars in a specific groupTool to retrieve all avatars that belong to a specific avatar group.
List knowledge basesTool to retrieve a list of all existing knowledge bases associated with your account.
List session historyTool to retrieve a paginated history of all streaming sessions with metadata including session duration, timestamps, and other details.
List streaming avatarsTool to retrieve a list of public and custom interactive avatars for streaming.
List TTS voicesTool to retrieve a list of public and custom voices compatible with HeyGen's Starfish TTS model.
Create new streaming sessionTool to initiate a new streaming session with an Interactive Avatar for real-time interactions.
Add contact to personalized video projectThis endpoint allows you to add one or more contacts to a specific personalized video project in the Heygen platform.
Fetch personalized video project detailRetrieves detailed information about a specific personalized video project in HeyGen, including status, settings, and metadata.
Get photo avatar detailsTool to retrieve detailed information about a photo avatar or look using its unique ID.
Post talking photo binary imageCreates a talking photo by processing an uploaded image file.
Restore folder from trashTool to restore a previously deleted folder from trash by its unique folder ID.
Retrieve avatar detailsTool to retrieve detailed information about a specific avatar by its ID.
Retrieve sharable video URLTool to generate a public, shareable URL for a specific video by ID.
Retrieve template details v3Tool to retrieve comprehensive details about a specific template including all available variables for replacement and scene mappings for templates built in the New AI Studio.
Retrieve video status detailsTool to retrieve the current processing status and metadata for a specific video by ID.
Search public avatar groupsTool to search and retrieve public avatar groups with optional filters and pagination.
Create streaming token with expiryCreates a new streaming token for use with HeyGen's real-time avatar and voice chat services.
Post streaming ice candidatesThis endpoint is used to submit ICE (Interactive Connectivity Establishment) candidate information for a specific streaming session in the Heygen platform.
Interrupt streaming sessionInterrupts an ongoing streaming session with an interactive avatar.
Retrieve streaming listRetrieves a list of active or available streaming sessions or content within the HeyGen platform.
Set streaming quality endpointInitiates a new streaming session with HeyGen, allowing users to start an avatar-based stream with specified quality settings.
Start streaming sessionInitiates a new streaming session for real-time communication in the HeyGen platform.
Stop streaming sessionThe streaming.
Send task to streaming avatarThe StreamingTask endpoint initiates a real-time speaking task for an AI-driven avatar within an active streaming session.
Move folder to trashTool to move a specific folder to trash by its unique folder ID.
Update folder nameTool to update (rename) an existing folder by its unique folder ID.
Update knowledge baseTool to update an existing knowledge base by its ID.
Update webhook endpointTool to modify an existing webhook endpoint configuration including URL and subscribed event types.
Upload assetTool to upload a file asset (image, video, or audio) to HeyGen platform.
Upscale motion avatarTool to enhance the resolution and visual quality of a motion avatar.
List avatars endpointRetrieves a list of available avatars from the Heygen platform.
List talking photo entriesRetrieves a list of talking photos created using the HeyGen platform.
List videosRetrieves a list of videos associated with the user's account on the HeyGen platform.
List voice endpointsRetrieves a comprehensive list of all available voices in the HeyGen platform.
Add webhook endpointAdds a new webhook endpoint to receive real-time notifications for specified Heygen events.
List webhook endpointsRetrieves a list of all webhook endpoints configured for your HeyGen account.
List webhooksRetrieves a list of all available webhook event types that can be subscribed to in your HeyGen account.
Delete talking photo by idDeletes a specific talking photo from the HeyGen platform using its unique identifier.
Generate video template with variablesGenerates a customized video from a pre-existing template using HeyGen's AI platform.
Get template by idRetrieves a specific template from the HeyGen platform using its unique identifier.
Retrieve all templatesRetrieves a list of available avatar templates from the HeyGen platform.
Retrieve user remaining quotaRetrieves the current remaining quota for the authenticated user on the HeyGen platform.
Generate video with inputsGenerates a customized video using Heygen's AI-driven platform.
Post video translate requestThe TranslateVideo endpoint enables the translation of video content from one language to another.
Retrieve video translation by idRetrieves the current status of a video translation job in the HeyGen platform.
Retrieve video translation target languagesRetrieves a list of all available target languages supported by HeyGen's video translation feature.
List available voicesRetrieves a list of available voice models and options that can be used with HeyGen's AI-driven video creation platform.

Conclusion

You've successfully integrated Heygen with Codex using Composio's MCP server. Now you can interact with Heygen directly from your terminal, VS Code, or the Codex App using natural language commands.

Key benefits of this setup:

  • Seamless integration across CLI, VS Code, and standalone app
  • Natural language commands for Heygen operations
  • Managed authentication through Composio
  • Access to 20,000+ tools across 1000+ apps for cross-app workflows
  • CodeAct workbench for complex tool chaining

Next steps:

  • Try asking Codex to perform various Heygen operations
  • Explore cross-app workflows by connecting more toolkits
  • Build automation scripts that leverage Codex's AI capabilities

How to build Heygen MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Heygen MCP?

With a standalone Heygen MCP server, the agents and LLMs can only access a fixed set of Heygen tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Heygen and many other apps based on the task at hand, all through a single MCP endpoint.

Can I use Tool Router MCP with Codex?

Yes, you can. Codex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Heygen tools.

Can I manage the permissions and scopes for Heygen while using Tool Router?

Yes, absolutely. You can configure which Heygen scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Heygen data and credentials are handled as safely as possible.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.