Authenticate your FastMCP client with a Bearer token.
New in version:Β 2.6.0
Authorization
header of an HTTP request, using the Bearer
scheme:
auth
parameter of the fastmcp.Client
or transport instance. FastMCP will automatically format it correctly for the Authorization
header and bearer scheme.
Bearer
prefix. FastMCP will add it for you.StreamableHttpTransport
or SSETransport
:
BearerAuth
HelperBearerAuth
class yourself, which implements the httpx.Auth
interface.
headers
instead of using the auth
parameter by setting them on your transport: