Building an Advanced Netflix MCP: Introduction and Setup
77%
Project Data Stores
First, we'll need to download and install Docker:
# Download the installation script
curl -fsSL https://get.docker.com -o get-docker.sh
# Run the installation script with the desired version (e.g., 29.2.1)
sh get-docker.sh --version 29.2.1
Once Docker is installed, we can run a PostgreSQL container:
docker run -d \
--name mcp_database \
-e POSTGRES_USER=mcp_user \
-e POSTGRES_PASSWORD=mysecretpassword \
-e POSTGRES_DB=netflix \
-p 5432:5432 \
-v mcp_data:/var/lib/postgresql \
postgres:18.2
Let's download the Netflix database dump and import it into our PostgreSQL server:
# Define the URL for the database dump
url="https://github.com/eon01/PracticalMCPWithFastMCPCompanionToolkit/raw/refs/heads/main/resources/code/netflixdb/netflixdb-postgres.zip"
# Download the database dump
curl -L -o /tmp/netflixdb.zip "$url"
# Install unzip if it's not already installed (for Debian/Ubuntu)
apt install unzip -y
# Unzip the downloaded file
unzip -o -d /tmp/netflixdb /tmp/netflixdb.zip
# Import the SQL dump into the PostgreSQL server (container must be running)
docker exec -i mcp_database psql \
-U mcp_user \
-d netflix < /tmp/netflixdb/netflixdb-postgres.sql
# Clean up the downloaded files
rm /tmp/netflixdb.zip
rm -rf /tmp/netflixdb
Let's verify that the database is running and that we can connect to it:
# Connect to the PostgreSQL server using psql
docker exec -it mcp_database psql -U mcp_user -d netflix
You should see a PostgreSQL prompt (netflix=#) where you can run SQL commands. For example, you can list the tables in the database, and you should see a list of tables like movie, season, tv_show, etc.:
-- List the tables in the database
\dt
-- Show the schema of the "movie" table
\d movie
-- Movies released since 2024-01-01 (limited to 10 results)
SELECT id, title, runtime FROM movie WHERE release_date >= '2024-01-01' LIMIT 10;
-- TV Show Seasons released since 2024-01-01 (limited to 10 results)
SELECT s.id, s.title AS season_title, s.season_number, t.title AS tv_show, s.runtime
FROM season s LEFT JOIN tv_show t ON t.id = s.tv_show_id
WHERE s.release_date >= '2024-01-01' LIMIT 10;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!
