{"id":48387758,"url":"https://github.com/marc-shade/agent-runtime-mcp","last_synced_at":"2026-04-05T22:38:40.976Z","repository":{"id":330447935,"uuid":"1106654230","full_name":"marc-shade/agent-runtime-mcp","owner":"marc-shade","description":"Persistent task queues and goal decomposition for cross-session AGI autonomy.","archived":false,"fork":false,"pushed_at":"2026-02-22T01:36:22.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T22:38:39.908Z","etag":null,"topics":["agi","ai-agents","ai-tools","anthropic","claude","claude-code","goals","mcp","model-context-protocol","task-queue"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marc-shade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-29T17:15:24.000Z","updated_at":"2026-02-22T01:36:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marc-shade/agent-runtime-mcp","commit_stats":null,"previous_names":["marc-shade/agent-runtime-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marc-shade/agent-runtime-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marc-shade%2Fagent-runtime-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marc-shade%2Fagent-runtime-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marc-shade%2Fagent-runtime-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marc-shade%2Fagent-runtime-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marc-shade","download_url":"https://codeload.github.com/marc-shade/agent-runtime-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marc-shade%2Fagent-runtime-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31452899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agi","ai-agents","ai-tools","anthropic","claude","claude-code","goals","mcp","model-context-protocol","task-queue"],"created_at":"2026-04-05T22:38:40.237Z","updated_at":"2026-04-05T22:38:40.937Z","avatar_url":"https://github.com/marc-shade.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent Runtime MCP\n\nPersistent task queues and goal decomposition for cross-session AGI autonomy with God Agent integration.\n\n## Description\n\nAgent Runtime MCP provides persistent task management that survives across sessions, enabling true autonomous AGI workflows. Features include:\n\n- **Persistent Goals \u0026 Tasks**: SQLite-backed storage that survives restarts\n- **AI-Powered Goal Decomposition**: Break complex goals into executable tasks\n- **Dependency Management**: Automatic task ordering based on dependencies\n- **Priority Queuing**: Intelligent task scheduling by priority and readiness\n- **Relay Race Protocol** (God Agent Phase 2): 48-agent pipelines with structured handoffs\n- **Circuit Breaker** (God Agent Phase 5): Fault tolerance with automatic fallback\n- **Cross-Session Continuity**: Resume work exactly where you left off\n\n## Installation\n\n### Using pip\n\n```bash\ngit clone https://github.com/marc-shade/agent-runtime-mcp\ncd agent-runtime-mcp\npip install -r requirements.txt\n```\n\n### Using uv (recommended)\n\n```bash\ngit clone https://github.com/marc-shade/agent-runtime-mcp\ncd agent-runtime-mcp\nuv pip install -r requirements.txt\n```\n\n### Dependencies\n\n```bash\npip install anthropic-mcp\n```\n\n## Configuration\n\nAdd to `~/.claude.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"agent-runtime\": {\n      \"command\": \"python3\",\n      \"args\": [\n        \"/absolute/path/to/agent-runtime-mcp/server.py\"\n      ]\n    }\n  }\n}\n```\n\n## Tools\n\n### Core Goal \u0026 Task Management (9)\n\n| Tool | Description |\n|------|-------------|\n| `create_goal` | Create high-level goal with name and description |\n| `decompose_goal` | Use AI to break goal into tasks (sequential/parallel/hierarchical) |\n| `create_task` | Manually create task with dependencies |\n| `get_next_task` | Get next ready task from queue (highest priority, deps met) |\n| `update_task_status` | Update status (pending/in_progress/completed/failed/cancelled) |\n| `list_goals` | List all goals, optionally filtered by status |\n| `list_tasks` | List tasks by goal, status, with limit |\n| `get_goal` | Get goal details by ID |\n| `get_task` | Get task details by ID |\n\n### Relay Race Protocol (God Agent Phase 2) (6)\n\n| Tool | Description |\n|------|-------------|\n| `create_relay_pipeline` | Create 48-agent relay race with baton passing |\n| `get_relay_status` | Get pipeline status (progress, quality scores) |\n| `advance_relay` | Pass baton to next agent after completing step |\n| `retry_relay_step` | Retry failed step without restarting pipeline |\n| `list_relay_pipelines` | List pipelines by status |\n| `get_relay_baton` | Get current baton with context for next agent |\n\n### Circuit Breaker (God Agent Phase 5: Tiny Dancer) (7)\n\n| Tool | Description |\n|------|-------------|\n| `circuit_breaker_status` | Get breaker state (CLOSED/OPEN/HALF_OPEN) |\n| `circuit_breaker_list` | List all breakers with open/degraded circuits |\n| `circuit_breaker_trip` | Manually trip breaker to OPEN state |\n| `circuit_breaker_reset` | Reset breaker to CLOSED state |\n| `circuit_breaker_configure` | Configure thresholds (failures, window, cooldown) |\n| `circuit_breaker_record_failure` | Record failure for tracking |\n| `circuit_breaker_record_success` | Record success (helps recovery) |\n\n## Usage Examples\n\n### Basic Goal Creation\n\n```python\n# Create goal\ngoal = mcp__agent-runtime__create_goal({\n    \"name\": \"Build REST API\",\n    \"description\": \"Create RESTful API for user authentication with JWT tokens\",\n    \"metadata\": {\"priority\": \"high\", \"project\": \"auth-service\"}\n})\n# Returns: {\"id\": 1, \"name\": \"Build REST API\", \"status\": \"active\", ...}\n```\n\n### AI Goal Decomposition\n\n```python\n# Decompose goal into tasks (sequential strategy)\nresult = mcp__agent-runtime__decompose_goal({\n    \"goal_id\": 1,\n    \"strategy\": \"sequential\"\n})\n# Returns: {\n#   \"goal_id\": 1,\n#   \"strategy\": \"sequential\",\n#   \"tasks_created\": [101, 102, 103, 104, 105],\n#   \"count\": 5\n# }\n# Tasks: Research → Plan → Implement → Test → Document (with dependencies)\n```\n\n### Parallel Decomposition\n\n```python\n# Decompose for parallel execution\nresult = mcp__agent-runtime__decompose_goal({\n    \"goal_id\": 1,\n    \"strategy\": \"parallel\"\n})\n# Creates: Backend, Frontend, Testing tasks (no dependencies, run simultaneously)\n```\n\n### Hierarchical Decomposition\n\n```python\n# Decompose into phases\nresult = mcp__agent-runtime__decompose_goal({\n    \"goal_id\": 1,\n    \"strategy\": \"hierarchical\"\n})\n# Creates: Phase 1 (Foundation) → Phase 2 (Core) → Phase 3 (Integration) → Phase 4 (Optimization)\n```\n\n### Task Queue Processing\n\n```python\n# Get next ready task\ntask = mcp__agent-runtime__get_next_task()\n# Returns: Highest priority task with all dependencies met\n# {\"id\": 101, \"title\": \"Research requirements...\", \"priority\": 10, ...}\n\n# Start work\nmcp__agent-runtime__update_task_status({\n    \"task_id\": 101,\n    \"status\": \"in_progress\"\n})\n\n# Complete task\nmcp__agent-runtime__update_task_status({\n    \"task_id\": 101,\n    \"status\": \"completed\",\n    \"result\": \"Requirements documented in docs/api-spec.md\"\n})\n\n# Get next (automatically handles dependencies)\nnext_task = mcp__agent-runtime__get_next_task()\n# Returns: Task 102 (Plan approach) since Research (101) is complete\n```\n\n### Manual Task Creation with Dependencies\n\n```python\n# Create task with explicit dependencies\nmcp__agent-runtime__create_task({\n    \"goal_id\": 1,\n    \"title\": \"Deploy to production\",\n    \"description\": \"Deploy authentication service\",\n    \"priority\": 7,\n    \"dependencies\": [103, 104]  # Wait for Implementation and Testing\n})\n```\n\n### Relay Race Pipeline (48-Agent)\n\n```python\n# Create relay pipeline for complex workflow\npipeline = mcp__agent-runtime__create_relay_pipeline({\n    \"name\": \"Research Paper Analysis\",\n    \"goal\": \"Extract insights from 10 AGI papers\",\n    \"agent_types\": [\n        \"researcher\",      # Gather papers\n        \"analyzer\",        # Extract key points\n        \"synthesizer\",     # Find patterns\n        \"validator\",       # Check quality\n        \"formatter\"        # Create report\n    ],\n    \"token_budget\": 100000\n})\n# Returns: {\"pipeline_id\": \"rp_abc123\", \"agent_count\": 5, ...}\n\n# Check pipeline status\nstatus = mcp__agent-runtime__get_relay_status({\n    \"pipeline_id\": \"rp_abc123\"\n})\n# Returns: {\n#   \"current_step\": 2,\n#   \"total_steps\": 5,\n#   \"status\": \"in_progress\",\n#   \"quality_scores\": [0.92, 0.88, ...],\n#   \"tokens_used\": 24531\n# }\n\n# Get current baton (context for next agent)\nbaton = mcp__agent-runtime__get_relay_baton({\n    \"pipeline_id\": \"rp_abc123\"\n})\n# Returns: {\n#   \"baton\": {...},\n#   \"prompt\": \"You are the Synthesizer. Previous output: ...\"\n# }\n\n# Advance to next step\nmcp__agent-runtime__advance_relay({\n    \"pipeline_id\": \"rp_abc123\",\n    \"quality_score\": 0.88,\n    \"l_score\": 0.85,\n    \"output_entity_id\": 456,\n    \"tokens_used\": 8234,\n    \"output_summary\": \"Found 3 key patterns across papers\"\n})\n\n# Retry failed step\nmcp__agent-runtime__retry_relay_step({\n    \"pipeline_id\": \"rp_abc123\",\n    \"step_index\": 2\n})\n```\n\n### Circuit Breaker (Fault Tolerance)\n\n```python\n# Check agent circuit breaker status\nstatus = mcp__agent-runtime__circuit_breaker_status({\n    \"agent_id\": \"researcher_agent\"\n})\n# Returns: {\n#   \"agent_id\": \"researcher_agent\",\n#   \"state\": \"CLOSED\",\n#   \"failure_count\": 0,\n#   \"success_count\": 42\n# }\n\n# Record failure\nmcp__agent-runtime__circuit_breaker_record_failure({\n    \"agent_id\": \"researcher_agent\",\n    \"failure_type\": \"timeout\",\n    \"error_message\": \"API request timed out after 30s\"\n})\n\n# List all circuit breakers\nbreakers = mcp__agent-runtime__circuit_breaker_list()\n# Returns: {\n#   \"total_breakers\": 10,\n#   \"open_circuits\": [\"failing_agent_1\", \"failing_agent_2\"],\n#   \"half_open_circuits\": [\"recovering_agent\"],\n#   \"breakers\": [...]\n# }\n\n# Configure thresholds\nmcp__agent-runtime__circuit_breaker_configure({\n    \"agent_id\": \"researcher_agent\",\n    \"failure_threshold\": 5,\n    \"window_seconds\": 60,\n    \"cooldown_seconds\": 300,\n    \"fallback_agent\": \"generalist\"\n})\n\n# Manually trip (emergency stop)\nmcp__agent-runtime__circuit_breaker_trip({\n    \"agent_id\": \"researcher_agent\",\n    \"reason\": \"Manual intervention - debugging required\"\n})\n\n# Reset after fix\nmcp__agent-runtime__circuit_breaker_reset({\n    \"agent_id\": \"researcher_agent\"\n})\n```\n\n### Cross-Session Resume\n\n```python\n# Session 1: Create goal and start work\ngoal = mcp__agent-runtime__create_goal({\"name\": \"Big Project\", ...})\nmcp__agent-runtime__decompose_goal({\"goal_id\": goal[\"id\"]})\ntask1 = mcp__agent-runtime__get_next_task()\nmcp__agent-runtime__update_task_status({\"task_id\": task1[\"id\"], \"status\": \"in_progress\"})\n\n# [Close Claude Code, restart later]\n\n# Session 2: Resume exactly where left off\npending = mcp__agent-runtime__list_tasks({\"status\": \"in_progress\"})\n# Returns: [task1] - still marked as in_progress\ntask1_updated = mcp__agent-runtime__update_task_status({\n    \"task_id\": task1[\"id\"],\n    \"status\": \"completed\"\n})\nnext_task = mcp__agent-runtime__get_next_task()\n# Automatically gets task2 (next in dependency chain)\n```\n\n## Requirements\n\n- **Python**: 3.10+\n- **Dependencies**: `anthropic-mcp` (MCP SDK)\n- **Storage**: `~/.claude/agent_runtime.db` (SQLite)\n\n## Database Schema\n\nTables in `~/.claude/agent_runtime.db`:\n\n- `goals` - High-level goals with status and metadata\n- `tasks` - Individual tasks with dependencies, priority, results\n- `task_queue` - Queue position and scheduling info\n- `relay_pipelines` - Relay race pipeline definitions (God Agent Phase 2)\n- `relay_batons` - Baton state for pipeline steps\n- `circuit_breakers` - Circuit breaker state and history (God Agent Phase 5)\n\n## Decomposition Strategies\n\n### Sequential\n```\nTask 1 → Task 2 → Task 3 → Task 4 → Task 5\n```\nEach task depends on previous. Linear execution.\n\n### Parallel\n```\nTask 1 (Backend)  ─┐\nTask 2 (Frontend) ─┼─→ All run simultaneously\nTask 3 (Testing)  ─┘\n```\nNo dependencies. Maximum parallelism.\n\n### Hierarchical\n```\nPhase 1 (Foundation)\n  ↓\nPhase 2 (Core Implementation)\n  ↓\nPhase 3 (Integration)\n  ↓\nPhase 4 (Optimization)\n```\nLarge phases that can be further decomposed.\n\n## Testing\n\n```bash\n# Run test suite\npython3 test_agent_runtime.py\n\n# Test relay protocol\npython3 test_relay_protocol.py\n\n# Test circuit breaker\npython3 test_circuit_breaker.py\n```\n\n## God Agent Integration\n\n### Phase 2: Relay Race Protocol\n- 48-agent sequential pipelines\n- Structured baton passing with context\n- Quality gates at each step\n- L-Score tracking for output quality\n- Single-step retry (no full restart)\n\n### Phase 5: Circuit Breaker (Tiny Dancer)\n- Automatic failure detection\n- State machine: CLOSED → OPEN → HALF_OPEN → CLOSED\n- Configurable thresholds and cooldowns\n- Fallback agent routing\n- Recovery monitoring\n\n## Links\n\n- GitHub: https://github.com/marc-shade/agent-runtime-mcp\n- Issues: https://github.com/marc-shade/agent-runtime-mcp/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarc-shade%2Fagent-runtime-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarc-shade%2Fagent-runtime-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarc-shade%2Fagent-runtime-mcp/lists"}