Token导航 LogoToken导航TokenDH.com
trakt mcpserver logo
数据服务stdio官方级别未说明来源级核验

trakt mcpserver

MCP Server

MCP Trakt是一个连接AI语言模型与Trakt.tv API的服务器,提供实时娱乐数据和个人观影历史访问功能。

工具数

0

提示词数

0

GitHub Stars

28

资源数

0
PythonClaude数据分析Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

wwiens

提供方

wwiens

最后核验

2026/5/17 20:21

运行时

Docker

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

docker run -d --rm --name trakt_mcpserver \

详细介绍

🎬 MCP Trakt:你的AI通往娱乐数据的门户

MCP Trakt Built by AI+Humans

Powered by Claude

一个模型上下文协议(MCP)服务器,在人工智能语言模型和Trakt.tv API之间建立一个桥梁,允许LLM访问实时娱乐数据和个人Trakt观看历史。使用FastMCP构建以域为中心的架构,在身份验证、节目、季节、剧集、电影、人物、用户数据、评论、搜索和签入功能之间提供清晰的关注点分离。

🖥️ 人工智能实验

除了这一段,这里的一切都是人工智能生成的,包括代码。我的目标是更多地了解MCP,并且一直在和Cursor一起玩,所以将这些结合在一起似乎是自然而然的下一步。结果就是这个项目。未来的所有变化也将由人工智能完成。

📚 关于MCP和Trakt

模型上下文协议(MCP) 使AI模型能够通过标准化的工具和资源与外部系统进行交互。 Track.TV 是一个用于跟踪电视节目和电影的综合平台,拥有1400多万用户和面向开发人员的广泛API。

🚀 快速开始

Docker快速入门

docker run -d --rm --name trakt_mcpserver \
  -e TRAKT_CLIENT_ID=your_client_id \
  -e TRAKT_CLIENT_SECRET=your_client_secret \
  -v trakt_auth:/data \
  -p 8080:8080 \
  ghcr.io/wwiens/trakt_mcpserver:latest

本地安装

需要Python 3.12或更高版本。

  1. 克隆此存储库
   git clone https://github.com/wwiens/trakt_mcpserver.git
   cd trakt_mcpserver
  1. 创建虚拟环境并安装依赖项
   python3 -m venv .venv
   source .venv/bin/activate
   pip install -e .
  1. 设置您的环境
   cp .env.example .env

然后编辑 .env 添加您的Trakt API证书:

   TRAKT_CLIENT_ID=your_client_id
   TRAKT_CLIENT_SECRET=your_client_secret
  1. 运行服务器
   python server.py

在Claude Desktop中安装

添加到您的Claude Desktop MCP配置文件中:

{
  "mcpServers": {
    "trakt": {
      "command": "python",
      "args": ["/path/to/your/server.py"],
      "env": {
        "TRAKT_CLIENT_ID": "your_client_id",
        "TRAKT_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

✨ 特性

🌎 公共Trakt数据

  • 访问热门节目和电影
  • 发现最受期待、喜爱、播放和观看的内容
  • 观看上周末美国票房收入最高的电影
  • 从Trakt的全球社区获取实时数据
  • 带有标题、年份和受欢迎程度指标的格式化回复
  • 查看详细评级 用于节目和电影,包括平均得分和分布
  • 浏览演出季 包括每季的集数、播出集数和收视率
  • 潜入特定季节 包含详细信息、剧集列表、收视率、演员和工作人员、视频、翻译和参与度统计
  • 看看谁在看 当前的特定季节
  • 查找列表 包含特定季节
  • 探索单个剧集 包含详细的摘要、评级、演员和工作人员、视频、翻译和参与度统计
  • 看看谁在看 当前的一个特定事件
  • 查找列表 包含特定剧集
  • 查找演员和工作人员 适用于任何电影或节目,可选择客串明星出演
  • 探索人 有传记、社交媒体和完整的电影
  • 浏览一个人的学分 跨角色名称和剧集数量的电影和节目
  • 查找列表 包含特定的人

👤 个人Trakt数据

  • 查看您观看的节目:获取您亲自观看过的完整节目列表
  • 查看每个系列的确切最后观看日期
  • 跟踪您观看每个节目的次数
  • 登记参加演出 您当前正在观看,将其标记为已观看

- 按节目ID(更精确)或节目标题(更方便) - 在您的签到中包含自定义消息 - 看看你什么时候以人类可读的格式观看了这一集

  • 搜索节目 查找他们的详细信息和ID
  • 管理您的评级:查看、添加和删除具有分页支持的电影、节目、季节和剧集的个人评级
  • 管理您的观察名单:使用分页和排序支持查看、添加和删除监视列表中的项目

- 按类型筛选(全部、电影、节目、季节、剧集) - 按多个条件排序(排名、添加、标题、发布、运行时、流行度、百分比、投票) - 在观察列表项目中添加可选注释(VIP功能,500个字符限制)

  • 跟踪演出进度:查看您观看的任何电视节目的进度

- 按完成百分比查看观看的剧集与播出的剧集 - 看你的下一集 - 查看每个赛季的进度统计数据 - 可选包括隐藏的季节和特价

  • 管理播放进度:查看并清除暂停的播放项目

- 观看您在观看过程中暂停的电影和剧集 - 查看进度百分比和暂停时间 - 清除不再需要的播放项目

  • 管理手表历史记录:添加和删除历史记录中的项目

- 标记已观看的电影、节目、季节或剧集 - 可选择指定观看时间 - 从手表历史记录中删除项目

  • 通过设备代码流使用Trakt进行安全身份验证
  • 个人数据直接从您的Trakt帐户中提取

🎯 个性化推荐

  • 获取量身定制的电影和节目建议 基于您的手表历史记录和评级(需要身份验证)
  • 过滤掉您已经收集或关注的项目
  • 隐藏推荐 你不感兴趣,所以他们不会回来
  • 打开 以前隐藏的项目可以还原它们

💬 评论与评价

  • 查看节目和电影的评论:阅读别人对你最喜欢的内容的评价
  • 查看特定季节和剧集的评论:了解节目的特定部分
  • 查看个人评论及其回复:参与社区讨论
  • 扰流板保护:默认情况下,带有剧透的评论是隐藏的
  • 切换扰流板可见性:选择是显示还是隐藏剧透
  • 查看评论:更长、更详细的评论标记为评论
  • 查看评级分布:查看有多少用户给每个评分从1到10

🔄 通用特性

  • 通过MCP资源公开Trakt API数据
  • 提供获取实时娱乐信息的工具
  • 使AI模型能够提供个性化的娱乐推荐
  • 简单的身份验证和注销过程
  • 分页支持 对于列表端点(趋势、流行、预期、收藏、播放、观看、搜索、评论、评级、观察列表):

- 通过 page: int 用于具有分页元数据的单页结果 - 省略 page 自动分页并返回到 limit 以平面列表形式列出所有项目 - 使用 limit=0 获取所有可用结果(为安全起见,上限为100)

🔥 实时趋势数据

  • 访问当前热门的电视节目,包括现场观众数量
  • 实时更新热门电影
  • 查看Trakt全球1400多万用户社区中流行的内容
  • 例如:《白莲》(2021)、《夜魔侠:重生》(2025)、《黑袋子》(2025年)

🔌 可用资源

MCP资源提供AI模型可以访问的静态数据端点。这些URI通过标准化的接口公开Trakt数据。

View all available resources

显示资源

资源描述示例数据
trakt://shows/trending过去24小时内收视率最高的节目节目名称、年份、观众人数
trakt://shows/popular基于收视率的最受欢迎节目节目标题、年份、受欢迎程度得分
trakt://shows/anticipated按列表计数排序的最受期待的节目节目标题、年份、列表计数
trakt://shows/favorited最受欢迎的节目节目名称、年份、最受欢迎次数
trakt://shows/played播放次数最多的节目节目名称、年份、播放次数
trakt://shows/watched独立用户观看次数最多的节目节目标题、年份、观看人数

影视资源

资源描述示例数据
trakt://movies/trending过去24小时内观看最多的电影电影名称、年份、观众数
trakt://movies/popular基于评级的最受欢迎电影电影标题、年份、流行评分
trakt://movies/anticipated按列表计数排序的最受期待的电影电影标题、年份、列表计数
trakt://movies/favorited最受欢迎的电影电影名称、年份、最受欢迎电影数
trakt://movies/played播放次数最多的电影电影名称、年份、播放次数
trakt://movies/watched独立用户观看最多的电影电影标题、年份、观看人数
trakt://movies/boxoffice上周末美国十大票房电影电影名称、年份、收入

用户资源

资源描述示例数据
trakt://user/auth/status当前身份验证状态身份验证状态,令牌过期
trakt://user/watched/shows已验证用户观看的节目节目标题、年份、上次观看日期、播放次数
trakt://user/watched/movies经过身份验证的用户观看的电影电影标题、年份、上次观看日期、播放次数

🛠️ 可用工具

MCP工具是人工智能模型可以通过参数调用的交互式函数。使用这些来获取、搜索和管理Trakt数据。

Show Tools

# Get trending shows: auto-paginate up to 10 results
fetch_trending_shows(limit=10)

# Get trending shows: fetch ALL results (no limit)
fetch_trending_shows(limit=0)

# Get trending shows: single page with pagination metadata
fetch_trending_shows(limit=10, page=1)

# Get popular shows with optional limit parameter
fetch_popular_shows(limit=10)

# Get anticipated shows with optional limit parameter
fetch_anticipated_shows(limit=10)

# Get favorited shows with optional limit and period parameters
fetch_favorited_shows(limit=10, period="weekly")

# Get most played shows with optional limit and period parameters
fetch_played_shows(limit=10, period="weekly")

# Get most watched shows with optional limit and period parameters
fetch_watched_shows(limit=10, period="weekly")

# Search for shows: auto-paginate all results (omit page parameter)
search_shows(query="Breaking Bad", limit=5)

# Search for shows: single page with pagination metadata
search_shows(query="Breaking Bad", limit=5, page=1)

# Get ratings for a show
fetch_show_ratings(show_id="game-of-thrones")

# Get comprehensive show summary (includes air times, production status, ratings, metadata)
fetch_show_summary(show_id="game-of-thrones", extended=True)  # Default: comprehensive

# Get basic show summary (title, year, ID only)
fetch_show_summary(show_id="game-of-thrones", extended=False)

# Get videos for a show (with embedded markdown - default)
fetch_show_videos(show_id="game-of-thrones")

# Get videos for a show (simple text links)
fetch_show_videos(show_id="game-of-thrones", embed_markdown=False)

# Get related shows (similar shows based on genres, themes, and viewer patterns)
fetch_related_shows(show_id="game-of-thrones", limit=10)

# Get related shows with pagination metadata
fetch_related_shows(show_id="game-of-thrones", limit=10, page=1)

# Get all seasons for a show (includes episode counts, aired episodes, ratings)
fetch_show_seasons(show_id="game-of-thrones")

# Get cast and crew for a show
fetch_show_people(show_id="breaking-bad")

# Get cast, crew, and guest stars for a show
fetch_show_people(show_id="breaking-bad", include_guest_stars=True)

# Search for movies: auto-paginate all results (omit page parameter)
search_movies(query="The Godfather", limit=5)

# Search for movies: single page with pagination metadata
search_movies(query="The Godfather", limit=5, page=1)

Season Tools

# Get detailed info about a specific season
fetch_season_info(show_id="breaking-bad", season=1)

# Get all episodes for a season with ratings and runtime
fetch_season_episodes(show_id="breaking-bad", season=1)

# Get ratings and voting distribution for a season
fetch_season_ratings(show_id="breaking-bad", season=1)

# Get engagement stats (watchers, plays, collectors)
fetch_season_stats(show_id="breaking-bad", season=1)

# Get cast and crew for a season
fetch_season_people(show_id="breaking-bad", season=1)

# Get videos/trailers for a season (with embedded markdown - default)
fetch_season_videos(show_id="breaking-bad", season=1)

# Get videos for a season (simple text links)
fetch_season_videos(show_id="breaking-bad", season=1, embed_markdown=False)

# See who's watching a season right now
fetch_season_watching(show_id="breaking-bad", season=1)

# Get translations for a season (all languages)
fetch_season_translations(show_id="breaking-bad", season=1)

# Get translations for a specific language
fetch_season_translations(show_id="breaking-bad", season=1, language="es")

# Get lists containing a season
fetch_season_lists(show_id="breaking-bad", season=1)

# Get lists with type and sort filters
fetch_season_lists(show_id="breaking-bad", season=1, list_type="personal", sort="popular")

Episode Tools

# Get detailed info about a specific episode
fetch_episode_summary(show_id="breaking-bad", season=1, episode=1)

# Get ratings and voting distribution for an episode
fetch_episode_ratings(show_id="breaking-bad", season=1, episode=1)

# Get engagement stats (watchers, plays, collectors)
fetch_episode_stats(show_id="breaking-bad", season=1, episode=1)

# Get cast and crew for an episode
fetch_episode_people(show_id="breaking-bad", season=1, episode=1)

# Get videos/trailers for an episode (with embedded markdown - default)
fetch_episode_videos(show_id="breaking-bad", season=1, episode=1)

# Get videos for an episode (simple text links)
fetch_episode_videos(show_id="breaking-bad", season=1, episode=1, embed_markdown=False)

# See who's watching an episode right now
fetch_episode_watching(show_id="breaking-bad", season=1, episode=1)

# Get translations for an episode (all languages)
fetch_episode_translations(show_id="breaking-bad", season=1, episode=1)

# Get translations for a specific language
fetch_episode_translations(show_id="breaking-bad", season=1, episode=1, language="es")

# Get lists containing an episode
fetch_episode_lists(show_id="breaking-bad", season=1, episode=1)

# Get lists with type and sort filters
fetch_episode_lists(show_id="breaking-bad", season=1, episode=1, list_type="personal", sort="popular")

Movie Tools

# Get trending movies: auto-paginate all results (omit page parameter)
fetch_trending_movies(limit=10)

# Get trending movies: single page with pagination metadata
fetch_trending_movies(limit=10, page=1)

# Get popular movies with optional limit parameter
fetch_popular_movies(limit=10)

# Get anticipated movies with optional limit parameter
fetch_anticipated_movies(limit=10)

# Get favorited movies with optional limit and period parameters
fetch_favorited_movies(limit=10, period="weekly")

# Get most played movies with optional limit and period parameters
fetch_played_movies(limit=10, period="weekly")

# Get most watched movies with optional limit and period parameters
fetch_watched_movies(limit=10, period="weekly")

# Get the top 10 U.S. box office movies from last weekend
fetch_boxoffice_movies()

# Get ratings for a movie
fetch_movie_ratings(movie_id="tron-legacy-2010")

# Get comprehensive movie summary (includes production status, ratings, genres, runtime, certification, metadata)
fetch_movie_summary(movie_id="tron-legacy-2010", extended=True)  # Default: comprehensive

# Get basic movie summary (title, year, ID only)
fetch_movie_summary(movie_id="tron-legacy-2010", extended=False)

# Get videos for a movie (with embedded markdown - default)
fetch_movie_videos(movie_id="tron-legacy-2010")

# Get videos for a movie (simple text links)
fetch_movie_videos(movie_id="tron-legacy-2010", embed_markdown=False)

# Get related movies (similar movies based on genres, themes, and viewer patterns)
fetch_related_movies(movie_id="tron-legacy-2010", limit=10)

# Get related movies with pagination metadata
fetch_related_movies(movie_id="tron-legacy-2010", limit=10, page=1)

# Get cast and crew for a movie
fetch_movie_people(movie_id="the-dark-knight-2008")

People Tools

# Get extended person details (biography, social media, birthday)
fetch_person_summary(person_id="bryan-cranston")

# Get basic person details (name and IDs only)
fetch_person_summary(person_id="bryan-cranston", extended=False)

# Look up by IMDB ID
fetch_person_summary(person_id="nm0186505")

# Get all movie credits for a person (cast roles and crew positions)
fetch_person_movies(person_id="bryan-cranston")

# Get all show credits for a person (with episode counts and series regular flags)
fetch_person_shows(person_id="bryan-cranston")

# Get lists containing a person (all types, sorted by popularity)
fetch_person_lists(person_id="bryan-cranston")

# Get lists with type and sort filters
fetch_person_lists(person_id="bryan-cranston", list_type="personal", sort="likes")

Authentication & User Tools

# Start the device authorization flow with Trakt
start_device_auth()

# Check the status of an ongoing authentication
check_auth_status()

# Clear authentication (logout)
clear_auth()

# Fetch shows watched by the authenticated user
fetch_user_watched_shows(limit=0)  # 0 for all shows

# Fetch movies watched by the authenticated user
fetch_user_watched_movies(limit=0)  # 0 for all movies

# Fetch user's personal ratings with pagination support
fetch_user_ratings(rating_type="movies", rating=10, page=1)

# Add new ratings for movies, shows, seasons, or episodes
add_user_ratings(rating_type="movies", items=[{"trakt_id": "314", "rating": 9}])

# Remove existing ratings by ID
remove_user_ratings(rating_type="movies", items=[{"trakt_id": "314"}])

# Fetch user's watchlist with pagination and sorting
fetch_user_watchlist(watchlist_type="all", sort_by="rank", sort_how="asc", page=1)

# Add items to watchlist with optional notes (VIP)
add_user_watchlist(watchlist_type="movies", items=[{"trakt_id": "314", "notes": "Must watch!"}])

# Remove items from watchlist
remove_user_watchlist(watchlist_type="movies", items=[{"trakt_id": "314"}])

Check-in Tools

# Method 1: Check in using show ID (recommended when precision is important)
# First use search_shows to find the correct show ID
search_shows(query="Breaking Bad", limit=5)
# Then use the ID for check-in
checkin_to_show(
    season=1,
    episode=3,
    show_id="1388",
    message="Loving this show!"
)

# Method 2: Check in using show title (more convenient)
checkin_to_show(
    season=1,
    episode=1,
    show_title="Breaking Bad",
    show_year=2008,  # Optional but helps with accuracy
    message="I'm the one who knocks!"
)

Comment Tools

# Get comments for a movie: auto-paginate all results (omit page parameter)
fetch_movie_comments(movie_id="123", limit=10, show_spoilers=False)

# Get comments for a movie: single page with pagination metadata
fetch_movie_comments(movie_id="123", limit=10, show_spoilers=False, page=1)

# Get comments for a show: auto-paginate all results (omit page parameter)
fetch_show_comments(show_id="456", limit=10, show_spoilers=False, sort="likes")

# Get comments for a show: single page with pagination metadata
fetch_show_comments(show_id="456", limit=10, show_spoilers=False, sort="likes", page=1)

# Get comments for a specific season sorted by most liked
fetch_season_comments(show_id="456", season=1, limit=10, show_spoilers=False, sort="likes")

# Get comments for a specific episode sorted by most replies
fetch_episode_comments(show_id="456", season=1, episode=3, limit=10, show_spoilers=False, sort="replies")

# Get a specific comment
fetch_comment(comment_id="789", show_spoilers=False)

# Get a comment with its replies
fetch_comment_replies(comment_id="789", limit=10, show_spoilers=False)

Recommendation Tools

# Get personalized movie recommendations (requires authentication)
fetch_movie_recommendations(limit=10)

# Include movies you've already collected or watchlisted
fetch_movie_recommendations(limit=10, ignore_collected=False, ignore_watchlisted=False)

# Get personalized show recommendations
fetch_show_recommendations(limit=10)

# Hide a movie from future recommendations
hide_movie_recommendation(movie_id="tron-legacy-2010")

# Hide a show from future recommendations
hide_show_recommendation(show_id="breaking-bad")

# Unhide a previously-hidden movie
unhide_movie_recommendation(movie_id="tron-legacy-2010")

# Unhide a previously-hidden show
unhide_show_recommendation(show_id="breaking-bad")

Progress Tools

# Get watched progress for a TV show
fetch_show_progress(show_id="breaking-bad")

# Get show progress with specials and hidden seasons included
fetch_show_progress(
    show_id="game-of-thrones",
    hidden=True,       # Include hidden seasons
    specials=True,     # Include season 0 (specials)
    count_specials=True,  # Count specials in overall stats
    last_activity="watched"  # Calculate next episode based on watched order
)

# Get detailed episode-by-episode progress with watch dates
fetch_show_progress(show_id="breaking-bad", verbose=True)

# Get paused playback progress (all types)
fetch_playback_progress()

# Get paused playback progress (movies only)
fetch_playback_progress(playback_type="movies")

# Get paused playback progress (episodes only)
fetch_playback_progress(playback_type="episodes")

# Remove a paused playback item (get ID from fetch_playback_progress)
remove_playback_item(playback_id=12345)

# Check if a movie has been watched (returns watch dates and count)
fetch_history(history_type="movies", item_id="314")  # The Dark Knight

# Check watch history for a show
fetch_history(history_type="shows", item_id="1388")  # Breaking Bad

# Browse all movie watch history
fetch_history(history_type="movies")

# Browse all watch history (all types)
fetch_history()

# Filter history by date range
fetch_history(
    history_type="movies",
    start_at="2024-01-01T00:00:00.000Z",
    end_at="2024-12-31T23:59:59.000Z"
)

# Add movies to watch history
add_to_history(
    history_type="movies",
    items=[{"trakt_id": "314"}]  # The Dark Knight
)

# Add movies with custom watched date
add_to_history(
    history_type="movies",
    items=[{"trakt_id": "314", "watched_at": "2024-01-15T20:30:00.000Z"}]
)

# Add episodes to watch history
add_to_history(
    history_type="episodes",
    items=[{"trakt_id": "62085"}]  # Breaking Bad S01E01
)

# Remove movies from watch history
remove_from_history(
    history_type="movies",
    items=[{"trakt_id": "314"}]
)

# Remove episodes from watch history
remove_from_history(
    history_type="episodes",
    items=[{"trakt_id": "62085"}]
)

📝 与克劳德一起使用

安装后,Claude可以使用此MCP服务器回答有关娱乐数据的问题。这里有一些例子可以让你开始。

  • “现在流行什么节目?”
  • “显示我看过的节目”(需要身份验证)
  • “《权力的游戏》的评级是多少?”

View more example questions

公共数据(无需身份验证):

  • “现在最受期待的节目是什么?”
  • “给我看最受期待的即将上映的电影”
  • “这个周末票房有哪些电影?”
  • “现在给我看最卖座的电影”
  • “你能推荐一些本周的热门电影吗?”
  • “本月收视率最高的节目是什么?”
  • “搜索像《绝命毒师》这样的节目”
  • “搜索像《教父》这样的电影”
  • “显示《绝命毒师》的评论”
  • “人们对《教父》电影有什么看法?”
  • “给我看《怪奇物语》第一季的评论”
  • “获取《权力的游戏》第二季第五集的评论”
  • “显示评论#12345及其回复”
  • “显示《绝命毒师》的评论,但包括剧透”
  • “显示《绝命毒师》最受欢迎的评论”
  • “获得《教父》电影最受欢迎的评论”
  • “显示《怪奇物语》第一季回复最多的评论”
  • “给我看看《教父》的收视率分布”
  • “《绝命毒师》的收视率有多高?”
  • “给我看TRON:Legacy的预告片”
  • “获取《权力的游戏》视频”
  • “《教父》有哪些预告片?”
  • “获取《绝命毒师》的详细摘要”
  • “给我看《教父》电影的细节”
  • “给我权力的游戏的基本信息”
  • “给我看类似《绝命毒师》的节目”
  • “哪些电影与《创:战纪》有关?”
  • “寻找像《权力的游戏》这样的节目”
  • “跟我说说《绝命毒师》第一季吧”
  • 《权力的游戏》第二季有哪些剧集
  • 《绝命毒师》第五季的收视率如何
  • “谁主演了《权力的游戏》第一季?”
  • 《绝命毒师》第一季有多受欢迎
  • “《怪奇物语》第二季有预告片吗?”
  • “现在谁在看《绝命毒师》第一季?”
  • “获得《绝命毒师》第一季的西班牙语翻译”
  • “《绝命毒师》第一季的名单是什么?”
  • “跟我说说《绝命毒师》的试播集吧”
  • 《权力的游戏》第一季第一集的收视率如何
  • “《绝命毒师》第一集是谁主演的?”
  • 《绝命毒师》第五季第16集有多受欢迎
  • “《怪奇物语》第一季第一集有预告片吗?”
  • “现在谁在看《绝命毒师》第一季第一集?”
  • “为《绝命毒师》第一季第一集获取西班牙语翻译”
  • “哪些列表包含《绝命毒师》第一季第一集?”
  • 《黑暗骑士》中谁主演
  • “给我看看《绝命毒师》的演员和工作人员”
  • “给我看看《绝命毒师》的客串明星”
  • “跟我说说布莱恩·克兰斯顿”
  • “布莱恩·克兰斯顿演过什么电影?”
  • “布莱恩·克兰斯顿出演过哪些电视节目?”
  • “布莱恩·克兰斯顿的名单是什么?”

个人数据(需要身份验证):

  • “我最后看的节目是什么?”
  • “给我看我看过的电影”
  • “我最后看的电影是什么?”
  • “我看过《黑暗骑士》吗?”
  • “我看过《盗梦空间》吗?”
  • “我什么时候看《黑客帝国》的?”
  • “显示我的10/10评级电影”
  • “给《绝命毒师》加9/10分”
  • “显示我的监视列表”
  • “我的观察名单上有哪些电影?”
  • “将《教父》加入我的观察名单”
  • “用便条将《绝命毒师》添加到我的关注名单中”(VIP)
  • “从我的观察名单中删除黑暗骑士”
  • “显示我添加时按顺序排列的观察列表”
  • “请帮我看《绝命毒师》第二季第五集”
  • “请帮我登记参加ID 1388的第一季第三集”
  • “我在《绝命毒师》上的进展如何?”
  • “《权力的游戏》我走了多远?”
  • “我的下一集《怪奇物语》是什么?”
  • “显示任何暂停的电影或剧集”
  • “清除该电影的暂停播放”
  • “马克黑暗骑士观看”
  • “将《绝命毒师》第一季添加到我的观看历史中”
  • “从我的手表历史记录中删除Inception”

👤 个人数据访问

通过身份验证,您可以访问:

  • 您完整的观看节目和电影历史
  • 每个节目和电影的最后观看日期
  • 您观看每个节目和电影的次数
  • 查看您当前正在观看的节目并跟踪您的进度
  • 个人浏览统计
  • 您的完整监视列表,包括过滤和排序选项
  • 在监视列表中添加和删除项目
  • 将个人笔记添加到观察列表项目(VIP功能)
  • 显示进度跟踪:看看你看任何电视节目的进度,以及下一集的推荐
  • 播放进度:查看并清除您在观看过程中暂停的任何电影或剧集
  • 观看历史管理:在您的手表历史记录中添加或删除带有可选时间戳的项目

所有数据都是实时直接从您的Trakt帐户获取的。

🔐 认证

服务器使用Trakt的设备身份验证流程:

  1. 当您请求用户特定的数据时,如果需要,服务器将自动启动身份验证
  2. 您将在浏览器上收到一个代码和一个要访问的URL
  3. 在Trakt网站上输入代码并授权应用程序后,通知Claude您已完成授权
  4. Claude将检查身份验证状态,然后获取您的个人数据
  5. 您的身份验证令牌安全地存储在 auth_token.json 对于未来的请求。在Docker中,这是 /data/auth_token.json --在以下位置安装卷 /data (例如。 -v trakt_auth:/data)在容器重新创建过程中保持身份验证。

您可以随时使用注销 clear_auth 工具。

🐳 Docker部署

两个Docker镜像具有不同的传输机制。每个版本还发布一个版本化标签(例如。 :0.9.0, :0.9.0-stdio)用于固定。

图像标签运输用例
:latestSSE(HTTP)远程访问、web客户端、docker编写
:latest-stdiostdioMCPhub、Claude Desktop、本地MCP客户端
:stdio站立已弃用的别名 :latest-stdio --将在v1.0.0中删除

stdio传输(MCPhub、克劳德桌面)

使用 :latest-stdio 图像(或固定一个版本,如 :0.9.0-stdio)对于通过stdin/stdout通信的MCP客户端:

# Pull and run the stdio image
docker run -i --rm --name trakt_mcpserver_stdio \
  -e TRAKT_CLIENT_ID=your_client_id \
  -e TRAKT_CLIENT_SECRET=your_client_secret \
  -v trakt_auth:/data \
  ghcr.io/wwiens/trakt_mcpserver:latest-stdio

Claude桌面配置:

{
  "mcpServers": {
    "trakt": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--name", "trakt_mcpserver_stdio",
        "-e", "TRAKT_CLIENT_ID=your_client_id",
        "-e", "TRAKT_CLIENT_SECRET=your_client_secret",
        "-v", "trakt_auth:/data",
        "ghcr.io/wwiens/trakt_mcpserver:latest-stdio"
      ]
    }
  }
}

SSE传输(HTTP/远程)

使用 :latest 基于HTTP访问的图像:

# Option 1: Pull and run from GHCR (recommended)
docker run -d --rm --name trakt_mcpserver \
  -e TRAKT_CLIENT_ID=your_client_id \
  -e TRAKT_CLIENT_SECRET=your_client_secret \
  -v trakt_auth:/data \
  -p 8080:8080 \
  ghcr.io/wwiens/trakt_mcpserver:latest

# Option 2: Build locally and run
docker build -t trakt_mcpserver .
docker run -d --rm --name trakt_mcpserver \
  -e TRAKT_CLIENT_ID=your_client_id \
  -e TRAKT_CLIENT_SECRET=your_client_secret \
  -v trakt_auth:/data \
  -p 8080:8080 \
  trakt_mcpserver

使用 docker compose

# Builds the docker image using the default Dockerfile (SSE variant) and starts the service
docker compose up

这将在上运行服务器 http://localhost:8080 并通过SSE(HTTP传输)代理MCP请求。

🧪 开发与测试

对于使用或扩展此MCP服务器的开发人员,这里有测试工具和开发工作流程。

🚀 人工智能驱动的开发体验

该项目是使用人工智能辅助开发工具构建的:

  • 光标 -AI驱动的代码编辑器,用于快速开发
  • 教唆者 -用于代码协作的AI配对编程工具
  • 克劳德代码 -Claude的专用编码接口

MCP检验员测试

验证您的MCP服务器实现,并探索可用的工具、资源和提示。

View MCP Inspector commands

# List available tools
npx @modelcontextprotocol/inspector --cli python server.py --method tools/list

# List available resources
npx @modelcontextprotocol/inspector --cli python server.py --method resources/list

# List available prompts
npx @modelcontextprotocol/inspector --cli python server.py --method prompts/list

运行测试

在进行更改之前,通过pytest、类型检查和linting确保代码质量。

View test commands

# Create a virtual environment, then install the project (editable) and test dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -r requirements-dev.txt

# Run all tests
pytest

# Run with verbose output
pytest -v -s

# Type checking
pyright

# Code linting and formatting with ruff
ruff check --fix    # Auto-fix issues
ruff format         # Format code

📄 许可证

MIT许可证

______________________________________________________________________

Built with 🧠 AI and human collaboration

Powered by Claude

目录标签

目录标签

PythonClaude数据分析AI集成本地部署娱乐数据分析观影历史管理个性化推荐API桥接

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Docker

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP