Obsidian笔记库访问
STDIO通过REST API访问Obsidian文档库
通过REST API访问Obsidian文档库
An MCP (Model Context Protocol) server implementation that provides access to Obsidian vaults through a local REST API. This server allows AI assistants to interact with Obsidian notes and manage vault content through a standardized interface.
Install the package globally:
npm install -g PublikPrinciple/obsidian-mcp-rest
Or if you prefer using a specific version/branch:
npm install -g PublikPrinciple/obsidian-mcp-rest#main
First, configure Obsidian Local REST API plugin:
Create a configuration file config.json
:
{ "obsidian": { "apiKey": "your-api-key-here", "port": 27123, "host": "localhost" }, "server": { "name": "obsidian-mcp", "version": "1.0.0" } }
obsidian-mcp-rest --config path/to/config.json
Configure Claude Desktop to use this MCP server:
{ "name": "obsidian-mcp", "command": "obsidian-mcp-rest", "args": ["--config", "path/to/config.json"] }
Claude can now access your Obsidian vault through commands like:
Read note "Projects/MyProject.md"
List all notes in "Projects" folder
Search for notes containing "typescript"
listNotes
: List all notes in the vault or a specific folderreadNote
: Read the contents of a specific notewriteNote
: Create or update a notesearchNotes
: Search for notes using a query stringgetMetadata
: Get metadata for a specific notegit clone https://github.com/PublikPrinciple/obsidian-mcp-rest.git cd obsidian-mcp-rest
npm install
npm run build
npm test
If you encounter any installation issues, try these alternatives:
git clone https://github.com/PublikPrinciple/obsidian-mcp-rest.git cd obsidian-mcp-rest npm install npm run build npm install -g .
npm install -g typescript
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
MIT License - see LICENSE file for details