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

# Model Context Protocol (MCP)

> Set up MCP to enable AI tools to access your PlayAI services

## What is MCP?

Model Context Protocol (MCP) is a standardized way for AI models to interact with external tools and APIs. It allows AI assistants like Cursor, and Windsurf to use your PlayAI APIs directly.

MCP acts as a universal adapter between large language models (LLMs) and various data sources and tools. With MCP integration, AI tools can:

* Search and understand your PlayAI documentation
* Make direct API calls to PlayAI services on your behalf
* Provide accurate, real-time information about PlayAI capabilities

<Tip>
  MCP transforms AI assistants from simple chatbots to powerful tools that can help you use PlayAI services more
  effectively.
</Tip>

## Setting Up PlayAI MCP

<Steps>
  <Step title="Install the MCP CLI">
    First, install the Mintlify MCP CLI tool:

    ```bash theme={null}
    npm install -g @mintlify/mcp
    ```
  </Step>

  <Step title="Add the PlayAI MCP Server">
    Run the following command to install the PlayAI MCP server:

    ```bash theme={null}
    npx @mintlify/mcp add playhtinc
    ```

    <Warning>
      During installation, the CLI will prompt you for authentication information. When it asks for "Bearer Token", provide your Secret Key. When it asks for "API Key", provide your PlayAI **User ID**.
    </Warning>
  </Step>

  <Step title="Start the MCP Server">
    After installation, you can start the MCP server with the command provided at the end of the installation process. It will look similar to:

    ```bash theme={null}
    node /Users/[username]/.mcp/playhtinc/src/index.js
    ```

    This server runs locally on your machine and acts as a bridge between AI tools and PlayAI services.
  </Step>

  <Step title="Configure Your AI Tools">
    Depending on which AI assistant you're using, you'll need to configure it to use the PlayAI MCP server.

    ### For Cursor

    The installation process should automatically update your Cursor configuration. You can verify this by checking `~/.cursor/mcp.json`.

    ### For Claude Desktop

    1. Navigate to Settings > Developer
    2. Click on Edit Config
    3. Add the following to your `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "playhtinc": {
          "command": "node",
          "args": [
            "/Users/[username]/.mcp/playhtinc/src/index.js"
          ]
        }
      }
    }
    ```

    Replace `[username]` with your actual username.
  </Step>
</Steps>

## Using MCP with AI Tools

Once your MCP server is running, supported AI tools like Claude Desktop or Cursor will be able to:

1. Access PlayAI documentation to answer your questions
2. Generate text-to-speech content using PlayAI's models
3. Manage voices and other PlayAI resources

Simply ask the AI tool about PlayAI services, and it will use the MCP server to provide accurate information and perform actions.

<Note>
  Your MCP server runs locally and securely on your machine. Your credentials are never sent to third parties.
</Note>

## Troubleshooting

If you encounter issues with your MCP setup:

1. **Authentication Errors**: Double-check that you provided your User ID when prompted during installation, not your API key
2. **Connection Issues**: Ensure the MCP server is running in a terminal window
3. **AI Tool Not Detecting MCP**: Verify your AI tool's configuration has been updated correctly

Need further assistance? Contact our [support team](mailto:support@play.ai) for help with MCP configuration.
