Obsidian MCP: Editing a Vault Without Breaking Links
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.
Updated · Markdown version
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
- Back up the vault or put it under version control. Every later step is easier to review with
git diffor a copy you can restore. Do this before the agent gets write access.
- 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.
- 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.
- 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
mcpServersentry that runsuvxand sets theOBSIDIAN_API_KEY,OBSIDIAN_HOSTandOBSIDIAN_PORTenvironment 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.
- 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.
- Apply edits in small batches. Limit each run to one folder or a few dozen notes. After each batch, run
git diffand 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
^idon 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 tidies a Markdown vault with Obsidian-style wikilinks, frontmatter and tags, aiming to change formatting without dropping content. 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 in this catalog
Platform Score is our assessment under a published method. It is not a safety guarantee.
Related guides
Sources
- https://modelcontextprotocol.io/docs/getting-started/intro (accessed 2026-11-21)
- https://obsidian.md/help/links (accessed 2026-11-21)
- https://obsidian.md/help/Files+and+folders/Accepted+file+formats (accessed 2026-11-21)
- https://github.com/MarkusPfundstein/mcp-obsidian (accessed 2026-11-21)
This page is not offered to search engines yet: The content file does not mark this page indexable yet.