mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
Add CIMD (Client ID Metadata Document) support for OAuth (#2871)
This commit is contained in:
parent
db650ca7cb
commit
880d835ccc
36 changed files with 4218 additions and 115 deletions
|
|
@ -8,14 +8,20 @@ To run:
|
|||
|
||||
import asyncio
|
||||
|
||||
from fastmcp.client import Client
|
||||
from fastmcp.client import Client, OAuth
|
||||
|
||||
SERVER_URL = "http://127.0.0.1:8000/mcp"
|
||||
SERVER_URL = "http://localhost:8000/mcp"
|
||||
|
||||
|
||||
async def main():
|
||||
try:
|
||||
async with Client(SERVER_URL, auth="oauth") as client:
|
||||
async with Client(
|
||||
SERVER_URL,
|
||||
auth=OAuth(
|
||||
# Replace with your own CIMD document URL
|
||||
client_metadata_url="https://www.jlowin.dev/mcp-client.json",
|
||||
),
|
||||
) as client:
|
||||
assert await client.ping()
|
||||
print("✅ Successfully authenticated!")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue