Add CIMD (Client ID Metadata Document) support for OAuth (#2871)

This commit is contained in:
Jeremiah Lowin 2026-02-06 13:44:52 -05:00 committed by GitHub
commit 880d835ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 4218 additions and 115 deletions

View file

@ -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!")