@@ -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 )
0 commit comments