maoyan-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@maoyan-mcp find showtimes for Ne Zha 2 at cinemas in Shanghai"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
maoyan-mcp(猫眼 + 大麦票务查询 MCP)
一个只读的 MCP(模型上下文协议)服务器:让 AI 助手查询猫眼电影排片、 猫眼演出和大麦演出信息。只做查询,不下单、不抢票、不支付。
English summary: A read-only MCP server (FastMCP, stdio) for querying Maoyan movie showtimes and performance listings and Damai performance listings in China. Query-only — no ordering, no ticket grabbing, no payments. See NOTES.md for endpoint research (kept out of git by default).
功能
猫眼
工具 | 说明 | 需要登录 |
| 正在热映(全国热映榜) | 否 |
| 即将上映(按城市) | 否 |
| 按片名搜索电影 | 否 |
| 电影详情:类型、导演、时长、评分、简介 | 否 |
| 某城市影院列表,可按名/地址筛选 | 否 |
| 某影院排片:场次时间、影厅、版本、语言 | 否 |
| 某城市热门演出列表 | 否 |
| 在热门演出列表内按关键词/分类筛选 | 否 |
| 演出详情:时间、城市、场馆、票价档、开售时间 | 否 |
| 演出场次与票档:时间、票档名、票面价/实售价、余票、限购(预售和已开售都已实测) | 是 |
| 登录状态 / Cookie 导入 / 退出 | — |
| 暂未实现(见下) | — |
大麦
大麦没有电影排片,只有演出。工具名都带 damai_ 前缀。
工具 | 说明 | 需要登录 |
| 大麦热门演出列表,可按城市/分类筛选 | 否 |
| 在热门榜内按关键词(片名/艺人/场馆)筛选 | 否 |
| 演出详情:时间、城市、场馆、票价区间、开售时间、艺人 | 否 |
| 演出场次与票档(见“已知限制”:目前场次不可用) | 部分 |
| 大麦登录状态 / Cookie 导入 / 退出 | — |
| 暂未实现(见下) | — |
Related MCP server: Cinema Scheduler
安装
git clone https://github.com/<you>/maoyan-mcp.git
cd maoyan-mcp
python3 -m venv .venv
.venv/bin/pip install -e .Python ≥ 3.10。依赖只有 fastmcp 和 httpx。
在 MCP 客户端里使用
以 Claude Desktop / Cursor 等为例,在 MCP 配置里加:
{
"mcpServers": {
"maoyan": {
"command": "/path/to/maoyan-mcp/.venv/bin/maoyan-mcp"
}
}
}也可以直接跑:.venv/bin/python -m maoyan_mcp(stdio 传输)。
冒烟测试(无需登录,真实联网查询):
.venv/bin/python scripts/smoke.py # 猫眼电影 + 演出
.venv/bin/python scripts/smoke_damai.py # 大麦热门 / 搜索 / 详情演出票档冒烟测试(需要先 import_cookie 登录,真实联网查询):
.venv/bin/python scripts/smoke_tickets.py [演出编号 ...]
# 默认查 518642([第25小时]跨年演唱会)和 509000(话剧《茶馆》)
.venv/bin/python scripts/smoke_damai_tickets.py [演出编号 ...]
# 默认查 1095761949422(周传雄深圳站)和 1101026106334(回春丹佛山站)大麦登录单独验证(不保存凭证,Cookie 只从 stdin 读):
printf '%s' 'cookie2=...; tb_token_=...; ...' \
| .venv/bin/python scripts/test_damai_auth.py登录
绝大多数查询不需要登录。 只有演出场次与票档(get_performance_tickets)
需要登录,因为猫眼的场次接口未登录会返回“请先登录”。
短信验证码登录:暂未实现
send_sms_code / login_with_sms 调用时会明确返回不可用,不会假装成功。
原因是美团/大众点评的登录流程必须先通过滑块验证(verify.meituan.com,
yoda),其 behavior / _token 参数与真实浏览器里的滑动轨迹绑定,
没有纯接口的短信登录流程。详见 NOTES.md。
可用的后备方式:导入 Cookie
在浏览器里登录大众点评,用和猫眼同一个手机号。 注意:只登录猫眼演出拿不到这个 Cookie,实测猫眼演出站本身没有
.dianping.com的 Cookie,只有登录大众点评后才有dper;开发者工具 → Application → Cookies →
.dianping.com,复制dper的值;调
import_cookie,传入dper=<值>。
工具会先拿这个凭证去猫眼校验,通过后才保存在本机
~/.maoyan-mcp/auth.json(文件权限 0600),凭证只存本机、不上传、
不写入代码或日志。logout 可删除它。
大众点评 App 扫码登录是另一条已验证可行的路(catbus 项目在用), 但它需要 H5guard 的 JS 签名,本项目 MVP 未实现,见 NOTES.md。
大麦登录:导入淘宝登录 Cookie(没有 SESSION)
大麦的登录是淘宝/支付宝账号体系,短信登录同样需要先过滑块验证
或 App 扫码,没有纯接口流程,所以 damai_send_sms_code /
damai_login_with_sms 也明确返回不可用。
后备方式与猫眼相同,只是 Cookie 不同:大麦现在的登录里没有
SESSION 这个 Cookie(2026-12-03 用真实登录验证过:已登录
的浏览器里,passport.damai.cn 和 www.damai.cn 的 .damai.cn
Cookie 列表里都没有 SESSION 这一行)。登录校验用的是淘宝的
登录 Cookie 组合,必须带上:
必需:
cookie2(淘宝登录会话)+tb_token_(Damai H5 里 叫这个名字,淘宝侧也写作_tb_token_);一起导入更好:
cna、t、_hvn_login、damai.cn_user、damai.cn_nickName、isg、sgcookie等其余.damai.cn登录 Cookie;_m_h5_tk/_m_h5_tk_enc不用复制,程序每次 调用时会自己向网关领新的。
步骤:
在浏览器里登录大麦;
开发者工具 → Application → Cookies →
.damai.cn,在列表里 找到cookie2、tb_token_等,双击 Value 单元格复制完整值 (值很长,单击只选中一部分,必须双击复制);调
damai_import_cookie,传入整串cookie2=<值>; tb_token_=<值>; cna=<值>; ...。
工具会先拿这组凭证去大麦的登录接口校验(未通过则不保存),通过后
保存在本机 ~/.maoyan-mcp/damai_auth.json(文件权限 0600),与猫眼
的凭证分开存。登录 Cookie 会过期,过期后需重新登录、重新导入。
注意:这条登录链路尚未用真实登录验证过(构建时没有可用的
大麦登录),见“已知限制”。想先单独验证登录而不保存凭证,可跑
scripts/test_damai_auth.py(Cookie 只从 stdin 读,不会打印出来)。
已知限制(诚实说明,不伪造数据)
大麦
按场次查票档目前不可用:大麦公开的 H5 详情接口目前不返回 场次列表(
performBases为空,多个项目、多种参数都试过),且按 场次查票档的接口本身也需要登录。damai_get_performance_tickets因此只返回演出的时间范围与票价区间,并如实说明场次不可用, 不编造场次和票价。等大麦恢复返回场次列表后,代码里已留好 按场次查票档的路径(需配合damai_import_cookie的登录 Cookie)。没有公开的关键词搜索接口:
damai_search_performances是在 热门榜(最多 150 条)内按关键词筛选,不是全库搜索;查指定演出 请用演出编号调damai_get_performance_detail。热门榜是全国榜:大麦的榜单接口忽略城市参数,城市筛选是在 本地按场馆城市做的;小城市(如东莞、惠州)在前 150 条热门里 可能一条都没有,这不代表当地没有演出,只是榜单覆盖不到。
大麦登录链路未实测:
damai_import_cookie的校验逻辑是按 上游接口的返回码写的,但构建时没有真实的大麦登录 Cookie 可用, 没有验证通过;用真实登录导入后请先跑scripts/test_damai_auth.py(只从 stdin 读 Cookie,不保存) 或scripts/smoke_damai_tickets.py验证。另:大麦现在的登录 里没有SESSION这个 Cookie,见“大麦登录”一节,不要只传SESSION。
猫眼
售价不完整:电影场次的售价是猫眼“石墨字体”加密的,接口返回的是 自定义字体码位而非数字,无法直接解析。本项目不猜价格,
sell_price返回空,只返回明文的影城卡价vip_price(如有), 并在结果里注明原因。影院列表里的起售价是明文的,可以正常看。排片只覆盖今天起 3 天:这是猫眼接口本身的范围,更远的日期暂无排片。
演出没有公开的关键词搜索接口:
search_performances是在该城市 热门演出列表内筛选,不是全库搜索;查指定演出请用演出编号调get_performance_detail。热门演出榜不是严格的本地表:
cityId确实会改变榜单(深圳、东莞、 惠州三城返回的编号完全不同),但榜单是按城市精选的“热门” feed,个别 条目是巡演项目、在其他城市开售(条目里的on_sale_text会注明,如 “哈尔滨已开售”)。想确认演出到底在哪个城市演,请看get_performance_detail/get_performance_tickets返回的城市和场馆。个别票档没有名字:上游对某些座位区票档只给价格和颜色,不给名字 (如话剧《茶馆》的 380/280/180/100 四档),本项目返回
name: null, 不编造名字。演出详情接口不稳定:
get_performance_detail在 2026-12-03 实测时 成功过一次,随后持续返回 403(疑似上游风控)。工具会如实返回上游 错误,不编造数据;热门演出列表本身稳定可用。12 月 5 日的排片可能还没放出来:以 2026-12-03 实测为例,东莞石龙 的影院里《饥饿游戏:收获日出》只排到 12 月 4 日,12 月 5 日尚无场次, 这是真实数据,不是接口故障。
平台结构
src/maoyan_mcp/providers/ 是按平台拆的:maoyan.py 实现猫眼,
damai.py 实现大麦,__init__.py 里是 provider 的最小约定
(TicketProvider)。新平台照此加一个 provider 文件,在 server.py
里按平台分发即可。
免责声明
本项目与猫眼、大麦无关,是非官方的个人学习/研究项目。
请遵守猫眼、大麦的服务条款;仅以普通浏览的频率查询,不要高频抓取, 不要用于批量爬取或抢票。
两家接口都未公开,随时可能变更或加风控;接口失效时工具会返回明确的 上游错误,而不是假数据。
License
MIT
Available Tools
24 toolsauth_statusAuth StatusB
查看当前登录状态。
Inputs: no named parameters. Returns: object
damai_auth_statusDamai Auth StatusA
查看大麦当前登录状态。
Inputs: no named parameters. Returns: object
damai_get_hot_performancesDamai Get Hot PerformancesA
大麦热门演出列表(演唱会、话剧、音乐会、体育等)。city 可传城市名如“深圳”——大麦的榜单是全国热门榜,城市筛选在本地按场馆城市做;小城市可能返回较少。category 可传“演唱会”“音乐会”“话剧歌剧”“舞蹈芭蕾”“曲苑杂坛”“体育”“展览休闲”或编号。
Inputs: city, limit, category. Returns: object
damai_get_performance_detailDamai Get Performance DetailA
大麦演出详情:时间、城市、场馆、票价区间、开售时间、艺人等,无需登录。item_id 来自大麦热门演出列表。
Inputs: item_id (required). Returns: object
damai_get_performance_ticketsDamai Get Performance TicketsA
大麦演出场次与票档。诚实说明:大麦公开的 H5 详情接口目前不返回场次列表,且按场次查票档需要登录;本工具返回演出时间范围与票价区间,并说明场次不可用的原因,不编造场次。
Inputs: item_id (required). Returns: object
damai_import_cookieDamai Import CookieA
导入大麦登录 Cookie(后备登录方式):先在浏览器里登录大麦,再取 .damai.cn 的登录 Cookie 整串,如 cookie2=xxx; tb_token_=xxx(还可带 cna、t、damai.cn_user 等)。注意:大麦现在的登录里没有 SESSION 这个 Cookie。验证通过后保存在本机 ~/.maoyan-mcp/damai_auth.json(0600),不上传。注意:该登录验证尚未用真实登录测过,见 README。
Inputs: cookie (required). Returns: object
damai_login_with_smsDamai Login With SmsB
【暂未实现】大麦用短信验证码登录。原因同 damai_send_sms_code:需先过滑块验证或 App 扫码,无法用纯接口完成。
Inputs: code (required), phone (required). Returns: object
damai_logoutDamai LogoutA
退出大麦登录:删除本机保存的大麦登录凭证。
Inputs: no named parameters. Returns: object
damai_search_performancesDamai Search PerformancesA
大麦按关键词搜演出(片名/艺人/场馆名)。注意:大麦没有可用的公开关键词搜索接口,本工具是在热门榜里筛选;如需查指定演出,请用演出编号调 damai_get_performance_detail。city 可传城市名,不传则全国。
Inputs: keyword (required), city, limit, category. Returns: object
damai_send_sms_codeDamai Send Sms CodeA
【暂未实现】大麦发送短信验证码。大麦登录是淘宝/支付宝账号体系,需先过滑块验证或 App 扫码,无法用纯接口完成,调用会明确返回不可用及替代方案。
Inputs: phone (required). Returns: object
get_cinema_showtimesGet Cinema ShowtimesB
某影院的排片:场次时间、影厅、版本、语言。只覆盖今天起 3 天;售价为石墨字体加密,返回为空,影城卡价(如有)在 vip_price。
Inputs: cinema_id (required), date, movie_id. Returns: object
get_coming_moviesGet Coming MoviesB
即将上映的电影列表(按城市)。city 可传城市名如“深圳”或编号如 30。
Inputs: city, limit. Returns: object
get_hot_moviesGet Hot MoviesB
正在热映的电影列表(全国热映榜,不分城市)。
Inputs: limit. Returns: object
get_hot_performancesGet Hot PerformancesA
热门演出列表(不指定关键词时用这个)。city 可传城市名或编号;返回的是按城市精选的热门榜,个别条目可能是巡演项目、在其他城市开售。
Inputs: city, limit. Returns: object
get_movie_detailGet Movie DetailA
一部电影的详情:类型、导演、时长、评分、简介等。movie_id 来自搜索或热映列表。
Inputs: movie_id (required). Returns: object
get_performance_detailGet Performance DetailB
演出详情:时间、城市、场馆、票价档、开售时间等,无需登录。item_id 来自热门演出列表。
Inputs: item_id (required). Returns: object
get_performance_ticketsGet Performance TicketsB
演出场次与票档:每场的时间、票档名、票面价/实售价、余票、限购。需要登录(import_cookie 后可用)。预售期走预选接口,已开售走场次+票档接口,两条都已实测;未登录会明确报错,不返回假数据。
Inputs: item_id (required), city. Returns: object
import_cookieImport CookieA
导入登录 Cookie(后备登录方式):先在浏览器里登录大众点评(www.dianping.com)再取 .dianping.com 的 dper 值,如 dper=xxx——只登录猫眼演出拿不到它。验证通过后保存在本机 ~/.maoyan-mcp/auth.json(0600),不上传。
Inputs: cookie (required). Returns: object
list_cinemasList CinemasB
某城市的影院列表,可按影院名/地址关键词筛选。day 为 YYYY-MM-DD,默认今天。
Inputs: day, city, limit, keyword. Returns: object
login_with_smsLogin With SmsB
【暂未实现】用短信验证码登录。原因同 send_sms_code:需先过滑块验证,无法用纯接口完成。
Inputs: code (required), phone (required). Returns: object
logoutLogoutA
退出登录:删除本机保存的登录凭证。
Inputs: no named parameters. Returns: object
search_moviesSearch MoviesB
按片名搜索电影。city 可传城市名如“深圳”或编号如 30。
Inputs: keyword (required), city. Returns: object
search_performancesSearch PerformancesB
某城市的热门演出列表(演唱会、话剧、音乐会等)。注意:这是猫眼按城市精选的热门榜,不是严格的本地演出表,个别条目可能是巡演项目、在其他城市开售,条目里的 on_sale_text 会注明。
Inputs: keyword (required), city, limit, category. Returns: object
send_sms_codeSend Sms CodeA
【暂未实现】发送短信验证码。美团/大众点评登录需先过滑块验证,无法用纯接口完成,调用会明确返回不可用及替代方案。
Inputs: phone (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
The maoyan vs damai_ prefixed tools are mostly separable, but the parallel performance tools (search_performances vs get_hot_performances, and the four damai equivalents) blur together, and search_performances is described as a hot list rather than a keyword search. Four tools are explicitly marked 【暂未实现】 (send_sms_code, login_with_sms, damai_send_sms_code, damai_login_with_sms), which are dead ends an agent may still pick. The login story (import_cookie vs SMS login vs auth_status) also has overlapping intent.
The verb_noun pattern is followed consistently (get_, list_, search_, import_, send_, login_with_), which is good. However, the namespace is asymmetric: damai tools carry a damai_ prefix while the equivalent Maoyan tools have no prefix, so identical concepts look like different families. The suffix naming (search_performances vs damai_search_performances) makes the pairing readable but not predictable.
24 tools is heavy for a read-only discovery server, and four of them are unimplemented stubs that consume slots without adding capability. The movie/cinema/performance/damai breakdown is logical, but trimming the non-functional auth tools would make the set much tighter.
Discovery coverage is solid for movies (hot, coming, search, detail, cinemas, showtimes) and performances (hot, search, detail, tickets) across both Maoyan and Damai. But the surface stops at browsing: no seat maps, no order/booking flow, and get_cinema_showtimes returns empty prices due to encryption, leaving a dead end. The auth lifecycle is half-finished since SMS login paths are declared unavailable.
Maintenance
Related MCP Connectors
Chinese company registry, litigation, IP and credit data for AI agents. Read-only remote MCP server.
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
Official MCP server for MAQAMI, a hotel and flight booking platform with 3M+ hotels. Search live hotel rates and flights, look up places, airports and hotel details, then prebook and book. Remote Streamable HTTP endpoint, no API key required.
Related MCP Servers
- AlicenseBqualityDmaintenance12306 ticket purchase search server based on Model Context Protocol (MCP). It provides a simple API interface, allowing large models to search for 12306 ticket purchasing information through the interface.81Apache 2.0
- FlicenseNot gradedqualityCmaintenanceAn MCP server that scrapes movie theater schedules from eiga.com to provide movie, theater, and showtime data to AI assistants. It enables users to search for screenings and calculate the optimal viewing order for watching multiple movies.-
- AlicenseAqualityDmaintenanceMCP server for searching, discovering, and exploring Chinese long-form video content from WeTV and Tencent Video, enabling AI assistants to recommend dramas, variety shows, anime, and movies with play links, ratings, and episode info.6MIT
- AlicenseAqualityDmaintenanceUnofficial, read-only MCP server for Fandango showtimes and seat availability, reverse-engineered from observed web traffic.462MIT