PiMCP is a distributed implementation of the Model Context Protocol (MCP) designed to connect AI models (LLMs or agents) with distributed tools, data, and environments β across both cloud and edge devices such as Raspberry Pi clusters.
It provides a unified, scalable, and fault-tolerant protocol layer that enables multiple nodes to cooperate, share context, and execute external tool calls on behalf of models.
PiMCP (Distributed Model Context Protocol System) enables LLMs and agents to access and coordinate distributed resources β such as tools, APIs, and context databases β across both edge devices and cloud nodes
It acts as a middleware layer between AI models and the physical or virtual world, orchestrating communication, context synchronization, and task execution through the MCP (Model Context Protocol).
ββββββββββββββββββββββββββββββ
β Clients β
β (OpenAI, Claude, LocalLLM) β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββ
β PiMCP Gateway Layer β
β (FastAPI + Redis Pub/Sub + JWT) β
ββββββββββββββββββ¬βββββββββββββββββββ
β
ββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββ
β β
βββββββββββββββββ βββββββββββββββββ
β MCP Node A β β MCP Node B β
β (Tokyo Edge) β β (SF Cloud) β
β - local tools β β - GCP tools β
β - log agent β β - DB adapter β
β - vector db βββββββ Redis / etcd Context Sync ββββΆβ - shell exec β
βββββββββββββββββ βββββββββββββββββ
β β
βΌ βΌ
Local Tools: Shell, FS, AI Inference Cloud Tools: SQL, API, Storage
-
π Context Synchronization: Maintain distributed shared memory between nodes for context continuity.
-
βοΈ Tool Invocation Routing: Automatically find and execute the best tool handler across multiple nodes.
-
π‘ Distributed Execution: Offload heavy computations to cloud nodes, while low-latency operations stay on edge.
-
π§© Modular Plug-in Architecture: Each node exposes capabilities (file.search, shell.run, db.query, etc.) that can be dynamically registered or disabled.
-π Secure Communication: All MCP traffic is authenticated via JWT and encrypted via TLS/mTLS.