Bear MCP Server
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.
README
Bear MCP Server
A Model Context Protocol (MCP) server that provides access to your Bear notes. This server allows AI assistants like Claude to search and read your Bear notes.
Features
Read Operations
- Search notes by title, content, or tags
- Open specific notes by title or ID
- Browse all tags with note counts
- View notes by tag to explore related content
- Direct SQLite queries for fast results
Write Operations
- Create new notes with tags and pin option
- Add text to existing notes (append, prepend, or replace)
- Move notes to trash
- Rename tags across all notes
- Delete tags from all notes
Installation
Option 1: Install from npm (when published)
npm install -g @mcp/bear-server
Option 2: Install from source
# Clone the repository
git clone https://github.com/quanticsoul4772/bear-mcp
cd bear-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Install globally
npm link
Configuration
For Claude Desktop
Add this to your configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"bear-mcp": {
"command": "node",
"args": [
"--max-old-space-size=4096",
"--expose-gc",
"--max-semi-space-size=64",
"/Users/yourusername/Projects/mcp-servers/bear-mcp/dist/index.js"
],
"type": "stdio"
}
}
}
Custom Database Path
If your Bear database is in a non-standard location, you can specify it:
{
"mcpServers": {
"bear-mcp": {
"command": "node",
"args": [
"--max-old-space-size=4096",
"--expose-gc",
"--max-semi-space-size=64",
"/path/to/bear-mcp/dist/index.js",
"--db-path",
"/custom/path/to/database.sqlite"
],
"type": "stdio"
}
}
}
Available Tools
open_note
Open a specific note by its title or unique ID.
Example usage:
- "Open my note titled 'Project Ideas'"
- "Show me the note with ID 123ABC-456DEF"
search_notes
Search for notes containing specific terms or tags.
Example usage:
- "Search for notes about machine learning"
- "Find all notes tagged with #work"
- "Search for 'API' in notes with tag #documentation"
get_tags
List all tags in your Bear notes, organized by frequency.
Example usage:
- "What tags do I use in Bear?"
- "Show me all my Bear tags"
open_tag
Display all notes that have a specific tag.
Example usage:
- "Show me all notes tagged #recipes"
- "List notes with the #meeting tag"
get_recent_notes
Get recently modified notes.
Example usage:
- "Show me my 10 most recent notes"
- "What notes did I modify today?"
get_pinned_notes
Get all pinned notes.
Example usage:
- "Show me my pinned notes"
- "What notes have I pinned?"
get_note_stats
Get statistics about your Bear notes.
Example usage:
- "How many notes do I have?"
- "Show me my Bear notes statistics"
get_notes_by_date
Get notes within a specific date range.
Example usage:
- "Show me notes from last week"
- "Find notes created between January 1 and January 31"
create_note
Create a new note in Bear.
Example usage:
- "Create a note titled 'Meeting Notes' with content 'Discussed project timeline'"
- "Create a note with tags 'work, project' and pin it"
add_text
Add text to an existing note (append, prepend, or replace).
Example usage:
- "Append 'Follow-up tasks' to the note with ID 123ABC"
- "Prepend today's date to my meeting notes"
- "Replace the content of note 456DEF with new text"
trash_note
Move a note to trash.
Example usage:
- "Trash the note with ID 789GHI"
- "Delete my note titled 'Old Draft'"
rename_tag
Rename a tag across all notes.
Example usage:
- "Rename tag 'todo' to 'tasks'"
- "Change the #work tag to #office"
delete_tag
Delete a tag from all notes.
Example usage:
- "Delete the tag 'temporary'"
- "Remove the #old-project tag from all notes"
Development
Prerequisites
- Node.js 18 or higher
- Bear app installed on macOS
- TypeScript knowledge for contributions
Building from source
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run in development mode
npm run dev
# Watch for changes
npm run watch
Project Structure
bear-mcp/
├── src/
│ ├── index.ts # Main server entry point
│ ├── bearDB.ts # Database connection and queries
│ ├── types.ts # TypeScript type definitions
│ └── tools/ # Tool implementations
│ ├── index.ts
│ ├── openNote.ts
│ ├── searchNotes.ts
│ ├── getTags.ts
│ └── openTag.ts
├── dist/ # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md
Security
This server implements several security measures:
- Local access only - Runs via stdio, not network accessible
- Filtered results - Trashed notes are automatically excluded
Troubleshooting
"Bear database not found"
- Ensure Bear is installed and has been opened at least once
- Check if the database exists at
~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite - Use the
--db-pathoption if your database is elsewhere
"Permission denied"
- The server needs read access to the Bear database
- Check file permissions on the database file
No results returned
- Verify that you have notes in Bear
- Check that notes aren't in the trash
- Ensure search terms are spelled correctly
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details
Acknowledgments
- Inspired by the Bear app team
- Thanks to the MCP community for the protocol and SDKs
- Based on patterns from other MCP server implementations
Disclaimer
This server is not affiliated with or endorsed by Bear (Shiny Frog Ltd.). It's an independent tool that provides access to the Bear database.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。