mcp-p2p-swarm-mesh
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-p2p-swarm-meshshow the aggregated capability registry across the swarm"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-p2p-swarm-mesh
A decentralized, multi-agent peer-to-peer (P2P) Model Context Protocol (MCP) router built strictly in Python 3.10+. It bridges physically distributed, independent MCP servers into an encrypted, self-healing swarm mesh, complete with an interactive Streamlit Web Application Control Center.
๐ Key Architecture & Capabilities
๐ Gateway Node Lifecycle (
FR-01): Bridges upstream MCP clients (Claude Desktop, Cursor, Autonomous Agents) over standard Stdio and SSE transports.๐ P2P Transport & Dynamic Discovery (
FR-02): Decentralized node discovery over asynchronous UDP gossip protocol and encrypted mutual TLS 1.3 socket streams.๐ Dynamic Capability Registry (
FR-03): Aggregates tools, resources, and prompt templates into a unified catalog exposed viamesh://capabilities/registry.โก Distributed Task Delegation (
FR-04): Routes execution payloads viamesh_delegate_taskto specific or auto-selected peers with progress streaming.๐ค Swarm Consensus Orchestration (
FR-05): Coordinates multi-agent deliberation routines (swarm_consensus_review) with customizable quorum thresholds and variance synthesis.๐ Zero-Trust Security (
NFR-02): Cryptographic Ed25519 identity, ephemeral TLS X.509 certs, and EdDSA-signed capability JWT tokens with replay-attack nonce caching.๐ก๏ธ Fault Tolerance & Isolation (
NFR-03): Heartbeat decay failure detector isolatingSUSPECTnodes at 10s and evictingDEADnodes at 15s with automatic split-brain recovery.โก High Performance (
NFR-04): Verified intra-mesh routing overhead strictly< 50ms(measured ~3.5ms on localhost).
Related MCP server: genswarms-fleet-mcp
๐ฅ๏ธ Streamlit Control Center (app.py)
The repository includes a modern, operator-grade Streamlit web application with 5 interactive views:
Mesh Topology Matrix: Live Graphviz network graph and node status table with color-coded health states (
ALIVE,SUSPECT,DEAD).Capability Registry Browser: Searchable tools inventory, schema inspector, and live
mesh://capabilities/registryJSON manifest viewer.Task Delegation Workbench: Real-time form to issue delegated calls, generate signed EdDSA JWT tokens, and monitor execution latencies.
Swarm Consensus Chamber: Interactive multi-agent consensus prompts, quorum adjustments, and score synthesis.
Security & Framing Telemetry: Cryptographic key inspector, wire frame codec diagrams, and replay nonce cache monitor.
๐ Quick Start
1. Installation
git clone https://github.com/shinevijayan03/mcp-p2p-swarm-mesh.git
cd mcp-p2p-swarm-mesh
# Create virtualenv
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install package
pip install -e ".[dev]"2. Launch the Streamlit Control Center
streamlit run app.pyOpen your browser at http://127.0.0.1:8501.
3. Run Gateway Server
# Stdio transport mode (e.g. for Claude Desktop)
python -m mcp_mesh.gateway.server --mcp-mode stdio
# SSE transport mode
python -m mcp_mesh.gateway.server --mcp-mode sse --mcp-port 8000๐งช Testing
The repository maintains an exhaustive test suite covering unit tests, integration tests, chaos network simulations, and security penetration vectors:
# Run all tests
pytest -v
# Run with test coverage report
pytest --cov=mcp_mesh --cov-report=term-missing tests/Result: 28 passed, 0 failed (100% pass rate).
๐ Technical Specifications
IMPLEMENTATION_PLAN.md โ Implementation roadmap, WBS, and risk mitigations.
ARCHITECTURE.md โ Topology, wire framing format, gossip state machines, and sequence diagrams.
SOFTWARE_DESIGN.md โ Module hierarchy, Pydantic schemas, event loops, and wire protocols.
TEST_STRATEGY.md โ Testing pyramid, async mocks, chaos injection, and benchmark setups.
TEST_CASES.md โ Granular test cases mapping to
FR-01..FR-05,NFR-01..NFR-04, andEC-01..EC-04.DEPLOYMENT_PLAN.md โ Virtualenv cluster guide, Docker, Docker Compose, and monitoring specs.
USAGE_GUIDE.md โ Claude Desktop integration, Python MCP client SDK, and custom worker node creation.
PRIORITIZED_PLAN.md โ 7-stage prioritized implementation roadmap.
๐ License
MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
Multi-agent coordination protocol on Solana. Swarm formation, on-chain settlement, 14 MCP tools.
- llm-busOAuthcom.llm-bus
Coordinate multiple AI agents over MCP: atomic claims, leases, shared ledger, handoffs, tasks.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceMCP server for multi-agent collaboration enabling AI agents to communicate, delegate tasks, and share artifacts across clients and machines with federation support.12 npm1MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that connects any MCP harness (Claude Code, claude.ai, Cursor) to a fleet of GenSwarms swarms for observation, configuration, and optional operation.-
- AlicenseNot gradedqualityCmaintenanceEnterprise-grade asynchronous multi-agent orchestration and MCP router mesh framework, enabling DAG-based workflows, consensus-driven agent swarms, and REST/telemetry gateway.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that enables AI agents on different machines to communicate and collaborate directly through relay channels, supporting structured agent contracts, real-time messaging, and human-in-the-loop approval workflows.12,453 npmMIT