Skip to main content
Glama
pmmvr

Obsidian MCP Server

by pmmvr

Сервер Obsidian MCP

Сервер MCP (Model Context Protocol), который позволяет агентам ИИ выполнять сложный поиск и анализ знаний в вашем хранилище Obsidian с помощью плагина Local REST API.

Почему это важно

Этот сервер преобразует ваше хранилище Obsidian в мощную базу знаний для агентов ИИ, позволяя выполнять сложные многоэтапные рабочие процессы, такие как:

  • «Извлеките заметки из моей папки «Проекты/Планирование», содержащие в заголовках слова «дорожная карта» или «хронология», созданные после 1 апреля, затем проанализируйте их на предмет наличия блокировщиков или зависимостей и представьте консолидированную оценку рисков со ссылками на исходные заметки»

  • «Найдите все заметки с тегами «исследование» или «анализ» за последний месяц, просмотрите их содержимое на предмет незавершенных разделов или открытых вопросов, затем сравните с моими заметками «Команда/Экспертиза», чтобы предложить коллегам, которые могли бы помочь заполнить каждый пробел»

  • «Получить полное содержание заметок о встречах из «Руководства/Ежеквартально», содержащих «бюджет» или «численность персонала», проанализировать их на предмет пунктов действий, назначенных моему отделу, и создать хронологическую временную шкалу со ссылками на исходные заметки»

Расширенные возможности фильтрации сервера, поддержка регулярных выражений и полный поиск контента позволяют агентам выполнять тонкую работу по обработке знаний, на которую вручную ушли бы часы.

Related MCP server: Obsidian Local REST API MCP Server

Предпосылки

  1. Установите плагин Obsidian Local REST API в хранилище Obsidian

  2. Настройте и включите плагин в настройках Obsidian

  3. Запишите URL-адрес API (по умолчанию: https://localhost:27124 ) и ключ API, если вы его установили.

Установка

Из PyPI (рекомендуется)

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

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

Добавить в конфигурацию MCP

Добавьте в конфигурацию вашего клиента MCP (например, 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"
      }
    }
  }
}

Из источника (Разработка)

# 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 .

Конфигурация

Установите переменные среды для 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"

Важное примечание по безопасности : Избегайте жесткого кодирования OBSIDIAN_API_KEY непосредственно в скриптах или передачи его в систему контроля версий. Рассмотрите возможность использования файла .env (который включен в .gitignore этого проекта) и библиотеки, например python-dotenv для управления вашим ключом API или используйте переменные среды, управляемые вашей операционной системой или оболочкой.

Примечание : сервер по умолчанию использует HTTPS и отключает проверку сертификатов SSL для самоподписанных сертификатов, обычно используемых с локальными экземплярами Obsidian. Для HTTP-подключений установите OBSIDIAN_API_URL="http://localhost:27123" .

Использование

Запустите сервер MCP:

obsidian-mcp

Доступные инструменты

Сервер предоставляет три мощных инструмента:

  1. search_vault — Расширенный поиск с гибкими фильтрами и полным извлечением контента:

    • query — поиск текста или регулярного выражения по содержимому заметки (необязательно)

    • query_type - Тип поиска: «текст» (по умолчанию) или «регулярное выражение»

    • search_in_path — Ограничить поиск определенным путем к папке

    • title_contains — Фильтр по тексту в заголовках заметок (строка, массив или строка JSON)

    • title_match_mode — Как сопоставить несколько терминов: «любой» (ИЛИ) или «все» (И)

    • tag — фильтр по тегу (строка, массив или строка JSON — поиск по заголовкам и встроенным #тегам)

    • tag_match_mode — Как сопоставить несколько тегов: «любой» (ИЛИ) или «все» (И)

    • context_length — объем возвращаемого контента (установите высокое значение для полного контента)

    • include_content — логическое значение для извлечения полного содержимого всех соответствующих заметок.

    • created_since/until - Фильтр по дате создания

    • modified_since/until - Фильтр по дате изменения

    • page_size - Результаты на страницу

    • max_matches_per_file — ограничение совпадений на одну заметку

    Основные характеристики :

    • Если query не указан, автоматически возвращается полный контент для поиска только с фильтром.

    • include_content=True принудительно извлекает полный контент для любого поиска

    • Поддерживает шаблоны регулярных выражений для сложного сопоставления текста (условия ИЛИ, поиск без учета регистра и т. д.)

  2. get_note_content — Извлечь полное содержимое и метаданные определенной заметки по пути

  3. browse_vault_structure — эффективная навигация по структуре каталогов хранилища:

    • path — каталог для просмотра (по умолчанию — корень хранилища)

    • include_files — логическое значение для включения файлов (по умолчанию: False, только папки для скорости)

    • recursive - Булевский для просмотра всех вложенных каталогов

Примеры использования

Базовые поиски

  1. Найти заметки по названию в определенной папке:

    search_vault(
      search_in_path="Work/Projects/",
      title_contains="meeting"
    )
  2. Найти заметки с несколькими терминами в заголовках (логика ИЛИ):

    search_vault(
      title_contains=["foo", "bar", "fizz", "buzz"],
      title_match_mode="any"  # Default
    )
  3. Найти заметки со ВСЕМИ терминами заголовка (И логикой):

    search_vault(
      title_contains=["project", "2024"],
      title_match_mode="all"
    )
  4. Получить все последние заметки с полным содержанием:

    search_vault(
      modified_since="2025-05-20",
      include_content=True
    )
  5. Текстовый поиск с контекстом:

    search_vault(
      query="API documentation",
      search_in_path="Engineering/",
      context_length=500
    )
  6. Поиск по тегу:

    search_vault(
      tag="project"
    )
  7. Поиск регулярных выражений для условий OR:

    search_vault(
      query="foo|bar",
      query_type="regex",
      search_in_path="Projects/"
    )
  8. Поиск регулярных выражений для задач, назначенных конкретным людям:

    search_vault(
      query="(TODO|FIXME|ACTION).*@(alice|bob)",
      query_type="regex",
      search_in_path="Work/Meetings/"
    )

Расширенные многошаговые рабочие процессы

Эти примеры демонстрируют, как агенты могут объединять сложные задачи по обнаружению знаний:

  1. Стратегический анализ проекта:

    # Step 1: Get all project documentation
    search_vault(
      search_in_path="Projects/Infrastructure/",
      title_contains=["planning", "requirements", "architecture"],
      title_match_mode="any",
      include_content=True
    )
    
    # Step 2: Find related technical discussions
    search_vault(
      tag=["infrastructure", "technical-debt"],
      tag_match_mode="any",
      modified_since="2025-04-01",
      include_content=True
    )

    Затем агент может анализировать зависимости, выявлять риски и рекомендовать распределение ресурсов.

  2. Майнинг элементов действия встречи:

# Get all recent meeting notes with full content
search_vault(
  search_in_path="Meetings/",
  title_contains=["standup", "planning", "retrospective"],
  title_match_mode="any",
  created_since="2025-05-01",
  include_content=True
)

Агент сканирует контент на предмет элементов действий, извлекает задания и создает хронологическое отслеживание.

  1. Анализ пробелов в исследованиях:

# Find research notes with questions or gaps
search_vault(
  query="(TODO|QUESTION|INVESTIGATE|UNCLEAR)",
  query_type="regex",
  tag=["research", "analysis"],
  tag_match_mode="any",
  include_content=True
)

# Cross-reference with team expertise
search_vault(
  search_in_path="Team/",
  tag=["expertise", "skills"],
  tag_match_mode="any",
  include_content=True
)

Агент выявляет пробелы в знаниях и предлагает членов команды, которые могли бы помочь

  1. Исследование структуры хранилища:

# Quick organizational overview
browse_vault_structure(recursive=True)

# Deep dive into specific areas
browse_vault_structure(
  path="Projects/CurrentSprint/",
  include_files=True,
  recursive=True
)
  1. Картирование знаний на основе тегов:

# Find notes with multiple tags (AND logic)
search_vault(
  tag=["project", "urgent"],
  tag_match_mode="all",
  include_content=True
)

# Find notes with any relevant tags (OR logic)
search_vault(
  tag=["architecture", "design", "implementation"],
  tag_match_mode="any",
  modified_since="2025-04-15"
)

Разработка

# Install with test dependencies
uv pip install -e ".[test]"

# Run the server
python -m obsidian_mcp.server

# Run tests
uv run behave features/blackbox_tests.feature
# Or use the test runner
python run_tests.py

Лицензия

Данный проект лицензирован по лицензии MIT — подробности см. в файле LICENSE .

Available Tools

3 tools
browse_vault_structureA
Read-only
Browse vault directory structure.

Args:
    path: Path to browse from (defaults to vault root)
    include_files: Include files in listing (default: False, folders only)
    recursive: List nested contents recursively
ParametersJSON Schema
NameRequiredDescriptionDefault
include_filesNo
pathNo
recursiveNo

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and openWorldHint=false, indicating this is a safe read operation with deterministic results. The description adds valuable context about default behaviors (browsing from vault root, folders-only by default) and the recursive option, which goes beyond what annotations provide. No contradictions with annotations exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured: a clear purpose statement followed by a bullet-point style explanation of each parameter. Every sentence earns its place, with no wasted words. The information is front-loaded with the core purpose first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a directory browsing tool with 3 parameters, no output schema, and good annotations, the description covers the essential behavior and parameters adequately. However, it doesn't describe the return format (e.g., what structure is returned, error conditions), which would be helpful given the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description carries full burden for parameter meaning. It successfully explains all three parameters: 'path' (starting location with default), 'include_files' (files inclusion toggle with default), and 'recursive' (nested listing). This compensates well for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Browse') and resource ('vault directory structure'), making the purpose immediately understandable. It distinguishes from sibling tools like 'get_note_content' (which retrieves content) and 'search_vault' (which searches), but doesn't explicitly mention these distinctions in the description itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for exploring directory structure rather than retrieving content or searching, but doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_vault'. The parameter descriptions suggest default behaviors (folders only, non-recursive), which gives some contextual hints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_note_contentA
Read-only
Get the full content and metadata of a specific note by path.

Args:
    path: Full path to the note within the vault
ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint=true and openWorldHint=false, indicating a safe, read-only operation with a closed world. The description adds context by specifying 'full content and metadata,' which hints at the return format, but doesn't detail aspects like error handling, rate limits, or auth needs. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by a concise parameter explanation. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema), annotations cover safety, and the description adds parameter semantics and purpose. However, it lacks details on return values, error cases, or how it differs from siblings, leaving some gaps for an AI agent to infer usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 1 parameter, the description compensates by explaining 'path: Full path to the note within the vault,' adding meaning beyond the bare schema. It clarifies the parameter's purpose and format, though it could provide more examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the full content and metadata of a specific note by path.' It specifies the verb ('Get'), resource ('note'), and scope ('full content and metadata'), though it doesn't explicitly differentiate from sibling tools like 'browse_vault_structure' or 'search_vault' beyond the 'specific note by path' aspect.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'by path,' suggesting it's for retrieving a known note, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_vault' for unknown notes or 'browse_vault_structure' for exploring. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_vaultA
Read-only
Search Obsidian vault for notes matching criteria.

Args:
    query: Text or regex pattern to search for
    query_type: "text" or "regex" 
    search_in_path: Limit search to specific folder
    title_contains: Filter by title (string or array)
    title_match_mode: "any" or "all" for multiple title terms
    tag: Filter by tag (string, array, or JSON string like title_contains)
    tag_match_mode: "any" or "all" for multiple tag terms
    context_length: Characters of context around matches
    include_content: Return full note content
    modified_since/until: Filter by modification date (YYYY-MM-DD)
    created_since/until: Filter by creation date (YYYY-MM-DD)
    page_size/page: Pagination controls
    max_matches_per_file: Limit matches per file
ParametersJSON Schema
NameRequiredDescriptionDefault
context_lengthNo
created_sinceNo
created_untilNo
include_contentNo
max_matches_per_fileNo
modified_sinceNo
modified_untilNo
pageNo
page_sizeNo
queryNo
query_typeNotext
search_in_pathNo
tagNo
tag_match_modeNoany
title_containsNo
title_match_modeNoany

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=false, indicating this is a safe read operation with limited scope. The description adds useful context about what gets searched ('notes') and the types of criteria available, but doesn't disclose behavioral aspects like performance characteristics, rate limits, or error conditions. With annotations covering the safety profile, this earns a baseline score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by a comprehensive parameter list. Every sentence earns its place by providing essential information. It could be slightly more concise by grouping related parameters, but overall it's efficient and front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex search tool with 16 parameters and no output schema, the description does a good job explaining inputs but has gaps. It doesn't describe the return format (what the search results look like), error conditions, or performance considerations. The parameter explanations are excellent, but without output information or behavioral context, completeness is limited.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage (titles only, no descriptions), the description carries the full burden of explaining parameters. It provides detailed semantic information for all 16 parameters, including data types, formats, and usage examples (e.g., 'YYYY-MM-DD' for dates, 'text' or 'regex' for query_type). This fully compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search Obsidian vault for notes matching criteria.' This specifies the verb ('search'), resource ('Obsidian vault'), and target ('notes matching criteria'). However, it doesn't explicitly differentiate from sibling tools like 'browse_vault_structure' or 'get_note_content', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of sibling tools like 'browse_vault_structure' (for exploring structure) or 'get_note_content' (for retrieving specific note content), nor any context about when search is appropriate versus other approaches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedbrowse_vault_structure
    • First observedget_note_content
    • First observedsearch_vault

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: browse_vault_structure is for exploring the file hierarchy, get_note_content retrieves a specific note's details, and search_vault performs complex queries across the vault. There is no overlap in functionality, making it easy for an agent to select the right tool.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case: browse_vault_structure, get_note_content, and search_vault. The naming is predictable and readable, with no deviations in style or convention.

Tool Count3/5

With only 3 tools, the server feels thin for managing an Obsidian vault, which typically involves operations like creating, updating, or deleting notes. While the tools cover browsing, reading, and searching, the lack of write operations limits the scope, making it borderline for the domain.

Completeness2/5

The tool set is severely incomplete for an Obsidian vault management server. There are no tools for creating, updating, or deleting notes, which are core CRUD operations. This creates significant gaps that will likely cause agent failures when trying to perform basic note management tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers