FastMCP
Model Context Protocol servers in Python: tools, resources, prompts, testing and HTTP.
6 chapters, about 1 hours of study. Part of the free Learn Python course.
- Protocol and capabilities1. FastMCP tutorial: what MCP is and your first serverLearn the Model Context Protocol's hosts, clients and servers, its tools, resources and prompts, then build and call a first FastMCP server in Python.10 min study
- Protocol and capabilities2. FastMCP tools: validated arguments, results and errorsDesign FastMCP tools with typed, constrained arguments, structured results and clear tool errors, then test success and failure paths with a client.13 min study
- Protocol and capabilities3. FastMCP resources, resource templates and promptsPublish readable MCP resources and URI templates with FastMCP, write reusable prompts, and keep content separate from instructions.12 min study
- Testing and deployment4. Testing FastMCP servers in memory and over stdioTest FastMCP servers with an in-memory client and pytest, run the same server as a stdio subprocess, and diagnose failures by boundary.12 min study
- Testing and deployment5. FastMCP over HTTP with JWT authentication and scopesServe FastMCP over Streamable HTTP, verify JWT bearer tokens, restrict tools by scope, and test reader and editor access.14 min study
- Testing and deployment6. FastMCP and FastAPI sharing one SQLite databaseShare a persistent SQLite catalog between a FastMCP server and a FastAPI app, wire lifespans together and keep blocking I/O off the event loop.13 min study