Skip to content

Commit c733eec

Browse files
Make client examples workspaces to reflect package code (modelcontextprotocol#1466)
1 parent 98f8248 commit c733eec

File tree

7 files changed

+100
-1131
lines changed

7 files changed

+100
-1131
lines changed

examples/clients/simple-auth-client/pyproject.toml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ classifiers = [
1414
"Programming Language :: Python :: 3",
1515
"Programming Language :: Python :: 3.10",
1616
]
17-
dependencies = [
18-
"click>=8.2.0",
19-
"mcp>=1.0.0",
20-
]
17+
dependencies = ["click>=8.2.0", "mcp"]
2118

2219
[project.scripts]
2320
mcp-simple-auth-client = "mcp_simple_auth_client.main:cli"
@@ -44,9 +41,3 @@ target-version = "py310"
4441

4542
[tool.uv]
4643
dev-dependencies = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]
47-
48-
[tool.uv.sources]
49-
mcp = { path = "../../../" }
50-
51-
[[tool.uv.index]]
52-
url = "https://pypi.org/simple"

examples/clients/simple-auth-client/uv.lock

Lines changed: 0 additions & 535 deletions
This file was deleted.

examples/clients/simple-chatbot/mcp_simple_chatbot/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ async def start(self) -> None:
401401
await self.cleanup_servers()
402402

403403

404-
async def main() -> None:
404+
async def run() -> None:
405405
"""Initialize and run the chat session."""
406406
config = Configuration()
407407
server_config = config.load_config("servers_config.json")
@@ -411,5 +411,9 @@ async def main() -> None:
411411
await chat_session.start()
412412

413413

414+
def main() -> None:
415+
asyncio.run(run())
416+
417+
414418
if __name__ == "__main__":
415-
asyncio.run(main())
419+
main()

examples/clients/simple-chatbot/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ classifiers = [
1717
dependencies = [
1818
"python-dotenv>=1.0.0",
1919
"requests>=2.31.0",
20-
"mcp>=1.0.0",
21-
"uvicorn>=0.32.1"
20+
"mcp",
21+
"uvicorn>=0.32.1",
2222
]
2323

2424
[project.scripts]
25-
mcp-simple-chatbot = "mcp_simple_chatbot.client:main"
25+
mcp-simple-chatbot = "mcp_simple_chatbot.main:main"
2626

2727
[build-system]
2828
requires = ["hatchling"]

examples/clients/simple-chatbot/uv.lock

Lines changed: 0 additions & 555 deletions
This file was deleted.

pyproject.toml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ venv = ".venv"
9898
# those private functions instead of testing the private functions directly. It makes it easier to maintain the code source
9999
# and refactor code that is not public.
100100
executionEnvironments = [
101-
{ root = "tests", reportUnusedFunction = false, reportPrivateUsage = false },
102-
{ root = "examples/servers", reportUnusedFunction = false },
101+
{ root = "tests", reportUnusedFunction = false, reportPrivateUsage = false },
102+
{ root = "examples/servers", reportUnusedFunction = false },
103103
]
104104

105105
[tool.ruff]
@@ -109,17 +109,17 @@ extend-exclude = ["README.md"]
109109

110110
[tool.ruff.lint]
111111
select = [
112-
"C4", # flake8-comprehensions
113-
"C90", # mccabe
114-
"E", # pycodestyle
115-
"F", # pyflakes
116-
"I", # isort
117-
"PERF", # Perflint
118-
"PL", # Pylint
119-
"UP", # pyupgrade
112+
"C4", # flake8-comprehensions
113+
"C90", # mccabe
114+
"E", # pycodestyle
115+
"F", # pyflakes
116+
"I", # isort
117+
"PERF", # Perflint
118+
"PL", # Pylint
119+
"UP", # pyupgrade
120120
]
121121
ignore = ["PERF203", "PLC0415", "PLR0402"]
122-
mccabe.max-complexity = 24 # Default is 10
122+
mccabe.max-complexity = 24 # Default is 10
123123

124124
[tool.ruff.lint.per-file-ignores]
125125
"__init__.py" = ["F401"]
@@ -128,13 +128,13 @@ mccabe.max-complexity = 24 # Default is 10
128128

129129
[tool.ruff.lint.pylint]
130130
allow-magic-value-types = ["bytes", "float", "int", "str"]
131-
max-args = 23 # Default is 5
132-
max-branches = 23 # Default is 12
133-
max-returns = 13 # Default is 6
134-
max-statements = 102 # Default is 50
131+
max-args = 23 # Default is 5
132+
max-branches = 23 # Default is 12
133+
max-returns = 13 # Default is 6
134+
max-statements = 102 # Default is 50
135135

136136
[tool.uv.workspace]
137-
members = ["examples/servers/*", "examples/snippets"]
137+
members = ["examples/clients/*", "examples/servers/*", "examples/snippets"]
138138

139139
[tool.uv.sources]
140140
mcp = { workspace = true }
@@ -154,16 +154,16 @@ filterwarnings = [
154154
"ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning",
155155
"ignore:Returning str or bytes.*:DeprecationWarning:mcp.server.lowlevel",
156156
# pywin32 internal deprecation warning
157-
"ignore:getargs.*The 'u' format is deprecated:DeprecationWarning"
157+
"ignore:getargs.*The 'u' format is deprecated:DeprecationWarning",
158158
]
159159

160160
[tool.markdown.lint]
161-
default=true
162-
MD004=false # ul-style - Unordered list style
163-
MD007.indent=2 # ul-indent - Unordered list indentation
164-
MD013=false # line-length - Line length
165-
MD029=false # ol-prefix - Ordered list item prefix
166-
MD033=false # no-inline-html Inline HTML
167-
MD041=false # first-line-heading/first-line-h1
168-
MD046=false # indented-code-blocks
169-
MD059=false # descriptive-link-text
161+
default = true
162+
MD004 = false # ul-style - Unordered list style
163+
MD007.indent = 2 # ul-indent - Unordered list indentation
164+
MD013 = false # line-length - Line length
165+
MD029 = false # ol-prefix - Ordered list item prefix
166+
MD033 = false # no-inline-html Inline HTML
167+
MD041 = false # first-line-heading/first-line-h1
168+
MD046 = false # indented-code-blocks
169+
MD059 = false # descriptive-link-text

uv.lock

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

0 commit comments

Comments
 (0)