(command_or_url: str, args: list[str], env: list[tuple[str, str]])
| 49 | |
| 50 | |
| 51 | async def main(command_or_url: str, args: list[str], env: list[tuple[str, str]]): |
| 52 | env_dict = dict(env) |
| 53 | |
| 54 | if urlparse(command_or_url).scheme in ("http", "https"): |
| 55 | # Use SSE client for HTTP(S) URLs |
| 56 | async with sse_client(command_or_url) as streams: |
| 57 | await run_session(*streams) |
| 58 | else: |
| 59 | # Use stdio client for commands |
| 60 | server_parameters = StdioServerParameters(command=command_or_url, args=args, env=env_dict) |
| 61 | async with stdio_client(server_parameters) as streams: |
| 62 | await run_session(*streams) |
| 63 | |
| 64 | |
| 65 | def cli(): |
nothing calls this directly
no test coverage detected