obsidian-api-mcp
MCP server for Obsidian with full Canvas support.
Prerequisites
Required: Install the Local REST API plugin in Obsidian.
Install via BRAT:
- Install BRAT from Obsidian Community Plugins
- Add Beta plugin:
ArtiPyHeart/obsidian-local-rest-api - Enable the plugin and copy your API key from settings
Features
- Async architecture - Uses
httpx.AsyncClientfor non-blocking HTTP requests - Coarse-grained tools - 6 tools instead of 16+ to reduce context overhead
- Full Canvas support - Read, create, and modify Canvas nodes and edges
- Canvas search - Search results include Canvas text nodes with metadata
Installation
From PyPI (recommended)
# Using uvx (recommended)
uvx obsidian-api-mcp
# Or install with pip
pip install obsidian-api-mcp
From source
git clone https://github.com/ArtiPyHeart/obsidian-local-rest-api.git
cd obsidian-local-rest-api/mcp/obsidian-mcp
uv pip install -e .
Configuration
Set environment variables (or use a .env file):
| Variable | Description | Default |
|---|---|---|
OBSIDIAN_API_KEY |
API key from Local REST API plugin | (required) |
OBSIDIAN_HOST |
Obsidian host | 127.0.0.1 |
OBSIDIAN_PORT |
Obsidian port | 27123 |
OBSIDIAN_PROTOCOL |
Protocol (http or https) |
http |
OBSIDIAN_VERIFY_SSL |
Verify SSL certificates | false |
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"obsidian-api-mcp": {
"command": "uvx",
"args": ["obsidian-api-mcp"],
"env": {
"OBSIDIAN_API_KEY": "your-api-key",
"OBSIDIAN_HOST": "127.0.0.1",
"OBSIDIAN_PORT": "27123",
"OBSIDIAN_PROTOCOL": "http"
}
}
}
}
Tools
1. obsidian_files - File Operations
Unified file operations for the Obsidian vault.
Operations:
list- List files in a directory (usepath=""for root)get- Get content of a single filebatch_get- Get contents of multiple files concatenatedput- Create or overwrite a fileappend- Append content to a filedelete- Delete a file
{
"operation": "get",
"path": "notes/example.md"
}
2. obsidian_patch - Content Insertion
Insert content relative to a heading, block reference, or frontmatter field.
Target types:
heading- Target a heading path (use::as delimiter for nested headings)block- Target a block reference (without^prefix)frontmatter- Target a frontmatter field name
Operations: append, prepend, replace
Heading example (note: use full heading path):
{
"filepath": "note.md",
"target_type": "heading",
"target": "Main Title::Tasks",
"operation": "append",
"content": "\n- [ ] New task"
}
Frontmatter example:
{
"filepath": "note.md",
"target_type": "frontmatter",
"target": "status",
"operation": "replace",
"content": "published"
}
Block reference example:
{
"filepath": "note.md",
"target_type": "block",
"target": "my-block-id",
"operation": "append",
"content": "\nAdditional content"
}
3. obsidian_search - Search
Search for documents in the vault.
Query types:
simple- Text search across all files (including Canvas text nodes)complex- JsonLogic query for advanced filtering
{
"query_type": "simple",
"query": "project ideas",
"context_length": 100
}
{
"query_type": "complex",
"query": {"glob": ["*.md", {"var": "path"}]}
}
4. obsidian_periodic - Periodic Notes
Operations for periodic notes and recent changes.
Note: Requires Periodic Notes plugin for
get/recentoperations, and Dataview plugin forchangesoperation.
Operations:
config- Get periodic notes configuration (folders, formats, enabled status)get- Get current periodic note (daily/weekly/monthly/quarterly/yearly)recent- Get most recent periodic notes of a typechanges- Get recently modified files (requires Dataview plugin)
Get configuration:
{
"operation": "config"
}
Get current periodic note:
{
"operation": "get",
"period": "daily",
"include_metadata": true
}
Get recent periodic notes:
{
"operation": "recent",
"period": "daily",
"limit": 5,
"include_content": true
}
Get recently changed files:
{
"operation": "changes",
"limit": 10,
"days": 30
}
5. obsidian_canvas_read - Read Canvas
Get Canvas file structure and metadata.
{
"filepath": "my-canvas.canvas",
"include_metadata": true
}
6. obsidian_canvas_write - Modify Canvas
Add, update, or delete Canvas nodes and edges.
Target types:
node/edge- Single operations (requiresoperation)nodes/edges- Batch operations
Node types: text, file, link, group
Single node add:
{
"filepath": "my-canvas.canvas",
"target_type": "node",
"operation": "add",
"id": "node1",
"node_type": "text",
"x": 0,
"y": 0,
"width": 200,
"height": 100,
"text": "Hello World"
}
Single node update:
{
"filepath": "my-canvas.canvas",
"target_type": "node",
"operation": "update",
"id": "node1",
"text": "Updated text"
}
Single edge add:
{
"filepath": "my-canvas.canvas",
"target_type": "edge",
"operation": "add",
"id": "edge1",
"fromNode": "node1",
"toNode": "node2",
"fromSide": "right",
"toSide": "left"
}
Batch operations:
{
"filepath": "my-canvas.canvas",
"target_type": "nodes",
"add": [
{"id": "n1", "type": "text", "x": 0, "y": 0, "width": 200, "height": 100, "text": "Node 1"},
{"id": "n2", "type": "text", "x": 300, "y": 0, "width": 200, "height": 100, "text": "Node 2"}
],
"update": {
"existing_node_id": {"text": "Updated content"}
},
"delete": ["old_node_id"]
}
Requirements
- Python 3.11+
- Obsidian with Local REST API plugin installed
License
MIT
Metadata
Release files for obsidian-api-mcp 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| obsidian_api_mcp-0.1.5.tar.gz | 12.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| obsidian_api_mcp-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.6 kB
Release files / obsidian_api_mcp-0.1.5.tar.gz
| Download URL | obsidian_api_mcp-0.1.5.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5060a30a54e9f54cb85c0d7c54cd67d48116ce907beb7f2c707eb020cc17678a
|
|
BLAKE2b-256 checksum How to use checksums |
b09d1448d22d99ea98e3b251d1a9313d32f448e960d9eacee77de7dffc11234d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / obsidian_api_mcp-0.1.5-py3-none-any.whl
| Download URL | obsidian_api_mcp-0.1.5-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fc43c8280ad93dea4b29746da8f0ec487f15616936aea5e3f1af8f7a8fea719
|
|
BLAKE2b-256 checksum How to use checksums |
d1928b1a8ebea877f08d7558d965e36753cdce868c4722e149ac6f50308e6f95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for obsidian-api-mcp 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.