File size: 666 Bytes
a010541
 
0629dc1
a010541
 
 
 
 
0629dc1
 
 
a010541
 
0629dc1
a010541
 
 
 
 
0629dc1
a010541
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
import asyncio
from typing import Dict

from fastmcp import Client


async def main() -> None:
    parser = argparse.ArgumentParser(description="Test MCP Bridge")
    parser.add_argument("--url", default="http://localhost:7860/sse")
    parser.add_argument("--api-key", required=True)
    args = parser.parse_args()

    headers: Dict[str, str] = {"Authorization": f"Bearer {args.api_key}"}

    async with Client(args.url, headers=headers) as client:
        tools = await client.list_tools()
        print("Tools:")
        for tool in tools:
            print("-", getattr(tool, "name", tool))


if __name__ == "__main__":
    asyncio.run(main())