Make AI features (AI Copilot + MCP) optional via [ai-features] extra

- Move fastmcp from core requirements.txt to mcp-requirements.txt
- Add MCP_AVAILABLE feature flag in agent/__init__.py (graceful degradation)
- Guard MCP imports/registration in server.py and tasks.py
- Replace ai-copilot/mcp/ai-support extras with single ai-features extra
- Add stub MCP routes returning 501 when MCP is not installed
- Add gns3server-uninstall-ai-features CLI command
- Remove old gns3server-uninstall-ai-copilot command
- Update all error messages and docs to reference ai-features

Closes #2794
This commit is contained in:
YueGuobin committed 2026-06-27 10:14:43 +08:00
1 parent 58d3055dd3
commit 292b60efaa
11 files changed
+117 -58

No files matched your search

+4 -6
View File
@@ -31,19 +31,17 @@ typing-extensions>=4.15.0
requests>=2.34.2
urllib3>=2.7.0
# MCP (Model Context Protocol) dependencies
fastmcp>=3.4.0
# ==============================================================================
# File type detection
python-magic>=0.4.27
# AI Copilot Optional Dependencies
# Optional AI Features (AI Copilot + MCP)
# ==============================================================================
# AI Copilot features are now optional. Install with:
# pip install gns3-server[ai-copilot]
# AI Copilot and MCP features are now optional. Install with:
# pip install gns3-server[ai-features]
# Or:
# pip install -r ai-requirements.txt
# pip install -r mcp-requirements.txt
#
# This reduces installation size and supports restricted environments where
# AI dependencies may not be allowed.