Skip to content

Commit 80a39f2

Browse files
committed
Merge branch 'feature/simple-chatbot-example' of https://github.com/3choff/python-sdk into feature/simple-chatbot-example
2 parents 466e1e8 + 07db4a3 commit 80a39f2

File tree

4 files changed

+27
-38
lines changed

4 files changed

+27
-38
lines changed

.github/workflows/main-checks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Main branch checks
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- 'v*.*.*'
68

79
jobs:
810
checks:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "mcp"
7-
version = "1.1.1.dev0"
7+
version = "1.1.2.dev0"
88
description = "Model Context Protocol SDK"
99
readme = "README.md"
1010
requires-python = ">=3.10"
@@ -31,7 +31,7 @@ dependencies = [
3131
"httpx-sse>=0.4",
3232
"pydantic>=2.7.2",
3333
"starlette>=0.27",
34-
"sse-starlette>=2.0",
34+
"sse-starlette>=1.6.1",
3535
]
3636

3737
[project.urls]

src/mcp/client/__main__.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import argparse
12
import logging
23
import sys
34
from functools import partial
45
from urllib.parse import urlparse
56

67
import anyio
7-
import click
88

99
from mcp.client.session import ClientSession
1010
from mcp.client.sse import sse_client
@@ -57,19 +57,22 @@ async def main(command_or_url: str, args: list[str], env: list[tuple[str, str]])
5757
await run_session(*streams)
5858

5959

60-
@click.command()
61-
@click.argument("command_or_url")
62-
@click.argument("args", nargs=-1)
63-
@click.option(
64-
"--env",
65-
"-e",
66-
multiple=True,
67-
nargs=2,
68-
metavar="KEY VALUE",
69-
help="Environment variables to set. Can be used multiple times.",
70-
)
71-
def cli(*args, **kwargs):
72-
anyio.run(partial(main, *args, **kwargs), backend="trio")
60+
def cli():
61+
parser = argparse.ArgumentParser()
62+
parser.add_argument("command_or_url", help="Command or URL to connect to")
63+
parser.add_argument("args", nargs="*", help="Additional arguments")
64+
parser.add_argument(
65+
"-e",
66+
"--env",
67+
nargs=2,
68+
action="append",
69+
metavar=("KEY", "VALUE"),
70+
help="Environment variables to set. Can be used multiple times.",
71+
default=[],
72+
)
73+
74+
args = parser.parse_args()
75+
anyio.run(partial(main, args.command_or_url, args.args, args.env), backend="trio")
7376

7477

7578
if __name__ == "__main__":

uv.lock

Lines changed: 5 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)