mcp-obsidian-cli 1.0.1 → 1.2.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/lib/helpers.js +62 -0
- package/package.json +7 -2
- package/prompts/obsidian-bases.md +380 -0
- package/prompts/obsidian-canvas.md +312 -0
- package/prompts/obsidian-cli.md +115 -0
- package/prompts/obsidian-markdown.md +224 -0
- package/server.js +131 -135
- package/.claude/settings.local.json +0 -15
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# JSON Canvas Reference
|
|
2
|
+
|
|
3
|
+
Canvas files (`.canvas`) are JSON files that define visual layouts of notes, text, links, and groups on an infinite canvas. Use them for brainstorming, relationship mapping, project planning, and content organization.
|
|
4
|
+
|
|
5
|
+
## File Structure
|
|
6
|
+
|
|
7
|
+
A canvas file contains two top-level arrays following the JSON Canvas Spec 1.0:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"nodes": [],
|
|
12
|
+
"edges": []
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `nodes` — array of node objects placed on the canvas
|
|
17
|
+
- `edges` — array of connections between nodes
|
|
18
|
+
|
|
19
|
+
Both arrays are optional (empty canvas is valid).
|
|
20
|
+
|
|
21
|
+
## Common Workflows
|
|
22
|
+
|
|
23
|
+
### Create a New Canvas
|
|
24
|
+
|
|
25
|
+
1. Create a `.canvas` file with base structure `{"nodes": [], "edges": []}`
|
|
26
|
+
2. Generate unique 16-character hex IDs for each node (e.g., `"6f0ad84f44ce9c17"`)
|
|
27
|
+
3. Add nodes with required fields: `id`, `type`, `x`, `y`, `width`, `height`
|
|
28
|
+
4. Add edges referencing valid node IDs via `fromNode` and `toNode`
|
|
29
|
+
5. Validate: ensure all `fromNode`/`toNode` values reference existing node IDs
|
|
30
|
+
|
|
31
|
+
### Add a Node to an Existing Canvas
|
|
32
|
+
|
|
33
|
+
1. Read and parse the existing `.canvas` file
|
|
34
|
+
2. Generate a unique ID that does not collide with existing IDs
|
|
35
|
+
3. Choose `x`, `y` position that avoids overlapping existing nodes (50-100px spacing)
|
|
36
|
+
4. Append the new node to the `nodes` array
|
|
37
|
+
5. Optionally add edges connecting it to existing nodes
|
|
38
|
+
|
|
39
|
+
### Connect Two Nodes
|
|
40
|
+
|
|
41
|
+
1. Identify source and target node IDs
|
|
42
|
+
2. Generate a unique edge ID
|
|
43
|
+
3. Set `fromNode` and `toNode`; optionally set `fromSide`/`toSide` for anchor points
|
|
44
|
+
4. Optionally add a `label`
|
|
45
|
+
5. Append to the `edges` array
|
|
46
|
+
|
|
47
|
+
## Node Types
|
|
48
|
+
|
|
49
|
+
All nodes share these required attributes:
|
|
50
|
+
|
|
51
|
+
| Attribute | Required | Type | Description |
|
|
52
|
+
|-----------|----------|------|-------------|
|
|
53
|
+
| `id` | Yes | string | Unique 16-char hex identifier |
|
|
54
|
+
| `type` | Yes | string | `text`, `file`, `link`, or `group` |
|
|
55
|
+
| `x` | Yes | integer | X position in pixels (left edge) |
|
|
56
|
+
| `y` | Yes | integer | Y position in pixels (top edge) |
|
|
57
|
+
| `width` | Yes | integer | Width in pixels |
|
|
58
|
+
| `height` | Yes | integer | Height in pixels |
|
|
59
|
+
| `color` | No | string | Preset `"1"`-`"6"` or hex `"#RRGGBB"` |
|
|
60
|
+
|
|
61
|
+
### Text Nodes
|
|
62
|
+
|
|
63
|
+
Display rich text with Markdown content.
|
|
64
|
+
|
|
65
|
+
| Attribute | Required | Description |
|
|
66
|
+
|-----------|----------|-------------|
|
|
67
|
+
| `text` | Yes | Markdown string |
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"id": "6f0ad84f44ce9c17",
|
|
72
|
+
"type": "text",
|
|
73
|
+
"x": 0,
|
|
74
|
+
"y": 0,
|
|
75
|
+
"width": 400,
|
|
76
|
+
"height": 200,
|
|
77
|
+
"text": "# Hello World\n\nThis is **Markdown** content."
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use `\n` for line breaks in JSON strings. Do NOT use literal `\\n`.
|
|
82
|
+
|
|
83
|
+
### File Nodes
|
|
84
|
+
|
|
85
|
+
Display a vault note or attachment inline.
|
|
86
|
+
|
|
87
|
+
| Attribute | Required | Description |
|
|
88
|
+
|-----------|----------|-------------|
|
|
89
|
+
| `file` | Yes | Path to file from vault root |
|
|
90
|
+
| `subpath` | No | Link to heading or block (starts with `#`) |
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"id": "a1b2c3d4e5f67890",
|
|
95
|
+
"type": "file",
|
|
96
|
+
"x": 500,
|
|
97
|
+
"y": 0,
|
|
98
|
+
"width": 400,
|
|
99
|
+
"height": 300,
|
|
100
|
+
"file": "Projects/Alpha.md"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Link Nodes
|
|
105
|
+
|
|
106
|
+
Display an external URL as a web preview.
|
|
107
|
+
|
|
108
|
+
| Attribute | Required | Description |
|
|
109
|
+
|-----------|----------|-------------|
|
|
110
|
+
| `url` | Yes | External URL |
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"id": "c3d4e5f678901234",
|
|
115
|
+
"type": "link",
|
|
116
|
+
"x": 1000,
|
|
117
|
+
"y": 0,
|
|
118
|
+
"width": 400,
|
|
119
|
+
"height": 200,
|
|
120
|
+
"url": "https://obsidian.md"
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Group Nodes
|
|
125
|
+
|
|
126
|
+
Visual containers for organizing other nodes. Position child nodes inside the group's bounds.
|
|
127
|
+
|
|
128
|
+
| Attribute | Required | Description |
|
|
129
|
+
|-----------|----------|-------------|
|
|
130
|
+
| `label` | No | Text label for the group |
|
|
131
|
+
| `background` | No | Path to background image |
|
|
132
|
+
| `backgroundStyle` | No | `cover`, `ratio`, or `repeat` |
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"id": "d4e5f6789012345a",
|
|
137
|
+
"type": "group",
|
|
138
|
+
"x": -50,
|
|
139
|
+
"y": -50,
|
|
140
|
+
"width": 1000,
|
|
141
|
+
"height": 600,
|
|
142
|
+
"label": "Project Overview",
|
|
143
|
+
"color": "4"
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Groups do not automatically contain nodes — nodes are "inside" a group visually based on position overlap.
|
|
148
|
+
|
|
149
|
+
## Edges
|
|
150
|
+
|
|
151
|
+
Edges connect nodes via their IDs.
|
|
152
|
+
|
|
153
|
+
| Attribute | Required | Default | Description |
|
|
154
|
+
|-----------|----------|---------|-------------|
|
|
155
|
+
| `id` | Yes | - | Unique identifier |
|
|
156
|
+
| `fromNode` | Yes | - | Source node ID |
|
|
157
|
+
| `toNode` | Yes | - | Target node ID |
|
|
158
|
+
| `fromSide` | No | - | `top`, `right`, `bottom`, or `left` |
|
|
159
|
+
| `toSide` | No | - | `top`, `right`, `bottom`, or `left` |
|
|
160
|
+
| `fromEnd` | No | `none` | `none` or `arrow` |
|
|
161
|
+
| `toEnd` | No | `arrow` | `none` or `arrow` |
|
|
162
|
+
| `color` | No | - | Line color (preset or hex) |
|
|
163
|
+
| `label` | No | - | Text label on the edge |
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"id": "0123456789abcdef",
|
|
168
|
+
"fromNode": "6f0ad84f44ce9c17",
|
|
169
|
+
"fromSide": "right",
|
|
170
|
+
"toNode": "a1b2c3d4e5f67890",
|
|
171
|
+
"toSide": "left",
|
|
172
|
+
"toEnd": "arrow",
|
|
173
|
+
"label": "leads to"
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Color Presets
|
|
178
|
+
|
|
179
|
+
| Preset | Color |
|
|
180
|
+
|--------|-------|
|
|
181
|
+
| `"1"` | Red |
|
|
182
|
+
| `"2"` | Orange |
|
|
183
|
+
| `"3"` | Yellow |
|
|
184
|
+
| `"4"` | Green |
|
|
185
|
+
| `"5"` | Cyan |
|
|
186
|
+
| `"6"` | Purple |
|
|
187
|
+
|
|
188
|
+
Also accepts hex strings: `"#FF0000"`. Exact shades depend on the Obsidian theme.
|
|
189
|
+
|
|
190
|
+
## ID Generation
|
|
191
|
+
|
|
192
|
+
Use 16-character lowercase hexadecimal strings (64-bit random value):
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
"6f0ad84f44ce9c17"
|
|
196
|
+
"a3b2c1d0e9f8a7b6"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
IDs must be unique across all nodes and edges in the file.
|
|
200
|
+
|
|
201
|
+
## Layout Guidelines
|
|
202
|
+
|
|
203
|
+
- Coordinates can be negative — the canvas is infinite
|
|
204
|
+
- `x` increases rightward, `y` increases downward
|
|
205
|
+
- `x`, `y` mark the top-left corner of the node
|
|
206
|
+
- Space nodes 50-100px apart; leave 20-50px padding inside groups
|
|
207
|
+
- Align to grid (multiples of 10 or 20) for cleaner layouts
|
|
208
|
+
- Array order determines z-index: first node = bottom layer, last = top layer
|
|
209
|
+
|
|
210
|
+
| Node Type | Suggested Width | Suggested Height |
|
|
211
|
+
|-----------|-----------------|------------------|
|
|
212
|
+
| Small text | 200-300 | 80-150 |
|
|
213
|
+
| Medium text | 300-450 | 150-300 |
|
|
214
|
+
| Large text | 400-600 | 300-500 |
|
|
215
|
+
| File preview | 300-500 | 200-400 |
|
|
216
|
+
| Link preview | 250-400 | 100-200 |
|
|
217
|
+
|
|
218
|
+
## Validation Checklist
|
|
219
|
+
|
|
220
|
+
Before writing a canvas file, verify:
|
|
221
|
+
|
|
222
|
+
1. All `id` values are unique across nodes and edges
|
|
223
|
+
2. Every `fromNode` and `toNode` references an existing node ID
|
|
224
|
+
3. Required fields are present for each node type:
|
|
225
|
+
- text nodes: `text`
|
|
226
|
+
- file nodes: `file`
|
|
227
|
+
- link nodes: `url`
|
|
228
|
+
4. `type` is one of: `text`, `file`, `link`, `group`
|
|
229
|
+
5. `fromSide`/`toSide` are one of: `top`, `right`, `bottom`, `left`
|
|
230
|
+
6. `fromEnd`/`toEnd` are one of: `none`, `arrow`
|
|
231
|
+
7. Color presets are `"1"` through `"6"` or valid hex `"#RRGGBB"`
|
|
232
|
+
8. JSON is valid and parseable (especially: `\n` not `\\n` in text)
|
|
233
|
+
|
|
234
|
+
## Complete Example
|
|
235
|
+
|
|
236
|
+
A minimal project overview canvas with a group, two notes, a text summary, and a connecting edge:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"nodes": [
|
|
241
|
+
{
|
|
242
|
+
"id": "d4e5f6789012345a",
|
|
243
|
+
"type": "group",
|
|
244
|
+
"x": -60,
|
|
245
|
+
"y": -60,
|
|
246
|
+
"width": 1100,
|
|
247
|
+
"height": 500,
|
|
248
|
+
"label": "Project Alpha",
|
|
249
|
+
"color": "4"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"id": "6f0ad84f44ce9c17",
|
|
253
|
+
"type": "text",
|
|
254
|
+
"x": 0,
|
|
255
|
+
"y": 0,
|
|
256
|
+
"width": 350,
|
|
257
|
+
"height": 150,
|
|
258
|
+
"text": "## Goal\n\nDeliver MVP by end of quarter.\n\n- Backend API\n- Frontend UI\n- Documentation"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "a1b2c3d4e5f67890",
|
|
262
|
+
"type": "file",
|
|
263
|
+
"x": 450,
|
|
264
|
+
"y": 0,
|
|
265
|
+
"width": 400,
|
|
266
|
+
"height": 300,
|
|
267
|
+
"file": "Projects/Alpha/Requirements.md"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"id": "b2c3d4e5f6789012",
|
|
271
|
+
"type": "link",
|
|
272
|
+
"x": 450,
|
|
273
|
+
"y": 320,
|
|
274
|
+
"width": 400,
|
|
275
|
+
"height": 120,
|
|
276
|
+
"url": "https://github.com/example/project-alpha"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"edges": [
|
|
280
|
+
{
|
|
281
|
+
"id": "0123456789abcdef",
|
|
282
|
+
"fromNode": "6f0ad84f44ce9c17",
|
|
283
|
+
"fromSide": "right",
|
|
284
|
+
"toNode": "a1b2c3d4e5f67890",
|
|
285
|
+
"toSide": "left",
|
|
286
|
+
"toEnd": "arrow",
|
|
287
|
+
"label": "defines"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Using This Knowledge with MCP Tools
|
|
294
|
+
|
|
295
|
+
When working with canvas files through this MCP server:
|
|
296
|
+
|
|
297
|
+
- Create a new canvas:
|
|
298
|
+
```
|
|
299
|
+
obsidian_create({
|
|
300
|
+
name: "Project Map",
|
|
301
|
+
path: "canvas/Project Map.canvas",
|
|
302
|
+
content: "{\"nodes\": [], \"edges\": []}"
|
|
303
|
+
})
|
|
304
|
+
```
|
|
305
|
+
- Read an existing canvas (parse the JSON to see its structure):
|
|
306
|
+
`obsidian_read({ path: "canvas/Project Map.canvas" })`
|
|
307
|
+
- List all canvas files in the vault:
|
|
308
|
+
`obsidian_files({ ext: "canvas" })`
|
|
309
|
+
- Update a canvas (read, modify JSON, write back):
|
|
310
|
+
`obsidian_create({ path: "canvas/Project Map.canvas", content: "<updated json>" })`
|
|
311
|
+
- Search for notes referenced in canvases:
|
|
312
|
+
`obsidian_search({ query: "canvas" })`
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Obsidian CLI Reference
|
|
2
|
+
|
|
3
|
+
Use the `obsidian` CLI to interact with a running Obsidian instance. Obsidian must be open.
|
|
4
|
+
|
|
5
|
+
## Command Syntax
|
|
6
|
+
|
|
7
|
+
Commands follow this pattern:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
obsidian <command> [key=value ...]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Parameters** take a value with `=`. Quote values that contain spaces:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
obsidian create name="My Note" content="Hello world"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Flags** are boolean switches with no value:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
obsidian create name="My Note" silent overwrite
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For multiline content, use `\n` for newline and `\t` for tab.
|
|
26
|
+
|
|
27
|
+
## File Targeting
|
|
28
|
+
|
|
29
|
+
Many commands accept `file` or `path` to target a note. Without either, the active file is used.
|
|
30
|
+
|
|
31
|
+
- `file=<name>` — resolves like a wikilink (name only, no path or extension needed)
|
|
32
|
+
- `path=<path>` — exact path from vault root, e.g. `folder/note.md`
|
|
33
|
+
|
|
34
|
+
## Vault Targeting
|
|
35
|
+
|
|
36
|
+
Commands target the most recently focused vault by default. Use `vault=<name>` as the first parameter to target a specific vault:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
obsidian vault="My Vault" search query="test"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Common Commands
|
|
43
|
+
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---------|-------------|
|
|
46
|
+
| `read file="Note"` | Read note contents by wikilink name |
|
|
47
|
+
| `read path="folder/note.md"` | Read note contents by exact path |
|
|
48
|
+
| `create name="New Note" content="..."` | Create a new note |
|
|
49
|
+
| `append file="Note" content="..."` | Append content to a note |
|
|
50
|
+
| `search query="term" limit=10` | Full-text vault search |
|
|
51
|
+
| `search:context query="term"` | Search with surrounding line context |
|
|
52
|
+
| `daily:read` | Read today's daily note |
|
|
53
|
+
| `daily:append content="..."` | Append to today's daily note |
|
|
54
|
+
| `daily:path` | Get file path of today's daily note |
|
|
55
|
+
| `tasks daily todo` | List incomplete tasks from daily note |
|
|
56
|
+
| `tasks` | List all tasks in the vault |
|
|
57
|
+
| `tags sort=count counts` | List tags sorted by frequency |
|
|
58
|
+
| `properties` | List all frontmatter properties in vault |
|
|
59
|
+
| `properties file="Note" counts` | List properties for a specific note |
|
|
60
|
+
| `property:read name="status" file="Note"` | Read a specific property value |
|
|
61
|
+
| `property:set name="status" value="done" file="Note"` | Set a property |
|
|
62
|
+
| `backlinks file="Note" counts` | List notes that link to this note |
|
|
63
|
+
| `files folder="Projects/"` | List files in a folder |
|
|
64
|
+
| `files ext=canvas` | List files by extension |
|
|
65
|
+
| `recents` | List recently opened files |
|
|
66
|
+
| `help` | Show all available commands |
|
|
67
|
+
| `help <command>` | Show help for a specific command |
|
|
68
|
+
|
|
69
|
+
## Parameter Patterns
|
|
70
|
+
|
|
71
|
+
| Parameter | Purpose | Example |
|
|
72
|
+
|-----------|---------|---------|
|
|
73
|
+
| `file=` | Target note by wikilink name | `file="My Note"` |
|
|
74
|
+
| `path=` | Target note by exact vault path | `path="Work/Projects/alpha.md"` |
|
|
75
|
+
| `query=` | Search terms | `query="meeting notes"` |
|
|
76
|
+
| `content=` | Text content to write or append | `content="- [ ] New task"` |
|
|
77
|
+
| `name=` | Note name (create) or property name | `name="New Note"` |
|
|
78
|
+
| `value=` | Property value | `value="done"` |
|
|
79
|
+
| `limit=` | Max results to return | `limit=10` |
|
|
80
|
+
| `sort=` | Sort order | `sort=count` |
|
|
81
|
+
| `folder=` | Folder to filter by | `folder="Projects/"` |
|
|
82
|
+
| `ext=` | File extension filter | `ext=canvas` |
|
|
83
|
+
|
|
84
|
+
Quote any value that contains spaces. Use `\n` for newlines within `content=` values.
|
|
85
|
+
|
|
86
|
+
## Output Behavior
|
|
87
|
+
|
|
88
|
+
- Commands write their output to stdout
|
|
89
|
+
- Errors appear on stderr
|
|
90
|
+
- Use `--copy` on any command to copy output to clipboard
|
|
91
|
+
- Use `silent` flag to prevent files from opening in the Obsidian UI
|
|
92
|
+
- Use `total` on list commands to get a count appended to output
|
|
93
|
+
|
|
94
|
+
## Using This Knowledge with MCP Tools
|
|
95
|
+
|
|
96
|
+
When working with an Obsidian vault via this MCP server, use these tools instead of running the CLI directly:
|
|
97
|
+
|
|
98
|
+
- Read a note: `obsidian_read({ file: "Note Name" })`
|
|
99
|
+
- Read by exact path: `obsidian_read({ path: "folder/note.md" })`
|
|
100
|
+
- Search with context: `obsidian_search({ query: "term", path: "folder/", limit: 5 })`
|
|
101
|
+
- Read today's daily note: `obsidian_daily_read()`
|
|
102
|
+
- Get daily note path: `obsidian_daily_path()`
|
|
103
|
+
- Append to daily note: `obsidian_daily_append({ content: "- [ ] New task" })`
|
|
104
|
+
- Create a note: `obsidian_create({ name: "New Note", content: "# Heading\n..." })`
|
|
105
|
+
- List tasks from daily note: `obsidian_tasks({ daily: true, todo: true })`
|
|
106
|
+
- List all vault tasks: `obsidian_tasks({})`
|
|
107
|
+
- List tags by frequency: `obsidian_tags({ sort: "count" })`
|
|
108
|
+
- Read all properties for a note: `obsidian_properties({ file: "Note Name" })`
|
|
109
|
+
- Read a specific property: `obsidian_properties({ file: "Note Name", name: "status" })`
|
|
110
|
+
- Set a property: `obsidian_property_set({ name: "status", value: "done", file: "Note Name" })`
|
|
111
|
+
- List backlinks: `obsidian_backlinks({ file: "Note Name" })`
|
|
112
|
+
- List files in folder: `obsidian_files({ folder: "Projects/" })`
|
|
113
|
+
- List canvas files: `obsidian_files({ ext: "canvas" })`
|
|
114
|
+
- List recent files: `obsidian_recents()`
|
|
115
|
+
- Run any CLI command directly: `obsidian({ command: "help search" })`
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Obsidian Flavored Markdown Reference
|
|
2
|
+
|
|
3
|
+
Obsidian extends CommonMark and GitHub Flavored Markdown with wikilinks, embeds, callouts, properties, and other vault-specific syntax. This reference covers only Obsidian-specific extensions — standard Markdown (headings, bold, italic, lists, code blocks, tables) is assumed knowledge.
|
|
4
|
+
|
|
5
|
+
## Wikilinks (Internal Links)
|
|
6
|
+
|
|
7
|
+
Use wikilinks for all links within the vault. Obsidian tracks renames automatically.
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
[[Note Name]] Link to a note
|
|
11
|
+
[[Note Name|Display Text]] Custom display text
|
|
12
|
+
[[Note Name#Heading]] Link to a specific heading
|
|
13
|
+
[[Note Name#^block-id]] Link to a specific block
|
|
14
|
+
[[Note Name#^block-id|Display Text]] Link to block with custom text
|
|
15
|
+
[[#Heading in same note]] Link to heading in current note
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Define a block ID by appending `^block-id` at the end of a paragraph:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
This paragraph can be linked to. ^my-block-id
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For lists or quotes, place the block ID on a separate line after the block:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
> A quote block
|
|
28
|
+
|
|
29
|
+
^quote-id
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Use `[text](url)` for external URLs only — not for vault notes.
|
|
33
|
+
|
|
34
|
+
## Embeds
|
|
35
|
+
|
|
36
|
+
Prefix any wikilink with `!` to embed content inline:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
![[Note Name]] Embed full note
|
|
40
|
+
![[Note Name#Heading]] Embed a specific section
|
|
41
|
+
![[image.png]] Embed an image
|
|
42
|
+
![[image.png|300]] Embed image with pixel width
|
|
43
|
+
![[document.pdf#page=3]] Embed a specific PDF page
|
|
44
|
+
![[audio.mp3]] Embed audio player
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Callouts
|
|
48
|
+
|
|
49
|
+
Callouts highlight information with a colored block and icon:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
> [!note]
|
|
53
|
+
> Basic callout with default title.
|
|
54
|
+
|
|
55
|
+
> [!warning] Custom Title
|
|
56
|
+
> Callout with a custom title.
|
|
57
|
+
|
|
58
|
+
> [!tip]- Collapsed by default
|
|
59
|
+
> Use `-` after the type to collapse. Use `+` to expand by default.
|
|
60
|
+
|
|
61
|
+
> [!faq]+ Expanded by default
|
|
62
|
+
> Starts open.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Common callout types: `note`, `tip`, `info`, `warning`, `danger`, `bug`, `success`, `failure`, `question`, `example`, `quote`, `abstract`, `todo`.
|
|
66
|
+
|
|
67
|
+
Callouts can be nested:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
> [!note] Outer
|
|
71
|
+
> > [!tip] Inner
|
|
72
|
+
> > Nested callout content.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Properties (Frontmatter)
|
|
76
|
+
|
|
77
|
+
Properties are YAML metadata in a `---` delimited block at the top of the file:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
---
|
|
81
|
+
title: My Note
|
|
82
|
+
date: 2024-01-15
|
|
83
|
+
tags:
|
|
84
|
+
- project
|
|
85
|
+
- active
|
|
86
|
+
aliases:
|
|
87
|
+
- Alternative Name
|
|
88
|
+
cssclasses:
|
|
89
|
+
- custom-class
|
|
90
|
+
status: in-progress
|
|
91
|
+
priority: 2
|
|
92
|
+
done: false
|
|
93
|
+
---
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Common property types:**
|
|
97
|
+
|
|
98
|
+
| Type | YAML example |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| Text | `status: "active"` |
|
|
101
|
+
| Number | `priority: 2` |
|
|
102
|
+
| Date | `due: 2024-03-01` |
|
|
103
|
+
| Boolean | `done: false` |
|
|
104
|
+
| List | `tags:\n - item1\n - item2` |
|
|
105
|
+
| Link | `related: "[[Other Note]]"` |
|
|
106
|
+
|
|
107
|
+
**Built-in Obsidian properties:**
|
|
108
|
+
- `tags` — searchable labels (`#tag` syntax, also works inline in body)
|
|
109
|
+
- `aliases` — alternative note names for link suggestions
|
|
110
|
+
- `cssclasses` — CSS classes applied to the note in reading view
|
|
111
|
+
|
|
112
|
+
## Tags
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
#tag Inline tag in body text
|
|
116
|
+
#nested/tag Nested tag (creates hierarchy)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Tags can also be defined in frontmatter under `tags`. Rules: letters, numbers (not first char), underscores, hyphens, and forward slashes.
|
|
120
|
+
|
|
121
|
+
## Comments
|
|
122
|
+
|
|
123
|
+
Comments are hidden in reading view:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
This is visible %%but this is hidden%% text.
|
|
127
|
+
|
|
128
|
+
%%
|
|
129
|
+
This entire block is hidden in reading view.
|
|
130
|
+
%%
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Highlights
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
==This text is highlighted==
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Math (LaTeX)
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
Inline: $e^{i\pi} + 1 = 0$
|
|
143
|
+
|
|
144
|
+
Block:
|
|
145
|
+
$$
|
|
146
|
+
\frac{a}{b} = c
|
|
147
|
+
$$
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Diagrams (Mermaid)
|
|
151
|
+
|
|
152
|
+
````markdown
|
|
153
|
+
```mermaid
|
|
154
|
+
graph TD
|
|
155
|
+
A[Start] --> B{Decision}
|
|
156
|
+
B -->|Yes| C[Do this]
|
|
157
|
+
B -->|No| D[Do that]
|
|
158
|
+
```
|
|
159
|
+
````
|
|
160
|
+
|
|
161
|
+
To link Mermaid nodes to Obsidian notes, add `class NodeName internal-link;`.
|
|
162
|
+
|
|
163
|
+
## Footnotes
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
Text with a footnote[^1].
|
|
167
|
+
|
|
168
|
+
[^1]: Footnote content goes here.
|
|
169
|
+
|
|
170
|
+
Inline footnote.^[This is the inline footnote text.]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Complete Note Example
|
|
174
|
+
|
|
175
|
+
````markdown
|
|
176
|
+
---
|
|
177
|
+
title: Project Alpha
|
|
178
|
+
date: 2024-01-15
|
|
179
|
+
tags:
|
|
180
|
+
- project
|
|
181
|
+
- active
|
|
182
|
+
status: in-progress
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
# Project Alpha
|
|
186
|
+
|
|
187
|
+
This project aims to [[improve workflow]] using modern techniques.
|
|
188
|
+
|
|
189
|
+
> [!important] Key Deadline
|
|
190
|
+
> The first milestone is due on ==January 30th==.
|
|
191
|
+
|
|
192
|
+
## Tasks
|
|
193
|
+
|
|
194
|
+
- [x] Initial planning
|
|
195
|
+
- [ ] Development phase
|
|
196
|
+
|
|
197
|
+
## Notes
|
|
198
|
+
|
|
199
|
+
The algorithm uses $O(n \log n)$ sorting. See [[Algorithm Notes#Sorting]] for details.
|
|
200
|
+
|
|
201
|
+
![[Architecture Diagram.png|600]]
|
|
202
|
+
|
|
203
|
+
Reviewed in [[Meeting Notes 2024-01-10#Decisions]].
|
|
204
|
+
````
|
|
205
|
+
|
|
206
|
+
## Using This Knowledge with MCP Tools
|
|
207
|
+
|
|
208
|
+
When creating or editing notes through this MCP server, apply these patterns:
|
|
209
|
+
|
|
210
|
+
- Read a note (see its markdown): `obsidian_read({ file: "Note Name" })`
|
|
211
|
+
- Create a note with frontmatter:
|
|
212
|
+
```
|
|
213
|
+
obsidian_create({
|
|
214
|
+
name: "New Note",
|
|
215
|
+
content: "---\ntags:\n - project\nstatus: active\n---\n# Heading\n\nContent here."
|
|
216
|
+
})
|
|
217
|
+
```
|
|
218
|
+
- Append a callout to daily note:
|
|
219
|
+
```
|
|
220
|
+
obsidian_daily_append({ content: "> [!tip] Reminder\n> Don't forget the meeting." })
|
|
221
|
+
```
|
|
222
|
+
- Set a frontmatter property: `obsidian_property_set({ name: "status", value: "done", file: "Note Name" })`
|
|
223
|
+
- Search by tag: `obsidian_search({ query: "tag:#project" })`
|
|
224
|
+
- Find notes linking to another: `obsidian_backlinks({ file: "Note Name" })`
|