binnapro/bear-mcp-server
If you are the rightful owner of bear-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This is a Model Context Protocol (MCP) server designed for the Bear note-taking application, enabling direct manipulation of notes within Bear using Claude Code.
Bear MCP Server
这是一个为 Bear 笔记应用设计的 MCP (Model Context Protocol) 服务器,让你能够通过 Claude Code 直接操作 Bear 中的笔记。
功能特性
- ✅ 创建新笔记
- ✅ 搜索笔记
- ✅ 添加文本到现有笔记
- ✅ 删除笔记
- ✅ 打开指定笔记
- ✅ 获取所有标签
- ✅ 获取所有笔记(支持分页)
安装和使用
快速安装(推荐)
使用自动设置脚本:
./setup.sh
脚本会自动完成:
- 依赖安装
- 项目构建
- 生成配置信息
手动安装
1. 安装依赖
npm install
2. 构建项目
npm run build
或者使用构建脚本:
./build.sh
3. 配置 MCP 服务器
在 Claude Code 的配置文件中添加以下配置:
{
"mcpServers": {
"bear": {
"command": "node",
"args": ["/path/to/bear-mcp-server/dist/index.js"],
"env": {}
}
}
}
或者复制 mcp-config.json 文件的内容到你的 Claude 配置中。
4. 重启 Claude Code
配置完成后,重启 Claude Code 以加载新的 MCP 服务器。
可用工具
create_note
创建一个新的 Bear 笔记。
参数:
title(可选): 笔记标题text(可选): 笔记内容tags(可选): 标签数组filename(可选): 自定义文件名pin(可选): 是否固定笔记open_note(可选): 创建后是否打开笔记
示例:
{
"title": "我的新笔记",
"text": "这是笔记内容",
"tags": ["标签1", "标签2"],
"pin": true
}
search_notes
搜索 Bear 中的笔记。
参数:
term(必需): 搜索词token(可选): 分页令牌
示例:
{
"term": "项目"
}
add_text
向现有笔记添加文本。
参数:
id或title(必需其一): 笔记 ID 或标题text(必需): 要添加的文本mode(可选):prepend或append,添加方式
示例:
{
"title": "我的笔记",
"text": "新添加的内容",
"mode": "append"
}
delete_note
删除笔记。
参数:
id或title(必需其一): 笔记 ID 或标题
示例:
{
"title": "要删除的笔记"
}
open_note
在 Bear 中打开指定笔记。
参数:
id或title(必需其一): 笔记 ID 或标题new_window(可选): 是否在新窗口中打开
示例:
{
"title": "我的笔记",
"new_window": true
}
get_tags
获取 Bear 中所有标签。
参数:无
get_all_notes
获取所有笔记列表。
参数:
token(可选): 分页令牌
系统要求
- macOS (Bear 目前仅支持 macOS)
- Node.js 18+
- Bear 应用已安装
开发
开发模式运行
npm run dev
构建生产版本
npm run build
Bear x-callback-url 支持
此 MCP 服务器基于 Bear 的 x-callback-url scheme 实现,支持以下 URL 操作:
bear://x-callback-url/createbear://x-callback-url/add-textbear://x-callback-url/deletebear://x-callback-url/openbear://x-callback-url/searchbear://x-callback-url/tags
更多关于 Bear x-callback-url 的信息,请参考:Bear 文档
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
注意事项
- 确保 Bear 应用已安装并运行
- 某些操作可能需要 Bear 应用在前台
- 批量操作时请注意性能,避免一次性操作过多笔记