- Add [mpp] section to conf/glances.conf with disable=True
- Add docs/aoa/mpp.rst documentation page and index entry
- Add unit test test_026_mpp with Rockchip MPP test fixtures
Introduce a generic Min/Max/Mean (mmm) mechanism at the plugin model level.
When a field in `fields_description` defines `'mmm': True`, the plugin
automatically generates and maintains the following derived fields:
<field>_min
<field>_max
<field>_mean
The computation is handled in the base plugin model to ensure the
feature is reusable across all plugins. Mean is calculated as a
running mean, and min/max are updated on each refresh cycle.
This implementation:
- Keeps the feature opt-in per field
- Avoids hardcoding logic in individual plugins
- Maintains full backward compatibility
- Preserves existing API v4 response structure
- Ensures no regression in existing behavior
Unit tests have been added to validate correct field generation
and update behavior.
Several plugins call msg_curse(args=None) with args defaulting to None,
but then access args attributes directly (e.g. args.diskio_iops) without
checking if args is None first, causing AttributeError in tests and any
caller that omits args.
Add `args and` guard before every args attribute access in msg_curse for:
- diskio (4 places)
- fs (2 places)
- network (6 places)
- processlist (7 places)
- processcount (1 place)
- system (1 place)
- load (1 place)
- containers (1 place)
- gpu (2 places)
Also fix TestDiskioPluginMsgCurse tests to call update_views() before
msg_curse() so views are populated before rendering.
Fixes#3429
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>