Skip to content

Commit 0fa3c4b

Browse files
Merge branch 'main' into feat/remove-prompt-resource-template
2 parents 63bb350 + fb2276b commit 0fa3c4b

File tree

6 files changed

+18
-36
lines changed

6 files changed

+18
-36
lines changed

.github/workflows/claude-code-review.yml

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

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
claude:
1616
if: |
17-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && !startsWith(github.event.comment.body, '@claude review')) ||
1818
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
1919
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
2020
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
]
2727
dependencies = [
2828
"anyio>=4.9",
29-
"httpx>=0.27.1",
29+
"httpx>=0.27.1,<1.0.0",
3030
"httpx-sse>=0.4",
3131
"pydantic>=2.12.0",
3232
"starlette>=0.48.0; python_version >= '3.14'",

src/mcp/server/mcpserver/server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ class Settings(BaseSettings, Generic[LifespanResultT]):
105105
# prompt settings
106106
warn_on_duplicate_prompts: bool
107107

108+
dependencies: list[str]
109+
"""List of dependencies to install in the server environment. Used by the `mcp install` and `mcp dev` CLI."""
110+
108111
lifespan: Callable[[MCPServer[LifespanResultT]], AbstractAsyncContextManager[LifespanResultT]] | None
109112
"""An async context manager that will be called when the server is started."""
110113

@@ -142,6 +145,7 @@ def __init__(
142145
warn_on_duplicate_resources: bool = True,
143146
warn_on_duplicate_tools: bool = True,
144147
warn_on_duplicate_prompts: bool = True,
148+
dependencies: list[str] | None = None,
145149
lifespan: Callable[[MCPServer[LifespanResultT]], AbstractAsyncContextManager[LifespanResultT]] | None = None,
146150
auth: AuthSettings | None = None,
147151
):
@@ -151,9 +155,11 @@ def __init__(
151155
warn_on_duplicate_resources=warn_on_duplicate_resources,
152156
warn_on_duplicate_tools=warn_on_duplicate_tools,
153157
warn_on_duplicate_prompts=warn_on_duplicate_prompts,
158+
dependencies=dependencies or [],
154159
lifespan=lifespan,
155160
auth=auth,
156161
)
162+
self.dependencies = self.settings.dependencies
157163

158164
self._tool_manager = ToolManager(tools=tools, warn_on_duplicate_tools=self.settings.warn_on_duplicate_tools)
159165
self._resource_manager = ResourceManager(warn_on_duplicate_resources=self.settings.warn_on_duplicate_resources)

tests/server/mcpserver/test_server.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ async def test_create_server(self):
6565
assert len(mcp.icons) == 1
6666
assert mcp.icons[0].src == "https://example.com/icon.png"
6767

68+
def test_dependencies(self):
69+
"""Dependencies list is read by `mcp install` / `mcp dev` CLI commands."""
70+
mcp = MCPServer("test", dependencies=["pandas", "numpy"])
71+
assert mcp.dependencies == ["pandas", "numpy"]
72+
assert mcp.settings.dependencies == ["pandas", "numpy"]
73+
74+
mcp_no_deps = MCPServer("test")
75+
assert mcp_no_deps.dependencies == []
76+
6877
async def test_sse_app_returns_starlette_app(self):
6978
"""Test that sse_app returns a Starlette application with correct routes."""
7079
mcp = MCPServer("test")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)