{
  "markdown": "# MetaMesh-UGA\n\n**The MCP Operating System — A Serverless Control Plane for AI Agents and MCP Infrastructure**\n\n[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-Registered-blue?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyIDJMMTQuNSA5SDIyTDE2IDEzLjI1TDE4LjUgMjFMMTIgMTYuNzVMNS41IDIxTDggMTMuMjVMMiA5SDkuNUwxMiAyWiIgZmlsbD0id2hpdGUiLz48L3N2Zz4&link=https://registry.modelcontextprotocol.io)](https://registry.modelcontextprotocol.io/servers/dev.metamesh-uga/metamesh-uga)\n[![Status](https://img.shields.io/badge/Status-Operational-green)](https://api.metamesh-uga.dev/health)\n[![MCP OS](https://img.shields.io/badge/MCP%20Operating%20System-Ready-blue)](https://docs.metamesh-uga.dev)\n\n> Set & Forget | Zero Infrastructure | Serverless | Edge Native | MCP Operating System\n\n## Live Status\n\n- **Gateway:** `https://api.metamesh-uga.dev` — operational\n- **Dashboard:** `https://dashboard.metamesh-uga.dev`\n- **MCP endpoint:** `https://api.metamesh-uga.dev/mcp` (JSON-RPC over HTTP)\n- **MCP Registry:** `dev.metamesh-uga/metamesh-uga` v2.0.0 — published & latest\n- **Tools indexed:** 13,000+ MCP servers, synced every 6h from the official MCP registry\n- **Stripe billing:** LIVE — agents top up a USD balance and are charged per call\n- **x402 payments:** implemented; activation gated by wallet config (see `/v1/x402/info`)\n\nMetaMesh-UGA is the MCP Operating System: a serverless, edge-native control plane that discovers, verifies, scores, routes, monitors and scales MCP servers behind a single endpoint.\n\nIt combines registry sync, semantic discovery, trust scoring, policy enforcement, security scanning, lifecycle management, smart routing, multi-level caching, reliability patterns, self-healing and real-time analytics to make MCP infrastructure production-ready for AI agents.\n\nConnect in seconds: point any MCP client (Claude, Windsurf, Cursor, Antigravity) at `https://api.metamesh-uga.dev/mcp`, or register an agent for a programmatic API key. Either way you gain access to a curated, trusted, and benchmarked catalog of MCP servers.\n\n## 🚀 Caratteristiche\n\n- **MCP Operating System**: Control Plane + Data Plane per gestire l'intero ecosistema MCP\n- **Unified Registry**: Single source of truth con federation, mirroring e snapshot\n- **Smart Discovery**: Keyword, semantic search, capability graph e intent-based discovery\n- **Trust Engine**: Reputation score basato su uptime, latenza, success rate e security\n- **Smart Routing**: Weighted, latency, geographic, cost e health-based routing\n- **Reliability Layer**: Circuit breaker, retry, bulkhead, hedging e fallback\n- **Multi-level Cache**: In-memory L1 + KV L2, TTL, pattern invalidation\n- **Security Fabric**: Dependency scan, CVE detection, policy engine OPA/Rego\n- **Self-Healing**: Auto-deprecated, rollback recovery, health-based remediation\n- **Analytics**: Usage trends, cost analysis, performance metrics, export OTel/Prometheus\n- **Lifecycle Management**: Stati automatici dalla discovery all'archiviazione\n- **Serverless**: Zero infrastruttura da gestire (Cloudflare Workers)\n- **WASM Runtime**: Esecuzione sicura dei tool MCP compilati in WebAssembly\n- **AI Agent Economy**: Supporto nativo per x402 Protocol (micropagamenti USDC)\n- **Monetizzazione**: Piani Free, Pro ($19/mese), Enterprise ($499/mese)\n- **Set & Forget**: Automazione completa con cron triggers\n\n## 📋 Requisiti\n\n- Node.js 18+\n- Go 1.21+ (per CLI)\n- Account Cloudflare (free tier sufficiente)\n- Account Stripe (per pagamenti)\n\n## 🛠️ Installazione\n\n### 1. Clone e Setup\n\n```bash\ngit clone https://github.com/SiouxTXT/metamesh-uga.git\ncd metamesh-uga\nnpm install\n```\n\n### 2. Configurazione Cloudflare\n\n```bash\n# Installa Wrangler\nnpm install -g wrangler\n\n# Login a Cloudflare\nwrangler login\n\n# Crea database D1\nwrangler d1 create metamesh-catalog\n\n# Crea KV namespace\nwrangler kv:namespace create \"CACHE\"\n\n# Crea R2 bucket\nwrangler r2 bucket create metamesh-wasm\n```\n\n### 3. Configura Secrets\n\n```bash\n# Stripe\nwrangler secret put STRIPE_SECRET_KEY\nwrangler secret put STRIPE_WEBHOOK_SECRET\n\n# JWT\nwrangler secret put JWT_SECRET\n\n# Alerting (opzionale)\nwrangler secret put TELEGRAM_BOT_TOKEN\nwrangler secret put TELEGRAM_CHAT_ID\n\n# Admin\nwrangler secret put ADMIN_KEY\n```\n\n### 4. Database Migration\n\n```bash\nwrangler d1 execute metamesh-catalog --file=./shared/migrations/001_init.sql\n```\n\n### 5. Deploy\n\n```bash\n# Deploy Workers\nnpm run deploy:workers\n\n# Deploy Dashboard\ncd packages/dashboard\nnpm install\nnpm run deploy\n```\n\n### 6. Installa CLI\n\n```bash\ncd cli\ngo build -o metamesh\n\n# Installa globalmente\nmv metamesh /usr/local/bin/\n\n# O usa direttamente\n./metamesh connect\n```\n\n## 🎯 Uso\n\n### CLI Tool\n\n```bash\n# Connetti al gateway (salva la config locale)\nmetamesh connect\n\n# Chiama un tool (raggiunge POST /v1/call)\nmetamesh call example.echo --message \"hello\"\n\n# Lista tool disponibili\nmetamesh list --category demo\n\n# Visualizza utilizzo\nmetamesh usage\n```\n\n### API REST\n\n```bash\n# List tools (paginated, public)\ncurl \"https://api.metamesh-uga.dev/v1/tools?limit=20&sort=popularity\"\n\n# Full-text search\ncurl \"https://api.metamesh-uga.dev/v1/search?q=github\"\n\n# Execute a tool\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tool\": \"example.echo\", \"params\": {\"message\": \"hello\"}}' \\\n  https://api.metamesh-uga.dev/v1/call\n```\n\n### MCP Protocol\n\nAdd to Devin / Cursor / Windsurf / Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"metamesh-uga\": {\n      \"url\": \"https://api.metamesh-uga.dev/mcp\",\n      \"transport\": \"http\"\n    }\n  }\n}\n```\n\nOr test directly via JSON-RPC:\n\n```bash\ncurl -X POST https://api.metamesh-uga.dev/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}'\n```\n\n## 🤖 AI Agent Economy\n\nTwo complementary, production-ready payment models:\n\n### Model A — Stripe prepaid credit (recommended)\n\nAgents top up a USD balance once via **Stripe Checkout**, then per-call pricing is debited automatically from the balance. No per-call fees, no crypto required.\n\n```bash\n# 1. Register an agent (returns agent_id + api_key, shown once)\ncurl -X POST https://api.metamesh-uga.dev/v1/agent/register \\\n  -H \"Content-Type: application/json\" -d '{\"name\":\"My Agent\"}'\n\n# 2. Top up via Stripe (returns a Checkout URL)\ncurl -X POST https://api.metamesh-uga.dev/v1/agent/topup \\\n  -H \"X-Agent-Id: agent_xxx\" -H \"X-Agent-Key: ak_xxx\" \\\n  -H \"Content-Type: application/json\" -d '{\"amount_usd\": 10}'\n\n# 3. Call tools — balance is debited per call\ncurl -X POST https://api.metamesh-uga.dev/v1/call \\\n  -H \"X-Agent-Id: agent_xxx\" -H \"X-Agent-Key: ak_xxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tool\":\"example.echo\",\"params\":{\"message\":\"hi\"}}'\n\n# 4. Check balance / history\ncurl https://api.metamesh-uga.dev/v1/agent/wallet -H \"X-Agent-Id: agent_xxx\" -H \"X-Agent-Key: ak_xxx\"\ncurl https://api.metamesh-uga.dev/v1/billing/info\n```\n\n**Operator activation:**\n\n```bash\nwrangler secret put STRIPE_SECRET_KEY --env production       # sk_live_... or sk_test_...\nwrangler secret put STRIPE_WEBHOOK_SECRET --env production   # whsec_... (Stripe webhook signing secret)\n# Point a Stripe webhook to: https://api.metamesh-uga.dev/v1/stripe/webhook (event: checkout.session.completed)\n# Optionally set BILLING_ENABLED=\"true\" in wrangler.toml to require payment for ALL callers.\n```\n\nWhen Stripe is unset, anonymous calls stay free and `/v1/agent/topup` returns a clear 503.\n\n> **Current production state:** Stripe (live keys) and the `checkout.session.completed` webhook are configured, and `BILLING_ENABLED=\"true\"`. Enforcement applies to the REST `POST /v1/call` endpoint — every caller is charged per request, so top up via `/v1/agent/topup` first. The public MCP endpoint (`POST /mcp`) stays free for discovery (`tools/list`) and native `metamesh.*` tools, so MCP clients keep working without an account.\n\n### Model B — x402 crypto (USDC on Base)\n\nThe [x402 protocol](https://www.x402.org): agents pay per call in USDC on-chain. Send an `X-PAYMENT` header; on HTTP 402 read the `accepts` requirements.\n\n```bash\ncurl https://api.metamesh-uga.dev/v1/x402/info\n```\n\n### Payment flow\n\n1. Call a paid resource (`POST /v1/call`). When enforcement is active and no payment is attached, the gateway responds **HTTP 402** with a standard `accepts` requirements body (scheme `exact`, network `base`, asset USDC, `payTo`, `maxAmountRequired`).\n2. The agent constructs a signed payment and retries with an `X-PAYMENT` header (base64 JSON).\n3. The gateway verifies + settles via the configured facilitator, then returns the result plus an `X-PAYMENT-RESPONSE` header with the on-chain tx.\n\n### Activation (operator)\n\nx402 is implemented but disabled until you set a receiving wallet:\n\n```bash\n# In wrangler.toml [env.production.vars]\nX402_ENABLED = \"true\"\nX402_PAY_TO  = \"0xYourBaseWallet\"\n# X402_FACILITATOR_URL and USDC_CONTRACT have working defaults\n```\n\nPer-tool pricing lives in the `tool_pricing` table (default $0.001/call, bulk $0.0005).\n\n## 📊 Architettura\n\nMetaMesh-UGA adotta un'architettura a due piani ispirata ai service mesh moderni.\n\n```\n┌─────────────────────────────────────────────────────────────────────────────┐\n│                      META MESH-UGA — MCP OPERATING SYSTEM                 │\n├─────────────────────────────────────────────────────────────────────────────┤\n│                                                                             │\n│  ┌─────────────────────────────────────────────────────────────────────┐   │\n│  │                     CONTROL PLANE                                   │   │\n│  │                                                                     │   │\n│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │   │\n│  │  │ Registry │ │ Discovery│ │  Trust   │ │  Policy  │ │ Lifecycle│ │   │\n│  │  │  Engine  │ │  Engine  │ │  Engine  │ │  Engine  │ │  Manager │ │   │\n│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │   │\n│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐             │   │\n│  │  │ Security │ │Benchmark │ │Analytics │ │  Config  │             │   │\n│  │  │  Scanner │ │  Engine  │ │  Engine  │ │  Engine  │             │   │\n│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘             │   │\n│  └─────────────────────────────────────────────────────────────────────┘   │\n│                                    │                                        │\n│                                    ▼                                        │\n│  ┌─────────────────────────────────────────────────────────────────────┐   │\n│  │                       DATA PLANE                                    │   │\n│  │                                                                     │   │\n│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │   │\n│  │  │  Routing │ │   Cache  │ │  Health  │ │  Proxy   │ │  Rate    │ │   │\n│  │  │  Engine  │ │  Engine  │ │  Engine  │ │  Engine  │ │ Limiting │ │   │\n│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │   │\n│  └─────────────────────────────────────────────────────────────────────┘   │\n│                                    │                                        │\n│                                    ▼                                        │\n│  ┌─────────────────────────────────────────────────────────────────────┐   │\n│  │                         MCP ECOSYSTEM                               │   │\n│  │  (Server MCP A, B, C, D, E...)                                     │   │\n│  └─────────────────────────────────────────────────────────────────────┘   │\n└─────────────────────────────────────────────────────────────────────────────┘\n```\n\n- **Control Plane**: decisioni, configurazione, orchestrazione, analytics.\n- **Data Plane**: esecuzione delle richieste, routing, caching, health in tempo reale.\n\nPer maggiori dettagli: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).\n\n## 💰 Piani di Pagamento\n\n| Piano | Prezzo | Feature |\n|-------|--------|---------|\n| **Free** | €0 | 1.000 chiamate/mese, 100 req/min |\n| **Pro** | $19/mese | Chiamate illimitate, 1.000 req/min |\n| **Enterprise** | $499/mese | Dedicated VPC, 10.000 req/min, SLA 99.9% |\n\n## 📁 Struttura Repository\n\n```\nmetamesh-uga/\n├── packages/\n│   ├── gateway/            # Data Plane: API Gateway, Routing, Cache, Proxy, Reliability\n│   ├── discovery/          # Control Plane: Discovery Engine\n│   ├── registry/           # Control Plane: Registry Engine (federation, mirroring, snapshot)\n│   ├── trust/              # Control Plane: Trust Engine\n│   ├── security/           # Control Plane: Security Scanner\n│   ├── policy/             # Control Plane: Policy Engine\n│   ├── benchmark/          # Control Plane: Benchmark Engine\n│   ├── lifecycle/          # Control Plane: Lifecycle Manager\n│   ├── recommendation/     # Control Plane: Recommendation Engine\n│   ├── cost/               # Control Plane/Data Plane: Cost Optimizer\n│   ├── compatibility/      # Control Plane: Compatibility Engine\n│   ├── intelligence/       # Control Plane: AI Intelligence Layer\n│   ├── analytics/          # Control Plane: Analytics Engine\n│   ├── health/             # Data Plane: Health Engine\n│   ├── config/             # Control Plane: Config Engine\n│   ├── cache/              # Data Plane: Advanced Cache Engine\n│   ├── self-healing/       # Data Plane: Self-Healing Engine\n│   ├── aggregator/         # Motore di aggregazione\n│   ├── inserter/           # Motore di inserimento\n│   ├── updater/            # Motore di aggiornamento\n│   ├── eliminatore/        # Motore di eliminazione\n│   ├── alerts/             # Alerting Worker\n│   ├── agent-billing/      # Billing per AI Agent\n│   ├── dashboard/            # Cloudflare Pages (React)\n│   └── landing/            # Landing page\n├── cli/                    # CLI Tool (Go)\n├── shared/                 # Librerie condivise\n│   ├── src/\n│   │   ├── auth.js         # Autenticazione\n│   │   ├── ratelimit.js    # Rate limiting\n│   │   ├── wasm-runtime.js # WASM execution\n│   │   └── x402.js         # x402 Protocol\n│   └── migrations/         # Database migrations\n├── docs/                   # Documentazione\n└── wrangler.toml           # Configurazione Cloudflare\n```\n\n## 🔧 Configurazione Environment\n\n```bash\n# .env\nCLOUDFLARE_API_TOKEN=xxx\nCLOUDFLARE_ACCOUNT_ID=xxx\nD1_DATABASE_ID=xxx\nJWT_SECRET=xxx\nSTRIPE_SECRET_KEY=sk_test_xxx\nSTRIPE_WEBHOOK_SECRET=whsec_xxx\nTELEGRAM_BOT_TOKEN=xxx\nTELEGRAM_CHAT_ID=xxx\n```\n\n## 🧪 Testing\n\n```bash\n# Test locale\nwrangler dev --config packages/gateway/wrangler.toml\n\n# Test API\ncurl http://localhost:8787/health\n```\n\n## 📝 Licenza\n\nMIT License - vedi [LICENSE](LICENSE)\n\n## 👤 Autore\n\nDavanzo Keoma - [GitHub](https://github.com/davanzo)\n\n---\n\n**Il \"set & forget\" è realtà. 🚀**\n",
  "bytes": 14824,
  "sha": "2b72c191a68631e3754c9e6ae23a42544932303bff5c7c09d9e1f7dd0d6e5e1c",
  "repo_slug": "siouxtxt/metamesh-uga",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_dev_metamesh_uga_metamesh_uga_87b88421/readme"
}