Skip to content

Commit b23c432

Browse files
committed
change fastmcp dependency approach
1 parent cd9687f commit b23c432

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "The Posit Connect command-line interface."
55
authors = [{ name = "Posit, PBC", email = "[email protected]" }]
66
license = { file = "LICENSE.md" }
77
readme = { file = "README.md", content-type = "text/markdown" }
8-
requires-python = ">=3.10"
8+
requires-python = ">=3.8"
99

1010
dependencies = [
1111
"typing-extensions>=4.8.0",
@@ -14,7 +14,6 @@ dependencies = [
1414
"pyjwt>=2.4.0",
1515
"click>=8.0.0",
1616
"toml>=0.10; python_version < '3.11'",
17-
"fastmcp==2.12.4"
1817
]
1918

2019
dynamic = ["version"]
@@ -40,6 +39,7 @@ test = [
4039
"types-Flask",
4140
]
4241
snowflake = ["snowflake-cli"]
42+
mcp = ["fastmcp==2.12.4"]
4343
docs = [
4444
"mkdocs-material",
4545
"mkdocs-click",

rsconnect/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,14 @@ def version():
404404

405405
@cli.command(help="Start the MCP server")
406406
def mcp_server():
407-
from fastmcp import FastMCP
408-
from fastmcp.exceptions import ToolError
407+
try:
408+
from fastmcp import FastMCP
409+
from fastmcp.exceptions import ToolError
410+
except ImportError:
411+
raise RSConnectException(
412+
"The fastmcp package is required for MCP server functionality. "
413+
"Install it with: pip install rsconnect-python[mcp]"
414+
)
409415

410416
mcp = FastMCP("Connect MCP")
411417

0 commit comments

Comments
 (0)