From 08db384f6058189aefba2f18696a596a95a29e0c Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Mon, 22 Dec 2025 13:03:27 +0000 Subject: [PATCH] Set up MCP for alo wiki. --- services/tiddlywiki-mcp.hcl | 68 ++++++++++++++++++++++++++++++++++--- services/wiki.hcl | 4 +-- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/services/tiddlywiki-mcp.hcl b/services/tiddlywiki-mcp.hcl index d885ae2..f0d463d 100644 --- a/services/tiddlywiki-mcp.hcl +++ b/services/tiddlywiki-mcp.hcl @@ -1,11 +1,14 @@ job "tiddlywiki-mcp" { datacenters = ["alo"] - group "captainslog" { + group "servers" { network { - port "http" { + port "captainslog" { static = 3500 } + port "alowiki" { + static = 3501 + } } volume "services" { @@ -26,7 +29,7 @@ job "tiddlywiki-mcp" { read_only = true } - task "mcp-server" { + task "captainslog" { driver = "exec" config { @@ -36,10 +39,11 @@ job "tiddlywiki-mcp" { env { MCP_TRANSPORT = "http" - MCP_PORT = "${NOMAD_PORT_http}" + MCP_PORT = "${NOMAD_PORT_captainslog}" CONSUL_SERVICE = "captainslog.service.consul" AUTH_HEADER = "X-Oidc-Username" AUTH_USER = "claude-code" + EMBEDDINGS_DB_PATH = "/data/services/tiddlywiki-mcp/embeddings-captainslog.db" } volume_mount { @@ -62,7 +66,61 @@ job "tiddlywiki-mcp" { service { name = "tiddlywiki-mcp-captainslog" - port = "http" + port = "captainslog" + + check { + type = "http" + path = "/health" + interval = "10s" + timeout = "2s" + } + } + + resources { + memory = 256 + } + + user = "ppetru" + } + + task "alowiki" { + driver = "exec" + + config { + command = "/sw/bin/node" + args = ["/data/services/tiddlywiki-mcp/dist/index.js"] + } + + env { + MCP_TRANSPORT = "http" + MCP_PORT = "${NOMAD_PORT_alowiki}" + CONSUL_SERVICE = "alowiki.service.consul" + AUTH_HEADER = "X-Oidc-Username" + AUTH_USER = "claude-code" + EMBEDDINGS_DB_PATH = "/data/services/tiddlywiki-mcp/embeddings-alowiki.db" + } + + volume_mount { + volume = "services" + destination = "/data/services" + read_only = false + } + + volume_mount { + volume = "nix-store" + destination = "/nix/store" + read_only = true + } + + volume_mount { + volume = "sw" + destination = "/sw" + read_only = true + } + + service { + name = "tiddlywiki-mcp-alowiki" + port = "alowiki" check { type = "http" diff --git a/services/wiki.hcl b/services/wiki.hcl index 5985c94..3adf76e 100644 --- a/services/wiki.hcl +++ b/services/wiki.hcl @@ -86,8 +86,8 @@ job "wiki" { "host=0.0.0.0", "port=${NOMAD_PORT_alo}", "authenticated-user-header=X-Oidc-Username", - "readers=ppetru,ines", - "writers=ppetru,ines", + "readers=ppetru,ines,claude-code", + "writers=ppetru,ines,claude-code", "admin=ppetru", ] }