Skip to content

Glossary: Agent Tools and MCP

Lifespan

Also written: lifespan

FastAPI code that runs when an app starts and stops. A mounted MCP app needs it to start the MCP request handler (`mcp.session_manager.run()`).

Where the book teaches it

Related terms

FastAPIASGI