Feedback

Chat Icon

Practical MCP with FastMCP & LangChain

Engineering the Agentic Experience

Building an Advanced Netflix MCP: Testing the Workflow
86%

Running the Server

The server is a uvicorn ASGI application. Navigate to the server/ directory and start it with:

.venv/bin/python -m uvicorn main:app --reload --port 8000

The --reload flag makes uvicorn watch for file changes and restart automatically, which is useful during development. We use uvicorn directly rather than fastmcp run --reload because the latter forces stateless mode: it generates a fresh session ID on every request, which means the Redis-backed favorites list would be lost between calls. Running through uvicorn preserves the mcp-session-id header and keeps session state alive across the whole conversation.

For reference, the server directory also contains a fastmcp.json configuration file. This file describes how to run the server with fastmcp run and is useful if you want to deploy to a managed environment in the future.

We're not using it but here's what it looks like:

{
  "$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
  "source": {
    "path": "main.py",
    "entrypoint": "mcp"
  },
  "environment"

Practical MCP with FastMCP & LangChain

Engineering the Agentic Experience

Enroll 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!