Skip to main content
Glama

Obsidian MCP REST 服务器

一个 MCP(模型上下文协议)服务器实现,可通过本地 REST API 访问 Obsidian 保险库。该服务器允许 AI 助手通过标准化界面与 Obsidian 笔记进行交互并管理保险库内容。

特征

  • 通过 MCP 访问 Obsidian 保险库内容

  • 阅读和写笔记

  • 列出保管库内容

  • 搜索功能

  • 安全的本地 REST API 集成

  • 兼容 Claude Desktop 和其他 AI 助手

Related MCP server: MCP Obsidian

先决条件

  • Node.js 16 或更高版本

  • 安装并配置了本地 REST API 插件的 Obsidian

  • 启用了本地 REST API 的 Obsidian 保险库

安装

全局安装包:

npm install -g PublikPrinciple/obsidian-mcp-rest

或者如果您更喜欢使用特定版本/分支:

npm install -g PublikPrinciple/obsidian-mcp-rest#main

配置

  1. 首先,配置 Obsidian Local REST API 插件:

    • 在 Obsidian 中安装本地 REST API 插件

    • 配置API端口(默认值:27123)

    • 生成并保存 API 密钥

  2. 创建配置文件config.json

{ "obsidian": { "apiKey": "your-api-key-here", "port": 27123, "host": "localhost" }, "server": { "name": "obsidian-mcp", "version": "1.0.0" } }

用法

  1. 启动服务器:

obsidian-mcp-rest --config path/to/config.json
  1. 服务器将启动并通过 stdin/stdout 监听 MCP 请求。

与 Claude Desktop 一起使用

  1. 配置 Claude Desktop 以使用此 MCP 服务器:

    • 打开 Claude 桌面设置

    • 导航至 MCP 部分

    • 添加新的服务器配置:

      { "name": "obsidian-mcp", "command": "obsidian-mcp-rest", "args": ["--config", "path/to/config.json"] }
  2. 克劳德现在可以通过以下命令访问你的 Obsidian 保险库:

    Read note "Projects/MyProject.md" List all notes in "Projects" folder Search for notes containing "typescript"

可用工具

  • listNotes :列出保管库或特定文件夹中的所有注释

  • readNote :阅读特定注释的内容

  • writeNote :创建或更新注释

  • searchNotes :使用查询字符串搜索笔记

  • getMetadata :获取特定笔记的元数据

安全

  • 服务器仅在本地运行并通过 stdin/stdout 进行通信

  • 所有对 Obsidian REST API 的请求均通过您的 API 密钥进行身份验证

  • 无需外部网络访问

  • 数据保留在您的机器本地

发展

  1. 克隆存储库:

git clone https://github.com/PublikPrinciple/obsidian-mcp-rest.git cd obsidian-mcp-rest
  1. 安装依赖项:

npm install
  1. 构建项目:

npm run build
  1. 运行测试:

npm test

故障排除

安装问题

如果您遇到任何安装问题,请尝试以下替代方法:

  1. 克隆并本地安装:

git clone https://github.com/PublikPrinciple/obsidian-mcp-rest.git cd obsidian-mcp-rest npm install npm run build npm install -g .
  1. 如果您看到与 TypeScript 相关的错误,请确保 TypeScript 已全局安装:

npm install -g typescript

贡献

欢迎贡献代码!欢迎提交 Pull 请求。对于重大变更,请先提交一个 issue 来讨论您想要修改的内容。

执照

MIT 许可证 - 详情请参阅许可证文件

-
security - not tested
A
license - permissive license
-
quality - not tested

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/PublikPrinciple/obsidian-mcp-rest'

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