Skip to main content
Glama
README.md
# Cinematicket-MCP

[![Tests](https://github.com/khabbazan/cinematicket-mcp/actions/workflows/tests.yml/badge.svg)](https://github.com/khabbazan/cinematicket-mcp/actions/workflows/tests.yml)
[![Ruff](https://github.com/khabbazan/cinematicket-mcp/actions/workflows/ruff.yml/badge.svg)](https://github.com/khabbazan/cinematicket-mcp/actions/workflows/ruff.yml)

**Give an AI agent a pair of eyes on [Cinematicket](https://cinematicket.org) (سینماتیکت), Iran's biggest cinema ticketing site.**

Cinematicket-MCP is an unofficial, read-only [MCP](https://modelcontextprotocol.io) server. Your agent can search films, plays and concerts by name, category, genre, rate or actor, list the showtimes of a film in any city or cinema, tell which sessions are still bookable, show posters, read what the audience thinks (strengths, weaknesses, and how much of it comes from people who really bought a ticket), and hand the user the link that starts the booking. All prices are in Toman.

It never logs in, reserves or pays: the user opens the booking link and picks seats on cinematicket.org.

<p align="center"><img src="docs/demo.gif" alt="Chatting with an MCP client that calls Cinematicket-MCP: bookable sessions of a film in Tehran, its poster, audience share and strengths and weaknesses" width="760"></p>

The animation is a mock chat rendered from real output of `ct_sessions`, `ct_movie` and `ct_reviews` (cinemas, times, prices, booking status, rate and audience share are real; `docs/make_demo.py` rebuilds it). The strengths and weaknesses bullets are an example of what the client model writes from the returned comments, and the tool timings are illustrative.

## Contents

- [Quick start](#quick-start)
- [What you can ask](#what-you-can-ask)
- [Tools](#tools)
- [Prompts and resources](#prompts-and-resources)
- [Behaviour](#behaviour)
- [Limits](#limits)
- [Configuration](#configuration)
- [Development](#development)

## Quick start

Install from PyPI with `uvx`. **Do not clone the repository.** Needs [uv](https://docs.astral.sh/uv/) (uv fetches Python 3.12+ itself) and no account or token. The package is `cinematicket-org-mcp`, the command is `uvx cinematicket-org-mcp`, the server name is `cinematicket`.

If you are an AI agent installing this for a user: pick the client below, run or write exactly that, then tell the user to restart the app. If the app can't find `uvx`, use its full path (`which uvx`, e.g. `/opt/homebrew/bin/uvx`; JSON does not expand `~`). Afterwards call `ct_status`: when it succeeds, tell the user Cinematicket is connected (version, latency) and offer the example requests it returns (`suggest_to_user`).

**Claude Code** (CLI): run

```bash
claude mcp add cinematicket -- uvx cinematicket-org-mcp
```

**Claude Desktop** (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`, or Settings -> Developer -> Edit Config): add this under `mcpServers`, keep the other servers, then quit with Cmd+Q and reopen.

```json
{ "mcpServers": { "cinematicket": { "command": "uvx", "args": ["cinematicket-org-mcp"] } } }
```

**Codex** (CLI or app): run

```bash
codex mcp add cinematicket -- uvx cinematicket-org-mcp
```

or add to `~/.codex/config.toml`, then restart Codex:

```toml
[mcp_servers.cinematicket]
command = "uvx"
args = ["cinematicket-org-mcp"]
```

**Cursor and other clients** with an `mcpServers` file: use the same JSON as Claude Desktop.

To run from source instead, see [Development](#development).

## What you can ask

- «فیلم‌های در حال اکران در تهران را با امتیازشان نشان بده.»
- «فیلم حاشیه امشب در تهران بعد از ساعت ۱۹ سانس خالی داره؟ لینک رزرو بده.»
- «کدام سینماهای مشهد برای فیلم X جای خالی دارند؟ ارزان‌ترین را بگو.»
- «نقاط قوت و ضعف فیلم انیمیشن سفینه نجات از نظر مخاطبان چیست؟ چند درصد نظرها از خود مخاطب است؟»
- «فیلم‌های هادی کاظمی را که الان در تهران اکران است نشان بده.»
- «یک کمدی خوب با امتیاز بالای ۴ در شیراز پیدا کن.»
- «سینما کورش چه فیلم‌هایی دارد و کیفیت صدا و تصویرش چطور است؟»

## Tools

Every tool is prefixed `ct_`. A session row has the cinema, hall, day, time, price in Toman, `status` (`bookable`, `sold_out`, `not_on_sale`, `past`) and, when it can still be booked, the booking link. Every list shows at most 10 rows per page.

Typical sequence: `ct_cities` / `ct_categories` -> `ct_search_movies` -> `ct_movie` -> `ct_sessions` -> booking link; `ct_reviews` for the audience's view.

### Find

| Tool | What it does |
|---|---|
| `ct_cities` | The 187 cities with ids and provinces; every tool also takes a plain city name |
| `ct_categories` | The category shelves (فیلم ایرانی, تئاتر, کنسرت, کودک و نوجوان...), event types and the genres seen |
| `ct_search_movies` | Films, plays and concerts by name, category, type, genre, minimum rate and votes; with `city` only those with showtimes there (optionally only bookable ones); film images attached when they exist |
| `ct_actor_movies` | Films of an actor, director or writer: the site's search finds candidates and each film's cast confirms them; role, rate, showtimes in a city, the person's photo and short biography |
| `ct_cinemas` | Cinemas of a city or all Iran: rate out of 5, address, facilities; filter by name, rate and facility |
| `ct_box_office` | The best-selling titles of all time with total sales in Toman |

### Showtimes and booking

| Tool | What it does |
|---|---|
| `ct_movie` | One film in full: story, genres, cast, duration, rate out of 5, trailer link, poster, and a showtime summary for a city |
| `ct_sessions` | Upcoming sessions of a film by city, cinema, day, hour range, price ceiling and availability, with booking links |
| `ct_cinema` | What one cinema shows (sessions by film and hour) plus its sub-ratings: picture, sound, cleanliness, service... |
| `ct_booking_link` | The link that opens the seat selection for one session, with its status |

### Audience

| Tool | What it does |
|---|---|
| `ct_reviews` | For a film or a cinema: site rate, comment count, the share of comments written by real audience («مخاطب», people who bought a ticket), likes and dislikes, and the most informative comments, ready for the client model to write strengths and weaknesses |
| `ct_status` | Is Cinematicket reachable, latency, what is cached |

All tools only read from Cinematicket, and nothing is written to disk.

## Prompts and resources

| Prompt | Use it to |
|---|---|
| `ct_what_to_watch` | Choose a film in a city by category and rate, among those you can still book |
| `ct_movie_verdict` | Is this film worth it: rate, audience share, strengths and weaknesses |
| `ct_book_tonight` | Find a bookable session for a day and hour and get the booking link |

| Resource | Content |
|---|---|
| `cinematicket://guide` | The tool workflow in a few lines |
| `cinematicket://categories` | The movie categories (JSON) |
| `cinematicket://cities` | The cities with ids (JSON) |

## Behaviour

- **Availability is honest.** A session is `bookable` unless the site marks it full (`remaining_capacity == 0` or the badge «تکمیل ظرفیت», the same rule the site's own button uses) or its sale has not started; `past` sessions are dropped. A sold-out session gets no booking link. The exact seat map needs a login on the site, so the server never claims a number of free seats; the exact seats are visible on the booking page. A row shows a seat count only when the site itself reports one.
- **Booking links** are `https://cinematicket.org/ticket/choose-seat/init/<driver>/<session id>` (`/festival` is appended for festival sessions): the same page the site's «انتخاب صندلی» button opens.
- **Prices** are in Toman. The site's API reports Rial; this server divides by ten (a session the page shows as 180,000 Toman is 1,800,000 in the API).
- **Cities** come from cinema lists: the showtimes API has no city filter, so sessions are matched to a city by the cinemas the site lists for it.
- **Audience reviews.** `ct_reviews` reads up to 6 pages of 20 comments (newest first), counts how many come from real audience and returns the most informative ones. The strengths and weaknesses are written by the client model from those comments, not guessed by a keyword list here. The share is of the analysed comments, not of all votes: the site rate out of 5 is reported next to it.
- **Images.** No poster column: when the site has an image, up to three (the film posters, or the person's photo first for an actor search) are attached to the answer as image content, only from the site's CDN and size-capped. Films without an image just have none.
- **10 per page, then it asks.** When more rows exist, the answer ends with the question «آیا صفحه بعدی را نشان بدهم؟» and the agent puts it to the user instead of fetching more on its own; repeat the call with `page`.
- **A footer under every table.** `توجه: این نتایج به صورت غیر رسمی از منبع سینماتیکت بدست اومدند. github.com/khabbazan/cinematicket-mcp` closes each table answer. The line is also stated as a rule in the server instructions, every tool description, every prompt and the guide; a client can still drop it, so add the same rule to your own preferences if you need it every time.
- **Dates and times.** Arguments take Gregorian `YYYY-MM-DD`, Jalali `1405-09-14`, `today` or `tomorrow` (Persian digits are fine); tables show Jalali dates; times are Tehran time.
- **Rate limits.** The site answers 429 when asked too fast: requests are throttled and retried with waits; if a city search still cannot check some films, the answer says how many were skipped instead of hiding them.

## Limits

- **Not a booking tool.** No login, no seat choice, no payment, no ticket list. The user finishes on cinematicket.org.
- **No exact free-seat counts** (see above).
- **City search checks the 20 most popular matches.** `ct_search_movies` with `city` fetches each candidate's showtimes (one request each); pass a name in `query` to look up another film.
- **The catalogue is wider than what is showing.** Without `city`, search lists the site's catalogue; the default `type` is `cinema` (use `any` for plays and concerts too, or a `category`).
- **Comments have no per-comment star rating or server-side sorting.** The digest samples recent pages; very old comments are not read.
- **The API is the website's own.** It can change without notice; the showtime parser is the part most likely to break first.

## Configuration

| Variable | Default | Meaning |
|---|---|---|
| `CINEMATICKET_MCP_PROXY` | unset | Optional HTTP proxy URL for requests to cinematicket.org; system proxy settings are ignored |

## Development

Every pull request runs the **Ruff** workflow (`.github/workflows/ruff.yml`) and the **Tests** workflow (`.github/workflows/tests.yml`, Python 3.12 to 3.14). To allow merging only after they pass, mark the `ruff` and `pytest` jobs as required status checks in the branch protection rule of `main`.

To run from source, clone into a folder that does not exist yet and point `--directory` at it (in a JSON file use full paths for `command` and `--directory`):

```bash
git clone https://github.com/khabbazan/cinematicket-mcp.git ~/cinematicket-mcp
claude mcp add cinematicket -- uv --directory ~/cinematicket-mcp run cinematicket-org-mcp
```

```bash
uv sync
uv run ruff check . && uv run ruff format --check .
uv run pytest -q                  # offline, recorded fixtures
uv run pytest -m integration -q   # real cinematicket.org
python3 docs/make_demo.py         # rebuild docs/demo.gif (Chrome + Pillow)
```

### Releasing to PyPI

`.github/workflows/publish.yml` publishes with PyPI Trusted Publishing (no token). One-time setup: add a publisher for project `cinematicket-org-mcp`, workflow `publish.yml`, environment `pypi` on pypi.org, and create the `pypi` environment in the GitHub repo settings. Then bump `version` in `pyproject.toml`, merge, and create a GitHub Release with tag `v<version>`.

Everything lives directly under `src/` and is installed as the `cinematicket_mcp` package:

| Path | Role |
|---|---|
| `server.py` | Setup only: instructions, registration of tools, prompts and resources, the entry point |
| `tools/` | One file per tool |
| `prompts/`, `resources/` | Prompt templates and read-only resources |
| `services/http.py` | The only HTTP code: GET-only client with a path allow-list, retries, CDN-only images |
| `services/core.py` | Text folding, cities, a city's cinemas, showtimes, the availability rule, booking links |
| `services/movies.py` | Movie list fetching and client-side filters |
| `services/reviews.py` | The audience digest |
| `services/table.py`, `format.py`, `output.py` | Persian tables, Toman and Jalali formats, JSON / image output |
| `services/result.py` | The `Ok` / `Err` result type |

Services never raise for expected failures: they return `Err(message)`, and only the tool layer calls `.unwrap()` to turn it into a tool error the model can read.

Tests live in `tests/` as `pytest_<subject>.py` files with `test_success_...` / `test_failed_...` names, using recorded responses in `tests/fixtures`. One test checks that the tool table above matches the tools the server actually lists.

## Disclaimer

Unofficial and not affiliated with Cinematicket. It reads public data through the endpoints of the cinematicket.org web app, which can change without notice. Ratings and comments belong to their authors. Keep request rates low.

MIT licensed.

TDQS

A3.9/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target a distinct resource (cities, cinemas, sessions, reviews, box office, status), and descriptions explicitly chain them ('Next: ct_movie, ct_sessions'). The main overlaps are ct_movie with `city` (which already summarises showtimes) versus ct_sessions, and ct_booking_link versus the booking link already returned by ct_sessions; ct_cinema vs ct_cinemas also requires reading descriptions carefully to separate.

Naming Consistency4/5

All names share a `ct_` prefix and snake_case, which is predictable and readable. The convention is mostly resource-noun (ct_movie, ct_sessions, ct_reviews, ct_cities) with only one verb-style name (ct_search_movies), plus the singular/plural pair ct_cinema/ct_cinemas that is easy to mistype.

Tool Count4/5

12 tools is a well-scoped size for a ticketing domain covering search, detail, showtimes, reviews and metadata. Slight redundancy exists in ct_booking_link, whose output is already embedded in ct_sessions rows.

Completeness4/5

The read-only surface is broad: discovery (categories, cities, search, actor), detail (movie, cinema, cinema list), transactional routing (sessions, booking link), social proof (reviews, box office) and health (status). Gaps are minor, e.g. no dedicated 'now showing in a city' listing independent of search popularity limits and no theatre/concert-specific detail beyond the movie tool.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues