★ 2262 TypeScript MIT http 更新 10小时前

Obsidian Local Rest Api

A secure REST API and Model Context Protocol (MCP) server for your vault.

安装配置

{
    "mcpServers": {
        "obsidian": {
            "type": "http",
            "url": "https://127.0.0.1:27124/mcp/",
            "headers": {
                "Authorization": "Bearer <your-api-key>"
            }
        }
    }
}

README 摘要

# Local REST API & MCP Server Give your scripts, browser extensions, and AI agents a direct line into your Obsidian vault via a secure, authenticated REST API. **Interactive API docs:** https://coddingtonbear.github.io/obsidian-local-rest-api/ ## What you can do Access your vault through the **REST API** or the **built-in [MCP server](https://modelcontextprotocol.io/)** — both interfaces expose the same core capabilities, so scripts, browser extensions, and AI agents all speak the same language. - **Read, create, update, or delete notes** — full CRUD on any file in your vault, including binary files - **Surgically patch specific sections** — target a heading, block reference, or frontmatter key and append, prepend, or replace just that section without touching the rest of the file - **Search your vault** — simple full-text search or structured [JsonLogic](https://jsonlogic.com/) queries against note metadata (frontmatter, tags, path, content) - **Access the active file** — read or write whatever note is currently open in Obsidian - **Work with periodic notes** — get or create daily, weekly, monthly, quarterly, and yearly notes - **List and execute commands** — trigger any Obsidian command as if you'd used the command palette - **Query tags** — list all tags across your vault with usage counts - **Open files in Obsidian** — tell Obsidian to open a specific note in its UI - **Extend the API** — other plugins can register their own routes via the [API extension interface](https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Adding-your-own-API-Routes-via-an-Extension) All requests are served over HTTPS with a self-signed certificate and gated behind API key authentication. ## Quick start After installing and enabling the plugin, open **Settings → Local REST API** to find your API key and certificate. ### REST API ```sh # Check the server is running (no auth required) curl -k https://127.0.0.1:27124/ # List files at the root of your vault curl -k -H "Authorization: Bearer " \ https://127.0.0.1:27124/vault/ # Read a note curl -k -H "Authorization: Bearer " \ https://127.0.0.1:27124/vault/path/to/note.md # Read a specific heading (URL-embedded target) curl -k -H "Authorization: Bearer " \ https://127.0.0.1:27124/vault/path/to/note.md/heading/My%20Section # Append a line to a specific heading (PATCH with headers) curl -k -X PATCH \ -H "Authorization: Bearer " \ -H "Operation: append" \ -H "Target-Type: heading" \ -H "Target: My Section" \ -H "Content-Type: text/plain" \ --data "New line of content" \ https://127.0.0.1:27124/vault/path/to/note.md ``` To avoid certificate warnings, you can download and trust the certificate from `https://127.0.0.1:27124/obsidian-local-rest-api.crt`, or point your HTTP client at it directly. ### MCP clients The MCP server runs at `https://127.0.0.1:27124/mcp/` and requires that you provide your bearer token for authentication via an `Authorization` header (i.e. `Authorization: Bearer `). Because the plugin uses a self-signed certificate, you may need to either trust the certificate in your OS/client, or use the plain HTTP endpoint at `http://127.0.0.1:27123/mcp/` (enable it under **Settings → Local REST API → Enable HTTP server**). #### Claude Code Claude Code has native HTTP MCP support. The quickest way to add the server is via the CLI: ```sh claude mcp add --transport http obsidian https://127.0.0.1:27124/mcp/ \ --header "Authorization: Bearer " ``` Or add i...

相关 MCP

GitHub MCP Server

连接 GitHub 仓库、Issues、Pull Requests 和代码搜索的 MCP 服务,适合代码协作和项目问答。

★ 15800 TypeScript stdio 有配置
github code repository

Chrome

Chrome MCP Server is a Chrome extension-based Model Context Protocol (MCP) server that exposes your Chrome browser funct...

★ 11659 TypeScript sse 有配置
mcp sse TypeScript