# Obsidian MCP: Editing a Vault Without Breaking Links

> Canonical: https://skillalmanac.com/learn/obsidian-mcp-guide | Updated: 2026-11-21 | Index status: not offered to search engines

Set up an AI agent on an Obsidian vault, keep wikilinks, aliases and block IDs intact, and check each batch of edits before moving on.

## Facts

- 2026-11-21: MCP is an open standard for connecting AI applications to external systems such as local files and databases (https://modelcontextprotocol.io/docs/getting-started/intro)
- 2026-11-21: Obsidian writes internal links as [[Note]], with headings as [[Note#Heading]], block IDs as [[Note#^id]] and display text as [[Note|Name]] (https://obsidian.md/help/links)
- 2026-11-21: Obsidian can update internal links automatically when a file is renamed, and Settings > Files and links can switch that to a prompt (https://obsidian.md/help/links)
- 2026-11-21: Block identifiers use only letters, digits and dashes, and lists, quotes, callouts and tables need the identifier on its own line (https://obsidian.md/help/links)
- 2026-11-21: Obsidian accepts Markdown (.md), Bases (.base), JSON Canvas (.canvas), common image, audio, video and PDF files (https://obsidian.md/help/Files+and+folders/Accepted+file+formats)
- 2026-11-22: The mcp-obsidian README configures OBSIDIAN_API_KEY, OBSIDIAN_HOST and OBSIDIAN_PORT environment variables, with no vault-path setting (https://github.com/MarkusPfundstein/mcp-obsidian)

Connecting an AI agent to an Obsidian vault through MCP lets the agent read and edit your notes directly. The main risk is not the connection itself but the links: an agent that rewrites a note can silently break wikilinks, heading links, aliases and block references, so the work is to control which files change and to check the links after each batch.

## Steps

1. **Back up the vault or put it under version control.** Every later step is easier to review with `git diff` or a copy you can restore. Do this before the agent gets write access.

2. **Change the rename behavior first.** Open Settings, then Files and links. Obsidian can update internal links automatically when a file is renamed. Set it to prompt rather than update silently while the agent works, so you see each change. Keep this setting in view during the run, and still check the links in step 6, because the batch diff is what shows the final result.

3. **Record the link forms your vault uses.** Search the vault for `[[`, `#`, `|` and `^` and note which forms appear: plain wikilinks, folder paths like `[[Projects/Note]]`, heading links, aliases and block links. Tell the agent to keep those exact forms.

4. **Pick a server and read its configuration first.** The mcp-obsidian project is a third-party option, not an Obsidian product. Its README wraps the server in an `mcpServers` entry that runs `uvx` and sets the `OBSIDIAN_API_KEY`, `OBSIDIAN_HOST` and `OBSIDIAN_PORT` environment variables. The README has no vault-path setting, so confirm which vault the API connection serves before the first run, and do not point the agent at a folder above the vault.

5. **Run a read-only pass.** Ask the agent for a list of broken links, duplicate keys and files it would change, without writing anything. Read the list before approving any edit.

6. **Apply edits in small batches.** Limit each run to one folder or a few dozen notes. After each batch, run `git diff` and confirm that only the intended lines changed and that no `[[link]]` target disappeared.

**Check that it worked:** a second read-only pass should list the same unresolved links as before, minus the ones you meant to fix, and the diff should contain no changes to link targets you did not plan to touch.

## Pitfalls

- **Renamed headings break heading links.** A link such as `[[Note#Setup]]` stops resolving when the heading becomes "Installation". Search for the old heading text before renaming it.
- **Block IDs on lists or tables.** Obsidian needs the `^id` on its own line for lists, quotes, callouts and tables. An agent that appends text after a block ID can make the reference stop resolving.
- **Markdown links need encoded spaces.** `[Note](Three%20laws.md)` uses `%20`, while the wikilink `[[Three laws]]` does not. Mixing both styles in one edit makes later searches miss matches.
- **Non-Markdown files need the extension.** Write `[[Figure 1.png]]`, not `[[Figure 1]]`, when linking an image or PDF.
- **Display text is not an alias.** `[[Note|Custom name]]` changes the text in one link only. An alias is set on the note and applies everywhere. An agent that edits one link's text and calls it an alias creates inconsistent links.

## When to use a skill instead

Ad-hoc prompting works for a single note, but a vault-wide cleanup repeats the same checks on every file, and a reusable skill keeps those checks identical from run to run. [notes-vault-organizer](/skills/skill-almanac/notes-vault-organizer) tidies a Markdown vault with Obsidian-style wikilinks, frontmatter and tags, aiming to change formatting without dropping content. [markdown-frontmatter-lint](/skills/skill-almanac/markdown-frontmatter-lint) is the better fit for the read-only pass in step 5: it reports duplicate keys, missing required keys, bad dates, bad tags and empty values with the file and line for each. Use the lint skill first to see the problems, then the organizer skill for the edits you approve.

## FAQ

**What is an MCP server?**
In MCP, the application that talks to the model is the client, and the server exposes an outside system, here your vault folder, through the protocol. The Obsidian MCP server is the piece that makes the vault available to the agent.

**What is MCP in AI?**
MCP is the abbreviation of Model Context Protocol, a common method that AI apps use to reach local files, databases and tools. It defines one shared way to do this instead of a separate integration for each app.

**What does MCP stand for?**
MCP stands for Model Context Protocol. The project's introduction calls it an open-source protocol aimed at linking AI tools with outside systems.

## Related skills

- [notes-vault-organizer](https://skillalmanac.com/skills/skill-almanac/notes-vault-organizer.md): Platform Score 67/100
- [markdown-frontmatter-lint](https://skillalmanac.com/skills/skill-almanac/markdown-frontmatter-lint.md): Platform Score 42/100 (provisional)

## Related guides

- [Debug an MCP Server with MCP Inspector](https://skillalmanac.com/learn/debug-an-mcp-server-with-inspector.md)
- [MCP Tools, Resources, and Prompts: Which to Use](https://skillalmanac.com/learn/mcp-tools-resources-prompts.md)
- [What Are MCP Apps? Interactive UI in AI Chats](https://skillalmanac.com/learn/what-are-mcp-apps.md)
- [Atlassian MCP Server Guide for Jira and Confluence](https://skillalmanac.com/learn/atlassian-mcp-server-guide.md)

## Sources

- https://modelcontextprotocol.io/docs/getting-started/intro
- https://obsidian.md/help/links
- https://obsidian.md/help/Files+and+folders/Accepted+file+formats
- https://github.com/MarkusPfundstein/mcp-obsidian

Platform Scores report our assessment under a published method. They are not a safety guarantee.
