Skip to main content
Glama
README.md
# Obsidian Vault Guard (MCP server)

A small [MCP](https://modelcontextprotocol.io) server that lets Claude (or any MCP client) work with an Obsidian vault **without being able to leak or damage it**.

Many Obsidian MCP servers exist; most give the model full read/write access. This one is built around three promises:

1. **Private stays private.** Notes with `private: true`, matches in the vault's `.agentignore`, and anything tagged as ignored never appear in search, reads, tags, task lists or link suggestions.
2. **Read-only by default.** Writing needs `--allow-write`, and the only write is adding `[[wikilinks]]`.
3. **Proof, not trust.** Before any link is saved, the server checks that no word, heading or property changed. If the check fails, nothing is written.

It reads the vault folder directly: **Obsidian does not need to be running**, and no plugin is needed.

## Install

```json
{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": ["-y", "obsidian-vault-guard-mcp", "/path/to/your/vault"]
    }
  }
}
```

Add `"--allow-write"` to the args to let it save links. Needs Node 18+.

## Tools

| Tool | What it does |
|---|---|
| `vault_overview` | Counts, top tags, open tasks, recent notes |
| `search_notes` | Find notes with all the words |
| `read_note` | Properties, tags, links and body of one note |
| `broken_links` | `[[links]]` that point to nothing |
| `link_candidates` | Phrases that mention existing notes (max 8) |
| `apply_links` | Add those links, verified; dry run unless `--allow-write` |
| `tag_suggestions` | Tags for a note, only from tags the vault already uses |
| `project_status` | Recent changes and open tasks for a folder or tag |
| `validate_base` | Check a `.base` file before saving it |

## Hide notes from the agent

Put a `.agentignore` in the vault root, one pattern per line: a folder or glob like `Private/` or `*.draft.md` (matched at any depth), or a tag like `#secret` (case-insensitive). Or add `private: true` to a note's properties. Symlinks are never followed, and notes whose properties cannot be read are hidden.

## Limits

Early version (0.1). It does not edit properties or create notes. It reads files directly, so it sees what is on disk, not unsaved editor text.

## License

MIT