Skip to content

About

Production-grade multi-agent runtime featuring dynamic StateGraph DAG execution, FastMCP protocol integration, AST-filtered sandbox, and 3-tier Human-in-the-Loop governance.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentMesh-MCP: Enterprise Multi-Agent Runtime with Model Context Protocol

Python 3.10+ License: Apache 2.0 Architecture: State-Graph Protocol: Model Context Protocol (MCP)

Architect & Author: Chethan Raj D S (chethanraj.d.s@gmail.com)
Engineering Focus: 0-to-1 Agentic Systems · State Graph Engines · Ephemeral Sandboxing · Tool Governance


1. Architectural Overview

AgentMesh-MCP is an enterprise-grade multi-agent runtime designed from first principles to overcome "framework bloat" and non-deterministic agent failures. It features:

  1. State Graph Engine (DAG/DCG): Explicit state-machine execution supporting cycles, retry checkpoints, and pause-and-resume.
  2. Model Context Protocol (MCP) Standard: Decoupled client/server tool execution enabling universal tool interoperability without tight SDK coupling.
  3. Multi-Tier Memory: Working memory (turn-level scratchpad), episodic memory (thread history with token budgeting), and semantic memory (vectorized knowledge).
  4. Isolated Execution Sandbox: Ephemeral sub-process execution runner with AST static safety checks, syscall protection, and strict execution timeouts.
  5. Human-in-the-Loop (HITL) Gatekeeper: Tiered risk categorization halting execution on mutating/destructive operations until explicit human authorization is received.
                      ┌──────────────────────────────────────┐
                      │          User Task Request           │
                      └──────────────────┬───────────────────┘
                                         │
                                         ▼
                      ┌──────────────────────────────────────┐
                      │    Supervisor Coordinator Node       │
                      │   (Task Decomposition & Routing)     │
                      └───────┬──────────────┬───────────────┘
                              │              │
           ┌──────────────────┘              └──────────────────┐
           ▼                                                    ▼
┌──────────────────────┐                             ┌──────────────────────┐
│  SQL & Data Analyst  │                             │ System Code Runner   │
│ (Schema & Query Plan)│                             │ (Python Code Gen)    │
└──────────┬───────────┘                             └──────────┬───────────┘
           │                                                    │
           │                                                    ▼
           │                                         ┌──────────────────────┐
           │                                         │ Ephemeral Sandbox    │
           │                                         │ (AST Inspection +    │
           │                                         │  Timeout Quotas)     │
           │                                         └──────────┬───────────┘
           │                                                    │
           └──────────────────┬─────────────────────────────────┘
                              ▼
           ┌──────────────────────────────────────┐
           │    HITL Gatekeeper (Risk Policies)   │
           │  • Tier 1 (Read): Auto-execute       │
           │  • Tier 2 (Mutate): Idempotency      │
           │  • Tier 3 (Destructive): Pause Graph │
           └──────────────────┬───────────────────┘
                              │
                              ▼
           ┌──────────────────────────────────────┐
           │      MCP Protocol Tool Adapter       │
           │   (Universal Tool Call Execution)    │
           └──────────────────┬───────────────────┘
                              │
                              ▼
           ┌──────────────────────────────────────┐
           │         Final Output & State         │
           │     (OpenTelemetry Traced Spans)     │
           └──────────────────────────────────────┘

2. Directory Structure

agentmesh-mcp/
├── pyproject.toml                     # Modern package spec & dependencies
├── agentmesh/
│   ├── state.py                       # Immutable & mutable graph state, message turns
│   ├── graph.py                       # State machine engine with conditional routing
│   ├── coordinator.py                 # Supervisor routing & decomposition logic
│   ├── specialists/
│   │   ├── base.py                    # Specialist agent interface
│   │   ├── sql_analyst.py             # Database query architect
│   │   ├── researcher.py              # Semantic vector memory retrieval specialist
│   │   └── code_runner.py             # Script synthesis & execution agent
│   ├── mcp/
│   │   ├── protocol.py                # Pydantic schemas for MCP spec
│   │   └── client.py                  # MCP Client for tool discovery & invocation
│   ├── sandbox/
│   │   ├── security.py                # Static AST validator blocking hazardous modules
│   │   └── executor.py                # Ephemeral execution runner with timeout caps
│   ├── memory/
│   │   └── vector_store.py            # Cosine similarity vector store (pgvector HNSW API)
│   └── hitl/
│       └── gatekeeper.py              # Human approval workflow for high-risk operations
├── tests/
│   ├── test_graph.py                  # Cycle detection, recursion limits, routing
│   ├── test_mcp.py                    # Tool discovery, schema validation, tool runs
│   ├── test_sandbox.py                # Timeout enforcement, forbidden imports block
│   ├── test_hitl.py                   # Graph interruption and resumption
│   └── test_end_to_end.py             # Multi-agent coordination test
└── examples/
    └── run_demo.py                    # End-to-end interactive CLI demonstration

3. Quickstart & Verification

# Clone the repository
git clone https://github.com/Chethan-Raj-D-S/agentmesh-mcp.git
cd agentmesh-mcp

# Run full test suite (100% offline, zero API keys required)
pytest tests/ -v

# Run the live interactive demonstration
python examples/run_demo.py

# Launch standard JSON-RPC 2.0 stdio MCP Server
python -m agentmesh.server

4. Model Context Protocol & AI Agent Skill Integration

AgentMesh-MCP is packaged with an official SKILL.md specification, making it instantly installable into Claude Code, Cursor, Windsurf, and Copilot:

{
  "mcpServers": {
    "agentmesh": {
      "command": "python",
      "args": ["-m", "agentmesh.server"],
      "cwd": "/path/to/agentmesh-mcp"
    }
  }
}

About

Production-grade multi-agent runtime featuring dynamic StateGraph DAG execution, FastMCP protocol integration, AST-filtered sandbox, and 3-tier Human-in-the-Loop governance.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages