Building an Advanced Netflix MCP: Server Implementation Guide
Component Implementation: Resources
Our application implements resources as readable documents rather than callable functions - which is the standard way to define them in the MCP protocol.
A client reads a resource to get background context — things like dataset notes, metric definitions, or static statistics — that help an LLM interpret tool results correctly. Our server exposes two resources from server/components/resources.py.
Imports and Registration Shell
The structure mirrors tools.py exactly: a single register_resources function receives mcp and uses it to decorate two inner functions. Keeping the same pattern across all component files makes the codebase easy to navigate.
# components/resources.py
import json
from fastmcp import FastMCP
def register_resources(mcp: FastMCP):
...
Resource 1: netflix://guide — Dataset Notes
The resource URI netflix://guide is a custom scheme that identifies this document uniquely within the server.
@mcp.resource("netflix://guide")
def get_data_guide() -> str:
"""Netflix data guide with important notes and usage information."""
guide_data = {
"about": "Netflix viewing data for movies from June 2021 to December 2024",
"important_notes": [
"All tools return WEEKLY viewing data only (7-day periods)",
"Weekly rankings show top 10 positions only (rank 1-10)",
"Use 'hours_viewed' as primary metric - it's more reliable than 'views'",
"Movie title searches are partial match and case-insensitive",
"The 'views' metric can be NULL for some periods",
"Cumulative weeks in top 10 tracks how many total weeks a title ranked",
],
"data_characteristics": {
"content_type": "Movies only",
"time_range": "June 2021 - December 2024",
"granularity": "Weekly snapshots (7-day periods)",
"geographic_scope": "Global Netflix viewing data",
},
"available_metrics": {
"hours_viewed": "Total viewing hours in the period (most reliable metric)",
"views": "Number of views (may be NULL for some periods)",
"view_rank": "Position in weekly top 10 (1-10, or NULL if outside top 10)",
"cumulative_weeks_in_top10":Practical MCP with FastMCP & LangChain
Engineering the Agentic ExperienceEnroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!
