Aller au contenu

πŸ”Œ XPipe Integration

Connection Hub fΓΌr G100 MEGA ECOSYSTEM


πŸ“‹ Übersicht

XPipe ist ein Connection Hub, der deine gesamte Server-Infrastruktur von deinem lokalen Desktop aus verwaltet. Im G100 MEGA ECOSYSTEM nutzen wir XPipe fΓΌr:

  • Cloudflare Workers Management (via Wrangler CLI)
  • Server & Container Zugriffe (SSH, Docker, Kubernetes)
  • AI Agent Integration (MCP Server)
  • Team Collaboration (Git-basiertes Vault + Cloudflare Tunnel)

πŸ”₯ Team Remote Access

XPipe lΓ€uft lokal, aber Team kann via Cloudflare Tunnel zugreifen! - βœ… HTTPS VerschlΓΌsselung - βœ… AI Agents weltweit - βœ… Keine Port-Forwarding

Setup: XPipe + Cloudflare Tunnel Guide β†’


🎯 Use Cases

1. Cloudflare Workers Deployment

# XPipe Shell Script: "Deploy MORELO API"
#!/bin/bash
cd ~/projects/morelo-api
wrangler deploy --env production
wrangler tail --format pretty

Vorteile: - βœ… Ein Klick Deployment aus XPipe - βœ… Logs in Echtzeit - βœ… Keine manuelle Terminal-Navigation

2. Multi-Instance Management

# XPipe Script: "Deploy All Instances"
#!/bin/bash

instances=("morelo" "flo" "contractplattform")

for instance in "${instances[@]}"; do
  echo "πŸš€ Deploying $instance..."
  cd ~/projects/$instance-api
  wrangler deploy --env production
  echo "βœ… $instance deployed"
done

3. Database Operations

# XPipe Script: "Check Contract Counts"
#!/bin/bash

# MORELO
echo "=== MORELO Contracts ==="
wrangler d1 execute morelo-prod --command \
  "SELECT COUNT(*) as total FROM contracts"

# FLO
echo "=== FLO Contracts ==="
wrangler d1 execute flo-prod --command \
  "SELECT COUNT(*) as total FROM contracts"

# Master
echo "=== ContractPlattform Total ==="
wrangler d1 execute contractplattform-prod --command \
  "SELECT instance_id, COUNT(*) as total FROM contracts GROUP BY instance_id"

4. Secret Management

# XPipe Script: "Rotate Adobe API Key"
#!/bin/bash

# Read new key from password manager (via XPipe integration!)
NEW_KEY=$(security find-generic-password -a "adobe-api-key" -w)

# Update on all instances
wrangler secret put ADOBE_API_KEY --env morelo <<< "$NEW_KEY"
wrangler secret put ADOBE_API_KEY --env flo <<< "$NEW_KEY"

echo "βœ… Adobe API Key rotated on all instances"

πŸ”§ Setup

1. XPipe installieren

# macOS (Homebrew)
brew install --cask xpipe-io/tap/xpipe

# Oder Download von:
# https://github.com/xpipe-io/xpipe/releases

2. Cloudflare Connection einrichten

In XPipe:

  1. New Connection β†’ Custom Command
  2. Name: Cloudflare - ContractPlattform
  3. Command:
    wrangler login
    

Custom Script erstellen:

  1. Scripts β†’ New Script
  2. Name: CF: Deploy All
  3. Type: Shell Script
  4. Content: (siehe Beispiele oben)

3. MCP Server aktivieren (fΓΌr AI Agents)

Settings β†’ Automation β†’ MCP Server:

  • βœ… Enable MCP Server
  • βœ… Enable Write Operations
  • πŸ”‘ Generate API Key

In Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "xpipe": {
      "command": "http",
      "args": ["http://localhost:21721"],
      "env": {
        "XPIPE_API_KEY": "your-api-key-here"
      }
    }
  }
}

πŸ€– AI Agent Use Cases

Prompt Examples

Agent, deploy the latest MORELO API changes via XPipe

Agent, check the contract count across all G100 instances using XPipe

Agent, rotate the Stripe API key on all instances via XPipe

Agent, show me the latest error logs from the FLO production worker using XPipe

Agent Workflow (automatisch):

  1. Agent erkennt XPipe MCP Tool
  2. FΓΌhrt run_script mit Script-Name aus
  3. Liest Output
  4. Interpretiert Ergebnis
  5. Berichtet an dich

πŸ” Git Vault fΓΌr Team Collaboration

Setup

In XPipe: Settings β†’ Sync β†’ Git Repository:

  1. Enable Git Sync: βœ…
  2. Repository URL:
    git@github.com:your-org/xpipe-vault.git
    
  3. Branch: main
  4. Auto-Commit: βœ…
  5. Auto-Push: βœ…

Was wird gespeichert?

xpipe-vault/
β”œβ”€β”€ connections/
β”‚   β”œβ”€β”€ cloudflare-morelo.json
β”‚   β”œβ”€β”€ cloudflare-flo.json
β”‚   β”œβ”€β”€ aws-production.json
β”‚   └── docker-local.json
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ deploy-all-instances.sh
β”‚   β”œβ”€β”€ check-contracts.sh
β”‚   └── rotate-secrets.sh
└── environments/
    β”œβ”€β”€ production.env
    └── staging.env

Team Benefits:

  • βœ… Jeder hat gleiche Connections
  • βœ… Scripts werden geteilt
  • βœ… Versioniert mit Git
  • βœ… Self-hosted (kein externer Service)

πŸ“Š Integration Matrix

Feature XPipe Cloudflare Dashboard Wrangler CLI
Deployment βœ… Scripts ❌ βœ… Direct
Logs βœ… Scripts βœ… Live Tail βœ… wrangler tail
Secrets βœ… Scripts βœ… GUI βœ… wrangler secret
D1 Queries βœ… Scripts βœ… GUI βœ… wrangler d1
AI Agent Access βœ… MCP ❌ ❌
Team Sharing βœ… Git Vault ❌ ❌
SSH Integration βœ… Native ❌ ❌

🎬 Workflow Example

Szenario: "Deploy MORELO mit Health Check"

XPipe Script: deploy-morelo-safe.sh

#!/bin/bash

set -e  # Exit on error

INSTANCE="morelo"
ENV="production"

echo "πŸš€ Starting deployment for $INSTANCE..."

# 1. Pre-deployment check
echo "πŸ“Š Current worker status:"
wrangler tail --format json --once | jq '.outcome'

# 2. Deploy
echo "πŸ”¨ Deploying..."
wrangler deploy --env $ENV

# 3. Wait for propagation
echo "⏳ Waiting 10s for propagation..."
sleep 10

# 4. Health check
echo "πŸ₯ Running health check..."
HEALTH=$(curl -s https://api-morelo.contractplattform.dev/health)

if echo "$HEALTH" | jq -e '.status == "ok"' > /dev/null; then
  echo "βœ… Deployment successful!"
  echo "πŸ“Š Health: $HEALTH"
else
  echo "❌ Health check failed!"
  echo "πŸ”΄ Response: $HEALTH"
  exit 1
fi

# 5. Notify
echo "πŸ“§ Sending notification..."
curl -X POST "https://hooks.slack.com/your-webhook" \
  -d "{\"text\": \"βœ… MORELO deployed successfully\"}"

echo "πŸŽ‰ Done!"

AusfΓΌhren: - In XPipe: Right-click auf Connection β†’ Run Script β†’ deploy-morelo-safe.sh - ODER via AI Agent: "Deploy MORELO with health check using XPipe"


πŸ”₯ Advanced: Cloudflare API Integration

Direkt via REST API (ohne Wrangler)

# XPipe Script: "cf-api-deploy.sh"
#!/bin/bash

CF_ACCOUNT_ID="edeaf72f08c3145711f257893d9ddab1"
CF_API_TOKEN="${CLOUDFLARE_API_TOKEN}"  # From XPipe env or password manager
WORKER_NAME="morelo-api"

# Get script content
SCRIPT=$(cat ~/projects/morelo-api/dist/index.js)

# Deploy via API
curl -X PUT \
  "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/$WORKER_NAME" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/javascript" \
  --data-binary "@~/projects/morelo-api/dist/index.js"

echo "βœ… Deployed via API"

πŸ“š Resources

Resource URL
XPipe Homepage https://xpipe.io
XPipe GitHub https://github.com/xpipe-io/xpipe
XPipe Docs https://docs.xpipe.io
MCP Server Guide https://docs.xpipe.io/guide/mcp
Reddit Discussion https://www.reddit.com/r/selfhosted/comments/14ttg5o/
Cloudflare API https://developers.cloudflare.com/api/

βœ… Vorteile fΓΌr G100

Vorteil Beschreibung
🎯 Zentralisiert Alle Connections an einem Ort
πŸ€– AI-ready MCP Server fΓΌr Agents
πŸ‘₯ Team-fΓ€hig Git-basiertes Sharing
πŸ” Sicher Password Manager Integration
⚑ Schnell One-Click Deployments
πŸ“Š Transparent Alle Logs zentral

Next: Cloudflare API Deployment β†’