PO

pmmvr/obsidian-api-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 3 forks 质量 65 趋势 0MIT

MCP服务器使AI代理能够在Obsidian vault中进行自然知识的发现和分析

概览

一个MCP(模型上下文协议)服务器,使AI代理能够通过本地REST API插件在你的Obsidian保险库中进行复杂的知识发现和分析。 该服务器将您的Obsidian保险库转变为强大的AI智能体知识库,支持复杂的多步骤工作流程,如: 服务器的高级过滤、正则表达式支持和完整的内容检索能力,使代理能够完成原本手工花费数小时的细致知识工作。 1. 在你的 Obsidian 保险库中安装 Obsidian 本地 REST API 插件 2.在 Obsidian 设置中配置并启用该插件 3.注意 API URL(默认:https://localhost:27124) 如果你设置了 API 密钥,请使用 添加到你的MCP客户端配置(例如,Claude Desktop): 为 Obsidian API 设置环境变量: 避免直接将OBSIDIAN_API_KEY硬编码到脚本中或提交到版本控制中。考虑使用.env文件(包含在.env文件中)。

概述(AI 翻译)

一个MCP(模型上下文协议)服务器,使AI代理能够通过本地REST API插件在你的Obsidian保险库中进行复杂的知识发现和分析。

为什么这很重要

该服务器将您的Obsidian保险库转变为强大的AI智能体知识库,支持复杂的多步骤工作流程,如:

  • “从我的’Projects/Planning’文件夹中检索包含’路线图’或’时间线’标题的笔记,这些笔记是在4月1日之后创建的,然后分析是否有障碍或依赖,并提交一份包含源注释参考的综合风险评估”

  • “查找过去一个月所有标有’研究’或’分析’标签的笔记,扫描内容是否有不完整或未解问题,然后与我的’团队/专长’笔记交叉比对,建议哪些同事能帮助弥补每个空白”

  • “获取’领导/季度’会议记录的完整内容,包含’预算’或’人数统计’,分析分配给我部门的行动事项,并创建带有来源说明的时间线”

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Obsidian MCP Server

An MCP (Model Context Protocol) server that enables AI agents to perform sophisticated knowledge discovery and analysis across your Obsidian vault through the Local REST API plugin.

Why This Matters

This server transforms your Obsidian vault into a powerful knowledge base for AI agents, enabling complex multi-step workflows like:

  • “Retrieve notes from my ‘Projects/Planning’ folder containing ‘roadmap’ or ‘timeline’ in titles, created after April 1st, then analyze them for any blockers or dependencies and present a consolidated risk assessment with references to the source notes”

  • “Find all notes tagged with ‘research’ or ‘analysis’ from the last month, scan their content for incomplete sections or open questions, then cross-reference with my ‘Team/Expertise’ notes to suggest which colleagues could help address each gap”

  • “Get the complete content of meeting notes from ‘Leadership/Quarterly’ containing ‘budget’ or ‘headcount’, analyze them for action items assigned to my department, and create a chronological timeline with source note references”

The server’s advanced filtering, regex support, and full content retrieval capabilities allow agents to perform nuanced knowledge work that would take hours manually.

Prerequisites

  1. Install the Obsidian Local REST API plugin in your Obsidian vault
  2. Configure and enable the plugin in Obsidian settings
  3. Note the API URL (default: https://localhost:27124) and API key if you’ve set one

Installation

# Install from PyPI
pip install obsidian-api-mcp-server

# Or with uv
uv pip install obsidian-api-mcp-server

Add to MCP Configuration

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "obsidian-api-mcp-server": {
      "command": "uvx",
      "args": [
        "--from",
        "obsidian-api-mcp-server>=1.0.1",
        "obsidian-api-mcp"
      ],
      "env": {
        "OBSIDIAN_API_URL": "https://localhost:27124",
        "OBSIDIAN_API_KEY": "your-api-key-here"
      }
    }
  }
}

From Source (Development)

# Clone the repository
git clone https://github.com/pmmvr/obsidian-api-mcp-server
cd obsidian-api-mcp-server

# Install with uv
uv pip install -e .

# Or with pip
pip install -e .

Configuration

Set environment variables for the Obsidian API:

# Required: Obsidian API URL (HTTPS by default)
export OBSIDIAN_API_URL="https://localhost:27124"  # Default

# Optional: API key if you've configured authentication
export OBSIDIAN_API_KEY="your-api-key-here"
在 GitHub 查看完整 README

安装

uvx --from obsidian-api-mcp-server>=1.0.1 obsidian-api-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "obsidian-api-mcp-server": { "command": "uvx", "args": [ "--from", "obsidian-api-mcp-server>=1.0.1", "obsidian-api-mcp" ], "env": { "OBSIDIAN_API_URL": "https://localhost:27124", "OBSIDIAN_API_KEY": "your-api-key-here" } } } }