#!/bin/bash
# MCP Factory V3 — Manifest Builder
# Creates the manifest file for all 30 servers

MANIFEST_DIR="$(dirname "$0")/../manifests"
mkdir -p "$MANIFEST_DIR"

cat > "$MANIFEST_DIR/batch-1.json" << 'EOF'
[
  {
    "name": "shopify",
    "displayName": "Shopify",
    "repo": "shopify-mcp-2026-complete",
    "apiBase": "https://{store}.myshopify.com/admin/api/2024-01",
    "auth": "oauth2",
    "toolCategories": ["products", "orders", "customers", "inventory", "collections", "discounts", "shipping", "fulfillments", "themes", "pages", "blogs", "analytics", "webhooks"],
    "appCount": 18
  },
  {
    "name": "stripe",
    "displayName": "Stripe",
    "repo": "stripe-mcp-2026-complete",
    "apiBase": "https://api.stripe.com/v1",
    "auth": "bearer",
    "toolCategories": ["charges", "customers", "subscriptions", "invoices", "products", "prices", "payment-intents", "payment-methods", "refunds", "disputes", "payouts", "balance", "events", "webhooks"],
    "appCount": 18
  },
  {
    "name": "quickbooks",
    "displayName": "QuickBooks Online",
    "repo": "quickbooks-mcp-2026-complete",
    "apiBase": "https://quickbooks.api.intuit.com/v3/company/{realmId}",
    "auth": "oauth2",
    "toolCategories": ["invoices", "customers", "payments", "estimates", "bills", "vendors", "items", "accounts", "reports", "employees", "time-activities", "taxes", "purchases", "journal-entries"],
    "appCount": 18
  },
  {
    "name": "hubspot",
    "displayName": "HubSpot",
    "repo": "hubspot-mcp-2026-complete",
    "apiBase": "https://api.hubapi.com",
    "auth": "bearer",
    "toolCategories": ["contacts", "companies", "deals", "tickets", "emails", "engagements", "pipelines", "lists", "forms", "campaigns", "blog", "analytics", "workflows", "webhooks"],
    "appCount": 20
  },
  {
    "name": "salesforce",
    "displayName": "Salesforce",
    "repo": "salesforce-mcp-2026-complete",
    "apiBase": "https://{instance}.salesforce.com/services/data/v59.0",
    "auth": "oauth2",
    "toolCategories": ["accounts", "contacts", "leads", "opportunities", "cases", "tasks", "events", "campaigns", "reports", "dashboards", "users", "custom-objects", "soql", "bulk-api"],
    "appCount": 20
  }
]
EOF

cat > "$MANIFEST_DIR/batch-2.json" << 'EOF'
[
  {
    "name": "notion",
    "displayName": "Notion",
    "repo": "notion-mcp-2026-complete",
    "apiBase": "https://api.notion.com/v1",
    "auth": "bearer",
    "toolCategories": ["pages", "databases", "blocks", "users", "comments", "search"],
    "appCount": 15
  },
  {
    "name": "airtable",
    "displayName": "Airtable",
    "repo": "airtable-mcp-2026-complete",
    "apiBase": "https://api.airtable.com/v0",
    "auth": "bearer",
    "toolCategories": ["bases", "tables", "records", "fields", "views", "webhooks", "automations"],
    "appCount": 15
  },
  {
    "name": "intercom",
    "displayName": "Intercom",
    "repo": "intercom-mcp-2026-complete",
    "apiBase": "https://api.intercom.io",
    "auth": "bearer",
    "toolCategories": ["contacts", "conversations", "companies", "articles", "help-center", "tickets", "tags", "segments", "events", "messages", "teams", "admins"],
    "appCount": 16
  },
  {
    "name": "monday",
    "displayName": "Monday.com",
    "repo": "monday-mcp-2026-complete",
    "apiBase": "https://api.monday.com/v2",
    "auth": "bearer",
    "toolCategories": ["boards", "items", "columns", "groups", "updates", "users", "teams", "workspaces", "folders", "webhooks", "automations"],
    "appCount": 16
  },
  {
    "name": "xero",
    "displayName": "Xero",
    "repo": "xero-mcp-2026-complete",
    "apiBase": "https://api.xero.com/api.xro/2.0",
    "auth": "oauth2",
    "toolCategories": ["invoices", "contacts", "accounts", "bank-transactions", "payments", "bills", "credit-notes", "purchase-orders", "quotes", "reports", "employees", "payroll", "tax-rates"],
    "appCount": 18
  }
]
EOF

cat > "$MANIFEST_DIR/batch-3.json" << 'EOF'
[
  {
    "name": "jira",
    "displayName": "Jira/Atlassian",
    "repo": "jira-mcp-2026-complete",
    "apiBase": "https://{domain}.atlassian.net/rest/api/3",
    "auth": "basic_or_oauth2",
    "toolCategories": ["issues", "projects", "boards", "sprints", "users", "comments", "attachments", "transitions", "fields", "filters", "dashboards", "webhooks"],
    "appCount": 18
  },
  {
    "name": "linear",
    "displayName": "Linear",
    "repo": "linear-mcp-2026-complete",
    "apiBase": "https://api.linear.app/graphql",
    "auth": "bearer",
    "toolCategories": ["issues", "projects", "teams", "cycles", "labels", "milestones", "users", "comments", "workflows", "webhooks"],
    "appCount": 15
  },
  {
    "name": "asana",
    "displayName": "Asana",
    "repo": "asana-mcp-2026-complete",
    "apiBase": "https://app.asana.com/api/1.0",
    "auth": "bearer",
    "toolCategories": ["tasks", "projects", "workspaces", "teams", "users", "sections", "tags", "goals", "portfolios", "custom-fields", "status-updates", "webhooks"],
    "appCount": 16
  },
  {
    "name": "docusign",
    "displayName": "DocuSign",
    "repo": "docusign-mcp-2026-complete",
    "apiBase": "https://{account}.docusign.net/restapi/v2.1",
    "auth": "oauth2",
    "toolCategories": ["envelopes", "templates", "recipients", "documents", "signing", "folders", "users", "accounts", "reports", "bulk-send"],
    "appCount": 14
  },
  {
    "name": "square",
    "displayName": "Square",
    "repo": "square-mcp-2026-complete",
    "apiBase": "https://connect.squareup.com/v2",
    "auth": "bearer",
    "toolCategories": ["payments", "orders", "customers", "catalog", "inventory", "locations", "team", "invoices", "subscriptions", "loyalty", "bookings", "disputes", "refunds"],
    "appCount": 18
  }
]
EOF

cat > "$MANIFEST_DIR/batch-4.json" << 'EOF'
[
  {
    "name": "klaviyo",
    "displayName": "Klaviyo",
    "repo": "klaviyo-mcp-2026-complete",
    "apiBase": "https://a.klaviyo.com/api",
    "auth": "bearer",
    "toolCategories": ["profiles", "lists", "segments", "campaigns", "flows", "templates", "metrics", "events", "catalogs", "forms", "tags", "reporting"],
    "appCount": 16
  },
  {
    "name": "activecampaign",
    "displayName": "ActiveCampaign",
    "repo": "activecampaign-mcp-2026-complete",
    "apiBase": "https://{account}.api-us1.com/api/3",
    "auth": "api_key",
    "toolCategories": ["contacts", "deals", "lists", "campaigns", "automations", "forms", "tags", "tasks", "notes", "pipelines", "accounts", "webhooks"],
    "appCount": 16
  },
  {
    "name": "salesloft",
    "displayName": "Salesloft",
    "repo": "salesloft-mcp-2026-complete",
    "apiBase": "https://api.salesloft.com/v2",
    "auth": "oauth2",
    "toolCategories": ["people", "cadences", "emails", "calls", "accounts", "steps", "users", "teams", "imports", "activities", "notes"],
    "appCount": 14
  },
  {
    "name": "zoho-crm",
    "displayName": "Zoho CRM",
    "repo": "zoho-crm-mcp-2026-complete",
    "apiBase": "https://www.zohoapis.com/crm/v6",
    "auth": "oauth2",
    "toolCategories": ["leads", "contacts", "accounts", "deals", "tasks", "events", "calls", "notes", "products", "quotes", "invoices", "campaigns", "blueprints", "workflows"],
    "appCount": 18
  },
  {
    "name": "sendgrid",
    "displayName": "SendGrid",
    "repo": "sendgrid-mcp-2026-complete",
    "apiBase": "https://api.sendgrid.com/v3",
    "auth": "bearer",
    "toolCategories": ["mail", "contacts", "lists", "segments", "templates", "campaigns", "senders", "stats", "suppressions", "webhooks", "api-keys"],
    "appCount": 14
  }
]
EOF

cat > "$MANIFEST_DIR/batch-5.json" << 'EOF'
[
  {
    "name": "greenhouse",
    "displayName": "Greenhouse",
    "repo": "greenhouse-mcp-2026-complete",
    "apiBase": "https://harvest.greenhouse.io/v1",
    "auth": "basic",
    "toolCategories": ["candidates", "applications", "jobs", "offers", "scorecards", "interviews", "users", "departments", "offices", "custom-fields", "activity-feed"],
    "appCount": 15
  },
  {
    "name": "datadog",
    "displayName": "Datadog",
    "repo": "datadog-mcp-2026-complete",
    "apiBase": "https://api.datadoghq.com/api/v2",
    "auth": "api_key_app_key",
    "toolCategories": ["monitors", "dashboards", "events", "metrics", "logs", "incidents", "service-checks", "hosts", "downtimes", "synthetics", "apm"],
    "appCount": 16
  },
  {
    "name": "supabase",
    "displayName": "Supabase",
    "repo": "supabase-mcp-2026-complete",
    "apiBase": "https://{project}.supabase.co",
    "auth": "bearer",
    "toolCategories": ["database", "auth", "storage", "edge-functions", "realtime", "rpc", "migrations", "policies"],
    "appCount": 14
  },
  {
    "name": "typeform",
    "displayName": "Typeform",
    "repo": "typeform-mcp-2026-complete",
    "apiBase": "https://api.typeform.com",
    "auth": "bearer",
    "toolCategories": ["forms", "responses", "workspaces", "themes", "images", "insights", "webhooks"],
    "appCount": 12
  },
  {
    "name": "chargebee",
    "displayName": "Chargebee",
    "repo": "chargebee-mcp-2026-complete",
    "apiBase": "https://{site}.chargebee.com/api/v2",
    "auth": "basic",
    "toolCategories": ["subscriptions", "customers", "invoices", "plans", "addons", "coupons", "payments", "credit-notes", "events", "quotes", "exports"],
    "appCount": 15
  }
]
EOF

cat > "$MANIFEST_DIR/batch-6.json" << 'EOF'
[
  {
    "name": "pandadoc",
    "displayName": "PandaDoc",
    "repo": "pandadoc-mcp-2026-complete",
    "apiBase": "https://api.pandadoc.com/public/v1",
    "auth": "bearer",
    "toolCategories": ["documents", "templates", "contacts", "content-library", "forms", "webhooks", "workspaces", "members"],
    "appCount": 12
  },
  {
    "name": "loom",
    "displayName": "Loom",
    "repo": "loom-mcp-2026-complete",
    "apiBase": "https://www.loom.com/v1",
    "auth": "bearer",
    "toolCategories": ["videos", "folders", "workspaces", "members", "comments", "transcripts", "analytics", "embeds"],
    "appCount": 12
  },
  {
    "name": "webflow",
    "displayName": "Webflow",
    "repo": "webflow-mcp-2026-complete",
    "apiBase": "https://api.webflow.com/v2",
    "auth": "bearer",
    "toolCategories": ["sites", "pages", "collections", "items", "orders", "products", "inventory", "users", "forms", "webhooks", "assets"],
    "appCount": 15
  },
  {
    "name": "apollo",
    "displayName": "Apollo.io",
    "repo": "apollo-mcp-2026-complete",
    "apiBase": "https://api.apollo.io/v1",
    "auth": "api_key",
    "toolCategories": ["people", "organizations", "contacts", "accounts", "sequences", "tasks", "emails", "opportunities", "labels", "lists", "enrichment"],
    "appCount": 15
  },
  {
    "name": "lever",
    "displayName": "Lever",
    "repo": "lever-mcp-2026-complete",
    "apiBase": "https://api.lever.co/v1",
    "auth": "basic_or_oauth2",
    "toolCategories": ["opportunities", "candidates", "postings", "interviews", "offers", "stages", "users", "archive-reasons", "sources", "tags", "feedback-forms"],
    "appCount": 14
  }
]
EOF

echo "All 6 batch manifests created (30 servers total)"
ls -la "$MANIFEST_DIR"
