Skip to content

Commit 271e77d

Browse files
committed
Fixing argument parsing and formatting
1 parent e11ce70 commit 271e77d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/mcp/client/__main__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ async def run_session(
4747
logger.info("Initialized")
4848

4949

50-
async def main(command_or_url: str, args: list[str], env: list[tuple[str, str]], disable_ssl_verification: bool):
50+
async def main(command_or_url: str, args: list[str], env: list[tuple[str, str]], verify_ssl: bool):
5151
env_dict = dict(env)
5252

5353
if urlparse(command_or_url).scheme in ("http", "https"):
5454
# Use SSE client for HTTP(S) URLs
55-
async with sse_client(command_or_url, verify_ssl=not disable_ssl_verification) as streams:
55+
async with sse_client(command_or_url, verify_ssl=verify_ssl) as streams:
5656
await run_session(*streams)
5757
else:
5858
# Use stdio client for commands
@@ -79,11 +79,15 @@ def cli():
7979
parser.add_argument(
8080
"--disable-ssl-verification",
8181
action='store_true',
82-
help="Disable SSL verification when using HTTPS. SSL verification is enabled by default.",
82+
default=False,
83+
help="Disable SSL verification on HTTPS. SSL verification by default.",
8384
)
8485

8586
args = parser.parse_args()
86-
anyio.run(partial(main, args.command_or_url, args.args, args.env, args.disable_ssl_verification), backend="trio")
87+
anyio.run(
88+
partial(main, args.command_or_url, args.args, args.env, not args.disable_ssl_verification),
89+
backend="trio",
90+
)
8791

8892

8993
if __name__ == "__main__":

0 commit comments

Comments
 (0)