Skip to main content
Glama

ilnmors-mcp

Unified, local-only, read-first homelab MCP (Model Context Protocol, Streamable HTTP) gateway built for Open WebUI as the agent frontend and 64k-context local LLMs (Quartermaster).

Goals & Scope

  • One lightweight pure-HTTP gateway for 12 homelab services: runs locally inside the app VM (loopback / host.containers.internal), never exposed directly to the public internet.

  • Open WebUI as the single agent & login layer: Open WebUI already handles Authelia OIDC login and runs the native tool-calling loop. ilnmors-mcp intentionally does not implement its own OIDC/LDAP login UI.

  • Strict per-user ACL preservation across every authenticated app: all 10 apps with user accounts/ACLs require per-user API keys under users.<email>. There is zero cross-user or shared-key fallback—neither between admin and regular users, nor between two regular users.

  • Compact tool schemas for local LLMs: split into 4 focused Streamable HTTP endpoints so each chat only loads the domain tools it needs and stays comfortably inside a 64k context window.

  • Read-first safety: Phase 1 exposes only read/search tools with strict output caps and content guards. Mail and Readur are intentionally out of scope for Phase 1.

Related MCP server: sources-mcp

Architecture & Authentication

Browser / Mobile PWA
        │  (Authelia OIDC login)
        ▼
   Open WebUI  ──(Bearer API key + optional X-OpenWebUI-User-* headers)──▶  ilnmors-mcp
                                                                                │
                                                 (strictly that user's own per-app API key / DAV App Password)
                                                                                ▼
                                                                      Homelab Services (12)

Hop 1: Client (Open WebUI / local test) → ilnmors-mcp

  • Shared Bearer API key: server.auth_token_file or ILNMORS_MCP_AUTH_TOKEN guards every /mcp/* route (Authorization: Bearer <token>).

  • Two operating modes:

    1. Local single-user test mode (require_user_header: false + default_user / default_role): lets you test directly with curl, MCP Inspector, or Open WebUI using only the Bearer API key, before enabling forwarded user headers.

    2. Open WebUI multi-user mode (require_user_header: true, ENABLE_FORWARD_USER_INFO_HEADERS=true in Open WebUI): ignores default_user and reads X-OpenWebUI-User-Email and X-OpenWebUI-User-Role on every request so every user only accesses what their own per-app API key permits, and non-admins receive 403 Forbidden on /mcp/ops.

Hop 2: ilnmors-mcp → Backend Services

  • Every authenticated app (10/12) resolves credentials strictly from users.<email>.<service> using that user's own API key/token (and OxiCloud's DAV App Password, since OxiCloud uses OIDC login + Basic Auth for WebDAV/CalDAV/CardDAV).

  • Only internal keyless observability backends (prometheus, loki on admin-only /mcp/ops) have no per-user API key.

  • Secret values are loaded from mounted files (*_file) or environment variables (${ENV_VAR})—never stored in Git.

  • Auto-enabling adapters: services with no configured user credentials (or missing base_url) are skipped cleanly at startup and reported under GET /healthz.

Endpoints & Phase 1 Tool Catalog

Endpoint

Access

Service

Credential scope

Read-only tools

/mcp/pim

Authenticated

OxiCloud

Per-user (DAV App Password)

oxicloud_calendar_list, oxicloud_contacts_search, oxicloud_files_list, oxicloud_files_read_text

/mcp/pim

Authenticated

Kaneo

Per-user (API key)

kaneo_projects_list, kaneo_tasks_list, kaneo_task_get

/mcp/knowledge

Authenticated

Outline

Per-user (API token)

outline_collections_list, outline_search, outline_get_document

/mcp/knowledge

Authenticated

BookStack

Per-user (Token ID/Secret)

bookstack_search, bookstack_get_page

/mcp/knowledge

Authenticated

Linkding

Per-user (API token)

linkding_search

/mcp/knowledge

Authenticated

Immich

Per-user (API key)

immich_search_smart, immich_albums_list, immich_statistics

/mcp/home

Authenticated

Sure Finance

Per-user (RO wrapper token)

sure_accounts_summary, sure_transactions_query

/mcp/home

Authenticated

Tandoor Recipes

Per-user (API token)

tandoor_recipes_search, tandoor_recipe_get, tandoor_mealplan_list, tandoor_shopping_list

/mcp/home

Authenticated

Mastodon

Per-user (Access token)

mastodon_search, mastodon_bookmarks

/mcp/ops

Admin only

Forgejo

Per-user (RO token)

forgejo_repos_list, forgejo_issues_list, forgejo_commits_recent

/mcp/ops

Admin only

Prometheus

Keyless (internal URL)

prometheus_query, prometheus_alerts, prometheus_targets_down

/mcp/ops

Admin only

Loki

Keyless (internal URL)

loki_query_errors

/healthz

Local health

—

None

Returns server version, auth mode, and list of enabled services per endpoint

Safety & Context Guards

  • Zero cross-user fallback (admin↔user and user↔user): all 10 authenticated services resolve strictly from users.<email>.<service>; unmapped users are rejected rather than falling back to another user's or service-level credentials.

  • Output truncation: tool responses are capped (server.default_max_chars, default 6000) to protect local LLM context windows.

  • WebDAV streaming & text guard: oxicloud_files_read_text refuses binary extensions/content-types and streams responses with a strict webdav_max_bytes cap (default 524288 bytes / 512 KiB).

  • Read-only backend enforcement:

    • Sure exposes only a read-only tool allowlist (accounts/transactions).

    • Loki permanently injects negative matchers excluding openwebui and quartermaster streams regardless of custom config overrides.

Quick Start (Local Testing)

1. Create a minimal local config.yaml

Start with just one or two services and your own API keys under users: to verify end-to-end connectivity:

server:
  host: "127.0.0.1"
  port: 8090
  auth_token: "${ILNMORS_MCP_AUTH_TOKEN}"
  # Local single-user test mode (switch to true when wiring Open WebUI headers)
  require_user_header: false
  default_user: "il@example.internal"
  default_role: "admin"

users:
  il@example.internal:
    linkding:
      token: "${LINKDING_TOKEN}"
    outline:
      token: "${OUTLINE_TOKEN}"

services:
  linkding:
    base_url: "https://linkding.example.internal"
  outline:
    base_url: "https://outline.example.internal"

See config.example.yaml for all 12 services and secret-file (*_file) options.

2. Install & run

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -v

export ILNMORS_MCP_AUTH_TOKEN="dev-local-token"
export OUTLINE_TOKEN="..."
.venv/bin/ilnmors-mcp --config config.yaml --check-config
ILNMORS_MCP_CONFIG=config.yaml .venv/bin/ilnmors-mcp

3. Smoke-test locally

# 1) Check which adapters enabled
curl -s http://127.0.0.1:8090/healthz

# 2) Verify Bearer auth + MCP tools/list over Streamable HTTP
curl -s http://127.0.0.1:8090/mcp/knowledge \
  -H "Authorization: Bearer ${ILNMORS_MCP_AUTH_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Open WebUI Integration

Add ilnmors-mcp to Open WebUI via TOOL_SERVER_CONNECTIONS (using the same Bearer token). When enabling multi-user access, set ENABLE_FORWARD_USER_INFO_HEADERS=true in Open WebUI and require_user_header: true in config.yaml:

ENABLE_FORWARD_USER_INFO_HEADERS=true
TOOL_SERVER_CONNECTIONS='[
  {"type":"mcp","url":"http://host.containers.internal:8090/mcp/pim","auth_type":"bearer","key":"<token>","config":{"enable":true},"info":{"id":"homelab-pim","name":"Homelab PIM","description":"OxiCloud, Kaneo"}},
  {"type":"mcp","url":"http://host.containers.internal:8090/mcp/knowledge","auth_type":"bearer","key":"<token>","config":{"enable":true},"info":{"id":"homelab-knowledge","name":"Homelab Knowledge","description":"Outline, BookStack, Linkding, Immich"}},
  {"type":"mcp","url":"http://host.containers.internal:8090/mcp/home","auth_type":"bearer","key":"<token>","config":{"enable":true},"info":{"id":"homelab-home","name":"Homelab Home","description":"Sure, Tandoor, Mastodon"}},
  {"type":"mcp","url":"http://host.containers.internal:8090/mcp/ops","auth_type":"bearer","key":"<token>","config":{"enable":true},"info":{"id":"homelab-ops","name":"Homelab Ops","description":"Forgejo, Prometheus, Loki (admin only)"}}
]'

Container Build

podman build -t ilnmors-mcp:0.1.0 -f Containerfile .

Implementation Roadmap

  1. Stage 1 — Specification (README.md): architecture, strict per-user ACL model, 12-service endpoint/tool catalog, and safety boundaries.

  2. Stage 2 — Core Server & Auth: Streamable HTTP router, Bearer API-key check, local single-user mode (default_user) + Open WebUI forwarded-header mode, and unit + live localhost tests.

  3. Stage 3 — Service Adapters: verify all 12 adapters (/mcp/pim, /mcp/knowledge, /mcp/home, /mcp/ops) with strict admin↔user and user↔user isolation tests.

  4. Stage 4 — Open WebUI Integration: container build, Open WebUI TOOL_SERVER_CONNECTIONS smoke test, and optional Phase 2 controlled write tools.

License

GPL-3.0-or-later.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Read-only MCP server exposing homelab data sources (files, mail, calls) to Cloudflare OS, enabling read-only access to documents, emails, and call records.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to query homelab infrastructure such as Proxmox VE, NetBox, systemd services, Grafana, InfluxDB, AdGuard Home, ping logs, and configured HTTP JSON endpoints through read-only tools.
      AGPL 3.0