Skip to main content
Glama

MCP Obsidian

MCP 黑曜石

用于与Obsidian集成的模型上下文协议 (MCP)的服务器实现。这允许 AI 助手读取、创建和操作 Obsidian 库中的笔记。

特征

  • 读取 Obsidian 中的活动文件
  • 删除活动文件
  • 在特定位置插入内容(标题、块引用、前言)
  • 将内容附加到文件
  • 打开特定文件
  • 列出保管库中的文件
  • 搜索你的笔记

先决条件

  • Bun运行时
  • Obsidian桌面应用程序
  • 兼容MCP的AI助手

添加到光标

将您的机密放入 .env 文件中

选择命令 MCP 然后输入此命令

bun __REPO_PATH__/src/index.ts

安装

  1. 克隆此存储库:
    git clone https://github.com/gregkonush/mcp-obsidian.git cd mcp-obsidian
  2. 安装依赖项:
    bun install
  3. 复制示例环境文件并进行配置:
    cp .env.example .env

配置

使用您的特定配置编辑.env文件:

OBSIDIAN_BASE_URL=http://localhost:27123 OBSIDIAN_TOKEN=your_token_here DEBUG=false

用法

启动 MCP 服务器:

bun run src/index.ts

服务器将启动并通过标准 I/O 与 MCP 兼容的 AI 助手进行通信。

可用工具

此实现为AI助手提供了以下工具:

  • get_active_file - 返回当前活动文件的内容
  • delete_active_file - 删除当前活动文件
  • insert_active_file - 修改相对于标题、块引用或前置字段的内容
  • append_active_file - 将内容附加到活动文件的末尾
  • open_file - 在 Obsidian 中打开特定文件
  • search_simple - 搜索与文本查询匹配的文档
  • list_files - 列出你的 Vault 根目录中的文件
  • list_directory_files - 列出保管库特定目录中的文件

发展

项目结构

mcp-obsidian/ ├── src/ │ ├── index.ts # Main server implementation │ └── tools/ # Individual tool implementations │ ├── get-active-file.ts │ ├── delete-active-file.ts │ └── ... ├── .env # Environment configuration ├── package.json # Project dependencies └── tsconfig.json # TypeScript configuration

添加新工具

要添加新工具:

  1. src/tools/目录中创建一个新文件
  2. 使用 MCP SDK 实现该工具
  3. src/index.ts中导入并注册该工具

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE.md文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

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

local-only server

The server can only run on the client's local machine because it depends on local resources.

一种服务器实现,允许 AI 助手通过模型上下文协议读取、创建和操作 Obsidian 保险库中的注释。

  1. 特征
    1. 先决条件
      1. 添加到光标
        1. 安装
          1. 配置
            1. 用法
              1. 可用工具
                1. 发展
                  1. 项目结构
                  2. 添加新工具
                2. 执照
                  1. 贡献

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      Enables AI assistants to interact with Obsidian vaults, providing tools for reading, creating, editing and managing notes and tags.
                      Last updated -
                      598
                      149
                      TypeScript
                      MIT License
                      • Apple
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Provides a standardized interface for AI assistants to interact with Obsidian vaults through a local REST API, enabling reading, writing, searching, and managing notes.
                      Last updated -
                      37
                      TypeScript
                      MIT License
                    • -
                      security
                      F
                      license
                      -
                      quality
                      This project implements a Model Context Protocol (MCP) server for connecting AI models with Obsidian knowledge bases. Through this server, AI models can directly access and manipulate Obsidian notes, including reading, creating, updating, and deleting notes, as well as managing folder structures.
                      Last updated -
                      598
                      7
                      JavaScript
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that enables AI assistants to interact with the HackMD API for managing notes, including creating, reading, updating, and deleting notes.
                      Last updated -
                      12
                      122
                      21
                      TypeScript
                      MIT License

                    View all related MCP servers

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

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