tui: instantiate MCPManager at startup to auto-connect and register MCP tools

This commit is contained in:
giveen
2026-01-21 11:15:21 -07:00
parent 84203c0435
commit d29e1f78e6

View File

@@ -1316,10 +1316,18 @@ class PentestAgentTUI(App):
# MCP: automatic install/start has been removed. Operators should
# run the scripts in `third_party/` manually to install and start
# any vendored MCP servers (e.g., HexStrike, MetasploitMCP) and
# then configure `mcp_servers.json` accordingly. No automatic
# background installs or starts will be performed.
self.mcp_manager = None
mcp_server_count = 0
# then configure `mcp_servers.json` accordingly. If a config is
# present, `MCPManager` will auto-connect and register tools so
# the TUI can display MCP-provided tools.
try:
from ..mcp import MCPManager
self.mcp_manager = MCPManager()
# connected servers are available synchronously
mcp_server_count = len(self.mcp_manager.get_all_servers())
except Exception:
self.mcp_manager = None
mcp_server_count = 0
# Runtime - Docker or Local
if self.use_docker: