Skip to content

Commit 2bac0c5

Browse files
committed
refactor(MCP): move mcp dependency to runtime check in fpb_mcp_server.py
1 parent cf6a5df commit 2bac0c5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Tools/WebServer/fpb_mcp_server.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@
2828
sys.path.insert(0, str(_SERVER_DIR))
2929
os.chdir(_SERVER_DIR)
3030

31-
from mcp.server.fastmcp import FastMCP # noqa: E402
31+
try:
32+
from mcp.server.fastmcp import FastMCP # noqa: E402
33+
except ImportError:
34+
print(
35+
"Error: 'mcp' package is not installed.\n"
36+
"Install it with: pip install mcp",
37+
file=sys.stderr,
38+
)
39+
sys.exit(1)
3240

3341
# Import the CLI class directly
3442
from cli.fpb_cli import FPBCLI # noqa: E402

Tools/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pyserial
77
pygdbmi
88
watchdog
99
tree_sitter
10-
mcp
1110

1211
# Test dependencies
1312
coverage

0 commit comments

Comments
 (0)