Expose Glances system monitoring data to AI assistants via the Model
Context Protocol, mounted alongside the existing REST API.
New features:
- GlancesMcpServer (glances/outputs/glances_mcp.py): FastMCP-based server
exposing 6 resources (glances://plugins, glances://stats,
glances://stats/{plugin}, glances://stats/{plugin}/history,
glances://limits, glances://limits/{plugin}) and 4 prompt templates
(system_health_summary, alert_analysis, top_processes_report,
storage_health).
- GlancesMcpAuthMiddleware: pure-ASGI middleware (SSE-safe, no body
buffering) reusing the existing Basic Auth / JWT Bearer credentials.
- CLI flags --enable-mcp and --mcp-path; config-file keys enable_mcp
and mcp_path under [outputs].
- 25 tests in tests/test_mcp.py covering SSE connectivity, all resources
and prompts via the MCP client SDK, and the auth middleware unit tests.
The mcp package (>=1.0.0) is added as the new optional dependency group
[mcp] and included in [all].
Activation: glances -w --enable-mcp
or [outputs] enable_mcp = true in glances.conf
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>