Skip to main content

MonarchAgents

English | 简体中文

Python License Ruff

MonarchAgents — you are the monarch, they are the agents.
(你当君主,agents 替你办事。)

MonarchAgents is an open-source, local-first multi-agent collaboration platform.
You give high-level direction; an appointed Cabinet agent clarifies requirements, proposes a division of labor, and presents a confirmation checklist; Minister agents (your local CLI agents like Claude Code, Codex, Gemini CLI, or API-backed models) execute within scoped positions; the Cabinet reviews deliverables first and rejects substandard work (with mandatory reasons) before presenting approved results to you.


Why MonarchAgents?

  • Human-in-the-loop by design: Nothing is dispatched until you confirm the Cabinet's checklist; nothing reaches you until the Cabinet verifies it. After 3 rejections (configurable), the Cabinet escalates to you (Continue, Adjust Plan, or Accept As Is).
  • CLI + API + MCP + GitHub Skills: Connect local coding CLIs (Claude Code, Codex, Gemini CLI) alongside 10 built-in API providers (DeepSeek, OpenAI, Anthropic Claude, Google Gemini, OpenRouter, xAI Grok, Qwen, Kimi, GLM, Ollama) and custom relays. Attach stdio MCP servers or install GitHub SKILL.md skills directly in the UI.
  • Pluggable Cultural Themes + 10 Languages: Switch seamlessly between Chinese Imperial Court (zh_court), Western Royal Court (en_royal), and Parliamentary Cabinet (parliament), with an independent 10-language switcher (zh, en, ja, ko, fr, de, es, pt, ru, ar).
  • Local-first & Auditable: Positions, appointments/dismissals, confirmation checklists, rejections, memorials, inter-agent messages, and provider-reported token costs (never estimated) are stored locally in SQLite. API keys stay in .env.

Screenshots

The Chinese Imperial Court theme with the Chinese UI — the court scene, the Cabinet Secretary's seal, and the three-step court setup:

MonarchAgents — Chinese Imperial Court

The Parliamentary Cabinet theme with the English UI — same product, different court:

MonarchAgents — Parliamentary Cabinet

Settings: registering an agent, with automatic detection of locally installed CLIs (Claude Code / Codex / Gemini CLI):

MonarchAgents — Settings with CLI detection


Quickstart

Download the latest release from GitHub Releases:

  • macOS (Apple Silicon / arm64) — v0.1.3 and later: open MonarchAgents-macos-arm64.dmg and drag MonarchAgents into the Applications folder, then launch it from there. (First launch: the app is not yet signed with an Apple Developer ID, so Gatekeeper may warn — right-click the app → Open → Open to allow it once.)
  • Windows (x64) — v0.1.3 and later: run MonarchAgents-Setup-x64.exe and follow the installer (Start Menu shortcut, optional desktop shortcut, uninstaller included). (First launch: SmartScreen may warn about an unsigned app — choose More info → Run anyway.)
  • Earlier releases (up to v0.1.2) shipped as .zip: unzip and open the app directly. A portable .zip stays attached to every release as an alternative.

Connect an agent before your first edict: MonarchAgents ships without agents. Local CLI agents (Claude Code, Codex, Gemini CLI) are detected automatically — check the Settings page. For API agents, register one on the same page: pick the provider, paste your API key into the form (stored only on this device), and hit Test Connection to verify it before your first edict. (Alternatively, keys can come from a .env file in the app data folder — macOS: ~/Library/Application Support/MonarchAgents/.env, Windows: %LOCALAPPDATA%\MonarchAgents\.env.)

Option B: Run from Source

git clone https://github.com/hx2167564036-hash/MonarchAgents.git
cd MonarchAgents
uv sync --extra dev

Or with standard pip:

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Configure API keys (optional if using local CLIs or Ollama):

cp .env.example .env
# Add keys you use, e.g. DEEPSEEK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, BAIFAN_API_KEY

Launch the local platform (or desktop window with desktop):

.venv/bin/python -m monarchagents serve --host 127.0.0.1 --port 8000

First-run flow:

  1. Onboarding: Pick your language and cultural theme, then walk through the 5-step interactive tutorial.
  2. Settings: Register your CLI (claude_code / codex / gemini_cli) or API agents.
  3. Appointments: Appoint a Cabinet position (reports to Monarch) and one or more Minister positions (with explicit scope and allowed tools).
  4. Overview: Issue an edict → review and confirm the Cabinet's checklist item by item → inspect deliverables & acceptance verdicts in Memorials and full logs/costs in Tasks.

Real End-to-End Run Archives


Build Desktop App Locally

# macOS (.app + drag-to-install .dmg + .zip)
uv sync --extra desktop
bash scripts/build_bundle.sh
# Windows (.exe + .zip; also builds MonarchAgents-Setup-x64.exe when Inno Setup 6 is installed)
uv sync --extra desktop
powershell -ExecutionPolicy Bypass -File scripts\build_windows.ps1

Development & Contributing

.venv/bin/python -m pytest tests/ -q
.venv/bin/python -m ruff check src tests

See CONTRIBUTING.md for adding new themes, CLI adapters, or skills.


Architecture & History

  • src/monarchagents/ — Court core (core/), CLI & API adapters (adapters/), ToolRegistry / MCP client / GitHub skills installer (tools/), SQLite persistence (storage/), themes (themes/), 10-language locales (locales/), FastAPI Web UI (web/), and desktop launcher (desktop.py).
  • src/researchcrew/ — Preserved from ResearchCrew (v0.1–v0.3) and imported directly by monarchagents.adapters and monarchagents.tools for LLM provider routing, fallback, and web search/fetch.

Metadata

Release files for monarchagents 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monarchagents 0.1.6
File Size Uploaded Provenance Actions
monarchagents-0.1.6.tar.gz 8.0 MB Without provenance Details for monarchagents-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monarchagents 0.1.6
File Interpreter ABI Platform Actions
monarchagents-0.1.6-py3-none-any.whl Python 3 none any Details for monarchagents-0.1.6-py3-none-any.whl

Total release size: 14.6 MB

Release files / monarchagents-0.1.6.tar.gz

Download URL monarchagents-0.1.6.tar.gz
Size 8.0 MB
Tags Source
SHA-256 checksum
How to use checksums
1b87c231a87e8bec8f07948df0bb62edccb3d21afc16858831074c257939b3bb
BLAKE2b-256 checksum
How to use checksums
373ac6a49a9097629841c4c68786dc4212f08e3495138479e88b8a1c07348f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / monarchagents-0.1.6-py3-none-any.whl

Download URL monarchagents-0.1.6-py3-none-any.whl
Size 6.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8313066c835d9fe5c976348093a67e13e84c7c42eeaf8ff0941b13efbb16432f
BLAKE2b-256 checksum
How to use checksums
294e305b6ee6345a0aeff9a7d12b064aac8124534fefd7c1b9eebdbffc3ab192
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for monarchagents 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page