fastmcp/docs/python-sdk/fastmcp-server-auth-registry.mdx
2025-08-01 20:39:55 -04:00

43 lines
1 KiB
Text

---
title: registry
sidebarTitle: registry
---
# `fastmcp.server.auth.registry`
Provider registry for FastMCP auth providers.
## Functions
### `register_provider` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/registry.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```python
register_provider(name: str) -> Callable[[type[T]], type[T]]
```
Decorator to register an auth provider with a given name.
**Args:**
- `name`: The name to register the provider under (e.g., 'AUTHKIT')
**Returns:**
- The decorated class
### `get_registered_provider` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/registry.py#L41" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```python
get_registered_provider(name: str) -> type[AuthProvider]
```
Get a registered provider by name.
**Args:**
- `name`: The provider name (case-insensitive)
**Returns:**
- The provider class if found, None otherwise