Send log messages back to MCP clients through the context.
fastmcp.utilities.logging.get_logger()
or Python’s built-in logging
module.extra
debug
, info
, warning
, error
, log
) now accept an extra
parameter, which is a dictionary of arbitrary data. This allows you to send structured data to the client, which is useful for creating rich, queryable logs.