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
AgentMesh-MCP is an enterprise-grade multi-agent runtime designed from first principles to overcome "framework bloat" and non-deterministic agent failures. It features:
- State Graph Engine (DAG/DCG): Explicit state-machine execution supporting cycles, retry checkpoints, and pause-and-resume.
- Model Context Protocol (MCP) Standard: Decoupled client/server tool execution enabling universal tool interoperability without tight SDK coupling.
- Multi-Tier Memory: Working memory (turn-level scratchpad), episodic memory (thread history with token budgeting), and semantic memory (vectorized knowledge).
- Isolated Execution Sandbox: Ephemeral sub-process execution runner with AST static safety checks, syscall protection, and strict execution timeouts.
- 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) │
└──────────────────────────────────────┘
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
# 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.serverAgentMesh-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"
}
}
}