Logo Bear MCP Server

Bear MCP Server

Cộng đồng
bejaminjones

MCP server for Bear app - Full Read + Write AI-powered note management with Claude Desktop

Nhà phát hànhbejaminjones
Kho mãbear-notes-mcp
Ngôn ngữTypeScript
Bản fork
8
Sao
32
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Bear MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    32 sao và 8 bản fork từ kho mã được liên kết.

Bear MCP Server

A Model Context Protocol (MCP) server that provides Claude with comprehensive access to your Bear notes using a hybrid sync-safe approach - combining direct database reads with Bear's API for writes.

🔄 Sync-Safe Hybrid Mode: All operations now work safely with iCloud sync!

⚠️ Disclaimer

This tool uses a hybrid approach: direct database reads + Bear API writes. While comprehensive safety measures are implemented:

  • Read operations access Bear's database directly (read-only, safe)
  • Write operations use Bear's official API (sync-safe)
  • The tool is not affiliated with Bear's developers
  • Always maintain regular Bear backups as good practice

🚀 Quick Start (5 minutes)

Prerequisites

  • Bear app installed on macOS
  • Claude Desktop app
  • Node.js 18+ installed

Installation

  1. Clone and setup:
bash
git clone <repository-url>
cd bear-notes-mcp
npm install
npm run build
  1. Add to Claude Desktop configuration: Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
json
{
  "mcpServers": {
    "bear": {
      "command": "node",
      "args": ["/path/to/bear-notes-mcp/dist/index.js"],
      "env": {}
    }
  }
}
  1. Start using:
  • Restart Claude Desktop
  • Ask Claude: "What Bear notes do I have?"
  • Begin managing your notes with natural language!

✨ What You Can Do

📖 Read Operations (26 tools) - ✅ ACTIVE

  • Search & Discovery: Full-text search, find similar notes, get suggestions
  • Organization: Browse by tags, analyze note relationships, get statistics
  • Content Analysis: Extract metadata, analyze attachments, find patterns
  • Advanced Queries: Complex filtering, date ranges, content criteria

✏️ Write Operations (6 tools) - ✅ ACTIVE (Sync-Safe)

  • Create Notes: ✅ Via Bear API (sync-safe)
  • Edit Notes: ✅ Via Bear API (sync-safe)
  • Organize: ✅ Via Bear API (sync-safe)
  • Tag Management: ✅ Via Bear API (sync-safe)
  • Hashtag Parsing: ✅ Via Bear API (sync-safe)

How it works: Uses Bear's x-callback-url API for writes, database for reads!

🛡️ Safety Features

  • Hybrid Architecture: Database reads + API writes for maximum safety
  • iCloud Sync Safe: All write operations use Bear's API
  • Conflict Detection: Prevents overwriting concurrent changes
  • Tag Validation: Automatic tag sanitization with warnings
  • Error Handling: Robust error management for all operations

📊 Capabilities Overview

CategoryToolsStatusKey Features
Basic Operations6✅ ActiveGet notes, search, browse tags, database stats
Advanced Search8✅ ActiveFull-text search, similarity matching, complex queries
Analytics6✅ ActiveContent analysis, relationship mapping, usage patterns
Metadata6✅ ActiveFile attachments, content structure, organization insights
Write Operations6✅ ActiveSync-safe via Bear API - full write capability restored!

🔧 Configuration

Database Location

The server automatically finds your Bear database at:

~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite

Environment Variables

  • BEAR_DB_PATH: Override default database location (for reads)
  • NODE_ENV: Set to 'development' for debug logging

📚 Usage Examples

Basic Note Management

"Show me my recent notes"
"Find all notes tagged with 'project'"  
"Create a new note about today's meeting"
"Search for notes containing 'API documentation'"
"Update my project notes with the latest status"

Advanced Operations

"Analyze my note-taking patterns this month"
"Find notes similar to my current project"
"Show me notes with attachments"
"What are my most-used tags?"

Organization & Cleanup

"Archive old notes from last year"
"Find duplicate or similar notes"
"Show me notes that might need better tags"
"Duplicate this note with a new title"
"Add tags to organize my notes better"

🛡️ Safety & Best Practices

⚠️ Safety Guidelines

  1. Bear can run during operations - Write operations use Bear's API safely
  2. Automatic tag validation - Tags are sanitized with warnings
  3. iCloud sync compatible - No conflicts or sync issues
  4. Keep Bear updated - Ensure API compatibility

💡 Best Practices

  • Read operations are instant - direct database access
  • Write operations work with Bear running or closed
  • Tag warnings show when tags are auto-corrected
  • Use specific search terms for better results
  • Archive notes instead of deleting when possible

🏷️ Tag Formatting Guidelines

✅ RECOMMENDED TAG FORMATS:

  • Simple tags: work, personal, urgent, meeting
  • Nested categories: work/projects, personal/health, study/math
  • Time-based: 2024, january, q1
  • Project codes: proj001, alpha, beta

❌ AVOID THESE FORMATS (auto-corrected):

  • Hyphens: project-alpha → becomes projectalpha
  • Spaces: work meeting → becomes workmeeting
  • Mixed case: ProjectAlpha → becomes projectalpha

🔧 Automatic Tag Sanitization: The server automatically validates and sanitizes all tags:

  • Lowercase only: Project → project
  • No spaces: tag name → tagname
  • No hyphens: project-alpha → projectalpha
  • No commas: tag,name → tagname
  • ✅ Forward slashes preserved: project/alpha → project/alpha (for nested tags)

Tag warnings are returned when tags are modified, so you'll know exactly what changes were made.

🏗️ REFACTORED SERVICE ARCHITECTURE

✅ Completely refactored from monolith to modern service-oriented architecture!

Transformation Overview

We've completely rebuilt the system from a 2,589-line monolithic BearService into a modern, testable, service-oriented architecture:

🔧 Service-Based Design

  • 7 specialized services with clear responsibilities
  • Dependency injection for testability and flexibility
  • Interface-driven development for maintainability
  • 384 comprehensive tests across all services

🛡️ Hybrid Sync-Safe Architecture

  • Read Operations: Direct SQLite database access for maximum performance
  • Write Operations: Bear's x-callback-url API for sync safety
  • Perfect coordination using ZUNIQUEIDENTIFIER bridge

📊 Quality & Performance

  • 100% TypeScript with strict type checking
  • Comprehensive error handling and validation
  • Multi-level caching for performance optimization
  • Structured logging and health monitoring

Service Architecture

ServiceContainer (Dependency Injection)
├── DatabaseService      (SQLite operations & connection management)
├── CacheService        (Performance optimization & intelligent caching)
├── LoggingService      (Structured logging with Winston)
├── HealthService       (System monitoring & health checks)
├── ValidationService   (Input validation & data sanitization)
├── NoteService         (Note CRUD & lifecycle management)
├── SearchService       (Advanced search & content discovery)
└── TagService          (Tag management & organization)

Why This Architecture Works

The Problem: Monolithic code was hard to test, maintain, and extend.

The Solution: Service-oriented architecture with clear separation of concerns.

The Result:

  • ✅ Maintainable code - Clear service boundaries and responsibilities
  • ✅ 100% test coverage - 384 tests across all services
  • ✅ Type safety - Eliminated 50+ any types
  • ✅ Performance optimized - Multi-level caching and query optimization
  • ✅ Production ready - Comprehensive logging, monitoring, and error handling
  • ✅ Sync-safe operations - Hybrid approach eliminates iCloud conflicts

Current Status

  • ✅ All read operations - Direct database access (26 tools)
  • ✅ All write operations - Sync-safe Bear API (6 tools)
  • ✅ Full feature parity - Everything works as designed
  • ✅ iCloud sync compatible - No conflicts or issues
  • ✅ Duplicate title fix - Notes display titles correctly (no duplication)

🙏 Thanks to Bear Team

Special thanks to Danilo from the Bear team who provided the key insight that led to this solution!


🤝 Contributing & Community

The iCloud sync challenge has been solved! 🎉 Now we're focused on making this the best Bear integration possible. Whether you're a:

  • macOS/iOS developer with API experience
  • Database expert familiar with SQLite optimization
  • Bear power user with workflow insights
  • Developer wanting to contribute to MCP ecosystem

Your contribution can help thousands of Bear users get even more from their AI assistants!

Current Priorities

  1. 🚀 Add new features - More ways to analyze and work with notes
  2. 📖 Improve documentation - Help others understand and contribute
  3. 🧪 Expand test coverage - Ensure reliability across Bear versions
  4. ⚡ Performance optimization - Make operations even faster

Quick Ways to Help

  • ⭐ Star the repo if you find it useful
  • 🐛 Report issues you encounter
  • 💡 Share ideas for new features or solutions
  • 🔗 Spread the word to developers who might help
  • 📝 Contribute documentation improvements

Together, we can build the most powerful Bear integration for AI assistants!

🔍 All Available Tools

Basic Operations (6 tools)

  • get_database_stats - Overview of your Bear database
  • get_notes - List notes with filtering options
  • get_note_by_id - Get specific note by ID
  • get_note_by_title - Find note by exact title
  • get_tags - List all tags with usage counts
  • get_notes_by_tag - Find notes with specific tag

Advanced Search (8 tools)

  • get_notes_advanced - Complex filtering and sorting
  • get_notes_with_criteria - Multi-criteria search
  • search_notes_fulltext - Full-text search with relevance scoring
  • get_search_suggestions - Auto-complete for searches
  • find_similar_notes - Content similarity matching
  • get_related_notes - Find related notes by tags and content
  • get_recent_notes - Recently created or modified notes
  • get_note_counts_by_status - Statistics by note status

Analytics & Insights (6 tools)

  • get_note_analytics - Comprehensive note statistics
  • analyze_note_metadata - Content pattern analysis
  • get_notes_with_metadata - Filter by content characteristics
  • get_file_attachments - File attachment management
  • get_tag_hierarchy - Tag relationship analysis
  • get_tag_analytics - Tag usage patterns

Content Analysis (6 tools)

  • analyze_tag_relationships - Tag optimization suggestions
  • get_tag_usage_trends - Tag usage over time
  • search_notes_regex - Pattern matching (when available)
  • Advanced content categorization
  • Link and reference analysis
  • Writing pattern insights

Note Management - SYNC-SAFE VIA BEAR API

  • create_note - ✅ Create new notes with tags and content
  • update_note - ✅ Update existing notes safely
  • duplicate_note - ✅ Create copies of existing notes
  • archive_note - ✅ Archive/unarchive notes
  • trigger_hashtag_parsing - ✅ Force hashtag reprocessing
  • batch_trigger_hashtag_parsing - ✅ Bulk hashtag processing

✅ All operations are now sync-safe:

  • Uses Bear's x-callback-url API for all writes
  • No iCloud sync conflicts or data corruption
  • Respects Bear's internal sync coordination
  • Full write functionality restored

Perfect integration between database reads and API writes!

🔧 Troubleshooting

Common Issues

"Database not found" error:

  • Verify Bear is installed and has been opened at least once
  • Check database path: ~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/

"Permission denied" error:

  • Ensure Claude Desktop has necessary file system permissions
  • Check that the database file is readable

Write operations not working:

  • Ensure Bear app is installed and has been opened at least once
  • Check that Bear's x-callback-url functionality is enabled
  • Try opening Bear manually to verify it's working

Slow performance:

  • Large databases (10,000+ notes) may take longer for reads
  • Use specific search terms instead of broad queries
  • Consider using pagination with limit parameters

Getting Help

  1. Check the troubleshooting guide
  2. Review common usage patterns
  3. Enable debug logging with NODE_ENV=development
  4. Test Bear's API directly: open "bear://x-callback-url/create?title=Test"

📈 Performance

  • Read operations: Instant (direct database access)
  • Write operations: 1-2 seconds (Bear API processing)
  • Large databases: Tested with 10,000+ notes
  • Memory usage: ~50MB typical, ~100MB for complex operations
  • Concurrent operations: Read operations can run simultaneously
  • API operations: Processed through Bear's URL scheme

📄 License

MIT License - see LICENSE file for details.


Made with ❤️ for the Bear community

Dùng MCP Bear MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Bear MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Bear MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Bear MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "bear-notes-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Bear MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Bear MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Bear MCP Server giúp tôi làm việc này không?
Bear MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Bear MCP Server.

Câu hỏi thường gặp

Máy chủ MCP Bear MCP Server dùng để làm gì?

Bear MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Bear MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Bear MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Bear MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Bear MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Bear MCP Server với TypingMind?

Bear MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Bear MCP Server cung cấp những công cụ nào trong TypingMind?

Bear MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Bear MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Bear MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇