# Obsidian MCP Server: Setup for Claude, Cursor & Codex (2026)
> Connect Obsidian to Claude, Cursor, Codex or OpenCode over MCP. Built-in server setup, all 20 tools, security limits and four alternatives compared.
Canonical: https://www.mcpfolio.com/articles/obsidian-mcp-server
Last updated: 2026-11-18
## Short answer: use the plugin's built-in Obsidian MCP server

Obsidian has no first-party MCP server. The community [Local REST API plugin](https://www.mcpfolio.com/servers/obsidian-local-rest-api-mcp) includes a built-in one that runs inside Obsidian at https://127.0.0.1:27124/mcp/, and the plugin's maintainer now says separate third-party servers are no longer necessary. For most people it is the right choice.

We checked every command and setting in this guide against the maintainers' documentation. We did not run them against a live vault, so try a throwaway vault first.

[Claude Code](https://www.mcpfolio.com/articles/obsidian-mcp-server#claude-code) · [Claude Desktop](https://www.mcpfolio.com/articles/obsidian-mcp-server#claude-desktop) · [Cursor](https://www.mcpfolio.com/articles/obsidian-mcp-server#cursor) · [Codex](https://www.mcpfolio.com/articles/obsidian-mcp-server#codex)



- Obsidian stays open and you want live search, the active file, tags and commands: use the built-in server from the plugin.

- Obsidian is closed, or you do not want a plugin: use MCPVault, which reads the vault folder directly.

- You want folder allowlists or a read-only mode: use cyanheads' obsidian-mcp-server on top of the plugin.

- You already run mcp-obsidian: it exposes 7 tools against the built-in server's 20, and its README pins the Python mcp package below 2.0.

## How the Obsidian MCP connection works

The plugin starts a local server inside Obsidian. Your AI client connects to it over Streamable HTTP and authenticates with an API key sent as a bearer token. HTTPS runs on port 27124 with a certificate the plugin generates itself. An optional plain HTTP endpoint runs on port 27123 once you enable it in the plugin settings.

Because the server lives inside Obsidian, the built-in route only works while Obsidian is open. That is the trade for live access to metadata, the active file and the command palette.

Clients that run on your own machine can reach 127.0.0.1. Hosted clients cannot. Claude's custom connectors, for example, expect an HTTPS server URL, and third-party documentation reports that they cannot reach localhost. For a local vault, use a local client such as Claude Code, Cursor or Codex, or a bridge.

## Set up the built-in Obsidian MCP server

The steps are the same for every client. Only the last step, the client configuration, changes.



1. In Obsidian, open Settings → Community plugins, search for Local REST API, then install and enable it.

2. Open Settings → Local REST API and copy the API key. Treat it like a password: anyone who has it can read and write your vault.

3. Handle the certificate. Download the plugin's certificate authority from https://127.0.0.1:27124/obsidian-local-rest-api.crt and trust it in your OS or client. Or turn on Settings → Local REST API → Enable HTTP server and use http://127.0.0.1:27123/mcp/ instead.

4. Add the server to your client with the configuration below, restart the client, and ask it to list the files in your vault root.

## Client configuration: Claude Code, Claude Desktop, Cursor, Codex, OpenCode

Any client that supports Streamable HTTP with a custom Authorization header can connect. Replace <your-api-key> with the key from the plugin settings, and prefer an environment variable or a user-scoped config over a project file you commit.

Claude Desktop does not natively support remote HTTP servers, so the plugin's README bridges it with mcp-remote, which needs Node.js. The Codex and OpenCode examples are built from those tools' documented remote-server fields and use the HTTP endpoint so you do not have to trust the certificate. OpenCode's configuration format has changed between versions, so check yours.

**Claude Code (command)**

```
claude mcp add --transport http obsidian https://127.0.0.1:27124/mcp/ \
  --header "Authorization: Bearer <your-api-key>"
```

**Claude Code (.mcp.json)**

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

**Claude Desktop (claude_desktop_config.json, via mcp-remote)**

```
{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": [
        "mcp-remote@latest",
        "https://127.0.0.1:27124/mcp/",
        "--header",
        "Authorization: Bearer <your-api-key>"
      ]
    }
  }
}
```

**Cursor (~/.cursor/mcp.json or .cursor/mcp.json)**

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

**Codex (~/.codex/config.toml, HTTP endpoint; export OBSIDIAN_API_KEY first)**

```
[mcp_servers.obsidian]
url = "http://127.0.0.1:27123/mcp/"
bearer_token_env_var = "OBSIDIAN_API_KEY"
```

**OpenCode (opencode.jsonc, HTTP endpoint; export OBSIDIAN_API_KEY first)**

```
{
  "mcp": {
    "servers": {
      "obsidian": {
        "type": "remote",
        "url": "http://127.0.0.1:27123/mcp/",
        "oauth": false,
        "headers": { "Authorization": "Bearer {env:OBSIDIAN_API_KEY}" }
      }
    }
  }
}
```

## What to ask Claude once Obsidian is connected

Each request below maps to documented built-in tools, so you can see what the agent is about to do before you approve it.



- "Find my notes about a topic." search_simple finds the matches, then vault_read opens the best ones.

- "Summarize the note I have open." active_file_get_path returns the open note and vault_read reads it.

- "List every note tagged #project." tag_list shows the tags, and search_query filters notes by tag or frontmatter with a JsonLogic query.

- "Add this under the Decisions heading in my meeting note." vault_patch edits one heading without rewriting the rest of the file.

- "Move the finished notes into Archive." vault_move relocates files, and vault_delete sends files to the trash by default.

- Approve write tools one at a time at first. Reads are low risk, but vault_write can overwrite a note and command_execute can run any Obsidian command.

## All 20 built-in Obsidian MCP tools

The built-in server exposes 20 tools, listed in the plugin's README. Write tools accept an ifMatch version check, so an agent cannot silently overwrite a note that changed after it read it; vault_read returns the version to use.

search_simple returns at most 20 files and 10 matches per file unless the call raises maxResults or maxMatchesPerFile. That limit keeps a broad search from flooding the model's context.

| Tool | What it does | Notes |
| --- | --- | --- |
| vault_list | Lists files and folders in a vault directory | Read |
| vault_read | Reads a text note with its frontmatter, tags and stats | Read; returns the version for ifMatch |
| vault_read_binary | Reads an attachment; images come back as viewable image blocks | Read |
| vault_get_document_map | Lists the headings, block references and frontmatter fields in a file | Read |
| active_file_get_path | Returns the path of the note open in Obsidian | Read |
| search_simple | Full-text search with Obsidian's built-in search | Read; capped by default |
| search_query | Searches note metadata with a JsonLogic query | Read |
| tag_list | Lists every tag with its usage count | Read |
| vault_write | Creates or overwrites a text file | Write; can overwrite |
| vault_append | Appends content to the end of a file | Write |
| vault_patch | Patches one heading, block reference or frontmatter field | Write |
| vault_delete | Deletes a file | Write; moves to trash by default |
| vault_move | Moves or renames a file | Write |
| vault_copy | Copies a file to a new path | Write |
| command_list | Lists the registered Obsidian commands | Read |
| command_execute | Runs an Obsidian command by ID | Can do anything the command does; review before approving |
| open_file | Opens a file in the Obsidian interface | Interface only |
| vault_get_download_url | Creates a signed, expiring download link that works without the API key | Only when signed URLs are enabled |
| vault_get_upload_url | Creates a signed, single-use upload link | Only when signed URLs are enabled |
| events_get_listener_url | Subscribes to an Obsidian event and returns a signed event-stream link | Only when signed URLs are enabled |

## Obsidian MCP security: what an agent can reach

The API key grants the same access as the plugin, which is your whole vault. Protect it, and decide which tools your client may call without asking. The folder restriction below follows a published security advisory (GHSA-66m9-r757-qvq7), so keep the plugin up to date.



- The config folder is blocked. The plugin refuses to read or write anything inside Obsidian's configuration directory, normally .obsidian, over REST and MCP alike. That folder holds each plugin's code and data, including this plugin's API key, and writing there would effectively run code. Such requests fail with 403.

- Guessing is rate-limited. Ten wrong credentials from one source within a minute are refused with 429 until the minute is up.

- Signed links are narrow. A signed link names one file, one method and one time window, and does not survive an Obsidian restart. The signed-URL tools only work when you enable signed URLs.

- The README documents no per-folder permissions for the built-in server. To limit an agent to certain folders or make it read-only, cyanheads' obsidian-mcp-server adds allowlists (OBSIDIAN_READ_PATHS, OBSIDIAN_WRITE_PATHS), a deny list and OBSIDIAN_READ_ONLY=true.

- Keep the key out of shared files. Use a user-scoped client config or an environment variable instead of committing a project .mcp.json.

- Back up first. Put the vault under version control or copy it before you let an agent write to it.

## Built-in server vs MCPVault, cyanheads and mcp-obsidian

Four routes are common. This comparison comes from each project's own documentation. We did not benchmark them.

| Option | Connects by | Obsidian must be open | Tools | Best for |
| --- | --- | --- | --- | --- |
| Built-in server (Local REST API plugin) | Streamable HTTP at /mcp/ | Yes | 20 | Live search, active file, tags and commands |
| [MCPVault](https://github.com/bitbonsai/mcpvault) (@bitbonsai/mcpvault) | Local stdio, reads the vault folder | No; no plugin needed | 18 | Working with notes while Obsidian is closed |
| [obsidian-mcp-server](https://github.com/cyanheads/obsidian-mcp-server) (cyanheads) | Stdio or HTTP, through the plugin's REST API | Yes | 14 tools, 3 resources | Folder allowlists and read-only mode |
| [mcp-obsidian](https://github.com/MarkusPfundstein/mcp-obsidian) (MarkusPfundstein) | Stdio through uvx, via the plugin's REST API | Yes | 7 | Older setups |



- npm packages: obsidian-mcp-server (cyanheads) and @bitbonsai/mcpvault. Run either with npx.

- Docker: mcp-obsidian ships a Docker setup that runs over stdio with docker compose run --rm -T and defaults to host.docker.internal to reach Obsidian on your machine. cyanheads' server publishes an image on ghcr.io.

- A generic [filesystem MCP server](https://www.mcpfolio.com/servers/filesystem) pointed at the vault folder also reads your Markdown files, but it sees none of Obsidian's metadata, active file or commands.

## Obsidian MCP troubleshooting

Most failures are one of these.



- Server disconnected or connection refused: Obsidian is closed, the plugin is disabled, or the port is wrong. HTTPS is 27124. HTTP on 27123 only exists after you enable it.

- 401 Unauthorized: the Authorization header is missing or the key is wrong. Copy the key again from Settings → Local REST API; the header must read Bearer followed by the key.

- 429 Too Many Requests: ten wrong keys in a minute trigger a pause. Fix the key and wait for the minute to pass.

- Certificate errors: trust the plugin's certificate authority from /obsidian-local-rest-api.crt, or switch to the HTTP endpoint on 27123. cyanheads' server accepts the self-signed certificate by default (OBSIDIAN_VERIFY_SSL=false).

- Claude Desktop ignores the URL: it needs the mcp-remote bridge shown above.

- Search misses results: search_simple returns at most 20 files and 10 matches each by default. Raise maxResults or maxMatchesPerFile.

- 403 on a .obsidian path: this is intentional; see the security section.

- mcp-obsidian fails on import with an AttributeError: its README says it needs the Python mcp package below 2.0, and an unconstrained mcp 2.x install crashes.

## Obsidian's own CLI is not an MCP server

Obsidian 1.12.4, released on February 27, 2026, added an official command line interface for controlling the app from a terminal, aimed at scripting and automation. It is a separate interface to your vault, not an MCP server.

Use MCP when your client speaks MCP and you want typed tools with approval prompts. If your agent already has a shell, the CLI is an alternative route.

Choosing MCP servers for other jobs? Our [best MCP servers guide](https://www.mcpfolio.com/articles/best-mcp-servers) compares options for coding, research and team work.

## Frequently asked questions

### Is there an official Obsidian MCP server?

No. Obsidian ships a command line interface but no MCP server. The closest option is the community Local REST API plugin, which includes a built-in MCP server.

### What is the Obsidian MCP server URL?

With the Local REST API plugin it is https://127.0.0.1:27124/mcp/ over HTTPS, or http://127.0.0.1:27123/mcp/ if you enable the HTTP server. Both need your API key as an Authorization bearer token.

### How do I connect Obsidian to Claude?

Claude Code supports HTTP servers natively, so use the claude mcp add command above. Claude Desktop needs the mcp-remote bridge. Claude's custom connectors expect a remote HTTPS URL, and third-party documentation reports they cannot reach a localhost endpoint.

### Does Obsidian MCP work when Obsidian is closed?

The built-in server does not, because it runs inside Obsidian. MCPVault does, because it reads the vault folder directly and needs no plugin.

### Can I limit the folders an AI can access?

The built-in server's README documents no per-folder permissions beyond blocking the config folder. cyanheads' obsidian-mcp-server adds read and write allowlists, a deny list and a read-only mode.

### Does Obsidian MCP work with ChatGPT?

MCPVault's README lists a ChatGPT Desktop (Enterprise+) configuration example. ChatGPT's MCP support varies by plan and product, so check OpenAI's current documentation. Codex can connect with the configuration above.

### Can I run an Obsidian MCP server in Docker?

Yes. mcp-obsidian ships a Docker setup that reaches Obsidian through host.docker.internal, and cyanheads' obsidian-mcp-server publishes an image on ghcr.io.

## Primary sources

- [Obsidian Local REST API (built-in MCP server) README](https://github.com/coddingtonbear/obsidian-local-rest-api#readme)
- [Local REST API security advisory GHSA-66m9-r757-qvq7](https://github.com/coddingtonbear/obsidian-local-rest-api/security/advisories/GHSA-66m9-r757-qvq7)
- [MCPVault (bitbonsai)](https://github.com/bitbonsai/mcpvault)
- [obsidian-mcp-server (cyanheads)](https://github.com/cyanheads/obsidian-mcp-server)
- [mcp-obsidian (MarkusPfundstein)](https://github.com/MarkusPfundstein/mcp-obsidian)
- [Codex MCP documentation](https://developers.openai.com/codex/mcp)
- [OpenCode MCP servers documentation](https://opencode.ai/docs/mcp-servers/)
- [Obsidian 1.12.4 changelog](https://obsidian.md/changelog/2026-02-27-desktop-v1.12.4/)
- [Claude custom connectors: remote MCP](https://claude.com/docs/connectors/custom/remote-mcp)


## Related

- [obsidian-local-rest-api-mcp](https://www.mcpfolio.com/servers/obsidian-local-rest-api-mcp)
- [filesystem](https://www.mcpfolio.com/servers/filesystem)