Skip to main content

Expose your Obsidian vault via REST API and streamable HTTP MCP server for AI tool access

Project description

obsidian-ai-miniserver

Makes your Obsidian vault accessible via REST API (OpenAPI) and a streamable HTTP MCP server. Enables AI to find, read, and edit text notes. Supports multiple users with token-based auth and path-level access control.

What's good about it

  • Works headless — runs without Obsidian present using just the raw vault files (unlike plugin-based solutions that require the full electron app to run).
  • Token-efficient — optimized tool signatures and docs to save tokens
  • Flexible tools — regex search across notes, batch requests, and more
  • AI-managed access — one AI can admin other AI's access with path-level permissions
  • Identical MCP and REST API — easy to build integrations against as well as connect AI

Quick start

pip install obsidian-ai-miniserver
obs_ai_ms start /path/to/vault --admin-token your_token

This starts both servers on their default ports. Connect your AI to the MCP endpoint or the REST API.

Options

Option Env Var Default Description
vault_path (required) Path to the Obsidian vault
--admin-token OBS_AI_MS_ADMIN_TOKEN (none) Auth token for the admin user
--openapi-port OBS_AI_MS_OPENAPI_PORT 8747 Port for the REST API server (-1 to disable)
--mcp-port OBS_AI_MS_MCP_PORT 8716 Port for the MCP server (-1 to disable)
--host OBS_AI_MS_HOST 127.0.0.1 Host to bind to. Use 0.0.0.0 to allow remote access

Persistence

Config is stored at .obsidian/obsidian_ai_miniserver.json inside the vault — user list with tokens and path access rules.

Headless deployment

Run headless in a Docker container with Obsidian Headless — no desktop app needed. The docker-compose.yaml is fully self-contained: it installs everything from the internet at startup.

You can paste it directly into a container platform like Coolify — just set the environment variables:

Env Var Description
OBSIDIAN_USERNAME Your Obsidian account email
OBSIDIAN_PASSWORD Your Obsidian account password
OBSIDIAN_VAULTNAME Name of your remote vault

Or via CLI:

OBSIDIAN_USERNAME=you@example.com OBSIDIAN_PASSWORD=secret OBSIDIAN_VAULTNAME="My Vault" docker compose up

API reference

See openapi.json for full request/response definitions.

All requests go to POST /api/obsidian with a kind field that discriminates the request type. Available kinds:

  • get_vault_info — vault name, daily notes folder, your user info
  • list_files — list files and folders at a path
  • read_text — read a note's text
  • write_text — overwrite a note
  • append_text — append to a note
  • replace_text — find and replace text in a note
  • move_file — move, copy, or delete a file
  • search_files — regex search across notes and text files with context snippets
  • batch — send multiple requests in one call
  • list_users / upsert_user — admin user management

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidian_ai_miniserver-0.2.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidian_ai_miniserver-0.2.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_ai_miniserver-0.2.1.tar.gz.

File metadata

  • Download URL: obsidian_ai_miniserver-0.2.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for obsidian_ai_miniserver-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c29043091959a6a0afa7264aaa49788dc1f2f1640d97b4ef48eb191e3f330cc9
MD5 69516ef467f72fc6650e82be6cfbe406
BLAKE2b-256 7392789755b67b050f8ba22924785fd4ad2429432cd25eb7113e366220e63f3d

See more details on using hashes here.

File details

Details for the file obsidian_ai_miniserver-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_ai_miniserver-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ba3524ffb9559877cdfac0f5b6b628403784271460f42d8afb60f3fbc5709c2
MD5 046dbe255058cc668f2f2ecf5c82615e
BLAKE2b-256 c846c630f9a3bfadad1c3e58f9506272a5f24d8eb16a9c58f9a49e7d375f45d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page