Skip to content

feat: implement Model Context Protocol (MCP) server & graceful in-place installer updates - #7

Merged
spelech merged 10 commits into
mainfrom
feat/mcp-server-and-installer-updates
Aug 22, 2026
Merged

feat: implement Model Context Protocol (MCP) server & graceful in-place installer updates#7
spelech merged 10 commits into
mainfrom
feat/mcp-server-and-installer-updates

Conversation

@spelech

@spelech spelech commented Aug 22, 2026

Copy link
Copy Markdown
Owner

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

  1. Model Context Protocol (MCP) Server (/mcp & /api/mcp/tools):

    • Integrated ModelContextProtocol.AspNetCore v2.2.0.
    • Added LocalLlmMcpTools exposing 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.
    • Mapped /mcp Streamable HTTP & SSE transport endpoint and updated GET /api/mcp/tools discovery.
  2. In-Place Installer & Update Lifecycle:

    • Inno Setup (scripts/installer.iss): Adds CloseApplications=yes, graceful service shutdown (net stop) & process termination before file copy to eliminate Windows file locking errors, preserves settings.json with onlyifdoesntexist, and reconfigures/starts service post-install.
    • PowerShell Install/Update (scripts/install.ps1, scripts/update.ps1): Added active service detection, tray process kill, atomic settings.json backup/restore, and service/tray app restart.
    • Linux Installer (scripts/install_linux.sh): Added systemctl is-active detection, service teardown, config preservation, and automatic systemd restart.
  3. Quality Assurance & Traceability:

    • Added McpServerIntegrationTests.cs (22 tests) covering DI resolution, attributes, tool execution, and error handling.
    • Updated README.md, docs/REQUIREMENTS.md (RTM), docs/TEST_COVERAGE.md, and docs/ARCHITECTURE.md.
    • All 174 tests in the test suite pass (173 passed, 1 skipped screenshot doc generator, 0 failed).

@spelech
spelech merged commit ff09ae0 into main Aug 22, 2026
1 check passed
@spelech
spelech deleted the feat/mcp-server-and-installer-updates branch August 22, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant