sovereign-exoself-mcp

sovereign-exoself-mcp

Local MCP server for a personal AI Council that routes tasks through manager, worker, critic, synthesizer, and archivist agents with fast/review/full paths, using SQLite memory and supporting mock, Ollama, and OpenRouter providers.

Category
访问服务器

README

sovereign-exoself-mcp

Local MCP server for personal AI Council. Routes tasks through manager, worker, critic, synthesizer, and archivist with fast/review/full paths. Uses SQLite memory with WAL and FTS5. Supports mock, Ollama, and OpenRouter providers.

Architecture

flowchart LR
  C[MCP stdio client] --> T[3 tools]
  T --> O[Council Router]
  O --> M[Manager<br/>granite3.3:2b]
  M -->|fast| W[Worker<br/>qwen2.5-coder:7b]
  M -->|review| W
  M -->|full| W
  W -->|review| CR[Critic<br/>qwen2.5-coder:7b]
  CR -->|reject| W
  CR -->|approve| S[Synthesizer<br/>granite3.3:2b]
  S -->|full| A[Archivist<br/>granite3.3:2b]
  S --> R[Result]
  A --> R

Model Configuration (Config B)

Role Model Rationale
Manager granite3.3:2b Fast routing decisions
Worker qwen2.5-coder:7b Quality code execution
Critic qwen2.5-coder:7b Reliable code review
Synthesizer granite3.3:2b Fast result merging
Archivist granite3.3:2b Fast memory extraction

Benchmark: 1504ms avg, 3428ms P95, 100% success rate, 0 timeouts.

Quick Start

Requirements: Ubuntu/Linux, Python 3.14, uv.

cd /home/hat/AionUI/sovereign-exoself-mcp
bash scripts/install.sh
bash scripts/smoke_test.sh --mock

--mock mode requires no API key and is useful for offline validation. For real inference, run the server directly with a provider (see below). scripts/generate_client_configs.py auto-generates host snippets (dist/) that enable a real provider: ollama by default, openrouter when OPENROUTER_API_KEY is present.

Ollama Mode

# Pull required models
ollama pull granite3.3:2b
ollama pull qwen2.5-coder:7b

# Run with Ollama
SOVEREIGN_PROVIDER_MODE=ollama \
uv run python -m sovereign_exoself_mcp

OpenRouter Mode

# Secrets are environment-only: store the key in the gitignored `.env` file
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env

SOVEREIGN_PROVIDER_MODE=openrouter \
uv run python -m sovereign_exoself_mcp

Council Routes

Fast Path (Default)

Manager → Worker → Result. Used for simple questions, facts, quick analysis.

Review Path

Manager → Worker → Critic → Synthesizer → Result. Used for code changes, architecture decisions.

Full Council

Manager → Worker → Critic → Synthesizer → Archivist → Result. Used for complex tasks requiring memory.

API Tools

council_run

{
  "task": "Review and improve the configuration loader.",
  "mode": "auto",
  "budget": "low",
  "worker_profile": null,
  "needs_memory": null,
  "max_rounds": null,
  "route_override": null
}

Mode values: auto (manager decides), code, analysis, decision. As a shorthand, mode also accepts fast, review, or full to force a route directly. An explicit route_override (fast/review/full) always wins when provided.

Response includes: run_id, status, route, models, result, metrics, memory_updates, warnings

memory_manage

{
  "action": "search",
  "query": "design decisions"
}

Actions: search, store, list, delete, export, profile

system_status

Returns health, provider mode, model mapping, prompt versions, active runs, Ollama status.

Changing Models

# Environment variables
export SOVEREIGN_OLLAMA_WORKER_MODEL=qwen3:8b
export SOVEREIGN_OLLAMA_MANAGER_MODEL=gemma2:2b

# Or config file
cp config/council.example.yaml config/council.yaml
# Edit config/council.yaml

Worker Profiles

Profile Purpose
code_engineer Code implementation, debugging, refactoring
system_engineer Infrastructure, DevOps, system design
researcher Information gathering, analysis
technical_writer Documentation, prose
planner Task decomposition, project planning
general_operator Default fallback

Running Benchmark

# Mock benchmark
python benchmarks/benchmark.py --mode mock

# Live benchmark (requires Ollama with models)
OLLAMA_TEST_MODEL=qwen2.5-coder:7b python benchmarks/benchmark.py --mode ollama

System Status

# Via MCP tool
system_status({})

# Via CLI
uv run python -c "import asyncio; from sovereign_exoself_mcp.providers import probe_ollama; print(asyncio.run(probe_ollama('http://127.0.0.1:11434', 5)))"

Rollback

  1. Set SOVEREIGN_PROVIDER_MODE=mock
  2. Remove new environment variables
  3. Revert code changes

Adding Worker Profiles

  1. Create src/sovereign_exoself_mcp/prompts/profiles/<name>.txt
  2. Add to PROFILES list in prompts.py
  3. Use in requests: {"worker_profile": "<name>"}

Environment Variables

See .env.example for all available settings.

Documentation

Testing

# Run all tests
python -m pytest tests/ -v

# Run specific test suite
python -m pytest tests/unit/test_prompts.py -v
python -m pytest tests/unit/test_router.py -v
python -m pytest tests/unit/test_schemas.py -v

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选