墨滴 AI 笔记助手
通过模型上下文协议(Model Context Protocol)将 Inkdrop 笔记应用与 Claude AI 集成,允许 Claude 搜索、读取、创建和更新您 Inkdrop 数据库中的笔记。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"inkdrop": {
"args": [
"-y",
"@inkdropapp/mcp-server"
],
"command": "npx",
"env": {
"INKDROP_LOCAL_PASSWORD": "your-local-server-password",
"INKDROP_LOCAL_SERVER_URL": "http://localhost:19840",
"INKDROP_LOCAL_USERNAME": "your-local-server-username"
}
}
}
}
该服务需要配置环境变量:INKDROP_LOCAL_PASSWORD、INKDROP_LOCAL_SERVER_URL、INKDROP_LOCAL_USERNAME
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
read-note 1 个参数 需填 1 项
Retrieve the complete contents of the note by its ID from the database.
必填参数:noteId
search-notes 1 个参数 需填 1 项
List all notes that contain a given keyword. The result does not include entire note bodies as they are truncated in 200 characters. You have to retrieve the full note content by calling `read-note`. Here are tips to specify keywords effectively: ## Use special qualifiers to narrow down results You can use special qualifiers to get more accurate results. See the qualifiers and their usage examples: - **book** `book:Blog`: Searches for notes in the 'Blog' notebook. - **tag** `tag:JavaScript`: Searches for all notes having the 'JavaScript' tag. Read more about [tags](https://docs.inkdrop.app/manual/write-notes#tag-notes). - **status** `status:onHold`: Searches for all notes with the 'On hold' status. Read more about [statuses](/reference/note-statuses). - **title** `title:"JavaScript setTimeout"`: Searches for the note with the specified title. - **body** `body:KEYWORD`: Searches for a specific word in all notes. Equivalent to a [global search](#search-for-notes-across-all-notebooks). ### Combine qualifiers You can combine the filter qualifiers to refine data even more. **Find notes that contain the word 'Hello' and have the 'Issue' tag.** ```text Hello tag:Issue ``` **Find notes that contain the word 'Typescript,' have the 'Contribution' tag, and the 'Completed' status** ```text Typescript tag:Contribution status:Completed ``` ## Search for text with spaces To find the text that includes spaces, put the text into the double quotation marks ("): ```text "database associations" ``` ## Exclude text from search To exclude text from the search results or ignore a specific qualifier, put the minus sign (-) before it. You can also combine the exclusions. See the examples: - `-book:Backend "closure functions"`: Ignores the 'Backend' notebook while searching for the 'closure functions' phrase. - `-tag:JavaScript`: Ignores all notes having the 'JavaScript' tag. - `-book:Typescript tag:work "Data types"`: Ignores the 'Typescript' notebook and the 'work' tag while searching for the 'Data types' phrase. - `-status:dropped title:"Sprint 10.0" debounce`: Ignores notes with the 'Dropped' status while searching for the 'debounce' word in the note with the 'Sprint 10.0' title. - `-"Phrase to ignore" "in the rest of a sentence"`: Ignores the 'Phrase to ignore' part while searching for 'in the rest of a sentence'. Note that you can't specify excluding modifiers only without including conditions. **WARNING**: Make sure to enter a text to search for after the exclusion modifier. - â Will work `-book:Backend "closure functions"` - âï¸ Won't work `-book:Backend`. There's no query. Inkdrop doesn't understand what to search for.
必填参数:keyword
create-note 4 个参数 需填 3 项
Create a new note in the database
必填参数:bookId、title、body
update-note 6 个参数 需填 5 项
Update the existing note in the database
必填参数:_id、_rev、bookId、title、body
list-notebooks
Retrieve a list of all notebooks
该工具无需必填参数,直接调用即可
服务介绍
Inkdrop MCP Server
一个用于 Inkdrop 本地 HTTP 服务器 API 的 Model Context Protocol 服务器。
安装
-
将服务器配置添加到 Claude Desktop:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- MacOS:
{
"mcpServers": {
"inkdrop": {
"command": "npx",
"args": ["-y", "@inkdropapp/mcp-server"],
"env": {
"INKDROP_LOCAL_SERVER_URL": "http://localhost:19840",
"INKDROP_LOCAL_USERNAME": "your-local-server-username",
"INKDROP_LOCAL_PASSWORD": "your-local-server-password"
}
}
}
}
组件
工具
read-note: 通过 ID 从数据库中检索笔记的完整内容。- 必需输入:
noteId: 要检索的笔记的 ID。它可以在笔记文档中找到_id。它总是以note:开头。
- 必需输入:
search-notes: 列出包含给定关键字的所有笔记。- 必需输入:
keyword: 要搜索的关键字。
- 注意:结果包括截断的笔记正文(200 个字符)。使用
read-note获取完整内容。 - 支持高级搜索限定符,如
book:,tag:,status:,title:等。
- 必需输入:
list-notes: 列出指定笔记本中的所有笔记。- 必需输入:
bookId: 笔记本 ID。它总是以 'book:' 开头。
- 可选输入:
tagIds: 用于过滤的标签 ID 数组。每个都以 'tag:' 开头。keyword: 用于过滤笔记的关键字。sort: 排序字段 (updatedAt,createdAt, 或title)。默认值:updatedAt。descending: 反转输出顺序。默认值:true。
- 注意:结果包括截断的笔记正文(200 个字符)。使用
read-note获取完整内容。
- 必需输入:
create-note: 在数据库中创建一个新的笔记。- 必需输入:
bookId: 笔记本 ID。必须以 'book:' 开头或为 'trash'。title: 笔记标题。body: 笔记的 Markdown 内容。
- 可选输入:
status: 笔记状态 (none,active,onHold,completed,dropped)。
- 必需输入:
update-note: 更新数据库中的现有笔记。- 必需输入:
_id: 笔记 ID。必须以 'note:' 开头。_rev: 修订版本 ID (CouchDB MVCC-token)。bookId: 笔记本 ID。必须以 'book:' 开头或为 'trash'。title: 笔记标题。body: 笔记的 Markdown 内容。
- 可选输入:
status: 笔记状态 (none,active,onHold,completed,dropped)。
- 必需输入:
list-notebooks: 检索所有笔记本的列表。list-tags: 检索所有标签的列表。
调试
由于 MCP 服务器运行在标准输入输出上,调试可能会比较困难。为了获得最佳调试体验,我们强烈推荐使用 MCP Inspector。
你可以通过以下命令使用 npm 启动 MCP Inspector:
npx @modelcontextprotocol/inspector "./dist/index.js"
确保环境变量已正确配置。
启动后,Inspector 会显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。
您还可以使用以下命令查看服务器日志:
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-inkdrop.log