Skip to main content
Glama
binnapro
by binnapro

Bear MCP Server

这是一个为 Bear 笔记应用设计的 MCP (Model Context Protocol) 服务器,让你能够通过 Claude Code 直接操作 Bear 中的笔记。

功能特性

  • ✅ 创建新笔记

  • ✅ 搜索笔记

  • ✅ 添加文本到现有笔记

  • ✅ 删除笔记

  • ✅ 打开指定笔记

  • ✅ 获取所有标签

  • ✅ 获取所有笔记(支持分页)

Related MCP server: Bear MCP Server

安装和使用

快速安装(推荐)

使用自动设置脚本:

./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

向现有笔记添加文本。

参数:

  • idtitle (必需其一): 笔记 ID 或标题

  • text (必需): 要添加的文本

  • mode (可选): prependappend,添加方式

示例:

{
  "title": "我的笔记",
  "text": "新添加的内容",
  "mode": "append"
}

delete_note

删除笔记。

参数:

  • idtitle (必需其一): 笔记 ID 或标题

示例:

{
  "title": "要删除的笔记"
}

open_note

在 Bear 中打开指定笔记。

参数:

  • idtitle (必需其一): 笔记 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/create

  • bear://x-callback-url/add-text

  • bear://x-callback-url/delete

  • bear://x-callback-url/open

  • bear://x-callback-url/search

  • bear://x-callback-url/tags

更多关于 Bear x-callback-url 的信息,请参考:Bear 文档

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

注意事项

  1. 确保 Bear 应用已安装并运行

  2. 某些操作可能需要 Bear 应用在前台

  3. 批量操作时请注意性能,避免一次性操作过多笔记

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Facilitates interaction with Bear note-taking software, allowing users to perform actions like opening notes, creating notes, and searching through Bear's X-callback-url Scheme.
    77
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search, read, and browse Bear notes directly from your local Bear database. Supports searching by title, content, or tags, opening specific notes, and exploring tag-based organization.
    1
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables Claude to interact with Bear notes (via better-bear-cli) for listing, searching, creating, editing, and exporting notes through natural language.
    -