Skip to content
Conduit

mcp server

llmesh

Security-first local LLM swarm over MCP with signed peer discovery, fail-closed validation, audit trails, and Docker-based PoC nodes.

furuse-kazufumi/llmeshcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "llmesh": {
      "command": "uvx",
      "args": [
        "llmesh-mcp"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 26, 2026

LLMesh

かみ砕いた説明(中学生レベル): llmesh は、いろんな会社の賢いおしゃべりAI(LLM、人間のように文章を作るプログラム)を、自分のパソコンや会社の中だけで安全に使うための「受付係」です。工場のセンサーやカメラの情報も同じ窓口でまとめて受け取り、外に勝手に漏らさないよう見張りながら、AIに渡したり結果を記録したりします。だから個人情報や会社の秘密を外のインターネットに出さずに、AIの便利さだけを使えます。

→ 用語集: docs/GLOSSARY.md

Part of the FullSense ™ family — llmesh (本リポ・secure LLM hub) ・ llive (self-evolving memory) ・ llove (TUI dashboard) の 3 製品を束ねる FullSense ブランドの中で、MCP 経由のセキュアな LLM ハブを担当します。FullSense Spec v1.1 は llive リポジトリの docs/fullsense_spec_eternal.md 参照。

Secure LLM Mesh over MCP — v3.1.0

Family / 同系プロジェクト: バックエンド (本リポ) / TUI ダッシュボード → llove / 一括インストール → pip install llmesh-suite (準備中)。

不混同 (Disambiguation): プロトコル横断・産業 IoT・プライバシーパイプライン 主体の本プロジェクトは、GPU を持ち寄り 1 つの LLM を分散推論 する mesh-llm とは別物です。 本プロジェクトは「I/O・プロトコル・産業現場」側、mesh-llm は「推論並列化」側。

産業 IoT、重要インフラ、先端 AI/量子、RTOS マイコンまでを統一フレームワークで カバーする Python 統合プラットフォーム。 ローカル LLM(Ollama / llama.cpp)とクラウド LLM(OpenAI / Azure / Anthropic / OpenRouter / Groq / Together / Mistral / DeepSeek)を同一 ABC で 透過運用。117 章 / 500+ 要件項目、Rust 拡張で性能 6×、2300+ テスト全 PASS。 全体 OWASP 静的監査クリーン(shell=True / pickle / eval / SQL 注入 / 弱暗号 ゼロ、全 HTTP クライアントにレスポンスサイズ上限)、 v3.0.0 から SemVer 正式適用(docs/API_STABILITY.md の公開シンボル一覧が契約)。

Architecture / 全体像

flowchart LR
  subgraph Field["Field / 現場"]
    M[Modbus / OPC-UA / MQTT / Serial / EtherCAT / BACnet]
    H[HTTP / HTTPS / WebSocket / gRPC]
    E[Email / SSH / FTP / SNMP / NTP]
    R[ROS 1 / ROS 2]
    V[Camera / Mic / VLM]
  end
  subgraph Core["llmesh core (multi-protocol gateway)"]
    PA[Protocol Adapters]
    PF[PromptFirewall<br/>L0/L1/L1.5/L2/L3/L4]
    AU[AuditTrail<br/>HMAC chain]
    RA[RAG<br/>numpy/sqlite/LSH]
    SP[SPC / MT-method<br/>Hotelling T² / CUSUM]
  end
  subgraph LLM["LLM backends (ABC)"]
    O[Ollama / llama.cpp]
    C[OpenAI / Anthropic / Azure /<br/>OpenRouter / Groq / Together / Mistral / DeepSeek]
  end
  subgraph UI["UI / dashboard (separate package)"]
    L[💗 llove TUI<br/>llmesh dashboard]
    HX[HTML export]
  end

  M & H & E & R & V --> PA --> PF --> RA & SP
  PF --> O & C
  PF --> AU
  SP & AU & RA -. stream .-> L
  L --> HX

責務境界: llmesh は I/O・プロトコル・分析・LLM 経路 に専念。可視化と 対局・学習デモは姉妹リポ llove に分離し、組み込み Linux / RTOS ターゲットでも pip install llmesh-mcp だけで 動くよう依存最小を維持しています。llmesh dashboard 1 発で TUI を呼べます。


Quick Start

# PyPI からのインストール(配布名は llmesh-mcp、import 名は llmesh)
pip install llmesh-mcp
# 産業用フル機能
pip install "llmesh-mcp[industrial,vision,presidio,rag]"
# 可視化込み一括(メタパッケージ、準備中)
pip install llmesh-suite

# ローカル開発
git clone git@github.com:furuse-kazufumi/llmesh.git
cd llmesh
pip install -e ".[dev,industrial]"
pytest
# import パスは llmesh のまま
from llmesh import PromptFirewall, SensorEvent
from llmesh.rag import Retriever, MockEmbedder, NumpyVectorStore
from llmesh.llm import openai_backend, OllamaBackend

主要 optional extras:

pip install -e ".[industrial]"   # MTEngine / SPC / Modbus / OPC-UA / MQTT
pip install -e ".[vision]"       # ImageFirewall / VLM 経路
pip install -e ".[presidio]"     # Layer 1.5 PII 検出(v2.13.0+)
pip install -e ".[rag]"          # RAG(ベクトル検索)(v2.13.0+)
pip install -e ".[email,udp,ssh,ftp,mgmt,can,bacnet]"

Screenshots — llmesh dashboard (powered by llove)

llmesh のデータは姉妹リポ llove の TUI から 1 画面で見えます。pip install llmesh-llove && llmesh dashboard で起動。スクリーンショット原寸は llove リポにあります。

画面ターゲット
SCADA産業 IoT / SCADA
PromptFirewallPromptFirewall / プライバシーパイプライン
RAGRAG 検索
AuditTrailHMAC チェーン Audit
BackendsLLM バックエンド切替
ReliabilityReliability Protocol
Multimodal画像 + 音声 + LLM

llove は単なるダッシュボードに留まらず、shogi (Ed25519 署名つき per-move log) / chess / タイピングなどの 対局・学習デモも同じ抽象で起動 できます。詳細は llove README を参照。


Components

Core

ModuleDescription
llmesh.classifierDataLevel (L0–L4) + ClassifiedPayload
llmesh.privacy.firewall4-layer Prompt Firewall(L0 注入検出 / L1 シークレット / L1.5 Presidio PII / L2 構造)
llmesh.privacy.summarizerPrivacySummarizer(L3 要約パイプライン)
llmesh.privacy.image_firewallImageFirewall(L4 画像 BLOCK / L3 サマリ)
llmesh.privacy.presidio_detectorNEW v2.13 Microsoft Presidio 統合(PII 検出、optional)
llmesh.identityEd25519 Node ID + did:llmesh:1: + Capability Manifest + X25519 ECDH
llmesh.rendezvous署名付きノード発見サービス(plaintext / AES-256-GCM)
llmesh.mcpMCP tool schemas + OutputValidator
llmesh.audittamper-evident HMAC chain audit log
llmesh.fairnessフリーライダー防止(ServiceReceipt / ContributionLedger / FairnessPolicy)

RAG (v2.13.0+)

ModuleDescription
llmesh.rag.embedderEmbedder ABC + MockEmbedder(決定論ハッシュ)+ OllamaEmbedder(urllib のみ)
llmesh.rag.storeVectorStore ABC + Document / RetrievedDocument
llmesh.rag.numpy_store純 numpy in-memory ストア(cosine 類似度、.npz アトミック永続化)
llmesh.rag.sqlite_storeNEW v2.14 純 sqlite3 永続ストア(WAL、UPSERT、≤10⁶ 件で実用)
llmesh.rag.lsh_storeNEW v2.15 LSH ANN ベクトルストア(≥10⁶ 件、recall@10 ≥ 0.92)
llmesh.rag.retrieverEmbedder + VectorStore + Firewall を結合した Retriever

Protocols (multi-protocol gateway)

ModuleDescription
llmesh.protocol.{http,tcp,udp,ssh,sftp,smtp,imap,pop3,ftp,snmp,telnet,ros2,ros1}_adapterプロトコルアダプタ群
llmesh.protocol.adapterProtocolAdapter ABC + TransportError
llmesh.protocol.registryAdapterRegistry(名前生成・カスタム登録・entry-points)
llmesh.protocol.messageUnifiedMessage + MessageType(STREAM_ACK / RETRANSMIT 含む)
llmesh.protocol.assemblerMessageAssembler(順序組立 + タイムアウト + ウォッチドッグ)
llmesh.protocol.chunk_senderChunkSender(送信バッファ + 再送 + ACK + TTL expire)
llmesh.protocol.watchdogWatchdogTimer
llmesh.security.clockNTPクロック同期チェック
llmesh.discovery.dns_sdDNS-SD v2 mDNS アナウンサー

Industrial (v1.3.0+)

ModuleDescription
llmesh.industrial.sensor_eventSensorEvent 統一モデル
llmesh.industrial.{modbus,serial,opcua,mqtt,ethercat,can,bacnet,websocket}_adapter産業プロトコル
llmesh.industrial.mt_engineMahalanobis-Taguchi 法(オフライン訓練 + リアルタイム推論)
llmesh.industrial.mt_onlineNEW v2.13 OnlineMTEngine(バッチ Mahalanobis、einsum、メモリ上限制御)
llmesh.industrial.spc_engineXbarRChart / CUSUMChart(Shewhart / 累積和管理図)
llmesh.industrial.hotelling_t2NEW v2.13 HotellingT2Chart(多変量管理図、Tikhonov 正則化)
llmesh.industrial.event_density_mapNEW v2.13 EventDensityMap(DVS イベント → グリッド特徴)
llmesh.industrial.multimodal_spcNEW v2.13 UnifiedSPC(センサー × VLM テキスト 2 系統 SPC)
llmesh.industrial.explainerNEW v2.13 LLMExplainer(SCADA 異常 → Markdown/JSON レポート)
llmesh.industrial.explained_cusumNEW v2.14 ExplainedCUSUM(自己説明 CUSUM、CUSUMChart + LLMExplainer 統合)
llmesh.industrial.video_cusumNEW v2.14 VideoCUSUM(動画 + センサー時刻同期 CUSUM、ペア化バッファ)
llmesh.industrial.vlm_feature_extractorNEW v2.14 VLMFeatureExtractor(画像 → ImageFirewall → caption → 数値ベクトル)
llmesh.industrial.dnp3_adapterNEW v2.14 DNP3Adapter(v3-N7 / K-1.1、SCADA outstation client、pydnp3 optional)
llmesh.industrial.goose_adapterNEW v2.14 GOOSEAdapter(IEC 61850 GOOSE subscriber、リプレイ防御付き)
llmesh.industrial.sensor_3dAOI / 深度 / DVS(mcp-3d SDK 互換)
llmesh.industrial.c_abiRTOS C ABI / EdgeProfile(Volume L)
llmesh.industrial.metrics / tracing / tenantOpenTelemetry / マルチテナント

Reliability Protocol

ストリーミング通信の信頼性を MessageAssembler と ChunkSender の 組み合わせで保証する。

[正常完了]  受信: pop_completed() → STREAM_ACK 送信
            送信: handle_ack()    → 送信バッファ破棄

[欠落検出]  受信: check_timeouts() → RETRANSMIT 送信(1 回のみ)
            送信: handle_retransmit() → 欠落チャンクのみ再送

[切断検出]  受信: check_watchdog()  → True で切断シグナル
            送信: expire_old()      → TTL 超過バッファ自動破棄

Privacy Pipeline

prompt → PromptFirewall (L0/L1/L1.5/L2) → PrivacySummarizer →
         LLM Backend (Ollama / LlamaCpp) → OutputValidator → caller
Layer役割出力
L0プロンプト注入 / jailbreak / Unicode 制御文字BLOCK
L1シークレット(API キー、JWT、PEM、AWS、GitHub、Anthropic、OpenAI)BLOCK
L1.5Presidio PII(CC / SSN / IBAN / 医療免許 / 個人名 / Email / 電話 …)BLOCK or SUMMARIZE
L2絶対パス / 内部 import / オーバーサイズ payloadSUMMARIZE or BLOCK

Security Guardrails

  • shell=True, pickle, yaml.load(unsafe), eval, exec を一切使わない
  • Firewall は fail-closed(例外 → L4/BLOCK)
  • OutputValidator が non-JSON / schema 不一致 / nonce replay を拒否
  • subprocess 呼び出しは list 形式のみ
  • すべての optional 依存は extras(軽量本体)

Performance

操作Pure PythonRust倍率
PointCloud encode (1M)4.0M pts/s24.1M pts/s6.0×
PointCloud decode (1M)3.7M pts/s5.9M pts/s1.6×
DVS encode (1M)3.4M evt/s5.5M evt/s1.6×
Pipeline + CUSUM190K events/s––

CLI

python -m llmesh.cli.doctor   # 環境健全性チェック
python -m llmesh.cli.status   # ランタイム状態
python -m llmesh.cli.sbom     # CycloneDX SBOM 自動生成

Documentation

概要 / 計画

  • docs/ROADMAP.md — リリース計画 / バージョン履歴
  • docs/REQUIREMENTS.md — 117 章 / 500+ 要件、Volume A〜N
  • docs/CHANGELOG.md — 詳細変更履歴

アーキテクチャ / 仕様

  • docs/ARCHITECTURE.md — アーキテクチャ
  • docs/SPECIFICATION.md — API 仕様
  • docs/SECURITY.md — STRIDE 脅威モデル + セキュリティ不変条件
  • docs/API_STABILITY.md — Public/Internal API 境界 + SemVer ポリシー(v2.15+)
  • docs/PERFORMANCE.md — モジュール別計算量 + メモリ + 推奨パラメータ(v2.15+)

利用ガイド

  • docs/SETUP.md / docs/SETUP_GUIDE.md — セットアップ
  • docs/USAGE.md — 使用例(v2.13/2.14 強化機能セクション含む)
  • docs/INDUSTRIAL_GUIDE.md — 産業 IoT 利用ガイド(Phase A〜v3 含む)
  • docs/PEERING.md / docs/PLATFORMS.md — ピアリング / プラットフォーム

運用 / トラブルシューティング(v2.18+)

  • docs/DEPLOYMENT.md — Docker / systemd / k8s / シークレット管理
  • docs/OBSERVABILITY.md — Prometheus / OTel / AuditTrace / SLO
  • docs/TROUBLESHOOTING.md — エラー対処集 + FAQ
  • docs/MIGRATION.md — バージョン間移行ガイド

開発者向け(v2.18+)

  • CONTRIBUTING.md — 貢献ガイド(コミット規約 / PR チェックリスト)
  • docs/DEVELOPMENT.md — 開発環境 / 内部構造 / 新規モジュール追加手順
  • docs/TESTING.md — テスト戦略 / Hypothesis / カバレッジ目標
  • docs/GLOSSARY.md — 用語集(LLM / セキュリティ / 産業)
  • docs/SETUP.md / docs/SETUP_GUIDE.md — セットアップ
  • docs/USAGE.md — 使用例
  • docs/PEERING.md / docs/PLATFORMS.md — ピアリング / プラットフォーム
  • docs/papers/ — RAD(21 分野コーパス)+ 論文素材

FullSense Portal hubs (drift 防止)

家族プロダクト横断の install snippet / 推奨モデル / ベンチ運用ルール / Spec の 真実ソース は FullSense portal 配下の hub ページ:

↑↓ navigate openesc close