obsidian-cli-rest
by dsebastien·★ 14·综合分 42
将 Obsidian CLI 命令转换为 HTTP API 和 MCP 服务器,实现自动化和 AI 助手集成。
概述
这个插件将 Obsidian 的命令行界面转换为可通过 REST 端点和 MCP 协议访问的程序化 API。它暴露了几乎所有 Obsidian CLI 命令,按文件、搜索、属性、日记、任务等类别组织。服务器本地运行,使用 API 密钥认证,并可配置为网络访问。其 MCP 实现采用'代码模式',仅使用两个工具(搜索和执行)就能逐步发现所有命令,不受命令数量限制。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
如果你需要以编程方式控制你的 Obsidian 笔记本或通过 MCP 连接 AI 助手与你的笔记交互,请选择它。
什么时候不要选它
如果你需要访问 Obsidian 的 GUI 功能,或者担心通过 API 暴露你的笔记本可能带来的安全风险,不要选择它。
此 server 暴露的工具
从 README 抽取出 12 个工具searchDiscover commands by name, description, or category
executeRun any CLI command by name
filesList files in your vault
createCreate new notes
readRead content of existing notes
appendAdd content to the end of notes
property:setSet frontmatter properties in notes
daily:readRead today's daily note
tagsList tags and get tag information
tasksList and manage tasks
pluginsList, install, enable, disable, and uninstall plugins
templatesList, read, and insert templates
可对比工具
安装
安装
- 在 Obsidian 中,进入 **设置 → 社区插件**
- 如已启用,请禁用**限制模式**
- 搜索 **REST and MCP server**,安装并启用它
Claude Desktop 配置
添加到您的 claude_desktop_config.json 中:
{
"mcpServers": {
"obsidian": {
"command": "http",
"args": ["http://127.0.0.1:27124/mcp"],
"env": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}配置
- 从 **设置 > REST and MCP server > 安全** 复制您的 API 密钥
- 服务器会自动在端口 27124 启动
FAQ
- 这个插件对网络访问是否安全?
- 默认情况下它仅在本地主机上运行。如需网络访问,您可以在设置中将绑定地址更改为 0.0.0.0,但始终需要 API 密钥。危险命令默认被阻止。
- 暴露了多少个 MCP 工具?
- 无论 CLI 命令有多少个,只暴露两个工具:'search' 用于发现命令,'execute' 用于执行它们。这遵循了'代码模式'以实现高效发现。
obsidian-cli-rest 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。