经 AI Skill Hub 精选评估,主权OS 获评「强烈推荐」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
主权OS 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
主权OS 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/Justin0504/Sovereign-OS
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"--os": {
"command": "npx",
"args": ["-y", "sovereign-os"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 主权OS 执行以下任务... Claude: [自动调用 主权OS MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"__os": {
"command": "npx",
"args": ["-y", "sovereign-os"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <a href="https://github.com/Justin0504/Sovereign-OS/actions"><img src="https://github.com/Justin0504/Sovereign-OS/actions/workflows/ci.yml/badge.svg" alt="CI"/></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"/></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.12+-green.svg" alt="Python 3.12+"/></a> </p>
<p align="center"> <img src="readme_images/sovereign_logo.png" alt="Sovereign-OS" width="720" style="max-width:100%"/> </p>
<p align="center"> <strong>Governance for an autonomous AI workforce — runs on your machine, on your keys.<br> Submit a goal: Sovereign-OS plans it, checks the budget, executes with built-in workers, and delivers a cryptographically verified result.</strong> </p>
<p align="center"> <em>Open source • self-hosted • bring your own keys • no fund custody</em> </p>
<p align="center"> <a href="#quick-start">Quick Start</a> • <a href="#architecture">Architecture</a> • <a href="#features">Features</a> • <a href="#deployment">Deployment</a> • <a href="#configuration">Configuration</a> • <a href="#custom-workers">Custom Workers</a> • <a href="#docs">Docs</a> </p>
<p align="center"> <img src="readme_images/demo1.gif" alt="Sovereign-OS dashboard demo" width="760" style="max-width:100%"/> </p>
---
Sovereign-OS is not another chatbot wrapper or agent framework. It is an operating system for autonomous AI work: a governance layer that enforces budget, quality, and permissions before any token is spent or any task is executed.
The core contract is simple. One YAML file — the Charter — declares the agent's mission, spending limits, KPIs, and allowed capabilities. Everything else — planning, approval, execution, auditing, payment — flows from that file.
Charter → CEO (plan) → CFO (approve budget) → Workers (execute) → Auditor (verify) → Ledger (record)
The Ledger is append-only. The Auditor is cryptographically bound. Neither can be overridden at runtime.
---
Governance - Charter-driven: mission, competencies, KPIs, fiscal boundaries — all in one YAML. - CEO (Strategist) decomposes natural-language goals into executable task plans with dependencies. Reactive: prune_to_budget sheds lowest-value tasks to fit a budget without breaking the dependency DAG; corrective_task builds a high-priority retry carrying the audit's failure reason and fix. - Profitability-first task selection — before spending any compute, an ingest screen (governance/economics.py) estimates a task's fully-loaded cost (LLM by category × complexity + settlement fee + gas) and skips anything that can't clear the margin floor. Stops the classic autonomous-agent failure mode where fees/gas turn shipped work into a net loss. Opt in with SOVEREIGN_PROFIT_SCREEN=true; tune with SOVEREIGN_{SETTLEMENT_FEE_RATIO,GAS_COST_CENTS,MIN_MARGIN_RATIO}. - Reactive self-repair — a task that fails audit is automatically re-run with the Auditor's reason + fix folded into its brief (SOVEREIGN_MAX_REPAIR_ATTEMPTS=N), recovering quality with no human in the loop. Only a fully-passing mission reaches delivery/settlement — a failed audit never gets submitted to a platform or charged. - CFO (Treasury) enforces max_task_cost_usd, daily_budget_usd, runway_days, and min_job_margin_ratio before any task runs. A runtime SpendCircuitBreaker adds fast-fail during a session — it halts the loop when cumulative spend hits a session ceiling, audits fail past a streak limit, or ROI collapses (the guard that stops runaway agent loops the pre-flight gates miss). Configure via SOVEREIGN_SESSION_CEILING_CENTS, SOVEREIGN_MAX_CONSECUTIVE_FAILURES, SOVEREIGN_ROI_FLOOR (all default off); watch it live on the dashboard Guardrails tab (session spend vs. ceiling, failure streak, ROI, one-click reset). - Permissions — TrustScore-gated capabilities (READ_FILES, WRITE_FILES, EXECUTE_SHELL, SPEND_USD, CALL_EXTERNAL_API), earned per category, with graduated autonomous-spend ceilings. High-risk grants use just-in-time leases: scoped to one task, bounded by TTL and use-count, auto-revoked on completion (grant_lease / use_lease / revoke_task_leases). Active leases and per-agent trust are shown live on the dashboard Guardrails tab. - Two dashboards, same guardrails — the web dashboard (Guardrails tab + per-task quality scorecard) and a Textual terminal Command Center (python -m sovereign_os.ui.app) both surface the CFO circuit breaker (session spend vs. ceiling, failure streak, ROI; press b to reset), active JIT leases, and the category-rubric breakdown streamed live under each audit verdict. - Prometheus metrics — all three guardrails export on /metrics for Grafana: breaker session spend/ceiling/ROI/trips, active JIT leases, per-agent trust, and per-category audit-quality histograms (overall + per rubric criterion). See docs/METRICS.md for the metric list and PromQL starter panels.
Execution - 16 built-in workers: summarize, research, reply, write_article, write_email, write_post, meeting_minutes, translate, rewrite_polish, collect_info, extract_structured, spec_writer, solve_problem, assistant_chat, code_assistant, code_review. - Verification-driven coding — the coding worker runs a harness-enforced loop (run_with_verified_tools): it won't accept "done" until the test suite actually passes. A premature answer bounces back with the failing test output and the model must fix and re-verify — code that can't reach green is marked tests_verified=false / success=false, so broken work never ships to a paid bounty. Gates only when execution is enabled (SOVEREIGN_CODE_EXEC_ENABLED); otherwise it's a no-op skip. - Multi-model: Strategist and workers can use different backends (e.g. GPT-4o for planning, Claude for execution). - Pluggable agent backends — for complex delivery a worker can delegate a whole task to a purpose-built coding agent (Claude Code, OpenAI Codex, Gemini CLI, Aider, or any headless CLI via a command template) instead of a single chat call. One stable AgentBackend seam; new agents plug in by config (SOVEREIGN_AGENT_BACKEND / SOVEREIGN_BACKEND_<CATEGORY>), dry-run until SOVEREIGN_AGENT_BACKEND_ENABLED=true. - MCP connectors in every worker — register MCP servers via SOVEREIGN_MCP_SERVERS and their tools appear inline in every worker's tool-use loop, next to built-ins like web_fetch. Any MCP-provided connector (DBs, search, SaaS, another agent over MCP) becomes callable mid-task with no code change — the universal connector layer both Claude Agent SDK and Codex speak. See docs/BACKENDS.md. - Dynamic worker loading: drop a Python file into sovereign_os/agents/user_workers/ — no registration boilerplate.
Auditing - Every task output is verified against Charter KPIs by the ReviewEngine. - Category-tuned analytic rubric: high-value deliverables are scored criterion-by-criterion on a rubric matched to the work type — coding gets correctness/completeness/robustness/relevance, writing gets clarity/voice, etc. — always ending in a safety criterion. Criterion order is deterministically shuffled per task to blunt LLM-judge positional bias. - Value-aware bar: higher-paid jobs must clear a stricter passing score; cheap tasks can skip the (relatively expensive) LLM judge. - AuditReport carries score, passed, reason, suggested_fix, sub_scores, and proof_hash (SHA-256 of inputs + output). Each job's delivery view renders a quality scorecard — the per-criterion rubric breakdown (bars per criterion, category label, overall score) so you can see why a deliverable passed or failed, not just the verdict. - Append-only audit trail (JSONL). Integrity verifiable offline.
Monetization & job queue - SQLite-backed job queue (Redis optional for multi-instance). - Stripe integration: set STRIPE_API_KEY and each completed job triggers a real charge; transactions appear in your Stripe Dashboard. - Auto-approval mode or manual review per job. - Ingest from any HTTP endpoint, Reddit (PRAW), Shopify, WooCommerce, or custom scrapers via the ingest bridge. - Webhook delivery: POST job result to any URL on completion.
<p align="center"> <img src="readme_images/job_delivery.png" alt="Job delivery result" width="340" style="max-width:48%"/> <img src="readme_images/stripe_dashboard.png" alt="Stripe Dashboard — completed charges" width="340" style="max-width:48%"/> </p> <p align="center"><sub>Left: job result delivered in the dashboard. Right: charges recorded directly in Stripe Dashboard.</sub></p>
Observability - OpenTelemetry tracing. - Prometheus metrics at GET /metrics: job counters, queue depth, task duration histograms. - GET /health returns config warnings (missing API keys, payment mode). - Structured JSON logs with correlation IDs.
Security - API key authentication (constant-time comparison). - Optional IP allowlist and per-IP rate limiting. - Job input validation (Pydantic v2). - No secrets in code; everything via environment variables.
<p align="center"> <img src="readme_images/block_case.png" alt="TrustScore gates" width="340" style="max-width:48%"/> <img src="readme_images/block_case_detail.png" alt="Permission gate detail" width="340" style="max-width:48%"/> </p> <p align="center"><sub>TrustScore-gated permission system — agents earn capabilities through passing audits.</sub></p>
---
```bash cp .env.example .env
services: web: build: . ports: ["8000:8000"] env_file: .env volumes: - sovereign_data:/app/data redis: image: redis:7-alpine volumes: - redis_data:/data ```
See docs/DEPLOY.md for volume strategy, health checks, and graceful shutdown.
Everything runs on your machine, on your keys — nothing is sent to a central service.
Docker — the whole workspace:
```bash git clone https://github.com/Justin0504/Sovereign-OS.git && cd Sovereign-OS export ANTHROPIC_API_KEY=sk-ant-… # or OPENAI_API_KEY docker compose up -d redis web # web console on :8000
python -m sovereign_os.web.app
python -m sovereign_os.web.app ```
Listens on http://0.0.0.0:8000 by default. Set SOVEREIGN_HOST and SOVEREIGN_PORT to change.
docker compose up -d
Pull real orders from Reddit, scrapers, or Shopify:
```bash pip install -e ".[bridge]" python -m sovereign_os.ingest_bridge # serves on :9000
```
See docs/INGEST_BRIDGE.md for Reddit credentials, scraper targets, and retail connectors.
---
All configuration is via environment variables. Copy .env.example to .env.
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | One of these | OpenAI API key for LLM workers |
ANTHROPIC_API_KEY | One of these | Anthropic API key for LLM workers |
STRIPE_API_KEY | Optional | Stripe secret key (sk_test_… or sk_live_…). Without this, charges are simulated. |
SOVEREIGN_CHARTER_PATH | Optional | Path to Charter YAML. Default: charter.default.yaml. |
SOVEREIGN_JOB_DB | Optional | SQLite path. Default: data/jobs.db. |
SOVEREIGN_AUTO_APPROVE_JOBS | Optional | true to skip manual approval. Default: false. |
SOVEREIGN_JOB_WORKER_ENABLED | Optional | true to start the background job processor. Default: false. |
SOVEREIGN_INGEST_URL | Optional | HTTP endpoint to poll for incoming jobs. |
SOVEREIGN_INGEST_ENABLED | Optional | true to enable the ingest poller. Default: false. |
SOVEREIGN_API_KEY | Optional | Bearer token for /api/* endpoints. |
SOVEREIGN_ALLOWED_IPS | Optional | Comma-separated IP allowlist. |
SOVEREIGN_WEBHOOK_URL | Optional | URL to POST job results to on completion. |
REDIS_URL | Optional | Redis connection string for multi-instance job queue. |
Full reference: docs/CONFIG.md.
---
高质量的开源MCP工具
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
AI Skill Hub 点评:主权OS 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | Sovereign-OS |
| 原始描述 | 开源MCP工具:Constitution-first AI orchestration: one Charter (YAML) defines mission, budget 。⭐98 · Python |
| Topics | ai-agentsorchestrationpython |
| GitHub | https://github.com/Justin0504/Sovereign-OS |
| 语言 | Python |
收录时间:2026-06-29 · 更新时间:2026-07-03 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端