How Bear CLI and MCP Reshape Apple-Native Note Automation
Bear has long been celebrated for its refined macOS and iOS native experience, typographic polish, and seamless CloudKit synchronization. Yet for developers and power users, its walled-garden architecture and longstanding lack of a CLI presented a frustrating barrier: notes were locked deep inside CoreData and SQLite databases, leaving virtually no clean way to interact via the command line.
With Bear 2.8, Shiny Frog introduced bearcli—a native command-line utility bundled directly within the macOS app package—alongside an official MCP Server built on Anthropic’s Model Context Protocol. This release eliminates the need to rely on brittle URL schemes or risk reverse-engineering SQLite databases, giving the design-forward note-taking app the modern automation layer it was missing in the age of AI agents.
Legacy Hurdles: The Flaws of x-callback-url and the Cost of the SQLite Black Box
Historically, developers looking to script or automate Bear from the terminal were left with only two paths—both carrying significant architectural penalties.
Three Critical Flaws of x-callback-url
Before bearcli, the only official programmatic interface was Apple’s URL Scheme (x-callback-url), structured like this:
bear://x-callback-url/create?title=Log&text=Hello&tags=journal
While x-callback-url worked adequately for simple capture in iOS Shortcuts, it posed three intolerable pain points for desktop developer workflows:
- Focus Stealing: By default, triggering a URL scheme forces macOS to bring Bear’s GUI window straight to the foreground (only some endpoints honor a
show_window=noopt-out), snatching focus away from the active editor and shattering developer flow. - Asynchronous & Disjointed Responses: Capturing return data required registering callback URLs or running local port listeners. Shell scripts, Makefiles, and CI/CD pipelines had no synchronous way to capture a newly created note ID, blocking downstream pipeline chaining.
- Completely Paralyzed in Headless Environments: URL schemes cannot be parsed or routed across remote SSH sessions, macOS
launchdbackground daemons, or headless terminal setups.
Data Corruption Risks of Direct SQLite Access
Frustrated by URL scheme constraints, some power users bypassed the GUI and touched Bear’s underlying database files directly:
~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite
Executing raw INSERT or UPDATE statements against this SQLite store, however, introduced severe system-level risks:
- CoreData Cache Inconsistency: Bear’s desktop app relies on Apple’s CoreData framework and its in-memory managed object graph. When an external process mutates SQLite behind its back, the running GUI has no way to register the change, leading to stale cache overwrites and silent data loss.
- Corrupted CloudKit Sync: Cross-device syncing depends on CoreData and CloudKit tombstones and change tokens. Bypassing the framework breaks the sync sequence, spawning persistent duplicate notes or ghost records across devices.
- Brittle Schema Migrations: Major Bear updates frequently refactor internal database schemas and encryption structures. External tools relying on reverse-engineered SQL schemas reliably break on updates.
bearcli: The Official Safe Broker
Fundamentally, bearcli acts as an official safe broker and bridge created by Shiny Frog. By hooking directly into Bear’s native engine, it:
- Ensures every write operation triggers the full CoreData lifecycle events.
- Automatically maintains CloudKit sync metadata and change token integrity.
- Operates 100% silently in the terminal background—no popups, no focus stealing, with full support for synchronous exits and structured error codes.
Engineers gain high-speed terminal automation without gambling with years of accumulated knowledge.
Engineering Design: A Modern Architecture Grounded in Unix Philosophy
bearcli’s architectural design is remarkably robust, reflecting careful consideration for command-line piping and scripted automation workflows.
Bundled Native Binary
Written natively in Swift with no external runtime dependencies, bearcli ships directly inside the macOS app bundle:
/Applications/Bear.app/Contents/MacOS/bearcli
A simple symlink makes it globally accessible from any shell:
sudo ln -s /Applications/Bear.app/Contents/MacOS/bearcli /usr/local/bin/bearcli
Multi-Format Output and Extended Markdown Support
bearcli offers three distinct output formats tailored to different automation scenarios:
- TSV (Tab-Separated Values, default): Emits headerless lines ideally suited for piping into standard Unix utilities like
awk,cut,xargs, orripgrep. - Structured JSON (
--format json): Emits standard JSON objects; on failure, errors are output cleanly to stdout as{"error":{"code":"...","message":"..."}}, making error handling in scripts straightforward. - Standards-Compliant CSV (
--format csv): Fully adheres to the RFC 4180 standard with a header row, ready for direct ingestion into data analysis tools.
On the content side, bearcli natively preserves Bear’s rich Markdown extensions, including nested tags (#tag, #nested/child), bidirectional wiki links ([[Title]], [[Title|alias]]), highlights (==highlight== and color variants), underlines (~underline~), GitHub-style callouts (> [!NOTE]), and standard LaTeX math blocks ($math$).
Section-Level Addressing and Optimistic Concurrency Control
While conventional note-taking CLIs typically offer only blunt all-or-nothing read/write operations, bearcli introduces sophisticated section-level addressing:
- Unique heading addressing:
--section "## Setup" - Nested heading addressing:
--section "# Build\n## Install" - Indexed duplicate heading targeting:
--section "# Build\n## Install\n2"(targets the second matching section) - Preamble targeting:
--section "## Install\npreamble"(targets the intro text between a heading and its first child subheading)
Running bearcli outline <note-id> provides external programs with the exact byte ranges and structural hierarchy of every section in a note.
For write safety, bearcli implements Optimistic Concurrency Control (OCC).
Reading a note or section with bearcli cat returns a unique hash receipt. A subsequent bearcli overwrite call can pass this receipt via --base <hash>; if the note changed between the read and the write, the update is immediately rejected, preventing race conditions. (CLI callers may omit --base for an unconditional write; calls made through the MCP server require it.)
Beyond concurrency safeguards, the system also enforces data integrity. If an overwrite would orphan embedded attachments such as images or PDFs, bearcli aborts the operation and lists the affected files—requiring an explicit --force flag to commit destructive changes.
Ecosystem Rivalry: Defending Against Obsidian’s Local-First Wave
In the evolution of Personal Knowledge Management (PKM), Obsidian redefined the landscape and applied relentless competitive pressure on Bear, a longtime favorite of the Apple ecosystem.
The Inherent Advantages of a Plain-Text Architecture
From day one, Obsidian stuck to an uncompromising principle: notes are simply plain-text Markdown files (Vaults) stored on your local disk. This philosophy resonated deeply with engineers and power users:
- Zero Vendor Lock-in: Notes are just standard directories and
.mdfiles. If the app disappears tomorrow, your data remains completely intact. - Terminal-Native Citizens: Search with
rg, fuzzy-find withfzf, batch-edit with shell scripts, or rungit initinside the vault for version control. - A Native CLI and Plugin Ecosystem: Obsidian 1.12.7+ includes the official Obsidian CLI for searching, reading, creating, and modifying notes, while community REST APIs and plugins extend other integrations.
By contrast, while Bear excelled in Apple-native rendering, typographic finesse, and mobile responsiveness, its proprietary SQLite backend and Apple-exclusive footprint felt restrictive to developers who demand full command over their environments. Community forums frequently echoed the same dilemma: engineers loved Bear’s design and feel, yet struggled to accept notes locked away from their terminal and automation tooling.
Shiny Frog’s Pragmatic Compromise
Faced with developer churn, Shiny Frog confronted a classic dilemma: rewriting the storage engine into flat Markdown files would deliver transparency, but at the cost of Bear’s fluid rich-text attachment handling, note encryption, efficient CloudKit delta syncing, and instant full-text search. Maintaining the status quo, however, meant risking irrelevance among technical users.
Shiny Frog opted for a pragmatic middle ground: preserve the polished SQLite/CoreData foundation under the hood, while exposing a modern CLI and secure broker layer that mirrors the plain-text experience. With bearcli, developers using bearcli search or bearcli cat enjoy a workflow that feels remarkably close to rg and cat, bridging a longstanding automation gap.
AI Strategic Breakthrough: Native MCP Server and Tag Sandboxing
Beyond closing the gap with terminal-first tools, the rapid ascent of AI agents was a primary catalyst behind Bear’s native CLI.
Why the Agent Era Demands MCP
Between 2024 and 2026, large language model applications evolved from conversational chatbots into autonomous AI agents capable of planning and invoking external tools (such as Claude Desktop, Claude Code, and Cursor). For knowledge workers, an essential role for AI is serving as an intelligent copilot over their personal note archives.
Under a plain-text model, Obsidian is a natural playground for AI agents: models can directly mount vault directories as local workspaces or search, read, and modify notes through the official Obsidian CLI.
That CLI connects to a running Obsidian desktop app, so it is not the same interface as Bear’s MCP server; without a structured, programmable interface, Bear would nevertheless have risked being sidelined from the personal knowledge assistant stack.
Key Architectural Features of bearcli mcp-server
bearcli delivers first-class support for Anthropic’s open standard, the Model Context Protocol (MCP). It embeds a fully functional MCP server communicating over standard input/output (stdio) via JSON-RPC 2.0:
bearcli mcp-server [--only-tags <tags>] [--exclude-tags <tags>]
This implementation incorporates three critical design choices:
- Granular Tag Sandboxing (Tag Scoping): Privacy is the foremost concern when granting AI access to personal notes. Passing
--only-tags dev,workrestricts the AI strictly to notes bearing those tags and their nested sub-tags; any attempt to read personal journal entries immediately returns anout_of_scopeerror. Combined with--exclude-tags private, sensitive records remain entirely invisible to the model. - Intent Hints & Destructive Action Gates: Every tool exposed by the server declares
readOnlyHintanddestructiveHintmetadata. Compatible clients can intercept calls to destructive endpoints liketrashoroverwrite, prompting the user for explicit confirmation before executing. - One-Click Claude Connector Setup: Bear’s macOS application menu now includes “Help -> Advanced -> Install Claude Connector.” Clicking it completes the MCP setup and mounting automatically—no config files need to be edited by hand, per Shiny Frog—in seconds.
Practical Applications: High-Value Terminal Workflows from the Community
Since bearcli debuted, developer communities and open-source projects have established several high-leverage workflows.
Scenario 1: Seamless Context Retrieval in Claude Code and Cursor Workflows
When coding in the terminal, developers often need to consult internal Architecture Decision Records (ADRs) or environment setup guides previously documented in Bear. By adding an MCP declaration to claude_desktop_config.json or a project-level .mcp.json:
{
"mcpServers": {
"bear-notes": {
"command": "/Applications/Bear.app/Contents/MacOS/bearcli",
"args": [
"mcp-server",
"--only-tags",
"tech,dev,architecture"
]
}
}
}
A developer can simply prompt Claude in natural language:
“Search my Bear notes tagged #tech, find the staging environment Redis connection rules, and add them to the current .env.example.”
Claude queries and retrieves the relevant note via MCP behind the scenes, eliminating the need to context-switch across windows or copy-paste text.
Scenario 2: Silent Quick Capture from the Shell
When encountering critical logs or command outputs, or quickly saving clipboard snippets into notes, lightweight shell functions enable instantaneous background capture:
# Quickly capture clipboard contents into Bear's scratchpad inbox
bclip() {
local title="${1:-Clipboard Capture $(date '+%Y-%m-%d %H:%M')}"
pbpaste | bearcli create "$title" --tags "inbox/quick" --content -
echo "✓ Saved clipboard to Bear: $title"
}
# Append piped command output directly to a specific section in a note
bnote() {
local title="$1" section="$2"
bearcli append --title "$title" --section "$section" --content -
}
All operations execute silently in milliseconds without spawning GUI windows, preserving uninterrupted focus.
Scenario 3: Automated Daily Work Logs
Using macOS launchd or cron alongside Git history and bearcli, developers can automatically aggregate their daily output every evening:
#!/usr/bin/env bash
TODAY=$(date '+%Y-%m-%d')
NOTE_TITLE="Daily Log $TODAY"
# Ensure today's note exists
if ! bearcli search --query "@title \"$NOTE_TITLE\"" --count | grep -q "1"; then
bearcli create "$NOTE_TITLE" --tags "journal/daily" \
--content "# $NOTE_TITLE\n\n## Standup\n- [ ] Morning sync\n\n## Git Commits Today\n\n## Completed Tasks\n"
fi
# Collect all commits made today in the specified repository
COMMITS=$(git -C "$HOME/Projects/repo" log --since="midnight" --oneline --author="$(git config user.name)")
[ -n "$COMMITS" ] && bearcli append --title "$NOTE_TITLE" --section "## Git Commits Today" --content "$COMMITS"
Scenario 4: Notes as Code and Automated Linting
In the open-source ecosystem, projects like noxctl leverage bearcli as an underlying engine to realize “Notes as Code”.
A noxctl.toml declares the tag, master, and hub taxonomy of the vault, which is then converged to that declared state idempotently—master and hub notes are generated automatically, and each managed note gets a canonical tag-line on top so bidirectional links come for free. Its audit/lint checks flag broken H1 titles, malformed canonical tag-lines, orphaned notes, and duplicate titles.
Similarly, BearKit (formerly bear-lint) traverses notes using bearcli cat --format json to flag dead links (wiki links targeting nonexistent notes) or malformed tags, applying batch fixes with bearcli overwrite guarded by --base hash receipts.
Evaluation and Decision Matrix: Bear with bearcli vs. Obsidian
bearcli is not an attempt to turn Bear into another Obsidian; rather, it provides the essential interoperability required in modern technical environments while preserving the application’s signature native craftsmanship.
Comprehensive Technical Comparison Matrix
| Dimension | Bear 2.8+ (with bearcli) | Obsidian | Analysis & Verdict |
|---|---|---|---|
| Underlying Storage | SQLite + CoreData (brokered via bearcli) | Local plain-text Markdown directory (Vault) | Obsidian offers maximum filesystem transparency; Bear closes the usability gap via its official CLI. |
| Native CLI Support | First-class official tool (Swift binary bundled with macOS app) | Official Obsidian CLI (1.12.7+, requires the desktop app to be running) | Both have official CLIs; Bear ships a bundled binary, whereas the Obsidian CLI controls the running app. |
| AI / MCP Support | Official built-in bearcli mcp-server with tag sandboxing | Official CLI and direct vault mounting; MCP integrations remain primarily community-provided | Bear’s advantage is its built-in MCP server, tag scoping, and destructive-action safeguards—not basic agent accessibility. |
| Concurrent Write Safety | High (built-in OCC hash receipts and attachment safety gates) | Its CLI operates through the running app; direct edits to vault files still need external coordination | bearcli’s section addressing and hash verification let scripts verify note state before writing. |
| Typography & Visual UX | Refined native experience (superior typography, micro-interactions, and rendering speed) | Highly customizable (Electron-based, higher startup overhead and memory footprint) | For pure writing aesthetics and frictionless interaction, Bear retains a noticeable edge. |
| Sync Experience | Zero-config iCloud sync (silent background sync across Apple devices; requires a Bear Pro subscription) | Requires paid Obsidian Sync or DIY Git / third-party sync | Bear is more seamless across Apple gear; Obsidian wins unequivocally across non-Apple platforms. |
| Cross-Platform Support | Apple ecosystem only (macOS, iOS, iPadOS, watchOS) | Every major platform (macOS, Windows, Linux, iOS, Android) | For workflows spanning Linux or Windows, Obsidian is the only viable choice. |
| Terminal Focus Stealing | Completely solved (bearcli runs 100% silently in background) | Naturally zero focus issues (direct filesystem operations) | bearcli permanently eliminates the intrusive GUI popups of legacy URL schemes. |
Decision Guide for Technical Users
In today’s landscape, these tools serve fundamentally distinct profiles:
- Who should choose Bear with bearcli: Developers deeply invested in the Apple ecosystem who prioritize typographic elegance, native fluid micro-interactions, and frictionless quick capture; those previously turned off by the lack of automation or AI support; and power users leveraging AI agents like Claude who demand strict privacy protections through tag-sandboxed knowledge bases (
--only-tags). - Who should still choose Obsidian: Users whose daily workflows include Linux or Windows, where cross-platform support is a hard requirement; those whose systems rely heavily on community plugins like Dataview, Canvas, or Excalidraw to build relational database workflows; and plain-text purists who refuse to store notes in anything other than raw, unmediated filesystem folders.
The arrival of bearcli and native MCP integration gives Apple-centric developers the best of both worlds: uncompromised native craft and the final missing piece of terminal and AI agent automation.