palace-mcp
palace-mcp
MCP 服务器,通过 Local REST API 插件将 Obsidian 仓库暴露给 AI 助手。
基于 FastMCP 构建。代理可以列出、读取、写入、搜索和删除笔记,并读取当前在 Obsidian 中打开的任意笔记。
先决条件
安装了 Local REST API 插件并正在运行的 Obsidian
Python 3.12+
uv(推荐)或 pip
继续之前,请先从 Obsidian 的插件设置中复制你的 API 密钥。
Related MCP server: obsidian-local-mcp
安装
git clone <repo-url> palace-mcp
cd palace-mcp
uv sync配置
变量 | 必填 | 默认值 | 描述 |
| 是 | — | 来自 Local REST API 插件的 Bearer 令牌 |
| 否 |
| Obsidian REST API 监听的主机 |
| 否 |
| REST API 的端口 |
| 否 |
|
|
| 否 |
| 以逗号分隔的路径,在这些路径下 |
当通过 HTTPS 使用插件的自签名证书时,会自动跳过证书验证。
运行
通过 stdio 启动服务器(MCP 客户端的默认传输方式):
export OBSIDIAN_API_KEY="your-api-key"
uv run python server.py或者通过 FastMCP:
uv run fastmcp run server.pyCursor 配置
添加到你的 MCP 配置中(例如 ~/.cursor/mcp.json):
{
"mcpServers": {
"obsidian-palace": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "/path/to/palace-mcp",
"env": {
"OBSIDIAN_API_KEY": "your-api-key-here"
}
}
}
}保存后重启 Cursor 或重新加载 MCP 服务器。
工具
工具 | 描述 |
| 列出文件和文件夹。传入子目录路径,或留空以表示仓库根目录。 |
| 按仓库相对路径读取笔记的完整内容(例如 |
| 创建新笔记或覆盖现有笔记。 |
| 将文本追加到笔记末尾。如果笔记不存在则创建它。 |
| 全文搜索;返回按相关性排序的匹配文件名。 |
| 返回当前在 Obsidian 中打开的笔记内容。 |
| 永久删除笔记。不可逆——请谨慎使用。 |
追加保护
某些仓库路径被视为 仅覆盖。向这些路径追加内容可能会在单个笔记中静默地堆叠重复内容,日后很难察觉。
默认情况下,append_note 会拒绝匹配以下路径的请求:
/Context/(Context文件夹下的任何笔记)/System/(System文件夹下的任何笔记)Index.md(任何名为Index.md的文件)
请改用 write_note 替换这些笔记。可通过 PALACE_APPEND_DENY 环境变量覆盖拒绝列表。
许可证
MIT
Available Tools
7 toolsactive_noteA
Return the contents of the note currently open in Obsidian.
Inputs: no named parameters. Returns: result
append_noteA
Append text to the end of a note (creates the note if it doesn't exist).
Inputs: path (required), content (required). Returns: result
delete_noteA
Permanently delete a note. Use with care — this is irreversible.
Inputs: path (required). Returns: result
list_notesA
List files and folders. Pass a subdirectory path, or leave empty for the vault root.
Inputs: directory. Returns: result
read_noteA
Read a note's full contents by vault-relative path, e.g. 'People/Alice.md'.
Inputs: path (required). Returns: result
search_notesA
Full-text search the vault; returns matching filenames ranked by relevance.
Inputs: query (required). Returns: result
write_noteA
Create a new note or OVERWRITE an existing one at the given vault-relative path.
Inputs: path (required), content (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct file operation: listing, reading, writing, appending, searching, accessing the active note, and deleting. There is no meaningful overlap between tool purposes.
Most tools follow a clear verb_note pattern: read_note, write_note, append_note, delete_note, and search_notes. The deviations are minor: list_notes uses plural and active_note is adjective_noun, but the overall convention is still predictable.
Seven tools is a well-scoped set for an Obsidian vault server. Each tool covers a necessary note operation without unnecessary bloat.
The core note lifecycle is covered: list, read, write, append, search, and delete. Missing operations like rename, move, or folder management are minor gaps that agents can usually work around by writing to a new path.
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides an MCP server that allows AI assistants to interact with Obsidian vaults, enabling reading/writing notes, managing metadata, searching content, and working with daily notes.37MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that wraps the Obsidian CLI to give AI assistants direct access to read, edit, and manage notes within an Obsidian vault. It enables advanced operations such as frontmatter property management, context-aware searching, and the execution of internal Obsidian commands.2MIT
- FlicenseBqualityNot gradedmaintenanceAn MCP server that enables AI assistants to access and manage your local Obsidian vault through a standardized protocol.142-
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server that enables AI assistants to securely read, create, and modify notes in an Obsidian vault, with support for semantic search and web scraping.MIT