@syndash/research-vault-mcp 1.1.1 → 1.1.2

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/README.md CHANGED
@@ -1,74 +1,121 @@
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
+ Use SSE only when you explicitly want a long-running HTTP server:
21
+
22
+ ```bash
23
+ MCP_PORT=8765 npx @syndash/research-vault-mcp --transport=sse
24
+ # health: http://127.0.0.1:8765/health
25
+ # sse: http://127.0.0.1:8765/sse
26
+ ```
27
+
28
+ ## Configure an MCP client
29
+
30
+ Claude Desktop / Claude Code style config:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "research_vault": {
36
+ "command": "npx",
37
+ "args": ["-y", "@syndash/research-vault-mcp", "--transport=stdio"]
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ Bun variant:
21
44
 
22
45
  ```json
23
46
  {
24
47
  "mcpServers": {
25
- "research-vault": {
48
+ "research_vault": {
26
49
  "command": "bunx",
27
- "args": ["@syndash/research-vault-mcp"]
50
+ "args": ["--bun", "@syndash/research-vault-mcp", "--transport=stdio"]
28
51
  }
29
52
  }
30
53
  }
31
54
  ```
32
55
 
33
- For direct local dev from this monorepo:
56
+ Local monorepo development:
34
57
 
35
58
  ```json
36
59
  {
37
60
  "mcpServers": {
38
- "research-vault-dev": {
61
+ "research_vault_dev": {
39
62
  "command": "bun",
40
- "args": ["run", "packages/research-vault-mcp/src/server.ts"]
63
+ "args": ["run", "packages/research-vault-mcp/src/server.ts", "--transport=stdio"]
41
64
  }
42
65
  }
43
66
  }
44
67
  ```
45
68
 
46
- ## Tools Exposed (MCP contract)
69
+ ## Configure the vault root
70
+
71
+ Set the vault location with an environment variable before launching your MCP client:
72
+
73
+ ```bash
74
+ export VAULT_ROOT=/path/to/research-vault
75
+ ```
76
+
77
+ The package is designed for markdown-based knowledge bases. Keep private vault contents outside the public Evensong repo.
78
+
79
+ ## Tools exposed
47
80
 
48
- See `src/vault.ts` and `src/amplify.ts` for current tool definitions:
81
+ Current MCP contract:
49
82
 
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)
83
+ - `vault_search` — search analyzed knowledge-base entries
84
+ - `vault_status` — registry, retention, and decay health
85
+ - `vault_taxonomy` — category tree and item counts
86
+ - `vault_batch_analyze` — raw queue status and preview
87
+ - `vault_note_save`persist a markdown note into the vault
88
+ - `vault_get` — retrieve a saved vault item by id
89
+ - `vault_delete` — delete a saved vault item
90
+ - `vault_raw_ingest` — queue a raw URL/text ingest job
91
+ - `amplify_*` — optional remote RAG query layer when Amplify credentials are configured
92
+
93
+ ## Package mechanics
94
+
95
+ Published packages include:
96
+
97
+ - `bin/research-vault-mcp.mjs`
98
+ - `dist/server.js`
99
+ - `src/**/*.ts` for source inspection
100
+ - `README.md`
101
+ - `package.json`
102
+
103
+ 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
104
 
56
105
  ## Architecture
57
106
 
58
- Retrieval uses a **unified multi-signal ranker** (not 3 separate subsystems):
107
+ Research Vault MCP uses a multi-signal ranker for candidate retrieval:
59
108
 
109
+ ```text
110
+ score(d, q, t) = lexical(q,d)
111
+ + semantic(embed(q), embed(d))
112
+ + recency/stability(d,t)
113
+ + access frequency(d)
114
+ + summary-level weight(d)
60
115
  ```
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
-
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.
69
116
 
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).
117
+ The Evensong benchmark evidence for hybrid retrieval and Dense RAR lives in the parent repo under `benchmarks/`.
71
118
 
72
119
  ## License
73
120
 
74
- `UNLICENSED` for now (pending org-level license decision). See parent repo LICENSE.
121
+ Apache-2.0 for package code. Research artifacts in the parent repo may use separate licenses; check the repository root license files.
@@ -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()