
This plugin runs a local server inside Obsidian. It allows external AI tools (like Claude Desktop, Cursor, or CLI agents) to connect to Obsidian, read your active context, and perform actions...
概览
This plugin runs a local server inside Obsidian. It allows external AI tools (like Claude Desktop, Cursor, or CLI agents) to connect to Obsidian, read your active context, and perform actions directly within the app. * get_active_file lets the agent see exactly what you are working on. * read_note, get_note_metadata, get_backlinks, and describe_vault provide full vault visibility. * create_note, edit_note, append_note, patch_note, rename_note, and delete_note allow agents to manage your notes. * read_attachment returns images as MCP ImageContent (AI can see them); add_attachment saves binary files to the vault. * search_notes filters by date/tags/frontmatter; search_content does full-text or regex search with line-number snippets and optional metadata. * append_daily_note works with your Daily Notes settings (creates/appends correctly). * list_folder (with sorting, filtering, recursion), list_all_tags, list_recent_notes, and create_folder help agents explore and organize the vault.
README
以下为原文 README 节选,完整内容请查看原文。
Obsidian MCP Server
Give your AI Agents a seat at the table.
This plugin runs a local Model Context Protocol (MCP) server inside Obsidian. It allows external AI tools (like Claude Desktop, Cursor, or CLI agents) to connect to Obsidian, read your active context, and perform actions directly within the app.
⚠️ Status: Beta (Production Ready Logic).
Features
- Context Awareness:
get_active_filelets the agent see exactly what you are working on. - Vault Access:
read_note,get_note_metadata,get_backlinks, anddescribe_vaultprovide full vault visibility. - Note Management:
create_note,edit_note,append_note,patch_note,rename_note, anddelete_noteallow agents to manage your notes. - Attachment Handling:
read_attachmentreturns images as MCP ImageContent (AI can see them);add_attachmentsaves binary files to the vault. - Search:
search_notesfilters by date/tags/frontmatter;search_contentdoes full-text or regex search with line-number snippets and optional metadata. - Quick Capture:
append_daily_noteworks with your Daily Notes settings (creates/appends correctly). - Discovery:
list_folder(with sorting, filtering, recursion),list_all_tags,list_recent_notes, andcreate_folderhelp agents explore and organize the vault. - Session Tracking:
list_sessionsshows active connections with client name/version and per-session tool usage stats. - Usage Statistics: Track tool call counts (total/successful/failed) in Settings, with persistent storage.
- Secure: Uses a local Auth Token with timing-safe comparison. Authentication can be disabled for local development.
- Access Control: Blacklist paths and tags to keep sensitive notes private.
Architecture
- Transport: Streamable HTTP.
- Endpoint:
http://localhost:/mcp - Security: Bearer Token Authentication (enabled by default, can be disabled in settings).
Available Tools
| Tool | Description |
|---|---|
get_active_file |
Get the content and metadata of the currently active note |
read_note |
Read a note by vault-relative path |
create_note |
Create a new note at a given path (auto-creates parent folders, prevents overwriting) |
edit_note |
Replace entire content of an existing note |
append_note |
Append or prepend text to an existing note |
patch_note |
Find-and-replace edit on a note (no full rewrite needed) |
rename_note |
Rename or move a note (Obsidian auto-updates wikilinks) |
delete_note |
Delete a note by path |
read_attachment |
Read a binary attachment — images returned as ImageContent (AI can see them) |
add_attachment |
Save a base64-encoded file to the vault (respects Obsidian’s attachment folder setting) |
get_note_metadata |
Get frontmatter, tags, headings, links without full content |
get_backlinks |
Get incoming links (backlinks) to a note |
安装
npx mcp-remote http://localhost:27123/mcp --header Authorization: Bearer YOUR_TOKEN配置
{
"mcpServers": {
"obsidian": {
"type": "http",
"url": "http://localhost:27123/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}