Obsidian MCP Server
Cho phép agent AI của bạn đọc, ghi, tìm và sửa ghi chú, thẻ và frontmatter trong kho Obsidian của bạn.
702 sao trên GitHubbởi cyanheadsGiấy phép Apache-2.0Cập nhật 23 ngày trước
Cách cài đặt
MCP này chạy cục bộ: nó chạy trên máy tính của bạn.
Nó hoạt động trong các ứng dụng cài trên máy (Claude Desktop, Claude Code, Cursor, VS Code…). Hãy chọn ứng dụng của bạn:
Dán vào terminal:
claude mcp add obsidian -e OBSIDIAN_API_KEY="<giá trị của bạn>" -- npx -y obsidian-mcp-server
Những gì cần điền
| Tên | Mô tả | Bắt buộc |
|---|---|---|
OBSIDIAN_API_KEY | Bearer token for the Obsidian Local REST API plugin (Settings → Community Plugins → Local REST API). | Có |
OBSIDIAN_BASE_URL | Base URL of the Obsidian Local REST API. Default: http://127.0.0.1:27123 (enable "Non-encrypted (HTTP) Server" in plugin settings). Use https://127.0.0.1:27124 for the always-on HTTPS port (self-signed cert; pair with OBSIDIAN_VERIFY_SSL=false). | Không |
OBSIDIAN_VERIFY_SSL | Whether to verify the TLS certificate on the Obsidian endpoint. Default false because the plugin uses a self-signed cert. | Không |
OBSIDIAN_REQUEST_TIMEOUT_MS | Per-request timeout in milliseconds. | Không |
OBSIDIAN_ENABLE_COMMANDS | Opt-in flag for the command-palette pair (obsidian_list_commands + obsidian_execute_command). Off by default — Obsidian commands are opaque and can be destructive. | Không |
OBSIDIAN_READ_PATHS | Optional comma-separated vault-relative folder allowlist for reads. Prefix-based with implicit recursion; case-insensitive; backslashes read as slashes, repeated and trailing slashes and '.' segments dropped, and names normalized to Unicode NFC; an entry naming the vault root ('.') is rejected at startup. Unset = full vault. Write paths are implicitly readable. Example: 'public/,projects/'. | Không |
OBSIDIAN_WRITE_PATHS | Optional comma-separated vault-relative folder allowlist for writes. Same syntax as OBSIDIAN_READ_PATHS. Unset = full vault, or the read scope when reads are restricted; paths in OBSIDIAN_DENY_PATHS stay denied. Example: 'projects/,scratch/'. | Không |
OBSIDIAN_DENY_PATHS | Optional comma-separated vault-relative paths withheld from reads and writes. Same syntax as OBSIDIAN_READ_PATHS. Wins over both allowlists; denied paths are left out of listings, search results, and tag counts. Unset = nothing denied. Example: 'private/,journal/therapy/'. | Không |
OBSIDIAN_READ_ONLY | Global read-only kill switch. When true, every write is denied regardless of OBSIDIAN_WRITE_PATHS, and the command-palette pair is suppressed (commands can mutate). Useful for shared or public-facing deployments. | Không |
OBSIDIAN_DELETE_ELICITATION | Opt-in delete confirmation. When true, obsidian_delete_note asks the user to confirm each delete through an elicitation round (the client must support elicitation), and HTTP startup requires a stateful session unless OBSIDIAN_READ_ONLY=true disables the tool. Off by default — the delete runs on the first call, bounded by OBSIDIAN_WRITE_PATHS and OBSIDIAN_READ_ONLY. | Không |
OBSIDIAN_OMNISEARCH_URL | Override URL for the Omnisearch plugin HTTP server. Unset derives from OBSIDIAN_BASE_URL host with port 51361. Required only if the Omnisearch plugin is not on the default port. | Không |
MCP_LOG_LEVEL | Sets the minimum log level for output (e.g., 'debug', 'info', 'warn'). | Không |
Xong rồi! Giờ hãy thử
Khởi động lại ứng dụng và dán một trong các yêu cầu này vào khung chat:
Thêm việc cần làm hôm nay vào dưới tiêu đề Tasks của ghi chú hằng ngày của tôi.
Liệt kê các thẻ tôi dùng nhiều nhất.
Đây là gì
Máy chủ này kết nối agent với kho Obsidian của bạn qua plugin Local REST API. Agent có thể đọc và tìm ghi chú, tạo hoặc sửa chúng, thay đổi một tiêu đề, khối hoặc trường frontmatter tại chỗ, và quản lý thẻ. Bạn có thể giới hạn thư mục nào nó được đọc hoặc ghi.
Nó làm được gì
obsidian_get_note: đọc một ghi chúobsidian_search_notes: tìm theo văn bản, JSONLogic hoặc Omnisearchobsidian_write_note: tạo hoặc thay thế một ghi chú hoặc một mụcobsidian_append_to_notevàobsidian_patch_note: thêm nội dung vào một tiêu đề hoặc trườngobsidian_replace_in_note: tìm và thay thế trong ghi chúobsidian_manage_frontmattervàobsidian_manage_tags: sửa frontmatter và thẻobsidian_list_notesvàobsidian_list_tags: duyệt kho
Khi nào nên dùng
- ›Khi bạn muốn agent thêm ghi chú cuộc họp dưới đúng tiêu đề.
- ›Khi bạn muốn gắn thẻ hoặc tìm nhiều ghi chú cùng lúc.
- ›Khi bạn muốn cập nhật ghi chú hằng ngày hoặc định kỳ.
Bạn cần gì
Skill đi kèm tốt
MCP hay skill?
MCP cho agent đôi tay. Skill dạy cách dùng đôi tay đó đúng cách. Kết hợp lại, kết quả tốt hơn và tốn ít token hơn.
obsidianGiúp agent của bạn đọc, tìm, tạo và sửa ghi chú trong kho Obsidian, bao gồm thêm liên kết giữa các ghi chú.cli-anything-obsidianGiúp agent của bạn đọc, tạo, cập nhật, tìm kiếm và thêm nội dung vào ghi chú trong kho Obsidian qua plugin Local REST API.obsidianGiúp agent của bạn đọc, tìm, tạo, sửa và sắp xếp ghi chú trong kho Obsidian (vault), gồm tác vụ, liên kết và thuộc tính.Câu hỏi thường gặp
Nó có miễn phí và mã nguồn mở không?
Nó có tệp giấy phép trong kho mã và không có giá được liệt kê.
Nó cần plugin nào?
Plugin Obsidian Local REST API.
Tôi có thể giới hạn những gì nó chạm vào không?
Có. OBSIDIAN_READ_PATHS, OBSIDIAN_WRITE_PATHS, OBSIDIAN_DENY_PATHS và OBSIDIAN_READ_ONLY đặt giới hạn.
Nó có xóa được ghi chú không?
Có, và mặc định không cần xác nhận. Đặt OBSIDIAN_DELETE_ELICITATION=true để yêu cầu bạn xác nhận.
Nó có chạy được lệnh Obsidian không?
Chỉ khi bạn bật OBSIDIAN_ENABLE_COMMANDS.
Nó hỗ trợ những transport nào?
STDIO hoặc Streamable HTTP.
Nếu không hoạt động
- ›Kiểm tra Obsidian đang mở và plugin Local REST API đã bật.
- ›Kiểm tra OBSIDIAN_API_KEY khớp với khóa trong cài đặt plugin.
- ›Đọc tài nguyên obsidian://status để kiểm tra plugin có truy cập được và xác thực đúng không.
5 skill mới mỗi tuần. Đọc chỉ 1 phút.