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

# Setup PlayerZero MCP Server

> PlayerZero exposes an MCP server that any compatible AI assistant can connect to, bringing codebase intelligence, live telemetry, and issue context directly into your editor.

PlayerZero exposes an MCP server that any compatible AI assistant can connect to, bringing codebase intelligence, live telemetry, and issue context directly into your editor. This lets you ask questions, debug issues, and investigate production behavior from tools like VS Code, Cursor, and GitHub Copilot without switching to the PlayerZero UI.

## Prerequisites

* Active PlayerZero account with project access
* *Editor* or *Owner* permissions in that project
* An MCP-compatible AI assistant (VS Code, Copilot, Cursor, Claude Code, etc.)

***

## Step 1: Create an MCP Token

1. **Open Project Settings**
   * Log in at [https://playerzero.ai](https://playerzero.ai)
   * Choose your organization & project
   * Navigate to **Settings → MCP Tokens**

2. **Generate Token**
   * Click **New Token**
   * Give it a descriptive name, e.g. `Cursor MCP` or `Claude Desktop`
   * Click **Create Token**
   * **Copy & store the token immediately** – it won’t be shown again.

3. **Token details**
   * Expires in **90 days**
   * Scoped to **one** project
   * Create multiple tokens for different tools or teammates

***

## Step 2: Configure Your MCP Client

The PlayerZero MCP endpoint speaks the standard **Streamable HTTP** transport with server-sent events (SSE), so mainstream MCP clients such as Claude Code and Cursor connect directly. Point your client at the endpoint and pass your token in the `Authorization` header, as shown below. This endpoint is called by your MCP client with the token header; it is not a page that will load if opened directly in a browser.

```
{
    "mcp": {

        "inputs": [
            {
                "id": "api-key",
                "type": "promptString",
                "description": "Your API key for the MCP server"
            }
        ],
        "servers": {
            "playerzero": {                      
                "url": "https://go.playerzero.app/api/mcp", 
                "headers": {
                    "Authorization": "Bearer [ENTER TOKEN HERE]",
                },
            }
        }
    },
    "chat.mcp.discovery.enabled": true
}
```

## Step 3: Available Tools

### **`playerzero_status`**

**Description**: Tests your connection to PlayerZero

**Request**: Use the playerzero\_status tool to check if PlayerZero is working.

**Response:**

* "true" if connection is successful
* Error message if there are authentication or connection issues

### **`ask_playerzero`**

**Description**: Query your codebase using PlayerZero's AI.

**Parameters**:
query (required): Your question about the codebase
playerId (optional): Continue existing conversation
lastMessageId (optional): Resume from specific message

**Usage Examples**:

```
Use ask_playerzero to find all authentication-related files in the codebase.

Use ask_playerzero to explain how the user registration process works.

Use ask_playerzero to identify potential security vulnerabilities in the API routes.
```

### **`stop_player`**

**Description**: Stop a running or stuck Player session

**Parameters**:
playerId (required): The ID of the Player to stop

**Usage Examples**:

```
Use stop_player to stop a Player that is stuck or taking too long.

Use stop_player with the playerId from a previous ask_playerzero response to end that session.
```

## Step 4: Best Practices

<AccordionGroup>
  <Accordion title="Conversation Continuity">
    * The ask\_playerzero tool returns playerId and lastMessageId in responses
    * Use these values in subsequent queries to maintain conversation context
    * This enables more accurate and contextual responses
    * For complex queries, the server may return a partial response with a message asking you to retry. Pass the returned `playerId` and `lastMessageId` in your next call to pick up where it left off.
  </Accordion>

  <Accordion title="Query Optimization">
    * Be specific in your questions for better results
    * Ask about particular files, functions, or architectural patterns
    * Use follow-up questions to dive deeper into specific areas
    * Visit our [Prompting Guides](/user-guides/prompting-basics) for more tips!
  </Accordion>

  <Accordion title="Token Management">
    **Token Management**

    * Rotate tokens regularly (every 60-90 days)
    * Use descriptive names to track token usage
    * Delete unused tokens to maintain security
    * Each team member should have their own token
  </Accordion>
</AccordionGroup>

## Security Considerations

* **Token Security:** Store MCP tokens securely and never commit them to version control
* **Project Scope:** Tokens only provide access to the specific project they were created for
* **Audit Trail:** All MCP interactions are logged in your PlayerZero project
* **Expiration:** Tokens automatically expire after 90 days for security

***

## Connect External MCP Servers

Looking to connect an external MCP server (like Datadog) to PlayerZero? See [Remote MCP Servers](/connector/remote-mcp-servers).
