Alberto Rosentiehl72 downloadsSecure local bridge for the A2RG Obsidian MCP server.
A2RG MCP Bridge connects MCP clients to an open Obsidian vault through a local desktop plugin. It exposes eight vault tools through Streamable HTTP MCP and keeps an optional Bun stdio process for filesystem fallback.
Current release: 1.0.13.
mcp-vault-connector: reads and writes the active vault
through Obsidian APIs and exposes a loopback HTTP or HTTPS server.dist/a2rg-obsidian-mcp: optional stdio fallback for
filesystem access when Obsidian or the plugin bridge is unavailable.@a2rg/obsidian-mcp: Node stdio executable for
plugin-first access and automatic filesystem fallback.MCP client
-> Streamable HTTP /mcp
-> authenticated local plugin bridge
-> App.vault / App.metadataCache / App.workspace
Local HTTPS is the default. Plain HTTP is blocked unless explicitly enabled for trusted loopback testing.
Install dependencies and build:
npm install
npm run build
Copy manifest.json and main.js into:
<vault>/.obsidian/plugins/mcp-vault-connector/
Enable A2RG MCP Bridge in Obsidian Community Plugins.
In plugin settings:
27125 unless a conflict requires another port.Configure the MCP client:
{
"mcpServers": {
"obsidian": {
"type": "http",
"url": "https://127.0.0.1:27125/mcp",
"headers": {
"Authorization": "Bearer <64-character-plugin-token>"
}
}
}
}
Direct HTTPS uses https://127.0.0.1:27125/mcp. Trust the plugin certificate
before connecting. The certificate and private key persist across Obsidian
reloads and restarts. Use Regenerate local TLS certificate in plugin
settings only when you intentionally replace that identity.
Direct HTTPS MCP does not require OBSIDIAN_VAULT_PATH, OBSIDIAN_CONFIG_DIR,
OBSIDIAN_API_KEY, OBSIDIAN_API_URL, a command, or an executable path.
The provider needs only the MCP URL and the bearer token.
The plugin starts a server only on 127.0.0.1 (localhost). It does not expose
the vault to the public internet, send vault content to a remote service,
collect telemetry, or include dynamic advertising.
The plugin enumerates vault file paths only to implement list_files and
search_vault. It returns relative paths and matching snippets after bearer
authentication, skips hidden directories and symlinks, and rejects absolute or
traversal paths.
Every /mcp and REST request requires a generated bearer token. HTTP requires
an explicit testing-only opt-in; HTTPS is recommended. The optional npm
stdio package can access only the discovered local vault when the bridge is
unavailable, and does not provide a public network endpoint.
curl --fail --silent \
--cacert /absolute/path/to/localhost.pem \
-H "Authorization: Bearer <64-character-plugin-token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
--data '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
https://127.0.0.1:27125/mcp
The server exposes:
get_filewrite_fileappend_filedelete_filesearch_vaultget_linked_noteslist_filesget_active_fileThe stdio executable remains available when Obsidian or the plugin bridge is unavailable. It can discover the vault and plugin settings automatically. Environment variables remain available for overrides.
Run the public npm package without a global install:
npx -y @a2rg/obsidian-mcp
Or install it with npm/pnpm:
npm install -g @a2rg/obsidian-mcp
# or
pnpm add -g @a2rg/obsidian-mcp
With pnpm without a global install:
pnpm dlx @a2rg/obsidian-mcp --discover
pnpm dlx @a2rg/obsidian-mcp
Discovery can be checked without starting MCP:
npx -y @a2rg/obsidian-mcp --discover
The package:
4xx/5xx responses.See npm and pnpm Package for MCP client configuration, auto-discovery, CLI flags, cache behavior, and publication.
npm test
npm run dev:mcp
npm run dev:plugin
npm run build:npm
npm run build
Run synthetic search benchmarks:
npm run benchmark:search -- 1000
npm run benchmark:search -- 10000
npm run benchmark:search -- 100000
The reproducible synthetic benchmark uses 10 relevance sets, known expected documents, and the same BM25 implementation used by the plugin and npm package.
| Scale | Initial indexing | Cold query | Warm query | Incremental 1000 | Heap / RSS |
|---|---|---|---|---|---|
| 1,000 documents | 166.8 ms | 4.885 ms | 3.959 ms | 112.1 ms | 17.7 MB / 85.9 MB |
| 10,000 documents | 806 ms | 217.063 ms | 225.786 ms | 83.3 ms | 74.3 MB / 171.5 MB |
| 100,000 documents | 9.502 s | 145.967 ms | 130.562 ms | 113.2 ms | 354.3 MB / 764.4 MB |
Measured metrics:
1.01.01.04.668 MB29 tests passingThe benchmark proves indexed-search behavior and incremental updates, not semantic similarity from embeddings. It is useful for comparing future search implementations against a reproducible baseline.
Field-aware BM25 weights title/H1, headings, tags, and frontmatter above unstructured content while preserving exact and filename matches.
npm test runs the Bun test suite. npm run build type-checks both targets,
bundles main.js, and compiles dist/a2rg-obsidian-mcp.
Plugin releases use .github/workflows/release.yml.
manifest.json, package.json, package-lock.json, and
versions.json to the same version.npm test and npm run build.manifest.json.version; do not
prefix it with v.main.js and manifest.json..github/workflows/npm-publish.yml to publish the npm CLI.127.0.0.1./mcp and REST request requires the bearer token.. / .. path segments are rejected.Read Security and Public Deployment before changing this local-only deployment model.