fathom-mcp 0.2.2 → 0.3.0

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 CHANGED
@@ -5,8 +5,9 @@
5
5
  Multi-agent support.
6
6
 
7
7
  - **Multi-agent init wizard** — auto-detects installed agents and generates per-agent MCP configs
8
- - **Supported agents:** Claude Code, OpenAI Codex, Gemini CLI, Cursor, VS Code Copilot, Windsurf
9
- - **Per-agent config writers** — `.mcp.json`, `.codex/config.toml`, `.gemini/settings.json`, `.cursor/mcp.json`, `.vscode/mcp.json`, `~/.codeium/windsurf/mcp_config.json`
8
+ - **Supported agents:** Claude Code, OpenAI Codex, Gemini CLI, OpenCode
9
+ - **Per-agent config writers** — `.mcp.json`, `.codex/config.toml`, `.gemini/settings.json`, `opencode.json`
10
+ - **Agent instructions boilerplate** — `fathom-agents.md` template for memory discipline, vault conventions, cross-workspace communication
10
11
  - **Conditional hooks** — hook setup only for Claude Code (other agents don't support hooks)
11
12
  - **`agents` array** replaces legacy `architecture` string in `.fathom.json` — backward compatible
12
13
  - **Server-side agent dispatch** — persistent sessions launch the correct agent CLI per workspace
package/README.md CHANGED
@@ -18,9 +18,7 @@ MCP server for [Fathom](https://hifathom.com) — vault operations, search, room
18
18
  | **Claude Code** | `.mcp.json` | `.claude/` directory |
19
19
  | **OpenAI Codex** | `.codex/config.toml` | `.codex/` directory |
20
20
  | **Gemini CLI** | `.gemini/settings.json` | `.gemini/` directory |
21
- | **Cursor** | `.cursor/mcp.json` | `.cursor/` directory |
22
- | **VS Code Copilot** | `.vscode/mcp.json` | `.vscode/` directory |
23
- | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/` directory |
21
+ | **OpenCode** | `opencode.json` | `opencode.json` file |
24
22
 
25
23
  The init wizard auto-detects which agents you have and generates the right config for each.
26
24
 
@@ -0,0 +1,68 @@
1
+ # {{WORKSPACE_NAME}}
2
+
3
+ {{DESCRIPTION}}
4
+
5
+ ## Memory — Memento Protocol
6
+
7
+ Working memory is managed by Memento (workspace: `{{WORKSPACE_NAME}}`).
8
+
9
+ **On session start:**
10
+ 1. `memento_health` — verify connection
11
+ 2. `memento_item_list` — check active work items and their next actions
12
+ 3. `memento_recall` with current task context — find relevant past memories
13
+
14
+ **During work — actively manage your memories:**
15
+ - `memento_store` when you learn something, make a decision, or discover a pattern
16
+ - `memento_recall` before starting any subtask — someone may have already figured it out
17
+ - `memento_item_update` as you make progress — don't wait until the end
18
+ - `memento_item_create` when new work emerges
19
+ - `memento_skip_add` the moment you hit a dead end (with expiry)
20
+ - `memento_consolidate` when recall returns 3+ overlapping memories on the same topic
21
+ - Delete or archive items that are done or wrong — stale memory is worse than no memory
22
+
23
+ **Writing discipline — instructions, not logs:**
24
+ - Write: "API moved to /v2 — update all calls" not "checked API, got 404"
25
+ - Write: "Skip X until condition Y" not "checked X, it was quiet"
26
+ - Tag generously — tags power recall and consolidation
27
+ - Set expiration on time-sensitive facts
28
+ - The test: could a future you, with zero context, read this and know exactly what to do?
29
+
30
+ ## Vault
31
+
32
+ Local files live in `{{VAULT_DIR}}/`. Vault is for long-form content — things that need to breathe, not be queried. Decisions and next-actions go in Memento; reflections, research notes, and finished pieces go in the vault.
33
+
34
+ **Folder conventions:**
35
+ - `research/` — reading notes, paper annotations, deep dives
36
+ - `thinking/` — speculative connections, insights, one file per idea
37
+ - `daily/` — session heartbeats and progress logs
38
+
39
+ **Frontmatter required** on vault files:
40
+ ```yaml
41
+ ---
42
+ title: My Note # required (string)
43
+ date: 2026-02-26 # required (YYYY-MM-DD)
44
+ tags: [research, topic] # optional
45
+ status: draft # optional: draft | published | archived
46
+ ---
47
+ ```
48
+
49
+ ## Cross-Workspace Communication
50
+
51
+ This workspace is part of a multi-workspace system. Other workspaces exist — you can talk to them.
52
+
53
+ - **Peek at another workspace's memory:** `memento_recall query="..." workspace="other-ws"`
54
+ - **Peek at another workspace's vault:** `fathom_vault_read path="file.md" workspace="other-ws"`
55
+ - **Send a direct message:** `fathom_send workspace="other-ws" message="..."`
56
+ - **Post to a shared room:** `fathom_room_post room="general" message="..."`
57
+ - **Read room history:** `fathom_room_read room="general"`
58
+ - **Discover workspaces:** `fathom_workspaces`
59
+
60
+ Your sender identity is automatic — messages are tagged with `{{WORKSPACE_NAME}}`.
61
+
62
+ ## Workflow
63
+
64
+ 1. Research and reading notes → `vault/research/`
65
+ 2. Speculative connections and insights → `vault/thinking/`
66
+ 3. Key findings and decisions → `memento_store` with tags
67
+ 4. Session heartbeats → `vault/daily/`
68
+ 5. When done — update Memento items, write what you found and what questions remain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fathom-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "MCP server for Fathom — vault operations, search, rooms, and cross-workspace communication",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "src/",
12
12
  "scripts/",
13
+ "fathom-agents.md",
13
14
  "README.md",
14
15
  "CHANGELOG.md",
15
16
  "LICENSE"
@@ -39,9 +40,7 @@
39
40
  "claude",
40
41
  "codex",
41
42
  "gemini",
42
- "cursor",
43
- "copilot",
44
- "windsurf",
43
+ "opencode",
45
44
  "ai-agent",
46
45
  "memory"
47
46
  ]
package/src/cli.js CHANGED
@@ -10,7 +10,6 @@
10
10
  */
11
11
 
12
12
  import fs from "fs";
13
- import os from "os";
14
13
  import path from "path";
15
14
  import readline from "readline";
16
15
  import { fileURLToPath } from "url";
@@ -157,42 +156,20 @@ function writeGeminiJson(cwd) {
157
156
  return ".gemini/settings.json";
158
157
  }
159
158
 
160
- function writeCursorJson(cwd) {
161
- const dir = path.join(cwd, ".cursor");
162
- fs.mkdirSync(dir, { recursive: true });
163
- const filePath = path.join(dir, "mcp.json");
164
- const existing = readJsonFile(filePath) || {};
165
- deepMerge(existing, { mcpServers: { "fathom-vault": MCP_SERVER_ENTRY } });
166
- writeJsonFile(filePath, existing);
167
- return ".cursor/mcp.json";
168
- }
169
-
170
- function writeVscodeJson(cwd) {
171
- const dir = path.join(cwd, ".vscode");
172
- fs.mkdirSync(dir, { recursive: true });
173
- const filePath = path.join(dir, "mcp.json");
159
+ function writeOpencodeJson(cwd) {
160
+ const filePath = path.join(cwd, "opencode.json");
174
161
  const existing = readJsonFile(filePath) || {};
175
162
  deepMerge(existing, {
176
- servers: {
163
+ mcp: {
177
164
  "fathom-vault": {
178
- type: "stdio",
179
- command: "npx",
180
- args: ["-y", "fathom-mcp"],
165
+ type: "local",
166
+ command: ["npx", "-y", "fathom-mcp"],
167
+ enabled: true,
181
168
  },
182
169
  },
183
170
  });
184
171
  writeJsonFile(filePath, existing);
185
- return ".vscode/mcp.json";
186
- }
187
-
188
- function writeWindsurfJson(_cwd) {
189
- const dir = path.join(os.homedir(), ".codeium", "windsurf");
190
- fs.mkdirSync(dir, { recursive: true });
191
- const filePath = path.join(dir, "mcp_config.json");
192
- const existing = readJsonFile(filePath) || {};
193
- deepMerge(existing, { mcpServers: { "fathom-vault": MCP_SERVER_ENTRY } });
194
- writeJsonFile(filePath, existing);
195
- return "~/.codeium/windsurf/mcp_config.json";
172
+ return "opencode.json";
196
173
  }
197
174
 
198
175
  const AGENTS = {
@@ -217,31 +194,17 @@ const AGENTS = {
217
194
  hasHooks: false,
218
195
  nextSteps: "Run `gemini` in this directory — fathom tools load automatically.",
219
196
  },
220
- "cursor": {
221
- name: "Cursor",
222
- detect: (cwd) => fs.existsSync(path.join(cwd, ".cursor")),
223
- configWriter: writeCursorJson,
224
- hasHooks: false,
225
- nextSteps: "Restart Cursor — fathom tools appear in MCP settings.",
226
- },
227
- "vscode": {
228
- name: "VS Code Copilot",
229
- detect: (cwd) => fs.existsSync(path.join(cwd, ".vscode")),
230
- configWriter: writeVscodeJson,
197
+ "opencode": {
198
+ name: "OpenCode",
199
+ detect: (cwd) => fs.existsSync(path.join(cwd, "opencode.json")),
200
+ configWriter: writeOpencodeJson,
231
201
  hasHooks: false,
232
- nextSteps: "Reload VS Code — fathom tools appear in Copilot.",
233
- },
234
- "windsurf": {
235
- name: "Windsurf",
236
- detect: () => fs.existsSync(path.join(os.homedir(), ".codeium", "windsurf")),
237
- configWriter: writeWindsurfJson,
238
- hasHooks: false,
239
- nextSteps: "Restart Windsurf — fathom tools appear in Cascade.",
202
+ nextSteps: "Run `opencode` in this directory — fathom tools load automatically.",
240
203
  },
241
204
  };
242
205
 
243
206
  // Exported for testing
244
- export { AGENTS, writeMcpJson, writeCodexToml, writeGeminiJson, writeCursorJson, writeVscodeJson, writeWindsurfJson };
207
+ export { AGENTS, writeMcpJson, writeCodexToml, writeGeminiJson, writeOpencodeJson };
245
208
 
246
209
  // --- Init wizard -------------------------------------------------------------
247
210
 
@@ -371,6 +334,20 @@ async function runInit() {
371
334
  console.log(` · ${vault}/ (already exists)`);
372
335
  }
373
336
 
337
+ // fathom-agents.md — boilerplate agent instructions
338
+ const agentMdSrc = path.join(__dirname, "..", "fathom-agents.md");
339
+ const agentMdDest = path.join(cwd, ".fathom", "fathom-agents.md");
340
+ try {
341
+ let template = fs.readFileSync(agentMdSrc, "utf-8");
342
+ template = template
343
+ .replace(/\{\{WORKSPACE_NAME\}\}/g, workspace)
344
+ .replace(/\{\{VAULT_DIR\}\}/g, vault)
345
+ .replace(/\{\{DESCRIPTION\}\}/g, description || `${workspace} workspace`);
346
+ fs.mkdirSync(path.dirname(agentMdDest), { recursive: true });
347
+ fs.writeFileSync(agentMdDest, template);
348
+ console.log(" ✓ .fathom/fathom-agents.md");
349
+ } catch { /* template not found — skip silently */ }
350
+
374
351
  // Per-agent config files
375
352
  for (const agentKey of selectedAgents) {
376
353
  const agent = AGENTS[agentKey];
@@ -450,7 +427,15 @@ async function runInit() {
450
427
  const agent = AGENTS[agentKey];
451
428
  console.log(` · ${agent.name}: ${agent.nextSteps}`);
452
429
  }
453
- console.log();
430
+ console.log(`
431
+ Agent instructions:
432
+ Some instructions are needed for your agent to use Fathom + Memento
433
+ effectively (memory discipline, vault conventions, cross-workspace
434
+ communication). Saved to: .fathom/fathom-agents.md
435
+
436
+ Paste it into your CLAUDE.md, AGENTS.md, or equivalent — or point
437
+ your agent at the file and ask it to integrate the instructions.
438
+ `);
454
439
  }
455
440
 
456
441
  // --- Status command ----------------------------------------------------------