Skip to content

mochow13/ticketmaster-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticketmaster MCP Server

A Model Context Protocol (MCP) server that provides tools to search for events, venues, and attractions using the Ticketmaster Discovery API. This server enables AI assistants to access Ticketmaster's extensive database of entertainment events and venues.

Features

  • Event Search: Find upcoming events by keyword, date range, location, and more
  • Venue Search: Discover venues by name, location, or specific criteria
  • Attraction Search: Search for artists, sports teams, and other attractions
  • Comprehensive Filtering: Filter results by date, location, venue, attraction, and classification
  • MCP Compatible: Fully compliant with the Model Context Protocol specification
  • HTTP Transport: Uses streamable HTTP transport for real-time communication

Architecture

This project consists of two main components:

Server (/server)

  • MCP Server: Implements the Model Context Protocol server using @modelcontextprotocol/sdk
  • Ticketmaster Integration: Custom client for the Ticketmaster Discovery API
  • HTTP Transport: Express.js server with streamable HTTP transport
  • TypeScript: Fully typed implementation with comprehensive error handling

Client (/client)

  • MCP Client: Example client implementation using @modelcontextprotocol/sdk
  • AI Integration: Uses Google's Gemini AI model for natural language queries
  • Interactive Chat: Command-line interface with conversation history
  • Function Calling: Demonstrates AI-powered tool usage

Installation

Prerequisites

  • Node.js 16.0.0 or higher
  • npm or yarn package manager
  • Ticketmaster API key (get one from Ticketmaster Developer Portal)
  • Google Gemini API key (for client example)

Server Setup

  1. Navigate to the server directory:
cd server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Start the server:
node build/index.js

The server will start on port 3000 by default.

Note: As of the latest version, the TicketMaster API key is now passed from the client to the server, so no environment variables are required for the server.

Client Setup (Optional)

  1. Navigate to the client directory:
cd client
  1. Install dependencies:
npm install
  1. Build the client:
npm run build
  1. Set up environment variables:
export GEMINI_API_KEY="your_gemini_api_key_here"
export TICKETMASTER_API_KEY="your_ticketmaster_api_key_here"
  1. Run the client:
node build/index.js

Docker Deployment

You can also run the server using Docker:

docker build -t ticketmaster-mcp-server .
docker run -p 3000:3000 ticketmaster-mcp-server

Note: No environment variables are needed for the server as API keys are now passed from the client.

API Usage

Available Tools

search_ticketmaster

Search for events, venues, or attractions on Ticketmaster.

Parameters:

  • type (required): Type of search - "event", "venue", or "attraction"
  • keyword (optional): Search keyword or term
  • startDate (optional): Start date in YYYY-MM-DD format
  • endDate (optional): End date in YYYY-MM-DD format
  • city (optional): City name
  • stateCode (optional): State code (e.g., "NY", "CA")
  • countryCode (optional): Country code (e.g., "US", "CA")
  • venueId (optional): Specific venue ID to search
  • attractionId (optional): Specific attraction ID to search
  • classificationName (optional): Event classification/category (e.g., "Sports", "Music")

Example Usage

Search for Events

{
  "type": "event",
  "keyword": "Taylor Swift",
  "city": "New York",
  "stateCode": "NY",
  "startDate": "2024-01-01",
  "endDate": "2024-12-31"
}

Search for Venues

{
  "type": "venue",
  "keyword": "Madison Square Garden",
  "city": "New York"
}

Search for Attractions

{
  "type": "attraction",
  "keyword": "Lakers",
  "classificationName": "Sports"
}

Response Format

The server returns structured data including:

Events

  • Event ID, name, and URL
  • Date and time information
  • Price ranges
  • Venue and attraction details
  • Images and multimedia content

Venues

  • Venue ID, name, and address
  • Location coordinates
  • City, state, and country information
  • Capacity and facility details

Attractions

  • Attraction ID and name
  • Classification (genre, segment)
  • Images and promotional content
  • Associated events and venues

Configuration

Environment Variables

Server:

  • PORT: Server port (default: 3000)

Client:

  • TICKETMASTER_API_KEY: Required for client operation (passed to server)
  • GEMINI_API_KEY: Required for client example

Smithery Configuration

The project includes a smithery.yaml file for MCP server configuration:

startCommand:
  type: http
  configSchema:
    type: object
    properties: {}
  exampleConfig: {}

Development

Project Structure

ticketmaster-mcp-server/
├── server/                 # MCP Server implementation
│   ├── src/
│   │   ├── index.ts       # Express server entry point
│   │   ├── server.ts      # MCP server implementation
│   │   └── ticketmaster/  # Ticketmaster API integration
│   │       ├── client.ts  # API client
│   │       ├── tools.ts   # Tool definitions
│   │       ├── types.ts   # Type definitions
│   │       └── formatter.ts # Response formatting
│   ├── package.json
│   └── tsconfig.json
├── client/                # Example MCP client
│   ├── index.ts          # Client implementation
│   ├── package.json
│   └── tsconfig.json
├── Dockerfile            # Docker configuration
├── smithery.yaml        # MCP configuration
└── README.md           # This file

Building from Source

  1. Clone the repository:
git clone https://github.com/mochow13/ticketmaster-mcp-server.git
cd ticketmaster-mcp-server
  1. Build the server:
cd server
npm install
npm run build
  1. Build the client (optional):
cd ../client
npm install
npm run build

Key Dependencies

Server:

  • @modelcontextprotocol/sdk: MCP protocol implementation
  • axios: HTTP client for Ticketmaster API
  • express: Web server framework
  • typescript: Type-safe JavaScript

Client:

  • @modelcontextprotocol/sdk: MCP client implementation
  • @google/genai: Google Gemini AI integration
  • dotenv: Environment variable management

Error Handling

The server includes comprehensive error handling:

  • API Errors: Proper handling of Ticketmaster API errors with detailed messages
  • Validation: Input parameter validation and type checking
  • Network Issues: Retry logic and timeout handling
  • Authentication: Clear error messages for missing or invalid API keys

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Ensure TypeScript compilation: npm run build
  5. Submit a pull request

License

ISC License - see package.json files for details.

Support

For issues related to:

Changelog

v1.1.0

  • BREAKING CHANGE: API key architecture changed - TicketMaster API key now passed from client to server
  • Updated tool schema to include apiKey as required parameter
  • Removed server environment variable dependency for TicketMaster API key
  • Enhanced security by allowing per-request API key specification
  • Updated documentation and examples to reflect new architecture

v1.0.0

  • Initial release
  • Event, venue, and attraction search functionality
  • HTTP transport implementation
  • Docker support
  • Example client with Google Gemini integration

About

An MCP server for TicketMaster Discovery API implemented in Streamable HTTP transport protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published