feat(servers): persistent volumes + self-hosted web search and docs templates

Instances are immutable and get recreated on any server edit, so anything an
MCP server wrote to its container filesystem was lost at exactly that point.
That ruled out every stateful MCP server, docs-mcp among them: its index is a
SQLite file (better-sqlite3 + sqlite-vec) and it has no external-database mode,
so no amount of Postgres helps.

A server or template can now declare volumes. The backing store is keyed on the
server, not the instance — `mcpctl-<server>-<name>` — which is the whole point:
an instance-scoped claim would be destroyed precisely when the data needs to
survive. On Kubernetes that is a PVC ensured in the servers namespace before the
pod is created and never deleted with it; on Docker, a named volume (named, not
anonymous, so `removeContainer`'s `v: true` leaves it alone).

Claims are ReadWriteOnce, so volumes and replicas > 1 are mutually exclusive;
validation rejects that pair instead of leaving the extra replicas
unschedulable. storageClassName is omitted rather than sent empty when no class
is configured — to Kubernetes those mean different things.

Also fixes a pre-existing bug in the same path: seedTemplates dropped `runtime`,
so every PyPI-backed template seeded from YAML silently defaulted to node and
would run `npx` against a package that only exists on PyPI. `unifi-network`
declares `runtime: python` and had been seeding with runtime unset.

Templates added, all self-hosted and none needing an API key:
  - duckduckgo — no backing service at all
  - searxng    — needs a SearXNG engine (compose profile in stack/)
  - docs-mcp   — open-source Context7/Ref alternative, uses the new volume

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BMXdb2qZbPSh8Q7XpTyjB
This commit is contained in:
Michal
2026-08-09 18:17:32 +01:00
parent 2513da33c3
commit b0233918ff
30 changed files with 822 additions and 8 deletions

25
templates/searxng.yaml Normal file
View File

@@ -0,0 +1,25 @@
name: searxng
version: "1.0.0"
description: SearXNG MCP server for private web search and URL-to-markdown reading
packageName: "mcp-searxng"
transport: STDIO
repositoryUrl: https://github.com/ihor-sokoliuk/mcp-searxng
healthCheck:
tool: searxng_web_search
arguments:
query: "mcp"
env:
- name: SEARXNG_URL
description: >-
SearXNG instance URL, or ';'-separated replicas
(e.g. http://mcpctl-searxng:8080). The instance must list `json` under
`search.formats` — see stack/searxng/settings.yml.
required: true
- name: SEARXNG_DEFAULT_RESPONSE_FORMAT
description: Result shape when a call omits response_format — "text" or "json"
required: false
defaultValue: "text"
- name: SEARXNG_HTML_FALLBACK
description: Scrape the HTML result page when the JSON API is unavailable
required: false
defaultValue: "false"