Repository avatar
Developer Tools
v0.2.0
active

zimatools

io.github.bobdivx/zimatools

Self-hosted MCP server for ZimaOS NAS: files, Docker and a fair-share GPU arbiter. 19 tools.

Documentation

ZimaTools demo: GPU dashboard, apps, GPU page and MCP server on a ZimaCube

ZimaTools

Turn your ZimaOS NAS into a local AI server.
One GPU, shared fairly between your media server, Ollama and your AI agents — plus an MCP server that lets Grok, Cursor or Claude manage your NAS.

Apache 2.0 ZimaOS 1.8+ 19 MCP tools native module

Add to Cursor Install in VS Code Works with Grok, Claude, Codex, Cursor


Why ZimaTools?

A ZimaCube with one NVIDIA card quickly becomes a battlefield: Jellyfin/Popcorn transcodes, Ollama loads a 7B model, an agent starts an image job — and somebody runs out of VRAM. ZimaTools sits next to ZimaOS and fixes that:

  • 🎛️ GPU arbiter — apps ask for the GPU (lease with VRAM, priority and TTL). Media playback wins over LLMs, LLMs win over background agents, and nobody crashes on an out-of-memory error.
  • 🤖 MCP server (19 tools) — files, Docker containers and GPU, exposed over Streamable HTTP with OAuth. Plug it into Grok, Cursor, Claude Desktop/Code or any MCP client.
  • 📊 Dashboard — live GPU/VRAM gauge and graph, who holds the GPU, who waits, running apps, image-update watchdog. Opens as a tile on the ZimaOS dashboard.
  • 📦 Native ZimaOS module — a single zimatools.raw systemd-sysext image (like ZimaOS-Terminal or ZimaScope). No Docker app, survives reboots, self-healing watchdog.

Running in production on a ZimaCube (ZimaOS 1.8, NVIDIA RTX A2000) since December 2026.

Home: GPU at a glance Apps: sorted, with logos

Mobile home Mobile apps MCP server page

Real screenshots from a ZimaCube. The UI is in English by default and switches to French (EN/FR toggle or browser language).

Install on ZimaOS (one command)

SSH into your NAS, then:

curl -fsSL https://raw.githubusercontent.com/bobdivx/zimatools/main/install.sh | sudo bash

The script downloads the latest module release, checks its SHA-256, installs it with zpkg and starts the service. Then open http://<your-nas>:8484 (or the ZimaTools tile on the ZimaOS dashboard).

⚠️ The first public module release is not out yet. Until then, build the image yourself (see Build from source) and install it with sudo ./install.sh --file module/artifacts/zimatools.raw.

WhatWhere
Dashboardhttp://<nas>:8484
MCP endpointhttp://<nas>:8484/mcp
ZimaOS gateway routehttp://<nas>:90/v2/zimatools (port of your ZimaOS gateway)
Admin password and static MCP token/DATA/AppData/zimatools/secrets.env (generated on first start, root only)
Optional settings/DATA/AppData/zimatools/zimatools.env (e.g. PUBLIC_BASE_URL=https://zimatools.example.com)
Uninstall (keeps data)curl -fsSL …/install.sh | sudo bash -s -- --uninstall

Prefer Docker / CasaOS? The original compose install still works: see docs/docker-install.md.

Connect your AI (MCP)

One-click and copy-paste setup for Grok / Grok Bot, Grok Build, Claude (Code, Desktop, claude.ai), Cursor, VS Code, Codex and any MCP client: docs/connectors.md. The badges above install the default LAN address http://zimaos.local:8484/mcp; change it in the client if your NAS has another name.

ZimaTools speaks MCP over Streamable HTTP at /mcp. Two ways to authenticate:

  • OAuth 2.1 (dynamic client registration) — for Grok and other remote connectors. Requires a public HTTPS URL (Cloudflare Tunnel, reverse proxy…) set as PUBLIC_BASE_URL.
  • Static Bearer token — ZIMATOOLS_MCP_TOKEN from secrets.env, ideal on your LAN.

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "zimatools": {
      "url": "http://<nas>:8484/mcp",
      "headers": { "Authorization": "Bearer <ZIMATOOLS_MCP_TOKEN>" }
    }
  }
}

Claude Code:

claude mcp add --transport http zimatools http://<nas>:8484/mcp \
  --header "Authorization: Bearer <ZIMATOOLS_MCP_TOKEN>"

Claude Desktop / any stdio-only client — bridge with mcp-remote:

{ "mcpServers": { "zimatools": { "command": "npx", "args": ["-y", "mcp-remote", "http://<nas>:8484/mcp", "--header", "Authorization: Bearer <ZIMATOOLS_MCP_TOKEN>"] } } }

Grok — add a custom connector with the URL https://<your-public-host>/mcp; Grok registers itself through OAuth and you approve it with the ZimaTools admin password.

GET /mcp in a browser shows a setup page with copy-paste snippets.

The 19 tools

AreaTools
GPUgpu.status, gpu.acquire, gpu.release, gpu.queue_list, gpu.set_priority
Dockerlist_docker_containers_zimaos, get_docker_container_info_zimaos, get_docker_container_logs_zimaos, start_…, stop_…, restart_docker_container_zimaos
Fileslist_allowed_directories_zimaos, list_directory_zimaos, read_file_from_zimaos, write_file_zimaos, edit_file_zimaos, create_directory_zimaos, search_file_zimaos, get_file_info_zimaos

File tools go through the ZimaOS files API (ZIMAOS_API_TOKEN); Docker tools use the local Docker socket.

The GPU arbiter in 60 seconds

GPU page

  • A client acquires a lease: client, optional vramMiB, ttlSeconds, exclusive.
  • Default priorities: popcorn (media) 100 › ollama 50 › agents 25 — change them at runtime with gpu.set_priority or POST /api/gpu/priority.
  • Priority ≥ 100 is exclusive (whole GPU). Lower priorities share VRAM as long as it fits.
  • A higher-priority request preempts lower leases; the others wait in a queue (ordered by priority, then arrival).
  • Leases expire (TTL), can be released explicitly, and every change is streamed as Server-Sent Events.
  • No NVIDIA card? The arbiter still works with a virtual capacity, so you can test anywhere.
# Ask for 4 GB of VRAM for Ollama, wait up to 2 minutes if the GPU is busy
curl -s -X POST http://<nas>:8484/api/gpu/acquire \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"client":"ollama","vramMiB":4096,"ttlSeconds":3600,"wait":true}'

curl -s -X POST http://<nas>:8484/api/gpu/release \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{"client":"ollama"}'

curl -N http://<nas>:8484/api/gpu/events -H "Authorization: Bearer $TOKEN"   # live events

A full walkthrough (Jellyfin/Popcorn + Ollama + agents on one card) is in the tutorial: Turn your ZimaCube into a local AI server.

Roadmap to ZimaOS 2.0

ZimaOS 2.0 announces open APIs, a public zpkg spec and build system, the Hana local-first assistant, Agent App templates and custom widgets. ZimaTools is built to follow:

  • Native sysext module installed with zpkg, gateway route, dashboard tile, boot watchdog
  • ZimaOS session login (ZimaOS user token validated against the system API)
  • One-line installer and release pipeline (module-v* tags)
  • Align the manifest/packaging with the official zpkg spec as soon as it is published (readiness notes)
  • GPU widget for the ZimaOS dashboard (custom widgets API)
  • Agent App / Hana template: "GPU-aware local AI" skills on top of the MCP tools (draft)
  • Listing in the ZimaOS Mod-Store
  • ARM64 build

Build from source

Requirements: Node.js 22, pnpm 10 (corepack enable), squashfs-tools, xz-utils.

git clone https://github.com/bobdivx/zimatools.git && cd zimatools
pnpm install && pnpm -r build
module/build.sh            # -> module/artifacts/zimatools.raw (+ .sha256)
module/test/smoke.sh       # end-to-end smoke test without ZimaOS
pnpm test                  # unit tests

Local development (UI with a mock API): pnpm dev:mcp and pnpm dev:web. Module internals: module/README.md.

Architecture

One Node.js process (Node 22 embedded in the image):

:8484  web UI + reverse proxy ──► /api  → REST (Hono)        127.0.0.1:8766
                               └─► /mcp  → MCP OAuth gateway  127.0.0.1:8765 → MCP server 127.0.0.1:8767
GPU arbiter ── nvidia-smi        Docker ── /var/run/docker.sock        Files ── ZimaOS API
apps/mcp/   MCP server, REST API, GPU arbiter, OAuth
apps/web/   Astro + Preact + Tailwind dashboard
module/     ZimaOS sysext packaging (build, systemd units, tile, watchdog, smoke test)
docs/       tutorial, Docker install, ZimaOS 2.0 notes

Contributing

Issues and pull requests are welcome — see CONTRIBUTING.md. Tested on your hardware (other GPUs, ZimaBoard, ZimaBlade)? Please open an issue with the result.

Credits & license

Started from IceWhale's ZimaOS-MCP prototype (history preserved). Licensed under the Apache License 2.0 — see NOTICE.

No installation packages available.

Remote

streamable-http
https://{nas_host}/mcp