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

# MCP Server

> Use the Ticketnation API directly from Claude, Cursor, or any MCP-compatible AI agent.

## What is MCP?

[Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that lets AI assistants interact with external tools. The [ticketnation-mcp](https://www.npmjs.com/package/ticketnation-mcp) server exposes the Ticketnation Open API as tools that AI agents can call directly.

<Note>
  Available on npm: [ticketnation-mcp](https://www.npmjs.com/package/ticketnation-mcp)
</Note>

This means you can say things like:

* *"Create a concert event at MOA Arena with VIP tickets at ₱3,500"*
* *"Add DJ Shadow as a performer and build a schedule"*
* *"How many tickets have been sold for my latest event?"*
* *"Set up a webhook for order notifications"*

## Installation

<Tabs>
  <Tab title="Claude Desktop">
    Add to your `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "ticketnation": {
          "command": "npx",
          "args": ["-y", "ticketnation-mcp"],
          "env": {
            "TICKETNATION_API_KEY": "tn_live_your_key_here"
          }
        }
      }
    }
    ```

    Restart Claude Desktop after saving.
  </Tab>

  <Tab title="Claude Code (CLI)">
    ```bash theme={null}
    claude mcp add ticketnation -- npx -y ticketnation-mcp
    ```

    Set the environment variable before running Claude Code:

    ```bash theme={null}
    export TICKETNATION_API_KEY=tn_live_your_key_here
    ```
  </Tab>

  <Tab title="Cursor">
    Add to `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "ticketnation": {
          "command": "npx",
          "args": ["-y", "ticketnation-mcp"],
          "env": {
            "TICKETNATION_API_KEY": "tn_live_your_key_here"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Warning>
  **Never hardcode your API key** in shared config files. Use environment variable references where supported, or keep the config file in `.gitignore`.
</Warning>

## Environment Variables

| Variable                | Required | Description                                                                                                   |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| `TICKETNATION_API_KEY`  | Yes      | Your API key from **Organizer Dashboard > Settings > API Keys**                                               |
| `TICKETNATION_BASE_URL` | No       | Override API URL (default: `https://api.ticketnation.ph`). Use `http://localhost:4000` for local development. |

## Available Tools

<AccordionGroup>
  <Accordion title="Events (6 tools)">
    | Tool                       | Description                                              |
    | -------------------------- | -------------------------------------------------------- |
    | `create_event`             | Create a new event in DRAFT status                       |
    | `create_and_publish_event` | Create and publish in one step (includes inline tickets) |
    | `list_events`              | List events with status/search filters                   |
    | `get_event`                | Get event details by ID or slug                          |
    | `publish_event`            | Publish a DRAFT event to the marketplace                 |
    | `unpublish_event`          | Revert a published event to DRAFT                        |
  </Accordion>

  <Accordion title="Tickets (3 tools)">
    | Tool                   | Description                                 |
    | ---------------------- | ------------------------------------------- |
    | `create_ticket`        | Add a ticket type with pricing and quantity |
    | `list_tickets`         | List all ticket types for an event          |
    | `mark_ticket_sold_out` | Set remaining quantity to 0                 |
  </Accordion>

  <Accordion title="Performers (2 tools)">
    | Tool              | Description                         |
    | ----------------- | ----------------------------------- |
    | `add_performer`   | Add an artist, DJ, speaker, or host |
    | `list_performers` | List the event lineup               |
  </Accordion>

  <Accordion title="Schedules (2 tools)">
    | Tool                | Description                                              |
    | ------------------- | -------------------------------------------------------- |
    | `add_schedule_item` | Add a timetable entry (optionally linked to a performer) |
    | `list_schedule`     | List all schedule items                                  |
  </Accordion>

  <Accordion title="Brands (2 tools)">
    | Tool          | Description                    |
    | ------------- | ------------------------------ |
    | `add_brand`   | Add a sponsor or partner brand |
    | `list_brands` | List brand partners            |
  </Accordion>

  <Accordion title="Orders (1 tool)">
    | Tool          | Description                          |
    | ------------- | ------------------------------------ |
    | `list_orders` | List orders for an event (read-only) |
  </Accordion>

  <Accordion title="Venues (1 tool)">
    | Tool            | Description                  |
    | --------------- | ---------------------------- |
    | `search_venues` | Search public venues by name |
  </Accordion>

  <Accordion title="Webhooks (2 tools)">
    | Tool             | Description               |
    | ---------------- | ------------------------- |
    | `create_webhook` | Create a webhook endpoint |
    | `list_webhooks`  | List all webhooks         |
  </Accordion>

  <Accordion title="Account (1 tool)">
    | Tool               | Description                      |
    | ------------------ | -------------------------------- |
    | `get_account_info` | Verify connection and see scopes |
  </Accordion>
</AccordionGroup>

## Example Conversations

### Create a full event

> **You:** Create a music festival called "Manila Beats 2026" at Mall of Asia Arena on October 15, 2026 from 6pm to 11pm. Add GA tickets at ₱1,500 and VIP at ₱5,000 with 500 and 100 capacity. Use this image: [https://example.com/manila-beats.jpg](https://example.com/manila-beats.jpg)

The AI agent will:

1. Call `search_venues` to find "Mall of Asia Arena"
2. Call `create_and_publish_event` with the venue ID, image, and inline tickets
3. Return the event URL on ticketnation.ph

### Add performers and schedule

> **You:** Add SB19 as the headliner and DJ Nix as the opening act. Build a schedule: doors at 6pm, DJ Nix from 7pm-8:30pm, SB19 from 9pm-11pm.

The AI agent will:

1. Call `add_performer` twice
2. Call `add_schedule_item` three times, linking performers to their time slots

### Check sales

> **You:** How are ticket sales going for Manila Beats 2026?

The AI agent will:

1. Call `list_events` with search "Manila Beats"
2. Call `list_tickets` to see remaining inventory
3. Call `list_orders` to see completed purchases

## Pricing Note

<Info>
  Prices are in **whole pesos** (not centavos). When the AI creates a ticket with `price: 1500`, that means **₱1,500.00**. The `formatPeso()` utility is used internally by the MCP server to display prices in tool responses.
</Info>

## Scopes Required

The MCP server uses whatever scopes your API key has. For full functionality, enable all scopes:

| Scope             | Tools that need it                                                                                                                |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `events:read`     | `list_events`, `get_event`, `search_venues`, `list_performers`, `list_schedule`, `list_brands`                                    |
| `events:write`    | `create_event`, `create_and_publish_event`, `publish_event`, `unpublish_event`, `add_performer`, `add_schedule_item`, `add_brand` |
| `tickets:read`    | `list_tickets`                                                                                                                    |
| `tickets:write`   | `create_ticket`, `mark_ticket_sold_out`                                                                                           |
| `orders:read`     | `list_orders`                                                                                                                     |
| `webhooks:manage` | `create_webhook`, `list_webhooks`                                                                                                 |

## SDK vs MCP — When to Use What

<CardGroup cols={2}>
  <Card title="Use the SDK" icon="code">
    When you're writing application code that programmatically creates events — e.g., a platform integration, a cron job, or a backend service.
  </Card>

  <Card title="Use the MCP" icon="robot">
    When you want AI agents to manage events conversationally — e.g., from Claude Desktop, Cursor, or a custom AI workflow.
  </Card>
</CardGroup>

The MCP server uses the SDK internally, so they have the same capabilities and connect to the same API.
