bearier-mcp

bearier-mcp

Bearier MCP lets two desktop AI agents collaborate asynchronously through a shared local task queue โ€” no API keys, no IDE, no cloud. Just one SQLite file bridging agents that otherwise can't talk to each other.

Category
Visit Server

README

๐Ÿป Bearier MCP

Multi-Agent Desktop Toolkit for Everyone

English | ็ฎ€ไฝ“ไธญๆ–‡

Bearier MCP lets two desktop AI agents collaborate asynchronously through a shared local task queue โ€” no API keys, no IDE, no cloud. Just one SQLite file bridging agents that otherwise can't talk to each other.

Pair a brain agent (plans, dispatches, reviews) with a hands agent (executes, reports). They coordinate through Bearier without either one needing an open API, an SDK, or a single line of glue code.

  Brain agent                    Hands agent
  (plans, dispatches,            (claims, executes,
   reviews results)               reports back)
        โ”‚                              โ”‚
        โ”‚ MCP stdio                    โ”‚ MCP stdio
        โ–ผ                              โ–ผ
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚         Bearier MCP server (stdio)      โ”‚
   โ”‚                                          โ”‚
   โ”‚            shared SQLite (local)         โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why

Most multi-agent tooling assumes you're a developer who lives in an IDE, configures API keys, and wires up coding agents inside VS Code. Bearier is built for everyone else โ€” people who use desktop AI apps that have no open API, no SDK, and no extension surface beyond an MCP config file and natural-language conversation.

If your agent can load an MCP server over stdio, it can join Bearier. That's the only requirement.

Bearier itself is just a task post office: it reliably relays tasks, persists state and result pointers, and gets out of the way. It never reasons, never executes commands, and never bypasses either agent's own permissions.

Features

  • 6-state machine with terminal-state protection โ€” a finished task can never be re-claimed by another worker
  • Atomic task claiming โ€” UPDATE ... WHERE status='pending' inside a transaction; the database guarantees a single winner even under concurrent fetch_pending_tasks
  • Heartbeat lease renewal + dual-layer timeout โ€” pending tasks that nobody claims expire to failed; running tasks whose lease lapses are reaped to failed/TIMEOUT
  • Approval gating โ€” tasks flagged approval_required or destructive are reported as needs_approval and never auto-executed
  • Path safety โ€” working_directory, context_path, result_path are validated by realpath against an allowlist; symlink traversal is rejected
  • Zero heavy dependencies โ€” Python stdlib sqlite3 + mcp; no Node, no Rust, no Docker
  • Cross-platform โ€” runs on macOS, Windows, and Linux; paths adapt via os.pathsep

Quick start

1. Install Python dependencies

Bearier needs Python 3.13+. Create a venv and install:

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

macOS note (no Rust): mcp==1.28.1 pulls pyjwt[crypto] โ†’ cryptography, which needs Rust to build. Since stdio never uses RS256 JWT, install in two steps to skip it:

pip install --no-deps mcp==1.28.1
pip install --only-binary :all httpx-sse==0.4.3 jsonschema==4.26.0 \
  python-multipart==0.0.32 sse-starlette==3.4.6 starlette \
  typing-inspection uvicorn pyjwt==2.13.0

Verify: python -c "from mcp.server.fastmcp import FastMCP; print('ok')"

2. Configure both agents

Both agents must point at the same BRIDGE_DB_PATH โ€” that's how they see each other's writes.

WorkBuddy โ€” ~/.workbuddy/mcp.json:

{
  "mcpServers": {
    "bearier": {
      "command": "/path/to/python",
      "args": ["/path/to/bearier-mcp/src/server.py"],
      "env": {
        "PYTHONPATH": "/path/to/bearier-mcp/src",
        "BRIDGE_DB_PATH": "/path/to/bridge.db",
        "ALLOWED_WORKSPACES": "/path/to/your/workspace",
        "SHARED_DIR": "/path/to/your/shared"
      }
    }
  }
}

Codex desktop โ€” ~/.codex/config.toml (TOML, not JSON):

[mcp_servers.bearier]
type = "stdio"
command = "/path/to/python"
args = ["/path/to/bearier-mcp/src/server.py"]
startup_timeout_sec = 30

[mcp_servers.bearier.env]
PYTHONPATH = "/path/to/bearier-mcp/src"
BRIDGE_DB_PATH = "/path/to/bridge.db"
ALLOWED_WORKSPACES = "/path/to/your/workspace"
SHARED_DIR = "/path/to/your/shared"

Restart both apps after writing. In WorkBuddy, also click Trust on the connector management page.

3. Verify connectivity

Ask each agent to call ping(caller="codex" / "workbuddy"), then list_ping_log(limit=5). If you see both pings, the bridge is live.

Tools (7)

Tool Called by Purpose
ping(caller, note) both connectivity check, writes ping_log
list_ping_log(limit) both view ping history
db_info() both database path + stats (debugging)
assign_task(...) brain dispatch a self-contained task
fetch_pending_tasks(worker_id, limit, claim) hands pull work; claim=true atomically transitions pendingโ†’running
report_result(task_id, worker_id, status, ...) hands report done / failed / needs_approval / cancelled / running (heartbeat)
get_task_result(task_id) brain fetch result + full event timeline

State machine

pending โ†’ running              claim
pending โ†’ failed               claim timeout (no worker)
running โ†’ running              heartbeat / lease renewal
running โ†’ done                 success
running โ†’ failed               failure / lease timeout (TIMEOUT)
running โ†’ needs_approval       requests human approval
running โ†’ cancelled            cancelled

done / failed / needs_approval / cancelled are terminal โ€” re-submitting the same terminal state is idempotent and returns the stored result. Only pendingโ†’running and runningโ†’running change task ownership; all other transitions are reported by the holding worker.

Automation (hands agent auto-pull)

Schedule the hands agent to periodically call fetch_pending_tasks so dispatched work gets picked up without human prompting. Suggested automation prompt:

Call fetch_pending_tasks(worker_id="workbuddy-default", limit=1, claim=true). If count=0, return silently. If a task is claimed: execute per instruction inside working_directory. On success call report_result(status="done", task_id=..., worker_id="workbuddy-default", summary="..."). On failure call report_result(status="failed", task_id=..., worker_id="workbuddy-default", error_code="EXEC_ERROR", error_message="..."). Tasks marked destructive or approval_required=true are reported as needs_approval and not executed.

For real-time collaboration, just tell the hands agent "pull pending tasks" โ€” it responds in seconds. Automation is the offline backstop.

Dashboard

Visualize the full collaboration timeline in a browser:

PYTHONPATH=src python src/dashboard.py

Open http://127.0.0.1:8765. Bound to loopback only โ€” never exposed publicly. Each task card shows title, status badge, worker, timestamps, error (if any), and the event timeline (created โ†’ claimed โ†’ completed).

Security

  • stdio only โ€” no network ports (dashboard binds 127.0.0.1 exclusively)
  • Never expose the database or dashboard to the public internet
  • Database lives on the local system disk โ€” not on ExFAT/removable drives (multi-process SQLite locking is unreliable there)
  • working_directory must fall inside ALLOWED_WORKSPACES
  • context_path / result_path must fall inside working_directory or SHARED_DIR (realpath-validated, anti-traversal)
  • summary โ‰ค 4 KB, metadata โ‰ค 16 KB โ€” larger payloads are forced to disk via result_path
  • destructive / approval_required tasks are never auto-executed by automation

Error codes

VALIDATION_ERROR / TASK_NOT_FOUND / INVALID_STATE / TASK_ALREADY_CLAIMED / WORKER_MISMATCH / TIMEOUT / PERMISSION_DENIED / PATH_VIOLATION / RESULT_TOO_LARGE / EXEC_ERROR / DATABASE_BUSY / UNKNOWN

Uniform response shape: {ok: bool, data: dict|null, error: {code, message, retryable}|null}

How it compares

Bearier occupies a lane most multi-agent tools don't:

Bearier MCP agent-orchestration beads-village
Target user everyone (non-coders) developers in IDEs developers in IDEs
Target agent desktop apps, no API needed IDE coding agents (Cursor, Copilot) IDE coding agents
Agent discovery by worker_id, no shared cwd requires same cwd team-based, same project
Transport stdio stdio stdio
Task timeout dual-layer (pending + lease) agent-level only none
Approval gating yes research gate no
Dependencies Python stdlib only Node 18+ Node + Python + optional Go

If you live in an IDE and want rich in-editor coordination, those projects fit better. If you have two desktop AI apps that only speak MCP and want them to hand off tasks โ€” Bearier is the bridge.

Project structure

bearier-mcp/
โ”œโ”€โ”€ README.md                   this file (English)
โ”œโ”€โ”€ README.zh-CN.md             ไธญๆ–‡็‰ˆ
โ”œโ”€โ”€ requirements.txt            pinned dependencies
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ server.py               MCP server (7 tools)
โ”‚   โ”œโ”€โ”€ config.py               config loading + path boundary checks
โ”‚   โ”œโ”€โ”€ errors.py               12 error codes + uniform response
โ”‚   โ”œโ”€โ”€ models.py               6-state machine + Task data structure
โ”‚   โ”œโ”€โ”€ db.py                   SQLite connection + schema init
โ”‚   โ”œโ”€โ”€ repository.py           task repo (CRUD + atomic claim + timeout sweep + path validation)
โ”‚   โ””โ”€โ”€ dashboard.py            collaboration timeline HTTP server (127.0.0.1:8765)
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_ping_client.py     connectivity test
โ”‚   โ”œโ”€โ”€ test_repository.py      data layer (29 cases)
โ”‚   โ””โ”€โ”€ test_mcp_tools.py       MCP tool end-to-end (22 cases)
โ””โ”€โ”€ config-examples/
    โ”œโ”€โ”€ workbuddy.mcp.json      WorkBuddy config example
    โ””โ”€โ”€ codex-desktop.config.toml  Codex desktop config example

Testing

PYTHONPATH=src python tests/test_repository.py   # 29 cases
PYTHONPATH=src python tests/test_mcp_tools.py    # 22 cases
PYTHONPATH=src python tests/test_ping_client.py  # connectivity

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured