heymegabyte/agent-skills / 05-architecture-and-stack
architecture-and-stack
VerifiedCloudflare-first platform selection. Workers, D1, R2, KV, DO, Queues, Vectorize, Containers, Workflows, native Go CLIs and measured Rust/WASM acceleration. Default stack, override conditions, auth, data patterns and reliability.
mcp-and-cloud-integrations.md
View on GitHub---
name: "MCP and Cloud Integrations"
description: "Connect all available MCP servers, cloud APIs, and SaaS integrations. Auto-discover secrets from shared pool, Coolify, and local configs. Integrate Slack, Discord, Twilio, Zapier, Cal.com, and all de-facto standard services. Promote aggressive use of AI APIs (OpenAI, Workers AI, Ideogram) and multimedia APIs for rich product experiences."
updated: "2026-10-06"
---
# MCP and Cloud Integrations
## MCP Server Discovery
### Cloudflare control-plane default
- Install official `cloudflare/skills` for Claude Code/Codex/OpenCode.
- Connect `https://mcp.cloudflare.com/mcp` directly.
- Run `node bin/audit-cloudflare-mcp-fleet.mjs` to inventory project/global MCP configs without printing secret values.
- Remote HTTP MCPs used across projects are candidates for Cloudflare MCP Server Portal; local stdio/localhost tools stay local unless deliberately re-hosted.
- Keep the Cloudflare API Code Mode MCP direct to avoid nested Code Mode.
- Large portal: Code Mode `default_on`; small predictable server: direct tools are fine.
- See `[[cloudflare-agent-fabric]]`.
### Scan Locations
1. `~/.claude/settings.json` — global MCP
2. `~/.claude/projects/*/settings.json` — per-project
3. `~/.claude/plugins/` — installed plugins
4. `~/.config/docker/mcp/` — Docker catalog
5. Project `.mcp.json` or `.mcp/` — local project
### Priority-Ranked Servers
| # | Server | Tools | Status | Cost |
|---|--------|-------|--------|------|
| 1 | Cloudflare | Workers, D1, R2, KV, DNS (2500+ endpoints via 2 tools) | Connected | Free |
| 2 | Playwright | Browser automation, screenshots | Connected | Free |
| 3 | Stripe | Customers, subscriptions, invoices | Connected | Free |
| 4 | GitHub | Repos, PRs, issues, Actions | Auto | Free |
| 5 | Neon Postgres | Projects, branches, SQL | When DB needed | Free tier |
| 6 | Resend | Send emails, contacts, domains | Auto | Free (3K/mo) |
| 7 | PostHog | Analytics, feature flags | Auto | Free (1M/mo) |
| 8 | Sentry | Issues, events, stack traces | Auto | Free (5K/mo) |
| 9 | Google Analytics | GA4 reports, dimensions | When GA4 set up | Free |
| 10 | n8n | Workflows, expose as tools | When automation needed | Free (self-hosted) |
| 11 | Google (Gmail, Cal, Drive) | Email, scheduling, files | Ask first | Free |
| 12 | Composio | 300+ connectors | Ask first | Free tier |
**Key insight** — Cloudflare API MCP uses two Code Mode tools with progressive discovery across 2,500+ operations instead of loading the whole schema.
### MCP Config Commands
```bash
claude mcp add neon --transport http --url https://mcp.neon.tech
claude mcp add posthog --transport http --url https://mcp.posthog.com
claude mcp add sentry --transport http --url https://mcp.sentry.dev/mcp
claude mcp add github --transport http --url https://api.githubcopilot.com/mcp
claude mcp add google-workspace -- npx -y @taylorwilsdon/google_workspace_mcp
```
### Connected in This Environment
- **Built-In (Claude AI OAuth)** — Cloudflare, Stripe, Gmail, Google Calendar, Google Drive, Slack, Canva, IFTTT
- **Self-Hosted** — Coolify, Firecrawl, Postiz, WordPress, Home Assistant, DeepSeek, n8n, Notion, Supermemory, Plane, Omi
- **Developer Tools** — Playwright, GitHub, Sequential Thinking, Computer Use, PostHog, Sentry
- **Resend MCP (Apr 7, 2026)** — official server at `github.com/resend/resend-mcp`; run locally (streamable-HTTP endpoint `http://127.0.0.1:3000/mcp`), Resend API key as Bearer header. Wire: `claude mcp add resend --transport http http://127.0.0.1:3000/mcp --header "Authorization: Bearer re_xxxxxxxxx"`. 10 tool groups (emails, contacts, broadcasts, domains, webhooks, segments, topics, contact properties, API keys, received emails) — full Resend API surface.
### Agent Interop Protocols
- **MCP (Model Context Protocol)** — tool access for AI agents. 97M+ monthly SDK downloads; donated to Linux Foundation AAIF (Dec 2025).
- **A2A (Agent-to-Agent, Google)** — agent discovery, authentication, and task delegation across org boundaries; Linux Foundation. ACP (Cisco/LangChain agent commerce) merged into A2A (Aug 2025).
- **Enterprise stack** — MCP for tool access + A2A for multi-agent orchestration across teams/orgs.
### MCP → Skill Mapping
- Cloudflare → `08-deploy`
- Playwright → `07-quality`
- Square → `13/square-payments` (ON-REQUEST rail only; Stripe+Link is default per `payments`)
- Stripe → `13/stripe-billing` (SaaS subs/enterprise only)
- GitHub → `08/ci-cd-pipeline`
- Coolify → `05/mcp-and-cloud-integrations`
- Firecrawl → `03/competitive-analysis`
- Postiz → `09/social-automation`
- n8n → `06/webhook-system`
- Gmail → `09/email-templates`
- WordPress → `06/blog-and-content-engine`
- Notion → `09/documentation-and-codebase-hygiene`
- Sentry → `13-observability`
- PostHog → `13-observability`
- Computer Use → `07-quality`
- Plane → `03-planning`
## Cloudflare MCP Server Portal policy
Use a portal when remote MCPs benefit from one Access front door, OAuth centralization, tool allowlists, tool-call analytics, namespacing, Gateway routing/DLP, server toggles, or Code Mode compression.
Do not portal-wrap:
- stdio/local MCPs unless intentionally re-hosted as authenticated Streamable HTTP;
- the direct Cloudflare API Code Mode server;
- an upstream forced into Code Mode when the portal would also force Code Mode.
Autonomous M2M agents use service-token/Access policy only when the server's authorization model permits it. Per-user OAuth remains per-user.
## Secret Hygiene
- 12 MCP servers have inline secrets
- Migrate to chezmoi at `~/.local/share/chezmoi/home/.chezmoitemplates/secrets-macbook-pro/`
- Never store secrets in markdown, CLAUDE.md, skill files, or git-tracked configs
## Secrets Discovery (check all, merge)
1. Project `.env.local`
2. Project `.env`
3. `rare-chefs/.env.local` (master)
4. `~/.config/emdash/` (stored tokens)
5. Coolify API
6. Claude MCP configs
7. Prompt user (ONCE per key, then store)
### Key Categories
| Category | Keys |
|----------|------|
| AI | `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `IDEOGRAM_API_KEY` |
| Cloud | `CLOUDFLARE_API_TOKEN`, `CF_ZONE_ID` |
| Payments (Square — on-request rail) | `SQUARE_ACCESS_TOKEN`, `SQUARE_LOCATION_ID`, `SQUARE_APPLICATION_ID`, `SQUARE_ENVIRONMENT`, `SQUARE_WEBHOOK_SIGNATURE_KEY` |
| Payments (SaaS subs / enterprise) | `STRIPE_API_KEY`, `STRIPE_WEBHOOK_SECRET` |
| Email | `RESEND_API_KEY` |
| Auth | `CLERK_SECRET_KEY` |
| Analytics | `POSTHOG_API_KEY`, `SENTRY_DSN`, `GA4_MEASUREMENT_ID` |
| Communication | `SLACK_WEBHOOK_URL`, `DISCORD_WEBHOOK_URL`, `TWILIO_AUTH_TOKEN` |
| Automation | `ZAPIER_WEBHOOK_URL`, `N8N_API_KEY` |
| Self-Hosted | `COOLIFY_API_TOKEN`, `SEARXNG_URL`, `FIRECRAWL_API_KEY` |
## Standard Integrations
### Tier 1 (Every Product)
**Slack Notifications:**
```typescript
async function notifySlack(env: Env, message: string) {
if (!env.SLACK_WEBHOOK_URL) return;
await fetch(env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: message }),
});
}
```
**Discord Webhooks** — same pattern with `embeds: [{ title, description, color: 0x00E5FF }]`
### Tier 2 (When Beneficial)
- **Twilio** — SMS via REST API for phone-based features
- **Zapier** — trigger workflows on key events (new donation, signup, deploy)
- **Cal.com** — `<button data-cal-link="brian/30min" data-cal-config='{"theme":"dark"}'>Schedule a Call</button>`
## AI API Usage Strategy
| Asset | API | Cost |
|-------|-----|------|
| Hero image | GPT Image 2 | ~$0.04 |
| Logo | Ideogram v3 | ~$0.03 |
| OG images | GPT Image 2 | ~$0.04/page |
| Hero video (4s) | Sora 2 | ~$0.10 |
| Alt text, translations, meta, blog, embeddings | Workers AI | $0 (free) |
| Keyword research | Google Autocomplete | $0 |
## projectsites.dev Attribution
```html
<footer><p>Built with <a href="https://projectsites.dev">projectsites.dev</a></p></footer>
```
- Every site shipped IS the marketing
- Quality = best ad
## Missing Key Prompt
Never block on missing key. Always have fallback. Be casual:
```
Hey — I need a [SERVICE] key. Options:
1. [SERVICE] — [free tier] — [URL]
2. Skip and use [fallback]
(I'll store so you only enter once)
```
## Ownership
- **Owns** — MCP discovery/connection, secrets discovery, cloud API patterns, AI API strategy, notification patterns, automation hooks, projectsites.dev branding
- **Never owns** — specific implementations (→individual skills), payments default Stripe+Link (→`13/stripe-billing`; Square on request →`13/square-payments`), SaaS subscriptions + enterprise billing (→`13/stripe-billing`), email (→`09/email-templates`), deployment (→`08-deploy`)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |