MCP Trakt 标志

MCP Trakt

社区
wwiens

A Model Context Protocol (MCP) server that creates a bridge between AI language models and the Trakt.tv API, allowing LLMs to access real-time entertainment data and personal Trakt viewing history.…

发布者wwiens
代码仓库trakt_mcpserver
语言Python
复刻数
14
星标数
46
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    MCP Trakt 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 46 个 Star 和 14 个 Fork。

🎬 MCP Trakt: Your AI's Gateway to Entertainment Data

MCP Trakt Built by AI+Humans Version Powered by Claude

A Model Context Protocol (MCP) server that creates a bridge between AI language models and the Trakt.tv API, allowing LLMs to access real-time entertainment data and personal Trakt viewing history. Built with a domain-focused architecture using FastMCP, providing clean separation of concerns across authentication, shows, seasons, episodes, movies, people, user data, comments, search, and check-in functionality.

🖥️ An AI Experiment

Other than this paragraph, everything here has been generated by AI, including the code. I had a goal to learn more about MCP and have been playing a lot with Cursor, so it seemed like a natural next move to bring these together. The result was this project. All changes moving forward will also be done by AI.

📚 About MCP & Trakt

Model Context Protocol (MCP) enables AI models to interact with external systems through standardized tools and resources. Trakt.tv is a comprehensive platform for tracking TV shows and movies with 14+ million users and extensive APIs for developers.

🚀 Quick Start

Docker Quickstart

bash
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

Run with uvx (no clone, no install)

Requires uv installed.

bash
uvx --from git+https://github.com/wwiens/trakt_mcpserver trakt-mcp

Pin to a release tag for reproducibility:

bash
uvx --from git+https://github.com/wwiens/trakt_mcpserver@v0.9.0 trakt-mcp

Claude Desktop / MCPhub configuration:

json
{
  "mcpServers": {
    "trakt": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/wwiens/trakt_mcpserver",
        "trakt-mcp"
      ],
      "env": {
        "TRAKT_CLIENT_ID": "your_client_id",
        "TRAKT_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

Your Trakt OAuth token is persisted to ~/.trakt-mcp/auth_token.json (the directory is created on first login), so authorization survives across uvx invocations. To override the location — e.g. for Docker volumes or to keep multiple isolated accounts — set TRAKT_AUTH_TOKEN_PATH to an absolute path.

Local Installation

Requires Python 3.12 or newer.

  1. Clone this repository

    bash
    git clone https://github.com/wwiens/trakt_mcpserver.git
    cd trakt_mcpserver
  2. Create a virtual environment and install dependencies

    bash
    python3 -m venv .venv
    source .venv/bin/activate
    pip install -e .
  3. Set up your environment

    bash
    cp .env.example .env

    Then edit .env to add your Trakt API credentials:

    bash
    TRAKT_CLIENT_ID=your_client_id
    TRAKT_CLIENT_SECRET=your_client_secret
  4. Run the server

    bash
    python server.py

Installing in Claude Desktop

Add to your Claude Desktop MCP configuration file:

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

✨ Features

🌎 Public Trakt Data

  • Access trending and popular shows and movies
  • Discover the most anticipated, favorited, played, and watched content
  • See the top-grossing U.S. box office movies from last weekend
  • Get real-time data from Trakt's global community
  • Formatted responses with titles, years, and popularity metrics
  • View detailed ratings for shows and movies including average scores and distribution
  • Browse show seasons with episode counts, aired episodes, and ratings per season
  • Dive into specific seasons with detailed info, episode lists, ratings, cast & crew, videos, translations, and engagement stats
  • See who's watching a specific season right now
  • Find lists containing a specific season
  • Explore individual episodes with detailed summaries, ratings, cast & crew, videos, translations, and engagement stats
  • See who's watching a specific episode right now
  • Find lists containing a specific episode
  • Look up cast and crew for any movie or show, with optional guest stars for shows
  • Explore people with biographies, social media, and full filmographies
  • Browse a person's credits across movies and shows with character names and episode counts
  • Find lists containing a specific person

👤 Personal Trakt Data

  • View Your Watched Shows: Get a complete list of shows you've personally watched
  • See your exact last-watched dates for each series
  • Track how many times you've watched each show
  • Check in to shows you're currently watching to mark them as watched
    • By show ID (more precise) or show title (more convenient)
    • Include custom messages with your check-ins
    • See when you watched the episode in human-readable format
  • Search for shows to find their details and IDs
  • Manage your ratings: View, add, and remove personal ratings for movies, shows, seasons, and episodes with pagination support
  • Manage your watchlist: View, add, and remove items from your watchlist with pagination and sorting support
    • Filter by type (all, movies, shows, seasons, episodes)
    • Sort by multiple criteria (rank, added, title, released, runtime, popularity, percentage, votes)
    • Add optional notes to watchlist items (VIP feature, 500 char limit)
  • Track show progress: See your watched progress for any TV show
    • View episodes watched vs aired with completion percentage
    • See your next episode to watch
    • View per-season breakdown with progress stats
    • Include hidden seasons and specials optionally
  • Manage playback progress: View and clear paused playback items
    • See movies and episodes you paused mid-watch
    • View progress percentage and when you paused
    • Clear playback items you no longer need
  • Manage watch history: Add and remove items from your history
    • Mark movies, shows, seasons, or episodes as watched
    • Optionally specify when you watched them
    • Remove items from your watch history
  • Secure authentication with Trakt through device code flow
  • Personal data is fetched directly from your Trakt account

🎯 Personalized Recommendations

  • Get tailored movie and show suggestions based on your watch history and ratings (requires authentication)
  • Filter out items you've already collected or watchlisted
  • Hide recommendations you're not interested in so they don't come back
  • Unhide previously hidden items to restore them

💬 Comments & Reviews

  • View comments for shows and movies: Read what others are saying about your favorite content
  • See comments for specific seasons and episodes: Get insights about particular parts of a show
  • View individual comments and their replies: Engage with the community's discussions
  • Spoiler protection: Comments with spoilers are hidden by default
  • Toggle spoiler visibility: Choose whether to show or hide spoilers
  • View reviews: Longer, more detailed comments are marked as reviews
  • See ratings distribution: View how many users gave each rating from 1-10

🔄 General Features

  • Exposes Trakt API data through MCP resources
  • Provides tools for fetching real-time entertainment information
  • Enables AI models to offer personalized entertainment recommendations
  • Simple authentication and logout process
  • Pagination support for list endpoints (trending, popular, anticipated, favorited, played, watched, search, comments, ratings, watchlist):
    • Pass page: int for single-page results with pagination metadata
    • Omit page to auto-paginate and return up to limit total items as a flat list
    • Use limit=0 to fetch all available results (capped at 100 for safety)

🔥 Real-Time Trending Data

  • Access currently trending TV shows with live viewer counts
  • Get trending movies updated in real-time
  • See what's popular across Trakt's global community of 14+ million users
  • Examples: The White Lotus (2021), Daredevil: Born Again (2025), Black Bag (2025)

🔌 Available Resources

MCP resources provide static data endpoints that AI models can access. These URIs expose Trakt data through a standardized interface.

Show Resources

ResourceDescriptionExample Data
trakt://shows/trendingMost watched shows over the last 24 hoursShow title, year, watchers count
trakt://shows/popularMost popular shows based on ratingsShow title, year, popular score
trakt://shows/anticipatedMost anticipated shows sorted by list countShow title, year, list count
trakt://shows/favoritedMost favorited showsShow title, year, favorites count
trakt://shows/playedMost played showsShow title, year, play count
trakt://shows/watchedMost watched shows by unique usersShow title, year, watcher count

Movie Resources

ResourceDescriptionExample Data
trakt://movies/trendingMost watched movies over the last 24 hoursMovie title, year, watchers count
trakt://movies/popularMost popular movies based on ratingsMovie title, year, popular score
trakt://movies/anticipatedMost anticipated movies sorted by list countMovie title, year, list count
trakt://movies/favoritedMost favorited moviesMovie title, year, favorites count
trakt://movies/playedMost played moviesMovie title, year, play count
trakt://movies/watchedMost watched movies by unique usersMovie title, year, watcher count
trakt://movies/boxofficeTop 10 grossing U.S. box office movies last weekendMovie title, year, revenue

User Resources

ResourceDescriptionExample Data
trakt://user/auth/statusCurrent authentication statusAuthentication status, token expiry
trakt://user/watched/showsShows watched by the authenticated userShow title, year, last watched date, play count
trakt://user/watched/moviesMovies watched by the authenticated userMovie title, year, last watched date, play count

🛠️ Available Tools

MCP tools are interactive functions that AI models can call with parameters. Use these to fetch, search, and manage Trakt data.

python
# 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)
python
# 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")
python
# 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")
python
# 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")
python
# 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")
python
# 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"}])
python
# 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!"
)
python
# 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)
python
# 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")
python
# 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"}]
)

📝 Using with Claude

Once installed, Claude can use this MCP server to answer questions about entertainment data. Here are some examples to get you started.

  • "What shows are trending right now?"
  • "Show me the shows I've watched" (requires authentication)
  • "What's the rating for Game of Thrones?"

Public Data (No Authentication Required):

  • "What are the most anticipated shows right now?"
  • "Show me the most anticipated upcoming movies"
  • "What movies are at the box office this weekend?"
  • "Show me the top-grossing movies right now"
  • "Can you recommend some popular movies this week?"
  • "What are the most watched shows of the month?"
  • "Search for shows like 'Breaking Bad'"
  • "Search for movies like 'The Godfather'"
  • "Show me comments for Breaking Bad"
  • "What are people saying about The Godfather movie?"
  • "Show me comments for Season 1 of Stranger Things"
  • "Get comments for Season 2 Episode 5 of Game of Thrones"
  • "Show me comment #12345 with its replies"
  • "Show me comments for Breaking Bad but include spoilers"
  • "Show me the most liked comments for Breaking Bad"
  • "Get the most liked comments for The Godfather movie"
  • "Show me the comments with most replies for Season 1 of Stranger Things"
  • "Show me the rating distribution for The Godfather"
  • "How highly rated is Breaking Bad?"
  • "Show me trailers for TRON: Legacy"
  • "Get videos for Game of Thrones"
  • "What trailers are available for The Godfather?"
  • "Get a detailed summary of Breaking Bad"
  • "Show me details about The Godfather movie"
  • "Give me basic info for Game of Thrones"
  • "Show me shows similar to Breaking Bad"
  • "What movies are related to TRON: Legacy?"
  • "Find shows like Game of Thrones"
  • "Tell me about Season 1 of Breaking Bad"
  • "What episodes are in Season 2 of Game of Thrones?"
  • "How is Season 5 of Breaking Bad rated?"
  • "Who starred in Season 1 of Game of Thrones?"
  • "How popular is Season 1 of Breaking Bad?"
  • "Are there any trailers for Season 2 of Stranger Things?"
  • "Who's watching Season 1 of Breaking Bad right now?"
  • "Get Spanish translations for Season 1 of Breaking Bad"
  • "What lists contain Season 1 of Breaking Bad?"
  • "Tell me about the pilot episode of Breaking Bad"
  • "How is Season 1 Episode 1 of Game of Thrones rated?"
  • "Who starred in the first episode of Breaking Bad?"
  • "How popular is Season 5 Episode 16 of Breaking Bad?"
  • "Are there any trailers for Season 1 Episode 1 of Stranger Things?"
  • "Who's watching Season 1 Episode 1 of Breaking Bad right now?"
  • "Get Spanish translations for Season 1 Episode 1 of Breaking Bad"
  • "What lists contain Season 1 Episode 1 of Breaking Bad?"
  • "Who stars in The Dark Knight?"
  • "Show me the cast and crew of Breaking Bad"
  • "Show me the guest stars for Breaking Bad"
  • "Tell me about Bryan Cranston"
  • "What movies has Bryan Cranston been in?"
  • "What TV shows has Bryan Cranston appeared in?"
  • "What lists feature Bryan Cranston?"

Personal Data (Requires Authentication):

  • "What was the last show I watched?"
  • "Show me the movies I've watched"
  • "What was the last movie I watched?"
  • "Have I seen The Dark Knight?"
  • "Have I watched Inception?"
  • "When did I watch The Matrix?"
  • "Show me my 10/10 rated movies"
  • "Add a 9/10 rating for Breaking Bad"
  • "Show me my watchlist"
  • "What movies are on my watchlist?"
  • "Add The Godfather to my watchlist"
  • "Add Breaking Bad to my watchlist with a note" (VIP)
  • "Remove The Dark Knight from my watchlist"
  • "Show me my watchlist sorted by when I added them"
  • "Check me in to Season 2 Episode 5 of Breaking Bad"
  • "Check me in to Season 1 Episode 3 of show ID 1388"
  • "What's my progress on Breaking Bad?"
  • "How far am I through Game of Thrones?"
  • "What's my next episode of Stranger Things?"
  • "Show me any paused movies or episodes"
  • "Clear my paused playback for that movie"
  • "Mark The Dark Knight as watched"
  • "Add Breaking Bad Season 1 to my watch history"
  • "Remove Inception from my watch history"

👤 Personal Data Access

With authentication, you can access:

  • Your complete watched show and movie history
  • Last watched dates for each show and movie
  • Number of times you've watched each show and movie
  • Check in to shows you're currently watching and track your progress
  • Personal viewing statistics
  • Your complete watchlist with filtering and sorting options
  • Add and remove items from your watchlist
  • Add personal notes to watchlist items (VIP feature)
  • Show progress tracking: See how far you are through any TV show, with next episode recommendations
  • Playback progress: View and clear any movies or episodes you paused mid-watch
  • Watch history management: Add or remove items from your watch history with optional timestamps

All data is fetched directly from your Trakt account in real-time.

🔐 Authentication

The server uses Trakt's device authentication flow:

  1. When you request user-specific data, the server will automatically initiate authentication if needed
  2. You'll receive a code and a URL to visit on your browser
  3. After entering the code on the Trakt website and authorizing the app, inform Claude that you've completed the authorization
  4. Claude will check the authentication status and then fetch your personal data
  5. Your authentication token is stored securely in ~/.trakt-mcp/auth_token.json for future requests, with 0o600 permissions. Override the location with the TRAKT_AUTH_TOKEN_PATH env var; Docker images set it to /data/auth_token.json — mount a volume at /data (e.g. -v trakt_auth:/data) to persist auth across container recreations.

You can log out at any time using the clear_auth tool.

🐳 Docker Deployment

Two Docker images are available with different transport mechanisms. Each release also publishes a versioned tag (e.g. :0.9.0, :0.9.0-stdio) for pinning.

Image TagTransportUse Case
:latestSSE (HTTP)Remote access, web clients, docker-compose
:latest-stdiostdioMCPhub, Claude Desktop, local MCP clients
:stdiostdioDeprecated alias for :latest-stdio — will be removed at v1.0.0

stdio Transport (MCPhub, Claude Desktop)

Use the :latest-stdio image (or pin a version like :0.9.0-stdio) for MCP clients that communicate via stdin/stdout:

bash
# 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 Desktop configuration:

json
{
  "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 Transport (HTTP/Remote)

Use the :latest image for HTTP-based access:

bash
# 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

Using docker compose

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

This runs the server on http://localhost:8080 and proxies MCP requests over SSE (HTTP transport).

🧪 Development & Testing

For developers working with or extending this MCP server, here are testing tools and development workflows.

🚀 AI-Powered Development Experience

This project was built using AI-assisted development tools:

  • Cursor - AI-powered code editor for rapid development
  • Aider - AI pair programming tool for code collaboration
  • Claude Code - Claude's dedicated coding interface

Testing with MCP Inspector

Validate your MCP server implementation and explore available tools, resources, and prompts.

bash
# 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

Running Tests

Ensure code quality with pytest, type checking, and linting before making changes.

bash
# 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

📄 License

MIT License


安装

TypingMind
{
  "mcpServers": {
    "trakt-mcpserver": {
      "command": "python3",
      "args": [
        "path/to/your/main.py"
      ]
    }
  }
}

将 MCP Trakt MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP Trakt 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 MCP Trakt 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP Trakt MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "trakt-mcpserver": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP Trakt MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP Trakt MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Trakt 帮我完成这项任务吗?
MCP Trakt
当然。我已阅读。
以下是我使用 MCP Trakt 得到的结果。

常见问题

MCP Trakt MCP 服务器有什么用途?

MCP Trakt 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP Trakt MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 MCP Trakt,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 MCP Trakt MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 MCP Trakt 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP Trakt MCP 连接到 TypingMind?

MCP Trakt 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP Trakt MCP 在 TypingMind 中提供哪些工具?

MCP Trakt 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP Trakt MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 MCP Trakt 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇