MCP Inspector tutorial: Python server and Claude Desktop

Test a Python MCP server with MCP Inspector, inspect structured outputs and progress logs, then connect Claude Desktop using STDIO.

Player not loading? Watch on YouTube

This tutorial combines earlier MCP examples into one server using the official MCP Python SDK’s FastMCP implementation and a separate client. The recipe helper demonstrates tools, resources, prompts and several return types. The client launches the server as a subprocess over STDIO and exercises each section.

The MCP Inspector walkthrough starts with Node.js and npm installed. The presenter selects STDIO, supplies the virtual environment's Python executable and the server.py path, then connects through the browser interface. Examples include reading cooking measurements, querying ingredients by dish and requesting prompts with arguments. The history and notification panels expose requests and server messages.

Tool tests compare Pydantic models, TypedDict, dictionaries and plain Python classes. In the examples, a class without attribute type hints produces an unhelpful raw object representation. Manual CallToolResult responses demonstrate error flags, embedded resources and image payloads. Several examples are stubs: nutrition values cover only three dishes, and the first serving chart is a one-pixel PNG that ignores its argument.

Async tools demonstrate shopping-list progress logs and resource-change notifications. The presenter also reconnects the Inspector using streamable HTTP. The final Claude Desktop setup returns to STDIO, adds the Python executable and server path to its configuration, and restarts the app. This connects a local server; the demonstration does not establish offline model inference.