wiki-vault/Wiki/Reference/vault-mcp.md
Travis Herbranson 75ba9f005a compile: promote 5 entities (trellis, vault-mcp, petalbrain, knot-dns, herbyeos)
User-approved promotions from the prior compile's proposal list.
pbs-hub-mcp deferred per user. Wiki domain indexes updated to list the new
entities; Sources left untouched (MCP-written/immutable).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 21:27:52 -04:00

54 lines
3.4 KiB
Markdown

---
type: entity
path: Wiki/Reference
tags:
- mcp
- pgvector
- embeddings
- wiki
- git
created: 2026-05-24
updated: 2026-05-24
---
# vault-mcp
## What it is
vault-mcp is the MCP server that writes Travis's project plans and session notes into the wiki vault. It is the canonical write path for the `Sources/` layer: a `create_artifact` call **dual-writes** a Postgres row in `petalbrain.wiki` *and* a markdown file in the vault repo, then commits and pushes to Gitea, then chunks and embeds the content into the shared `public.embeddings` table. It is the machine half of the [[Wiki/Dev/ai-memory-architecture|memory architecture]] — agents and the email pipeline write through it; the compile skill reads what it produced. Formerly named `homelab-mcp-server` / `herbydev-mcp`.
## Current state
Operational end-to-end after a long May-2026 debugging chain (package rename → import paths → tool exposure → wrapper dispatch → env config → schema search_path → git credential helper → token). Key facts:
- **Tools** — `create_artifact` + `update_artifact` are canonical; `update_artifact` mutates metadata only (artifacts are immutable once created); `save_note` is a hidden deprecation shim
- **Schema** — owns `petalbrain.wiki` as the `vault_mcp` role (`search_path = wiki, public`)
- **Embeddings** — chunks at 512 tokens / 64 overlap, writes to `public.embeddings` (source_schema=`wiki`)
- **NOTIFY → Trello** — project-status changes fire a Postgres NOTIFY that n8n turns into Trello card moves; hand-editing frontmatter does *not* fire it (use the tool)
- **Git push** — HTTPS with a `lovebug` PAT via an env-driven credential helper (the secret never lands in `.git/config`)
- The `vault:search` semantic tool ([[Sources/Homelab/vault-semantic-search|vault-semantic-search]]) is designed but not yet built
## Where it lives
- `vault-mcp` container on the homelab; hostname under `*.herbylab.dev` behind Authentik + Cloudflare Tunnel
- Data: `petalbrain.wiki` schema on `homelab-postgres` (pgvector:pg17)
- Local repo: `/opt/projects/homelab/vault-mcp/` (renamed from `herby-dev`)
- Writes markdown into this vault (`/opt/projects/wiki-vault/Sources/`)
## Related projects
- [[Sources/Homelab/homelab-mcp-server|homelab-mcp-server]] — original stand-up (FastMCP + Authentik + Tunnel)
- [[Sources/Homelab/herbylab-project-management|herbylab-project-management]] — artifact/project model + NOTIFY→Trello
- [[Sources/Homelab/postgres-consolidation-ob1-reflection-layer|postgres-consolidation-ob1-reflection-layer]] — wiki schema + embeddings consolidation
- [[Sources/Homelab/postgres-consolidation-followups|postgres-consolidation-followups]] — write-surface cleanup items
- [[Sources/Homelab/vault-semantic-search|vault-semantic-search]] — planned `vault:search` read tool
- [[Wiki/Reference/trellis|trellis]] — sibling MCP, same deployment pattern
- [[Wiki/Reference/gitea|gitea]] — push target
- [[Wiki/Dev/ai-memory-architecture|ai-memory-architecture]] — synthesis
## History
- **2026-05-06** — Stood up as `homelab-mcp-server` at `mcp.herbylab.dev`
- **2026-05** — Renamed to `vault-mcp`; artifact tooling (`create_artifact`/`update_artifact`) added
- **2026-05-15** — Owns `petalbrain.wiki`; chunked embeddings into `public.embeddings`
- **2026-05-16/17** — Write surface declared operational end-to-end (dual-write + git push + embeddings) after the full-stack debugging chain