Skip to main content
Glama
AMC MCP Server
by ho-ju

AMC MCP Server 🎬

一个模型上下文协议(MCP)服务器,为 AMC Theatres 提供全面的电影预订体验。该服务器使对话式 AI 助手能够通过简单的 API 接口帮助用户发现电影、查找放映时间、预订座位和处理付款。

功能 ✨

  • 电影发现:浏览当前上映的电影并获得个性化推荐

  • 放映时间查询:按地点、日期和电影查找可用的放映时间

  • 座位选择:查看交互式座位图并检查可用性

  • 预订管理:通过实时可用性检查预订座位

  • 支付处理:处理带有确认收据的模拟支付交易

  • 多地点支持:跨多个 AMC 影院地点搜索

Related MCP server: AMC MCP Server

快速开始 🚀

先决条件

  • Python 3.8+

  • Docker(可选,用于容器化部署)

安装

选项 1:本地安装

  1. 克隆仓库:

git clone <repository-url>
cd amc-mcp
  1. 安装依赖:

pip install -r requirements.txt
  1. 安装包:

pip install -e .
  1. 运行服务器:

python -m amc_mcp.fastmcp_server

选项 2:Docker 部署

  1. 使用 Docker Compose 构建并运行:

docker-compose up --build
  1. 或手动构建并运行:

docker build -t amc-mcp .
docker run -it amc-mcp

MCP 工具参考 🛠️

1. get_now_showing

返回指定地点当前上映的电影列表。

输入:

{
  "location": "Boston, MA"
}

输出:

{
  "location": "Boston, MA",
  "movies": [
    {
      "movie_id": "mv001",
      "title": "Dune: Part Two",
      "rating": "PG-13",
      "duration": 166,
      "genre": "Sci-Fi/Action",
      "description": "Paul Atreides unites with Chani..."
    }
  ]
}

2. get_recommendations

根据心情、类型或偏好推荐电影。

输入:

{
  "genre": "action",
  "mood": "exciting"
}

输出:

{
  "criteria": {"genre": "action", "mood": "exciting"},
  "recommendations": [...]
}

3. get_showtimes

获取特定电影和地点的可用放映时间。

输入:

{
  "movie_id": "mv001",
  "date": "2025-10-28",
  "location": "Boston, MA"
}

输出:

{
  "movie": {"id": "mv001", "title": "Dune: Part Two"},
  "date": "2025-10-28",
  "location": "Boston, MA",
  "showtimes": [
    {
      "showtime_id": "st001",
      "theater_name": "AMC Boston Common 19",
      "theater_address": "175 Tremont Street",
      "time": "14:00",
      "format": "IMAX",
      "price": 18.50
    }
  ]
}

4. get_seat_map

显示特定放映时间的可用座位和已预订座位。

输入:

{
  "showtime_id": "st001"
}

输出:

{
  "showtime_id": "st001",
  "movie": "Dune: Part Two",
  "theater": "AMC Boston Common 19",
  "date": "2025-10-28",
  "time": "14:00",
  "seat_map": [
    {
      "seat_number": "A5",
      "row": "A",
      "column": 5,
      "is_available": true,
      "price_tier": "Standard",
      "price": 18.50
    }
  ]
}

5. book_seats

为用户预订所选座位。

输入:

{
  "showtime_id": "st001",
  "seats": ["A5", "A6"],
  "user_id": "user123"
}

输出:

{
  "booking_id": "booking-uuid",
  "status": "pending",
  "movie": "Dune: Part Two",
  "theater": "AMC Boston Common 19",
  "date": "2025-10-28",
  "time": "14:00",
  "seats": ["A5", "A6"],
  "total_price": 37.00
}

6. process_payment

处理模拟支付交易。

输入:

{
  "booking_id": "booking-uuid",
  "payment_method": "card",
  "amount": 37.00
}

输出:

{
  "payment_id": "payment-uuid",
  "payment_status": "success",
  "booking_id": "booking-uuid",
  "receipt_url": "https://amc.com/receipts/payment-uuid",
  "confirmation": {
    "movie": "Dune: Part Two",
    "theater": "AMC Boston Common 19",
    "date": "2025-10-28",
    "time": "14:00",
    "seats": ["A5", "A6"],
    "total_paid": 37.00
  }
}

示例对话流程 💬

以下是典型的电影预订对话流程:

  1. 用户:“今晚在我附近找一部动作片。”

    • 服务器调用:get_now_showing + get_recommendations

    • 返回:带放映时间的动作片列表

  2. 用户:“预订今晚 8 点《沙丘:第二部》的两个座位。”

    • 服务器调用:get_showtimes → get_seat_map → book_seats

    • 返回:座位选择和预订确认

  3. 用户:“用我的卡支付。”

    • 服务器调用:process_payment

    • 返回:带数字收据的支付确认

架构 🏗️

amc-mcp/
├── src/
│   └── amc_mcp/
│       ├── __init__.py
│       └── server.py          # Main MCP server implementation
├── data/
│   ├── movies.json           # Movie catalog
│   ├── theaters.json         # Theater locations
│   ├── showtimes.json        # Showtime schedules
│   └── seats.json           # Seat maps by showtime
├── config/
│   └── nginx.conf           # Web server configuration
├── Dockerfile               # Container configuration
├── docker-compose.yml       # Multi-service orchestration
├── requirements.txt         # Python dependencies
├── pyproject.toml          # Package configuration
└── README.md               # This file

数据模型 📊

Movie

{
  "movie_id": str,
  "title": str,
  "rating": str,         # PG, PG-13, R, etc.
  "duration": int,       # Minutes
  "genre": str,
  "description": str,
  "poster_url": str
}

Theater

{
  "theater_id": str,
  "name": str,
  "address": str,
  "city": str,
  "state": str,
  "zip_code": str
}

Showtime

{
  "showtime_id": str,
  "movie_id": str,
  "theater_id": str,
  "date": str,           # YYYY-MM-DD
  "time": str,           # HH:MM
  "format": str,         # Standard, IMAX, 3D, Dolby
  "price": float
}

开发 👨💻

添加新电影

编辑 data/movies.json 以添加新电影:

{
  "movie_id": "mv011",
  "title": "New Movie Title",
  "rating": "PG-13",
  "duration": 120,
  "genre": "Action",
  "description": "Description of the movie...",
  "poster_url": "https://example.com/poster.jpg"
}

添加新影院

编辑 data/theaters.json:

{
  "theater_id": "th011",
  "name": "AMC New Location 15",
  "address": "123 Main Street",
  "city": "New City",
  "state": "NY",
  "zip_code": "12345"
}

添加放映时间

编辑 data/showtimes.json 和 data/seats.json 以添加新的放映时间和相应的座位图。

测试

手动测试

您可以使用 MCP 检查器或连接到任何兼容 MCP 的客户端来测试各个工具。

使用 Claude Desktop 进行测试

  1. 配置 Claude Desktop 以连接到您的 MCP 服务器

  2. 使用自然语言测试预订流程

  3. 示例:“找一部今晚在波士顿上映的科幻电影”

配置 ⚙️

环境变量

  • PYTHONPATH:设置为 /app/src 以确保正确的模块解析

  • PYTHONUNBUFFERED:设置为 1 以实现实时日志记录

  • MCP_LOG_LEVEL:设置日志级别(DEBUG、INFO、WARNING、ERROR)

Docker 配置

服务器运行在轻量级 Python 3.11 容器中,具有:

  • 非 root 用户以确保安全

  • 用于监控的健康检查

  • 用于数据持久化的卷挂载

  • 网络隔离

安全注意事项 🔒

这是一个模拟实现,用于演示目的。在生产环境中:

  1. 支付处理:与真实支付网关(Stripe、PayPal)集成

  2. 身份验证:添加用户身份验证和授权

  3. 数据验证:实现全面的输入验证

  4. 速率限制:添加 API 速率限制

  5. 加密:使用 HTTPS 并加密敏感数据

  6. 数据库:用真实数据库替换 JSON 文件

  7. 日志记录:实现结构化日志记录和监控

未来增强 🔮

  • 真实 AMC API 集成:连接到实际的 AMC Theatres API

  • 用户账户:持久的用户资料和预订历史

  • 团体预订:支持多个用户一起预订

  • 会员计划:AMC Stubs 集成

  • 移动票券:生成用于移动入场的二维码

  • 座位推荐:AI 驱动的优化座位建议

  • 价格提醒:通知用户折扣和促销信息

  • 社交功能:与朋友分享电影计划

  • 无障碍:符合 ADA 标准的座位选择

  • 多语言:国际语言支持

贡献 🤝

  1. Fork 仓库

  2. 创建功能分支:git checkout -b feature/new-feature

  3. 进行更改并添加测试

  4. 提交更改:git commit -am 'Add new feature'

  5. 推送到分支:git push origin feature/new-feature

  6. 提交拉取请求(Pull Request)

许可证 📄

本项目采用 MIT 许可证授权 - 有关详细信息,请参阅 LICENSE 文件。

支持 💬

如有问题、疑问或功能请求:

  • 在 GitHub 仓库中创建 issue

  • 查看文档以获取常见解决方案

  • 查看示例对话流程


祝您预订电影愉快!🍿🎬

Available Tools

6 tools
book_seatsC

Reserves selected seats for the user.

Inputs: seats (required), user_id (required), showtime_id (required). Returns: result

get_now_showingA

Returns a list of movies currently showing in a given city or ZIP code.

Inputs: location (required). Returns: result

get_recommendationsA

Suggests movies based on mood, genre, or time preferences.

Inputs: mood, genre, time_preference. Returns: result

get_seat_mapA

Displays available and reserved seats for a specific showtime.

Inputs: showtime_id (required). Returns: result

get_showtimesB

Fetches available showtimes for a specific movie and location.

Inputs: date (required), location (required), movie_id (required). Returns: result

process_paymentC

Handles simulated payment transaction.

Inputs: amount (required), booking_id (required), payment_method (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool targets a distinct step in the movie-booking flow: recommendations, showtimes, seat maps, booking, payment, and now-showing lists. The only slight overlap is between get_recommendations and get_now_showing, but their purposes (personalized suggestions vs. current listings) are clear enough.

    Naming Consistency4/5

    All tools use a consistent verb_noun pattern (get_, book_, process_), which is predictable. Minor deviation: 'process_payment' uses a generic verb compared to the more specific 'get_' and 'book_' verbs, but it still fits the pattern.

    Tool Count5/5

    Six tools is well-scoped for a movie booking domain, covering the essential user journey from discovery to payment without unnecessary bloat. Each tool serves a clear purpose in the workflow.

    Completeness4/5

    The surface covers the core booking lifecycle: discover movies, check showtimes, view seats, book, and pay. A minor gap is the lack of a cancellation or refund tool, but the simulated payment and booking flow is otherwise complete.

    Related MCP Connectors

    Related MCP Servers