feat: implement Model Context Protocol (MCP) server & graceful in-place installer updates - #7
Merged
Merged
Conversation
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.
Summary
This PR implements an official Model Context Protocol (MCP) server for AI agent integration and provides robust in-place update support across all Windows and Linux installation/upgrade pipelines.
🌟 Key Changes
Model Context Protocol (MCP) Server (
/mcp&/api/mcp/tools):ModelContextProtocol.AspNetCorev2.2.0.LocalLlmMcpToolsexposing 8 AI automation tools:get_gpu_vram— Real-time GPU VRAM telemetry via NVML CUDA.check_health— Probe Ollama (:11434), SD Forge (:7860), and ComfyUI (:8188).list_models— Installed Ollama models, quantization tags, and footprints.pull_model— Automated model pull from Ollama library / Hugging Face.unload_vram— Release loaded models from GPU VRAM (keep_alive: 0).start_engine/stop_engine— Manage SD Forge and ComfyUI backend processes.detect_tools— Auto-scan drives and PATH for installed tools./mcpStreamable HTTP & SSE transport endpoint and updatedGET /api/mcp/toolsdiscovery.In-Place Installer & Update Lifecycle:
scripts/installer.iss): AddsCloseApplications=yes, graceful service shutdown (net stop) & process termination before file copy to eliminate Windows file locking errors, preservessettings.jsonwithonlyifdoesntexist, and reconfigures/starts service post-install.scripts/install.ps1,scripts/update.ps1): Added active service detection, tray process kill, atomicsettings.jsonbackup/restore, and service/tray app restart.scripts/install_linux.sh): Addedsystemctl is-activedetection, service teardown, config preservation, and automatic systemd restart.Quality Assurance & Traceability:
McpServerIntegrationTests.cs(22 tests) covering DI resolution, attributes, tool execution, and error handling.README.md,docs/REQUIREMENTS.md(RTM),docs/TEST_COVERAGE.md, anddocs/ARCHITECTURE.md.