Sponsored by Deepsite.site

Obsidian MCP

Created By
newtype-019 months ago
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.
Content

# Obsidian MCP (Model Context Protocol) 服务器

[English](./README.en.md) | 中文

这个项目实现了一个 Model Context Protocol (MCP) 服务器,用于连接 AI 模型与 Obsidian 知识库。通过这个服务器,AI 模型可以直接访问和操作 Obsidian 笔记,包括读取、创建、更新和删除笔记,以及管理文件夹结构。

功能特点

  • 与 Obsidian 知识库的无缝集成
  • 支持笔记的读取、创建、更新和删除
  • 支持文件夹的创建、重命名、移动和删除
  • 支持全文搜索功能
  • 符合 Model Context Protocol 规范

前提条件

  • Node.js (v16 或更高版本)
  • Obsidian 桌面应用
  • Obsidian Local REST API 插件 (需要在 Obsidian 中安装)

安装

  1. 克隆此仓库:

```bash git clone https://github.com/newtype-01/obsidian-mcp.git cd obsidian-mcp ```

  1. 安装依赖:

```bash npm install ```

  1. 构建项目:

```bash npm run build ```

配置

服务器通过环境变量进行配置:

  • `OBSIDIAN_VAULT_PATH`: Obsidian 知识库的路径
  • `OBSIDIAN_API_TOKEN`: Obsidian Local REST API 插件的 API 令牌
  • `OBSIDIAN_API_PORT`: Obsidian Local REST API 插件的端口号 (默认为 27123)

您可以通过以下方式设置环境变量:

  1. 复制 `.env.example` 文件为 `.env` 并编辑其中的值:

```bash cp .env.example .env ```

  1. 编辑 `.env` 文件,填入您的实际配置:

``` OBSIDIAN_VAULT_PATH=/path/to/your/vault OBSIDIAN_API_TOKEN=your_api_token_here OBSIDIAN_API_PORT=27123 ```

**注意:** `.env` 文件包含敏感信息,已被添加到 `.gitignore` 中,不会被提交到版本控制系统。

使用方法

  1. 确保 Obsidian 正在运行,并且已安装和配置了 Local REST API 插件

  2. 启动 MCP 服务器:

```bash npm start ```

  1. 服务器将通过标准输入/输出与 AI 模型通信

测试

项目包含一个测试脚本,用于验证服务器功能:

```bash node test-mcp.js ```

支持的工具

MCP 服务器提供以下工具:

  • `list_notes`: 列出知识库中的所有笔记
  • `read_note`: 读取指定笔记的内容
  • `create_note`: 创建新笔记
  • `update_note`: 更新现有笔记
  • `search_vault`: 在知识库中搜索内容
  • `delete_note`: 删除笔记
  • `manage_folder`: 管理文件夹 (创建、重命名、移动、删除)

开发

  • 使用 `npm run dev` 在开发模式下运行服务器
  • 源代码位于 `src` 目录中

许可证

ISC

贡献

欢迎提交 Pull Requests 和 Issues!

相关项目

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor