@mandays/obsidian-memory-mcp 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ # obsidian-memory-mcp
2
+
3
+ MCP (Model Context Protocol) server for **Obsidian v3 Atomic Markdown Memory** vaults.
4
+
5
+ Provides standardized tools for any AI assistant (Claude Code, Claude Desktop, ChatGPT, Codex, Qoder, Open Code, Hermes Agent, Antigravity, Open Claw) to read, write, search, and manage Obsidian vault memory using the [v3 Atomic Markdown Memory](https://github.com/jrcruciani/obsidian-memory-for-ai) specification.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g obsidian-memory-mcp
11
+ # or run directly
12
+ npx obsidian-memory-mcp --vault ~/path/to/vault
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ### stdio mode (Claude Code, Qoder, Open Code)
18
+
19
+ ```bash
20
+ npx obsidian-memory-mcp --vault ~/obsidian-vault
21
+ ```
22
+
23
+ ### SSE/HTTP mode (Desktop apps)
24
+
25
+ ```bash
26
+ npx obsidian-memory-mcp --vault ~/obsidian-vault --transport sse --port 3100
27
+ ```
28
+
29
+ ### Initialize a new vault
30
+
31
+ ```bash
32
+ npx obsidian-memory-mcp --vault ~/new-vault
33
+ # Then call the vault_init tool
34
+ ```
35
+
36
+ ## MCP Client Configuration
37
+
38
+ ### Claude Code / Qoder
39
+
40
+ Add to your MCP settings:
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "obsidian-memory": {
46
+ "command": "npx",
47
+ "args": ["obsidian-memory-mcp", "--vault", "/path/to/vault"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Claude Desktop
54
+
55
+ Add to `claude_desktop_config.json`:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "obsidian-memory": {
61
+ "command": "npx",
62
+ "args": ["obsidian-memory-mcp", "--vault", "/path/to/vault"]
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### Multi-agent (inbox mode)
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "obsidian-memory": {
74
+ "command": "npx",
75
+ "args": [
76
+ "obsidian-memory-mcp",
77
+ "--vault", "/path/to/vault",
78
+ "--mode", "inbox",
79
+ "--agent-id", "agent-claude-1a2b3c4d"
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Available Tools (20)
87
+
88
+ ### Read/Query
89
+
90
+ | Tool | Description |
91
+ |------|-------------|
92
+ | `read_fact` | Read a fact by entity+predicate or ID |
93
+ | `read_entity` | Get all facts for an entity |
94
+ | `read_event` | Find events by date range, entity, or kind |
95
+ | `search_memory` | Flexible search with text, entity, predicate, date, confidence, tags |
96
+ | `get_view` | Read materialized views (timeline, contradictions, stale, graph, etc.) |
97
+
98
+ ### Write
99
+
100
+ | Tool | Description |
101
+ |------|-------------|
102
+ | `create_fact` | Create a new atomic fact |
103
+ | `update_fact` | Update an existing fact (with precondition hash) |
104
+ | `add_event` | Record an append-only event |
105
+ | `archive_fact` | Archive a fact to `_archive/` |
106
+
107
+ ### Maintenance
108
+
109
+ | Tool | Description |
110
+ |------|-------------|
111
+ | `lint_vault` | Full schema validation |
112
+ | `rebuild_views` | Regenerate all `_views/` files |
113
+ | `compact_inbox` | Apply proposed operations from inbox |
114
+ | `reflect` | Create a reflection/observation event |
115
+
116
+ ### Schema Management
117
+
118
+ | Tool | Description |
119
+ |------|-------------|
120
+ | `list_entities` | List registered entities |
121
+ | `list_predicates` | List allowed predicates |
122
+ | `add_entity` | Register a new entity |
123
+ | `add_predicate` | Register a new predicate |
124
+ | `get_schema` | Get YAML schema for a type |
125
+
126
+ ### Vault
127
+
128
+ | Tool | Description |
129
+ |------|-------------|
130
+ | `vault_init` | Scaffold a new v3 vault |
131
+ | `vault_status` | Health overview with counts |
132
+
133
+ ## CLI Options
134
+
135
+ ```
136
+ --vault <path> Path to vault root (required, or set VAULT_PATH env)
137
+ --transport <type> stdio (default) or sse
138
+ --agent-id <id> Agent identity for this instance
139
+ --mode <mode> direct (default) or inbox
140
+ --port <port> SSE port (default: 3100)
141
+ --api-key <key> API key for SSE auth
142
+ --stale-days <days> Days before a fact is stale (default: 180)
143
+ ```
144
+
145
+ ## Environment Variables
146
+
147
+ | Variable | Description |
148
+ |----------|-------------|
149
+ | `VAULT_PATH` | Path to vault (alternative to `--vault`) |
150
+ | `TRANSPORT` | Transport type |
151
+ | `AGENT_ID` | Agent identity |
152
+ | `WRITE_MODE` | direct or inbox |
153
+ | `PORT` | SSE port |
154
+ | `API_KEY` | SSE authentication key |
155
+ | `STALE_DAYS` | Stale threshold |
156
+ | `MEMORY_TODAY` | Override "today" for deterministic views |
157
+
158
+ ## Write Modes
159
+
160
+ ### Direct (default)
161
+
162
+ Single-agent mode. Writes go directly to vault files. Safe for single AI tool usage.
163
+
164
+ ### Inbox
165
+
166
+ Multi-agent mode. Writes create operation envelopes in `memory/_inbox/{agent-id}/ops/`. Use `compact_inbox` to validate and apply them. Supports precondition hashes and advisory claims for conflict detection.
167
+
168
+ ## Development
169
+
170
+ ```bash
171
+ # Install dependencies
172
+ npm install
173
+
174
+ # Run in development
175
+ npm run dev -- --vault ./test/fixtures/v3-vault
176
+
177
+ # Run tests
178
+ npm test
179
+
180
+ # Type check
181
+ npm run typecheck
182
+
183
+ # Build
184
+ npm run build
185
+ ```
186
+
187
+ ## Architecture
188
+
189
+ The server ports the complete v3 toolchain (lint.py, compact.py, rebuild_views.py, ops.py, query.sh) to TypeScript, providing a self-contained npm package with no Python dependency.
190
+
191
+ ```
192
+ MCP Tool Layer
193
+
194
+
195
+ Query Engine │ Operation Manager │ View Generator │ Schema Validator
196
+ │ │ │ │
197
+ ▼ ▼ ▼ ▼
198
+ Vault Service (path resolution, entity/predicate registries)
199
+
200
+
201
+ Markdown Service (frontmatter parse/serialize via gray-matter)
202
+ ```
203
+
204
+ ## License
205
+
206
+ MIT