@ai-coach/vault-view-server
The local HTTP backend for the vault web UI. It composes vault-application with its Node adapters and runs vault-adapter-view on 127.0.0.1 so the Angular vault-view frontend can read and edit your Obsidian vault locally.
What it does not do
- No MCP transport or AI agent tools. Stdio MCP lives in
vault-mcp-server(DEC-AIC-0061). - No frontend UI code or HTTP route logic. Route handlers, CSP headers, and token checks live in
vault-adapter-view; browser UI components live invault-view. - No coaching or LLM dependencies. Nothing in
scope:coachmay be imported here, and nothing in the workspace may import this app.
Architecture fit
- Scope:
scope:vault - Style:
architecture:hexagonal(type:app,app:vault-view-server) - Depends on:
@ai-coach/vault-application,@ai-coach/vault-adapter-fs,@ai-coach/vault-adapter-markdown,@ai-coach/vault-adapter-pdf,@ai-coach/vault-adapter-search,@ai-coach/vault-adapter-view - Used by:
coach viewinapps/cliand direct terminal runs
[Browser (vault-view)] ──HTTP 127.0.0.1──▶ [@ai-coach/vault-view-server] ──▶ [vault-adapter-view]
│
└──▶ [vault-application] + [vault-adapter-*]
Internal architecture & rules
- Composition root (
src/compose.ts): WirescreateVaultto the filesystem, markdown, PDF, and search adapters. - CLI entrypoint (
src/main.ts): Parses--vault,--vault-config, and--portviaparseViewFlagsandresolveVaultForProcessfromvault-adapter-fs, then startscreateVaultViewServeron loopback only. - No comments in source code: Keep TypeScript source files comment-free (DEC-AIC-0011).
Public surface
coach-vault-view— starts the loopback HTTP server on127.0.0.1(default port4747) serving the graph, plans, and climb pages plus their JSON/write APIs. See Vault view for full usage.
How to extend it
- Add new vault read/write operations in
vault-application. - Expose new HTTP endpoints or security checks in
vault-adapter-view. - Update the Angular UI in
vault-view. - Add loopback HTTP integration tests in
src/view.test.tsand runnpm exec nx run @ai-coach/vault-view-server:lint,typecheck,test, andbuild.
Running & testing
The build outputs dist/main.js (the coach-vault-view binary). Pass --vault (with a path or using DOCS_MCP_VAULT / ~/.config/docs-mcp/config.json) and optional --port:
node apps/vault-view-server/dist/main.js --vault ~/Documents/my-vault
node apps/vault-view-server/dist/main.js --vault ~/Documents/my-vault --port=4747
See Vault view and Configuration for CLI integration (coach view and vaultViewBin).
npm exec nx lint @ai-coach/vault-view-server
npm exec nx typecheck @ai-coach/vault-view-server
npm exec nx test @ai-coach/vault-view-server
npm exec nx build @ai-coach/vault-view-server
Tests
src/view.test.ts runs Vitest against isolated temporary vaults over real loopback HTTP (127.0.0.1), checking CSP/token/origin guards, note and page endpoints, distillation writes, and graph regeneration without touching your vault.
Key ADRs
- DEC-AIC-0061 — splits this HTTP view server out of the pure MCP server.
- DEC-AIC-0059 — defines the Angular
vault-viewfrontend served by this host. - DEC-AIC-0052 — defines the hexagonal vault libraries composed here.
- DEC-AIC-0060 — governs this README's eight-section structure.