Skip to main content

Tavus CLI and MCP server for agentic PAL creation and editing.

Project description

tavus-cli

Agent-facing surfaces that let another agent (Claude, Codex, or any MCP-aware client) drive Tavus PAL creation end-to-end — separate from the human-facing PAL Maker.

What's here

  • MCP server. PAL CRUD plus mutations for tools, KB, guardrails, pronunciation dicts, layers, and objectives. Local stdio for IDE-embedded clients, remote (Cloudflare Worker) for hosted agents.
  • CLI. Scripted PAL authoring + publish. tavus pal list / options / patch, JSON round-tripping, OS-keychain auth.
  • Codex skill. Publishable skill so an external agent can invoke the MCP server and CLI without reading the full Tavus API.

Why standalone (not under PAL Maker)

The PAL Maker project is the human builder — face-driven, in-product. This repo is for agents driving the API without that UI. Adjacent in code and concepts, but a different deliverable and audience.

The Tavus API exposes /v2/pals and /v2/faces as backwards-compatible vocabulary aliases over /v2/personas and /v2/replicas. This toolkit speaks the new pal/face vocabulary throughout.

Out of scope (for now)

  • Face/video preview surfaces (live in the PAL Maker)
  • Marketplace / sharing UX
  • Multi-tenant auth beyond the existing dev-portal token model

Local Setup

uv sync --extra dev
cp .env.example .env

By default the CLI targets production (PROD). To switch to the test DB, either set TAVUS_ENV=TEST in .env / your shell or pass --env TEST to the CLI. You can set TAVUS_API_KEY directly for automation or run:

uv run tavus auth login

Examples:

# Production defaults; only the API key is required.
TAVUS_API_KEY=... uv run tavus pal list

# Test DB without URL overrides.
TAVUS_ENV=TEST TAVUS_API_KEY=... uv run tavus pal list
uv run tavus --env TEST pal list

The login flow opens the dev-portal at /dev/cli-authorize with a loopback callback URL and an anti-CSRF state. The dev-portal mints an API key for your signed-in user (tagged source: cli) and POSTs it back to the loopback receiver. The CLI stores that key in the OS keychain under the selected environment. No Firebase config lives in the CLI — the browser side handles all of it.

CLI

Install the CLI from PyPI:

uv tool install tavus-cli

Or run it without installing:

uvx --from tavus-cli tavus doctor

Local development commands:

uv run tavus doctor
uv run tavus pal list
uv run tavus pal options <pal_id>
uv run tavus pal patch <pal_id> --op replace --path /pal_name --value '"New Name"'
uv run tavus pal capabilities list <pal_id>
uv run tavus pal capabilities attach <pal_id> web_search
uv run tavus pal capabilities attach <pal_id> slide_presenter --document-id <document_id> --slides-trigger walk_the_deck
uv run tavus document create --url https://example.com/handbook.pdf --tag onboarding
TAVUS_PORTAL_BEARER_TOKEN=<firebase-id-token> uv run tavus document upload ./handbook.pdf --tag onboarding
uv run tavus pal knowledge add <pal_id> --document-id <document_id>
TAVUS_PORTAL_BEARER_TOKEN=<firebase-id-token> uv run tavus pal knowledge upload <pal_id> ./handbook.pdf

pal capabilities mirrors PAL Maker's built-in capability surface: Magic Canvas (magic_canvas), Slide Presenter (slide_presenter), Web Search (web_search), Perception (perception), and Memory (memory). The first, second, third, and fifth map to RQH PAL skills; Perception maps to layers.perception.

document and pal knowledge mirror PAL Maker's Knowledge section. With a normal Tavus API key, create Knowledge documents from an already reachable URL via RQH /v2/documents. Local file upload uses the same portal-only flow as PAL Maker (local file -> tavus-api upload/S3 URL -> RQH document record), so it requires TAVUS_PORTAL_BEARER_TOKEN. PAL Knowledge attachment uses document_ids and document_tags; RAG tuning lives under layers.knowledge_base.

MCP

{
  "mcpServers": {
    "tavus": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/tavus-mcp", "tavus-mcp"]
    }
  }
}

MCP tools return data and file manifests. They do not write files.

Cloudflare Worker

The remote MCP server lives in workers/tavus-mcp/ and uses Cloudflare's stateless createMcpHandler transport at /mcp.

cd workers/tavus-mcp
npm install
cp .dev.vars.example .dev.vars
npm run dev

The local remote-MCP endpoint is http://127.0.0.1:8787/mcp.

Hosted remote MCP

Hosted remote MCP clients should point directly at the HTTPS /mcp URL. Do not put a Tavus API key or shared bearer token in client config. The Worker exposes standard OAuth metadata, dynamic client registration, authorize, and token endpoints so MCP clients can authenticate through Tavus browser auth.

Claude Code example:

claude mcp add -s user --transport http tavus https://mcp.tavus-preview.io/mcp

The OAuth authorize step redirects to Tavus developer portal /dev/cli-authorize?mode=oauth. After the user signs in, the portal mints a per-user Tavus API key and redirects back to the MCP client's loopback callback. The Worker exchanges that code for an MCP bearer token, then forwards the bearer to RQH as x-api-key. This keeps Tavus API keys user-scoped and out of MCP client configuration.

Developer portal must support the mode=oauth authorize flow for remote MCP auth to complete. If a local portal is running on port 3000, test the full browser-auth path against TEST with:

cd workers/tavus-mcp
npm run dev -- --env test --var TAVUS_DEV_PORTAL_URL:http://localhost:3000

claude mcp add -s user --transport http tavus-dev http://127.0.0.1:8787/mcp

Keep the Worker environment aligned with the portal environment that minted the key. For example, a TEST key from a local or dev portal must hit a Worker running with --env test, otherwise downstream Tavus API calls will return 401.

For Tavus deployment, configure these Cloudflare/GitHub environment secrets:

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID
  • TAVUS_API_KEY and MCP_BEARER_TOKEN only if you need the legacy shared-token fallback

Then run the Deploy Tavus MCP Worker workflow for test, stg, or prod. The prod Wrangler route is configured as a custom domain on mcp.tavus.io; use https://mcp.tavus-preview.io/mcp as the Cloudflare-owned endpoint until mcp.tavus.io DNS resolves. For direct Wrangler usage, the default config targets production; use wrangler deploy --env test or wrangler dev --env test to point at TEST.

Useful production checks:

curl https://mcp.tavus-preview.io/.well-known/oauth-protected-resource/mcp
curl https://mcp.tavus-preview.io/.well-known/oauth-authorization-server
curl -i https://mcp.tavus-preview.io/mcp

Unauthenticated /mcp should return 401 with a WWW-Authenticate header that points at the protected-resource metadata URL. A 404 Not Found at discovery usually means the Worker version serving the custom domain does not include the OAuth routes yet.

Codex Skill

A publishable Codex skill for this repo lives at skills/tavus-agentic-pals/. It documents the CLI and MCP workflows, safe PAL patching, environment setup, and concrete examples for agents using this toolkit.

Install it by copying that folder into ${CODEX_HOME:-$HOME/.codex}/skills/, or publish the folder directly through whatever skill distribution flow you use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tavus_cli-0.3.0.tar.gz (218.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tavus_cli-0.3.0-py3-none-any.whl (68.1 kB view details)

Uploaded Python 3

File details

Details for the file tavus_cli-0.3.0.tar.gz.

File metadata

  • Download URL: tavus_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 218.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tavus_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 855102451a23e1f4bbf54fb18f8d86df781ac069561a019ce190a24a01f1293c
MD5 d99486bb749ff54179536a63648ff8c2
BLAKE2b-256 8e9f8bff88e5db445deccc75816ad9e7cffddcc2fd642e8b1e91def9340b214a

See more details on using hashes here.

File details

Details for the file tavus_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tavus_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 68.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tavus_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e938cb7f2378cc1931b014475105618dbe230db5f35143b829e01446e9b08420
MD5 3db5e0bea11249f5bfedff83b1cc305d
BLAKE2b-256 41871c2042abda9e9a7311bd6223c144ab917be635b0ff067b6d823c807d96de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page