⚡ session-mesh-mcp — MCP Agent Orchestrator

An open, extensible Model Context Protocol (MCP) server that acts as a scalable, multi-modal multi-agent coordination engine.
It allows any MCP-compatible client (Claude Desktop, Cursor, Antigravity, Zed, LibreChat) to delegate complex multi-step programming and research goals to internal teams of specialized subagents — acting as a context firewall to conserve client token limits while preventing tool timeouts.
Naming note: The canonical name of this project is session-mesh-mcp — it is used consistently for the GitHub repository, the npm package, and the PyPI package. The legacy CLI aliases agent-mesh-mcp, mcp-agent-orchestrator, and agent-orchestrator are deprecated: they still work today, but new setups should use session-mesh-mcp, and the aliases will be removed in a future major release. (The Python wrapper's internal module name, mcp_agent_orchestrator, is not user-facing.)
🌟 Key Features
- 🧠 Multi-Modal Orchestration:
- Cross-Session Agent Mesh (
invoke_session, send_session_message, check_inbox): Spawn independent specialist subagents in isolated sessions with dedicated models, context boundaries, persistent SQLite inboxes, and bidirectional inter-session messaging.
- Autonomous Swarm (
start_swarm): Supervisor agent decomposes goals into subtasks, delegates to worker agents, and synthesizes final outputs.
- Interactive Toolkit (
spawn_agent, send_agent_message): Direct agent management primitives enabling host models to orchestrate custom loops.
- Structured Pipelines (
run_pipeline): Deterministic multi-stage DAG workflows passing typed artifacts with human-in-the-loop checkpoints (approve_checkpoint).
- 🔌 Flexible Inference (Zero API Keys or Cloud APIs):
- Zero-Key Local Setup: Uses your authenticated local Antigravity (
agy) CLI (accessing gemini-3.8-flash-high, claude-sonnet-4-6, etc.) or Ollama.
- Cloud API Setup: Direct integrations for Google Gemini, Anthropic, OpenAI, or any OpenAI-compatible provider (DeepSeek, Groq, Together).
- Hybrid Setup: Mix and match free local models for high-volume workers and cloud frontier models for critical reviews.
- 🛡️ Sandboxed Workspace Tools:
- Scoped filesystem tools (
fs_read, fs_write, fs_list, fs_delete).
- Controlled shell execution (
shell_exec) with configurable safety modes (autonomous, semi-autonomous, safe).
- Web search and HTTP fetch (
web_fetch).
- MCP Gateway Bridge: Subagents can dynamically call tools on third-party MCP servers (e.g. GitHub, PostgreSQL, Docker).
- 💾 State & Persistence:
- Embedded SQLite database (
data/orchestrator.db) with WAL mode.
- Persists task histories, agent thought transcripts, and generated artifacts across restarts.
- 🖥️ Live Web Dashboard:
- Runs on
http://localhost:4000 with Server-Sent Events (SSE).
- Real-time progress tracker, live agent scratchpads, artifact previewer, and one-click checkpoint approval buttons.
🏗️ Architecture
flowchart TD
Client["Host MCP Client\n(Claude Desktop / Cursor / Antigravity / Zed)"]
subgraph Server["MCP Agent Orchestrator Server"]
subgraph Transport["MCP Protocol Layer (stdio)"]
Tools["MCP Tools\n(start_swarm, run_pipeline, spawn_agent, etc.)"]
Status["Inspection Tools\n(get_task_status, list_jobs, approve_checkpoint)"]
end
subgraph Kernel["Orchestration Kernel"]
Dispatcher["Task Dispatcher & Scheduler"]
PolicyEngine["Workspace & Safety Policy Gatekeeper"]
Supervisor["Swarm Supervisor"]
DAGRunner["Pipeline DAG Runner"]
AgentPool["Interactive Agent Pool"]
end
subgraph Inference["Inference Layer"]
Agy["Local agy CLI\n(Zero Keys)"]
Ollama["Local Ollama\n(Zero Keys)"]
Cloud["Cloud APIs\n(Gemini / Anthropic / OpenAI / DeepSeek)"]
end
subgraph Capabilities["Subagent Capabilities"]
Builtins["Workspace Tools\n(fs, shell, web)"]
Bridge["MCP Bridge\n(External MCP Servers)"]
end
subgraph Persistence["Storage & Dashboard"]
DB[("SQLite Storage\n(data/orchestrator.db)")]
UI["Web Dashboard\n(http://localhost:4000)"]
end
end
Client <-->|"stdio"| Transport
Transport --> Dispatcher
Dispatcher --> PolicyEngine
PolicyEngine --> Supervisor & DAGRunner & AgentPool
Supervisor & DAGRunner & AgentPool --> Inference
Supervisor & DAGRunner & AgentPool <--> Capabilities
Dispatcher <--> DB
DB <--> UI
⚡ Quick Start & CLI
1. Instant Run with uvx / pip (PyPI)
# Run directly via uvx (zero install) or install from PyPI
uvx session-mesh-mcp doctor
pip install session-mesh-mcp
# Start the MCP server over stdio
session-mesh-mcp serve
# Launch the live Web Dashboard on http://localhost:4000
session-mesh-mcp dashboard
2. Instant Run with npx (Node.js)
# Run the built-in system diagnostics & health check
npx session-mesh-mcp doctor
# Generate a starter orchestrator.yaml in your current directory
npx session-mesh-mcp init
# Start the MCP server over stdio
npx session-mesh-mcp
3. Local Development & Build
git clone https://github.com/ShashankIIITN/session-mesh-mcp.git
cd session-mesh-mcp
# Install dependencies and compile TypeScript
npm install
npm run build
# Run all 32 unit and integration test scenarios
# (plus the stdio end-to-end smoke test via: npm run test:e2e)
npm test
⚙️ Configuration (orchestrator.yaml)
Create orchestrator.yaml in the project root (you can also reference orchestrator.example.yaml):
version: "1.0"
server:
port: 4000 # Web Dashboard port (http://localhost:4000)
storage:
type: "sqlite"
connection_string: "./data/orchestrator.db"
security:
default_safety_mode: "semi-autonomous" # autonomous | semi-autonomous | safe
allowed_workspaces:
- "./"
- "D:/"
# ─────────────────────────────────────────────────────────────────────────
# INFERENCE PROVIDERS
# Choose your setup: Local (Zero API Keys), Cloud API Keys, or Hybrid
# ─────────────────────────────────────────────────────────────────────────
inference:
default_provider: "direct"
# Cost & capability tiers for isolated child sessions
tiers:
fast:
provider: "agy"
model: "gemini-3.8-flash-low" # Ultra-fast, zero thinking-token overhead
balanced:
provider: "agy"
model: "gemini-3.8-flash-high"
heavy:
provider: "agy_claude"
model: "claude-sonnet-4-6"
providers:
# ── Option A: Local Antigravity CLI (Zero API Keys) ──
# Auto-detected on Windows, macOS, and Linux!
agy:
type: "agy"
model: "gemini-3.8-flash-high" # Or "claude-sonnet-4-6", "gemini-3.1-pro-high"
# ── Option B: Local Ollama (Zero API Keys) ──
ollama:
type: "ollama"
base_url: "http://localhost:11434"
model: "llama3.3"
# ── Option C: Cloud API Providers (Require API Keys) ──
gemini:
type: "gemini"
model: "gemini-2.5-flash"
api_key_env: "GEMINI_API_KEY"
anthropic:
type: "anthropic"
model: "claude-3-7-sonnet-20250219"
api_key_env: "ANTHROPIC_API_KEY"
openai:
type: "openai"
model: "gpt-4o"
api_key_env: "OPENAI_API_KEY"
# ── Option D: Custom OpenAI-Compatible (DeepSeek, Groq, Together) ──
deepseek:
type: "openai-compatible"
base_url: "https://api.deepseek.com"
model: "deepseek-coder"
api_key_env: "DEEPSEEK_API_KEY"
# ─────────────────────────────────────────────────────────────────────────
# DECLARATIVE AGENT PERSONAS
# Assign each agent whichever provider you prefer (local or cloud)
# ─────────────────────────────────────────────────────────────────────────
agents:
researcher:
role: "Research & Documentation Specialist"
provider: "agy" # Using zero-key local model
tools: ["web_fetch", "fs_read", "fs_list"]
system_prompt: "You are an expert researcher. Synthesize concise and factual summaries."
coder:
role: "Senior Software Engineer"
provider: "agy"
tools: ["fs_read", "fs_write", "fs_list", "shell_exec"]
system_prompt: "You are a senior engineer. Write clean, robust code and verify changes."
reviewer:
role: "Staff Security & QA Auditor"
provider: "agy"
tools: ["fs_read", "fs_list", "shell_exec"]
system_prompt: "You are a staff reviewer focused on correctness, edge cases, and security."
# ─────────────────────────────────────────────────────────────────────────
# PRESET PIPELINES
# ─────────────────────────────────────────────────────────────────────────
pipelines:
feature_implementation:
stages:
- name: "research"
agent: "researcher"
output_artifact: "research_notes.md"
checkpoint: false
- name: "code"
agent: "coder"
input_artifacts: ["research_notes.md"]
output_artifact: "implementation.md"
checkpoint: true # Pauses for human approval
- name: "review"
agent: "reviewer"
input_artifacts: ["implementation.md"]
checkpoint: false
# ─────────────────────────────────────────────────────────────────────────
# EXTERNAL MCP GATEWAYS (Optional)
# Subagents can call tools from these external servers
# ─────────────────────────────────────────────────────────────────────────
mcp_gateways:
github:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}"
🔌 Connecting to Your MCP Client
You can connect either via npx (instant, portable) or pointing directly to your local clone.
1. Antigravity (agy)
To register the orchestrator globally in your local Antigravity environment:
# Using npx (portable):
agy mcp add session-mesh npx -y session-mesh-mcp
# OR using local build:
agy mcp add session-mesh node "D:\my project\session-mesh-mcp\dist\index.js" "D:\my project\session-mesh-mcp\orchestrator.yaml"
Verify it is active:
agy mcp list
2. Claude Desktop
Add to your %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"agent-orchestrator": {
"command": "npx",
"args": ["-y", "session-mesh-mcp"]
}
}
}
(Or replace "command": "node" and point to "D:\\my project\\session-mesh-mcp\\dist\\index.js" for local development).
3. Cursor
- Open Cursor Settings $\rightarrow$ Features $\rightarrow$ MCP Servers.
- Click Add New MCP Server:
🛠️ MCP Tool Reference
Cross-Session Agent Mesh Tools (v0.2.0)