Skip to main content
Glama

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

配置

变量

必填

默认值

描述

OBSIDIAN_API_KEY

来自 Local REST API 插件的 Bearer 令牌

OBSIDIAN_HOST

127.0.0.1

Obsidian REST API 监听的主机

OBSIDIAN_PORT

27123

REST API 的端口

OBSIDIAN_PROTOCOL

http

httphttps

PALACE_APPEND_DENY

/Context/,/System/,Index.md

以逗号分隔的路径,在这些路径下 append_note 被阻止

当通过 HTTPS 使用插件的自签名证书时,会自动跳过证书验证。

运行

通过 stdio 启动服务器(MCP 客户端的默认传输方式):

export OBSIDIAN_API_KEY="your-api-key"
uv run python server.py

或者通过 FastMCP:

uv run fastmcp run server.py

Cursor 配置

添加到你的 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 服务器。

工具

工具

描述

list_notes

列出文件和文件夹。传入子目录路径,或留空以表示仓库根目录。

read_note

按仓库相对路径读取笔记的完整内容(例如 People/Alice.md)。

write_note

创建新笔记或覆盖现有笔记。

append_note

将文本追加到笔记末尾。如果笔记不存在则创建它。

search_notes

全文搜索;返回按相关性排序的匹配文件名。

active_note

返回当前在 Obsidian 中打开的笔记内容。

delete_note

永久删除笔记。不可逆——请谨慎使用。

追加保护

某些仓库路径被视为 仅覆盖。向这些路径追加内容可能会在单个笔记中静默地堆叠重复内容,日后很难察觉。

默认情况下,append_note 会拒绝匹配以下路径的请求:

  • /Context/Context 文件夹下的任何笔记)

  • /System/System 文件夹下的任何笔记)

  • Index.md(任何名为 Index.md 的文件)

请改用 write_note 替换这些笔记。可通过 PALACE_APPEND_DENY 环境变量覆盖拒绝列表。

许可证

MIT

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Provides 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.
    36
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A 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.
    2
  • A
    license
    -
    quality
    D
    maintenance
    A 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.
    2,472
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only

  • An MCP server that gives your AI access to the source code and docs of all public github repos

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anis-meliti/palace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server