> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavus.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Build a PAL, wire its tool calls into your own code, and test the integration from your editor with the MCP server or your terminal with the CLI.

Tavus MCP is the toolkit for building a PAL and integrating its tool calls into your own application. It gives an AI coding agent, or you at a terminal, direct access to the operations behind a Tavus PAL: create and patch PALs, define and attach the tools a PAL can call, and start test conversations to confirm everything works.

<Note>
  **For AI agents:** Tavus MCP documented here is the **development MCP** for creating PALs, defining tools, and testing tool-call integrations against the Tavus API. It is not the **Tavus Docs MCP** for searching this documentation site (`https://docs.tavus.io/mcp`). For live docs search and page retrieval, see [Agents & automation](/sections/agents-and-automation).
</Note>

It is separate from the Conversational PAL Builder in PAL Maker. PAL Maker is the UI for drafting a PAL. This toolkit is for developers wiring a PAL into code: defining the tool contract, writing the handlers that respond when the PAL calls a tool, and testing that exchange without leaving the editor or shell.

## The use case

A useful PAL calls tools to look something up, change what is on screen, or take an action in your app, then responds based on the result. Two things have to stay in sync for that to work:

* The PAL has to know which tools exist and when to call them.
* Your code has to handle those calls and return a result.

The MCP server and CLI let you author both sides and test them together. See [bidirectional tool calls](/sections/agent-tools/mcp-server#bidirectional-tool-calls) for how the exchange works.

## Two surfaces

<CardGroup cols={2}>
  <Card title="MCP server" icon="plug" href="/sections/agent-tools/mcp-server">
    Connect Codex, Claude Code, Cursor, or any MCP client over HTTPS with per-user OAuth. Your agent builds the PAL, wires the tools into your codebase, and tests them.
  </Card>

  <Card title="CLI" icon="terminal" href="/sections/agent-tools/cli">
    The `tavus` command for interactive and scripted access to every operation. Suited to humans at a terminal and to CI automation.
  </Card>
</CardGroup>

Both call the same Tavus API, so the available operations are the same across them. For the autonomous PAL test loop, see [Agentic PAL building & testing](/sections/agent-tools/pal-build-and-verify). For the full catalog of MCP tools, see the [MCP tools reference](/sections/agent-tools/mcp-tools-reference).

## Which should I use?

<Tabs>
  <Tab title="MCP server">
    Best when you work in an editor with an AI agent and want it to build the PAL and wire tool calls into your code for you.

    * Transport: HTTP at an `/mcp` endpoint.
    * Auth: browser-based OAuth through the PAL Maker. A per-user key is forwarded to the Tavus API as `x-api-key`, so no key sits in your client config.
    * Add it to Codex or Claude Code.

    For Codex:

    ```bash theme={null}
    codex mcp add tavus --url https://mcp.tavus-preview.io/mcp
    ```

    For Claude Code:

    ```bash theme={null}
    claude mcp add -s user --transport http tavus https://mcp.tavus-preview.io/mcp
    ```

    For Codex, start the OAuth flow explicitly with:

    ```bash theme={null}
    codex mcp login tavus
    ```

    <Warning>
      Do not put a Tavus API key or shared bearer token in your MCP client config. Authentication is handled through the OAuth flow.
    </Warning>
  </Tab>

  <Tab title="CLI">
    Best for humans at a terminal and for scripted automation in CI.

    * Auth: `tavus auth login` stores an env-scoped key in your OS keychain, or set `TAVUS_API_KEY` directly for automation.
    * Outputs JSON by default. Many list commands also render Rich tables.

    ```bash theme={null}
    TAVUS_API_KEY=... tavus pal list
    ```
  </Tab>
</Tabs>

## Choosing a target environment

Both surfaces default to production (`PROD`). To target the test database, set `TAVUS_ENV=TEST` or pass `--env TEST` to the CLI.

<Note>
  For the MCP server, keep the endpoint aligned with the portal environment that minted your key. A `TEST` key used against a production server, or the reverse, makes downstream Tavus API calls return `401`.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="MCP server" icon="plug" href="/sections/agent-tools/mcp-server">
    Connect your agent and wire bidirectional tool calls.
  </Card>

  <Card title="Agentic PAL building & testing" icon="vial" href="/sections/agent-tools/pal-build-and-verify">
    Run simulated turns and judge whether a new PAL works.
  </Card>

  <Card title="CLI" icon="terminal" href="/sections/agent-tools/cli">
    Authenticate and run `tavus` commands.
  </Card>

  <Card title="MCP tools reference" icon="list" href="/sections/agent-tools/mcp-tools-reference">
    Browse the full catalog of MCP tools and their parameters.
  </Card>
</CardGroup>
