mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
* Add Auth0MCPProvider for Auth0 Auth for MCP * Document Auth0 MCP provider integration * Add Auth0MCPProvider scope and auth rejection tests Cover permissions-based required_scopes enforcement and unauthenticated MCP 401 responses. * fixed documentation * Narrow Auth0 docs to integration guide only * Fix Auth0 provider: use httpx2 instead of httpx httpx is a dev-only transitive dependency in this repo; runtime installs declare httpx2 exclusively. The module-level 'import httpx' in auth0.py broke import on a clean install of fastmcp or fastmcp-slim[server]. --------- Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
21 lines
488 B
Python
21 lines
488 B
Python
"""Auth0 Auth for MCP client example."""
|
|
|
|
import asyncio
|
|
|
|
from fastmcp import Client
|
|
from fastmcp.client.auth import OAuth
|
|
|
|
auth = OAuth(
|
|
additional_client_metadata={"token_endpoint_auth_method": "none"},
|
|
callback_host="127.0.0.1",
|
|
)
|
|
|
|
|
|
async def main() -> None:
|
|
async with Client("http://127.0.0.1:8000/mcp", auth=auth) as client:
|
|
result = await client.call_tool("echo", {"message": "hello"})
|
|
print(result)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|