MCP: add system.log + system.info + viewer.shutdown#5997
Merged
Conversation
system.log returns the last N lines (default 100, capped at 1000) of the existing rotating-file spdlog output — opens the file fresh each call, no new sink. Lines come pre-formatted; LLM substring-matches `[error]` etc. client-side if it wants level filtering. system.info wraps the existing GetSystemInfoJson() (Version/OS/CPU/GPU/ memory/window). Json::Value -> nlohmann::json via StreamWriterBuilder. viewer.shutdown calls Viewer::stopEventLoop() so the MCP response can flush before the event loop exits on the next frame. Re-launch via the gateway's `launch` tool. system.runPython is intentionally not here — it'll land on the private MeshInspectorCode layer where access can be gated on user permission. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
adalisk-emikhaylov
approved these changes
Apr 27, 2026
Fedr
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the merged scene/viewer/ui/tools MCP work (#5972, #5980, #5982, #5996). Adds two
system.*tools for host-environment observability and oneviewer.shutdownfor clean process exit.Tools
system.log({maxLines})— last N pre-formatted spdlog lines (default 100, cap 1000) from the existing rotating-file sink. Opens the file fresh each call; no new sink. Returns[]when file logging is disabled. LLM substring-matches[error]/[warn]client-side if it wants level filtering.system.info— snapshot ofMR::GetSystemInfoJson()(the same data behind the About dialog):Version,OS Version,CPU Info,Graphics Info,Memory Info,Window Info,Process Memory.Versionis prefixed with\"Debug:\"on Debug builds.viewer.shutdown— callsViewer::stopEventLoop()from the GUI thread; the MCP response flushes before the event loop exits next frame. The gateway's existinglaunchtool brings MI back up.system.runPythonis intentionally not in this PR — it'll land on the private MeshInspectorCode layer where access can be gated on user permission.Verification (live)
system.logdefault → 100 lines includingMCP server started on port 7887.system.log {maxLines:5}→ exactly 5 lines.system.info→{Version: \"Debug: Apr 24 2026\", OS Version: ..., CPU Info: ..., Graphics Info: ..., Memory Info: ..., Window Info: ..., Process Memory: ...}.viewer.shutdown→{}response delivered, MI process exits with code 0; the gateway'slaunchbrings it back.🤖 Generated with Claude Code