Skip to content

miao4ai/PiMCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 

Repository files navigation

🧠 PiMCP β€” Distributed Model Context Protocol System

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.


πŸš€ Overview

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).


System Architecture

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚          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

🧠 Core Capabilities

  • πŸ”„ 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.

About

Distributed Model Context Protocol System for Edge AI and Cloud Agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published