Self-hosted MCP server + dashboard giving Claude Code, Cursor & Hermes agents shared long-term memory over a git-backed markdown vault. Agent-native, Obsidian-compatible second brain — markdown RAG, no vector DB.
TypeScript agent-memoryai-agentsanthropicclaude-codecursorgitknowledge-baseknowledge-graphllmmarkdownmcpmcp-servermodel-context-protocolnote-takingobsidianpkmragsecond-brainself-hostedzettelkasten
fix(docker): stdio image died on the exact command the registry publishes (#5)
Ronalds Palacis9f6187446dfc
diff --git a/Dockerfile.mcp b/Dockerfile.mcpindex 3b4bf4c..f70d2bd 100644--- a/Dockerfile.mcp+++ b/Dockerfile.mcp@@ -31,4 +31,14 @@ ENV NODE_ENV=production \GIT_SYNC_ENABLED=false# stdio MCP server: JSON-RPC on stdin/stdout. Nothing here may write to stdout.-CMD ["bun", "scripts/mcp-stdio.ts"]+#+# ENTRYPOINT, not CMD. server.json tells clients to pass the vault as a positional argument+# (`docker run ... <image> /vault`), and with a bare CMD that argument *replaces* the command+# instead of appending to it — the base image's entrypoint then tries to exec /vault, a+# directory, and the container dies with "Permission denied" before serving a single request.+# As ENTRYPOINT the argument lands where the script expects it. Overriding the base entrypoint+# is deliberate: this image runs exactly one program.+#+# Verified: `docker run -i --rm --mount type=bind,src=<vault>,dst=/vault <image> /vault`+# answers initialize/tools/list, and a bare `docker run <image>` still serves sample-vault.+ENTRYPOINT ["bun", "scripts/mcp-stdio.ts"]diff --git a/app/api/mcp/route.ts b/app/api/mcp/route.tsindex 36ea7c5..ef0021e 100644--- a/app/api/mcp/route.ts+++ b/app/api/mcp/route.ts@@ -3,6 +3,7 @@ import { harnessEnabled } from "@/lib/settings";import { hasAnyToken, resolveToken, type TokenScope } from "@/lib/tokens";import { oauthEnabled, verifyAccessToken, wwwAuthenticate } from "@/lib/oauth";import { withActor } from "@/lib/actor";+import { VERSION } from "@/lib/version";import { TOOL_MAP, visibleTools } from "@/lib/mcp/tools";export const dynamic = "force-dynamic";@@ -37,7 +38,7 @@ async function handleMessage(msg: Json, caller: Caller): Promise<Json | null> {return rpc(id, {protocolVersion: params?.protocolVersion || PROTOCOL,capabilities: { tools: { listChanged: false } },- serverInfo: { name: "engram", version: "0.1.0" },+ serverInfo: { name: "engram", version: VERSION },});case "ping":return rpc(id, {});diff --git a/lib/version.ts b/lib/version.tsnew file mode 100644index 0000000..871cd16--- /dev/null+++ b/lib/version.ts@@ -0,0 +1,12 @@+import pkg from "@/package.json";++/**+ * The one place the version is read from.+ *+ * It was hardcoded in both MCP server entry points and in package.json and server.json — four+ * copies, three of them invisible to the release workflow's version gate. `serverInfo.version`+ * is what every connected client reports, so a stale literal there means an agent tells you it's+ * talking to 0.1.0 forever. Now only package.json and server.json are hand-maintained, and the+ * release gate compares those two against the tag.+ */+export const VERSION: string = pkg.version;diff --git a/package.json b/package.jsonindex bb4fca8..5d79a5e 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "engram",- "version": "0.1.0",+ "version": "0.1.1","private": true,"author": "rwnalds","homepage": "https://github.com/rwnalds/engram#readme",diff --git a/scripts/mcp-stdio.ts b/scripts/mcp-stdio.tsindex a43ef44..018938b 100644--- a/scripts/mcp-stdio.ts+++ b/scripts/mcp-stdio.ts@@ -21,11 +21,12 @@ async function main() {process.env.GIT_SYNC_ENABLED = "false";const { TOOLS, TOOL_MAP } = await import("@/lib/mcp/tools");+ const { VERSION } = await import("@/lib/version");const { Server } = await import("@modelcontextprotocol/sdk/server/index.js");const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");const { ListToolsRequestSchema, CallToolRequestSchema } = await import("@modelcontextprotocol/sdk/types.js");- const server = new Server({ name: "engram", version: "0.1.0" }, { capabilities: { tools: {} } });+ const server = new Server({ name: "engram", version: VERSION }, { capabilities: { tools: {} } });server.setRequestHandler(ListToolsRequestSchema, async () => ({tools: TOOLS.map((t) => ({ name: t.name, description: t.description, inputSchema: t.inputSchema })),diff --git a/server.json b/server.jsonindex 0f76345..4613086 100644--- a/server.json+++ b/server.json@@ -3,7 +3,7 @@"name": "io.github.rwnalds/engram","title": "Engram","description": "Git-backed markdown memory for AI agents; search hides superseded and archived notes.",- "version": "0.1.0",+ "version": "0.1.1","repository": {"url": "https://github.com/rwnalds/engram","source": "github"@@ -12,7 +12,7 @@"packages": [{"registryType": "oci",- "identifier": "ghcr.io/rwnalds/engram:0.1.0",+ "identifier": "ghcr.io/rwnalds/engram:0.1.1","transport": {"type": "stdio"},