MonarchAgents
English | 简体中文
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.mdskills 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:
The Parliamentary Cabinet theme with the English UI — same product, different court:
Settings: registering an agent, with automatic detection of locally installed CLIs (Claude Code / Codex / Gemini CLI):
Quickstart
Option A: Desktop App (Recommended — No Python Setup Required)
Download the latest release from GitHub Releases:
- macOS (Apple Silicon / arm64) — v0.1.3 and later: open
MonarchAgents-macos-arm64.dmgand 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.exeand 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.zipstays 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, create a .env file in the app data folder — macOS: ~/Library/Application Support/MonarchAgents/.env, Windows: %LOCALAPPDATA%\MonarchAgents\.env — with lines such as DEEPSEEK_API_KEY=... (see .env.example in this repo for all supported providers), then restart the app.
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:
- Onboarding: Pick your language and cultural theme, then walk through the 5-step interactive tutorial.
- Settings: Register your CLI (
claude_code/codex/gemini_cli) or API agents. - Appointments: Appoint a Cabinet position (reports to Monarch) and one or more Minister positions (with explicit
scopeand allowedtools). - 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
- Real Codex CLI + API Run —
codex-cliMinister +baifan/deepseek-v4.1-flash-ecoCabinet (tsk_08ba6d7213,presented). - Real API Rejection & Escalation Run — 3 Cabinet rejections + Monarch escalation resolution + provider-reported costs (
tsk_3208540069).
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 bymonarchagents.adaptersandmonarchagents.toolsfor LLM provider routing, fallback, and web search/fetch.
Metadata
Release files for monarchagents 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| monarchagents-0.1.3.tar.gz | 7.9 MB | Without provenance | Details for monarchagents-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| monarchagents-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for monarchagents-0.1.3-py3-none-any.whl |
Total release size: 14.5 MB
Release files / monarchagents-0.1.3.tar.gz
| Download URL | monarchagents-0.1.3.tar.gz |
|---|---|
| Size | 7.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d1dde12a296e4d1f42c1bf330f4cabb1f188f1bc30773bd8ad648c52c951085
|
|
BLAKE2b-256 checksum How to use checksums |
217afba0d8530f1e5698cf0c1d5b9d4073a3d5e39cc3ee8fbf824f3e7119a401
|
| 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.3-py3-none-any.whl
| Download URL | monarchagents-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22a69a1d4574efe1731741c5a1ef9156e2abcbcfaae79496401d96f0c343a4da
|
|
BLAKE2b-256 checksum How to use checksums |
afd728eed3c61e4cbbd22c415751868d9eb6a794a84d8c53ecac9746a041341f
|
| 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.3
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.