@syndash/research-vault-mcp 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 1.1.3 — 2026-05-10
6
+
7
+ ### Added
8
+
9
+ - HTTP transport now supports Streamable HTTP at `POST /mcp`, while keeping the legacy `/sse` + `/messages` endpoints.
10
+ - Added a Streamable HTTP regression test that initializes a session and lists MCP tools through `/mcp`.
11
+ - Documented the default read-only MCP profile, including the public-safe read/evidence tool surface and the `full`/`admin` opt-in for mutation-capable tools.
12
+ - Added public guidance for the provenance/freshness response envelope, including `agent_guidance` and evidence metadata on search, status, and batch responses.
13
+
14
+ ### Changed
15
+
16
+ - `vault_get` is documented as bounded by default, with operator-approved `include_content:true` and `max_chars` caps for larger reads.
17
+ - Mutation blocking guidance now tells operators to restart in `MCP_PROFILE=full` or `MCP_PROFILE=admin` before using write/configure tools.
18
+ - Public-surface safety redaction is documented for local paths, credential markers, and private network values.
19
+
20
+ ## 1.1.2 — 2026-04-26
21
+
22
+ ### Changed
23
+
24
+ - Default MCP transport is now `stdio`, matching command-launched MCP clients.
25
+ - The npm bin is a Node-compatible launcher that delegates server execution to Bun.
26
+ - Published package includes `dist/server.js` via `prepack` build and `files` allowlist.
27
+ - README now documents Evensong hub vs Research Vault module, install commands, Claude config, Bun runtime requirement, and explicit SSE mode.
28
+ - Package metadata now uses Evensong module wording and Apache-2.0 package license.
29
+
30
+ ### Verified
31
+
32
+ - `bun --filter @syndash/research-vault-mcp test`
33
+ - `bun --filter @syndash/research-vault-mcp build`
34
+ - `npm pack --dry-run --json`
35
+ - stdio smoke returning 13 MCP tools
package/README.md CHANGED
@@ -1,74 +1,148 @@
1
1
  # @syndash/research-vault-mcp
2
2
 
3
- MCP (Model Context Protocol) server for Nolan's research vault (private) semantic search + memory persistence over 200+ markdown documents via local Gemma (Atomic Chat) or cloud LLM fallback.
3
+ Research Vault is the memory/search module inside **Evensong**. This package exposes it as an MCP server for agents that speak the Model Context Protocol.
4
4
 
5
- **Part of**: DASH SHATTER / SynDASH ecosystem.
6
- **Home**: [github.com/Fearvox/Evensong](https://github.com/Fearvox/Evensong) — `packages/research-vault-mcp/`
5
+ It is not the whole Evensong product. Evensong is the hub: runtime, benchmark evidence, handoff pages, and modules. Research Vault MCP is the installable knowledge-base module.
7
6
 
8
- ## Install & Run
7
+ ## Install
9
8
 
10
9
  ```bash
11
- # Via bun (recommended native TS execution)
12
- bunx @syndash/research-vault-mcp
10
+ # MCP clients usually launch the package for you.
11
+ # The npm shim still delegates runtime execution to Bun.
12
+ npx @syndash/research-vault-mcp --transport=stdio
13
13
 
14
- # Via Node
15
- npx @syndash/research-vault-mcp
14
+ # Bun direct launch:
15
+ bunx @syndash/research-vault-mcp --transport=stdio
16
16
  ```
17
17
 
18
- ## Configure Claude Code / Claude Desktop
18
+ Default transport is `stdio`, because command-launched MCP servers are expected to speak JSON-RPC over stdin/stdout. Install [Bun](https://bun.sh) before using either `npx` or `bunx`; the server itself is Bun-native.
19
19
 
20
- Add to `~/.claude/settings.json` or Claude Desktop config:
20
+ **Runtime note:** `@syndash/research-vault-mcp` is Bun-native. `npx` is supported as an install/launch shim, but the target machine must have `bun` available on `PATH`. If you need a pure Node runtime, treat that as a separate compatibility track rather than assuming this package already provides it.
21
+
22
+ Use HTTP only when you explicitly want a long-running remote MCP server. The HTTP server exposes both the current Streamable HTTP endpoint and the legacy SSE endpoint:
23
+
24
+ ```bash
25
+ MCP_PORT=8765 npx @syndash/research-vault-mcp --transport=http
26
+ # streamable: http://127.0.0.1:8765/mcp
27
+ # legacy sse: http://127.0.0.1:8765/sse
28
+ # health: http://127.0.0.1:8765/health
29
+ ```
30
+
31
+ ## Configure an MCP client
32
+
33
+ Claude Desktop / Claude Code style config:
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "research_vault": {
39
+ "command": "npx",
40
+ "args": ["-y", "@syndash/research-vault-mcp", "--transport=stdio"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ Bun variant:
21
47
 
22
48
  ```json
23
49
  {
24
50
  "mcpServers": {
25
- "research-vault": {
51
+ "research_vault": {
26
52
  "command": "bunx",
27
- "args": ["@syndash/research-vault-mcp"]
53
+ "args": ["--bun", "@syndash/research-vault-mcp", "--transport=stdio"]
28
54
  }
29
55
  }
30
56
  }
31
57
  ```
32
58
 
33
- For direct local dev from this monorepo:
59
+ Local monorepo development:
34
60
 
35
61
  ```json
36
62
  {
37
63
  "mcpServers": {
38
- "research-vault-dev": {
64
+ "research_vault_dev": {
39
65
  "command": "bun",
40
- "args": ["run", "packages/research-vault-mcp/src/server.ts"]
66
+ "args": ["run", "packages/research-vault-mcp/src/server.ts", "--transport=stdio"]
41
67
  }
42
68
  }
43
69
  }
44
70
  ```
45
71
 
46
- ## Tools Exposed (MCP contract)
72
+ ## Configure the vault root
73
+
74
+ Set the vault location with an environment variable before launching your MCP client:
47
75
 
48
- See `src/vault.ts` and `src/amplify.ts` for current tool definitions:
76
+ ```bash
77
+ export VAULT_ROOT=/path/to/research-vault
78
+ ```
49
79
 
50
- - `vault_search` hybrid search over analyzed knowledge base
51
- - `vault_status` — decay scores + retention health
52
- - `vault_taxonomy` — category tree + item counts
53
- - `vault_batch_analyze` — raw queue status + preview
54
- - `amplify_*` remote RAG relay layer powered by SynDASH (Amplify-compatible API endpoint, self-hosted relay; no external vendor required)
80
+ The package is designed for markdown-based knowledge bases. Keep private vault contents outside the public Evensong repo.
81
+
82
+ ## MCP Profiles
83
+
84
+ `MCP_PROFILE=readonly` is the default public-safe autonomous-agent profile. It exposes only read/evidence tools:
85
+
86
+ - `vault_status`
87
+ - `vault_taxonomy`
88
+ - `vault_search`
89
+ - `vault_get`
90
+ - `vault_batch_analyze`
91
+
92
+ Mutation tools are hidden and blocked in `readonly`. `MCP_PROFILE=full` enables non-destructive mutators such as `vault_raw_ingest` and `vault_note_save`. `MCP_PROFILE=admin` is required for destructive or admin tools such as `vault_delete`.
93
+
94
+ `vault_get` is bounded by default: it returns an excerpt unless the operator approves `include_content:true`, and even full-content requests are capped by `max_chars`. Search, status, and batch responses include `agent_guidance` plus evidence metadata for provenance, freshness, profile, and public-safety state.
95
+
96
+ ## Tools exposed
97
+
98
+ Current MCP contract:
99
+
100
+ - `vault_search` — search analyzed knowledge-base entries
101
+ - `vault_status` — registry, retention, and decay health
102
+ - `vault_taxonomy` — category tree and item counts
103
+ - `vault_batch_analyze` — raw queue status and preview
104
+ - `vault_get` — retrieve a saved vault item by id
105
+ - `vault_raw_ingest` — queue a raw URL/text ingest job (`full` or `admin` profile only)
106
+ - `vault_note_save` — persist a markdown note into the vault (`full` or `admin` profile only)
107
+ - `vault_delete` — delete a saved vault item (`admin` profile only; destructive)
108
+ - `amplify_*` — optional remote RAG query layer when Amplify credentials are configured
109
+
110
+ Public MCP responses are redacted before they leave the server if they contain local paths, credential markers, or private network values. Use a private operator session for diagnostics that need raw source details.
111
+
112
+ ## Package mechanics
113
+
114
+ Published packages include:
115
+
116
+ - `bin/research-vault-mcp.mjs`
117
+ - `dist/server.js`
118
+ - `src/**/*.ts` for source inspection
119
+ - `README.md`
120
+ - `package.json`
121
+
122
+ The bin prefers `dist/server.js`. In a monorepo checkout without `dist`, it falls back to `bun run src/server.ts` so development remains fast without a separate compile step.
55
123
 
56
124
  ## Architecture
57
125
 
58
- Retrieval uses a **unified multi-signal ranker** (not 3 separate subsystems):
126
+ Research Vault MCP uses a multi-signal ranker for candidate retrieval:
59
127
 
128
+ ```text
129
+ score(d, q, t) = lexical(q,d)
130
+ + semantic(embed(q), embed(d))
131
+ + recency/stability(d,t)
132
+ + access frequency(d)
133
+ + summary-level weight(d)
60
134
  ```
61
- score(d, q, t) = 0.35·BM25(q,d) + 0.35·cosine(embed(q), embed(d))
62
- + 0.15·exp(-(t - lastAccess)/stability)
63
- + 0.10·log1p(accessCount)/log1p(MAX_ACCESS)
64
- + 0.05·summary_level_weight(d)
65
- ```
66
135
 
67
- **Primary LLM**: Atomic Chat local Gemma-4-E4B-Uncensored-Q4_K_M (`http://127.0.0.1:1337/v1`).
68
- **Fallback chain**: xai-fast → minimax-m27 → openrouter/qwen3.6-plus → openrouter/llama-3.1-8b-free.
136
+ The Evensong benchmark evidence for hybrid retrieval and Dense RAR lives in the parent repo under `benchmarks/`.
137
+
138
+ ## Node compatibility status
69
139
 
70
- **Prior art**: EverMemOS (arxiv 2601.02163, EverMind/Shanda, 2026-01) LLM-orchestrated hybrid retrieval. This package adopts their Stage-1 hybrid candidate generation but replaces Stage-2 verifier-loop with direct listwise LLM judge (simpler + more deterministic).
140
+ The package is intentionally Bun-native today because the server uses Bun APIs and the parent Evensong repo is Bun-only. The npm bin is Node-compatible only as a launcher: it locates `dist/server.js` or `src/server.ts`, then delegates execution to `bun`. This keeps package installation convenient while avoiding a misleading claim that the MCP server itself runs under plain Node.js.
71
141
 
72
142
  ## License
73
143
 
74
- `UNLICENSED` for now (pending org-level license decision). See parent repo LICENSE.
144
+ Apache-2.0 for package code. Research artifacts in the parent repo may use separate licenses; check the repository root license files.
145
+
146
+ ## Releases
147
+
148
+ See [CHANGELOG.md](./CHANGELOG.md). Current npm release: `1.1.2`.
@@ -1,49 +1,65 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * CLI entry point for @syndash/research-vault-mcp.
4
- * Invoked via `npx @syndash/research-vault-mcp` or `bunx @syndash/research-vault-mcp`.
5
- * Delegates to src/server.ts (compiled or via bun direct).
6
4
  *
7
- * Part of DASH SHATTER (Fearvox/Evensong repo, SynDASH org).
8
- * See packages/research-vault-mcp/README.md for MCP client config.
5
+ * The server is Bun-native. The npm bin is a small Node-compatible shim so
6
+ * `npx` can install the package, then delegate execution to `bun`.
9
7
  */
10
8
 
11
9
  import { fileURLToPath } from 'url'
12
10
  import { dirname, join } from 'path'
13
11
  import { existsSync } from 'fs'
12
+ import { spawn } from 'child_process'
14
13
 
15
14
  const __filename = fileURLToPath(import.meta.url)
16
15
  const __dirname = dirname(__filename)
17
16
  const pkgRoot = join(__dirname, '..')
18
17
 
19
- // Prefer compiled JS if available (post-build); fall back to bun direct execution of TS source.
20
18
  const compiledServer = join(pkgRoot, 'dist', 'server.js')
21
19
  const sourceServer = join(pkgRoot, 'src', 'server.ts')
22
20
 
23
- async function main() {
24
- const args = process.argv.slice(2)
25
- let transport = 'sse'
26
-
21
+ function parseTransport(args) {
27
22
  for (let i = 0; i < args.length; i++) {
28
- if (args[i] === '--transport' && args[i + 1]) {
29
- transport = args[i + 1]
30
- } else if (args[i].startsWith('--transport=')) {
31
- transport = args[i].split('=')[1]
32
- }
23
+ if (args[i] === '--transport' && args[i + 1]) return args[i + 1]
24
+ if (args[i]?.startsWith('--transport=')) return args[i].split('=')[1]
33
25
  }
34
- process.env.MCP_TRANSPORT = transport
26
+ return 'stdio'
27
+ }
28
+
29
+ function runWithBun(entrypoint, args) {
30
+ const child = spawn('bun', [entrypoint, ...args], {
31
+ cwd: pkgRoot,
32
+ stdio: 'inherit',
33
+ env: {
34
+ ...process.env,
35
+ MCP_TRANSPORT: parseTransport(args),
36
+ },
37
+ })
38
+
39
+ child.on('exit', (code, signal) => {
40
+ if (signal) process.kill(process.pid, signal)
41
+ process.exit(code ?? 1)
42
+ })
43
+
44
+ child.on('error', err => {
45
+ console.error('research-vault-mcp: failed to spawn bun')
46
+ console.error('Install Bun first: https://bun.sh')
47
+ console.error(err.message)
48
+ process.exit(1)
49
+ })
50
+ }
51
+
52
+ function main() {
53
+ const args = process.argv.slice(2)
35
54
 
36
55
  if (existsSync(compiledServer)) {
37
- await import(compiledServer)
56
+ runWithBun(compiledServer, args)
38
57
  } else if (existsSync(sourceServer)) {
39
- await import(sourceServer)
58
+ runWithBun(sourceServer, args)
40
59
  } else {
41
60
  console.error('research-vault-mcp: neither dist/server.js nor src/server.ts found')
42
61
  process.exit(1)
43
62
  }
44
63
  }
45
64
 
46
- main().catch(err => {
47
- console.error('research-vault-mcp fatal:', err)
48
- process.exit(1)
49
- })
65
+ main()