Steps 0–10 of the v2 plan, 194 tests passing. Core infrastructure - Shared Redis client (src/redis.ts); all four Redis consumers migrated - Vitest test harness with vitest.config.ts and npm test/test:watch scripts Billing & invoicing (Steps 1–2) - Monthly invoice generation with idempotency (MySQL uq_customer_period unique key) - Cron job with Redis distributed lock (Lua compare-delete, 1-hr TTL) - Invoice emailer via nodemailer (FETCHERPAY SMTP) - Billing middleware: checkLimit gate in handleToolCall; platform attribution fix Email multi-tenancy (Step 3) - EmailCtx = Account | EmailCredentials; imap.ts + smtp.ts accept both - resolveEmailCtx helper in tools.ts; all email tools use customer credentials Analytics + platform health (Steps 4–5) - Chart.js bar charts for platform breakdown and daily activity - Token expiry check in getCredential with dynamic import refresh - platform-health.ts: per-platform health probe with 10-min Redis cache - GET /api/health/platforms; "Token expired" amber badge in dashboard Tool schema filtering (Step 6) - stripAccountParam deep-clones tool schemas; multi-tenant sessions never see the internal account enum OAuth hardening (Step 7) - Atomic auth code consumption: UPDATE SET used=TRUE, check affectedRows - customer_id threaded through oauth_auth_codes → oauth_tokens - getTokenCustomer(); requireAuth resolves req.customer from Bearer token - Consent page requires authenticated session; redirect_uri validated against registered URIs; http://localhost:* loopback wildcard DCR browser flow (Step 8) - ensureOAuthAppRegistered() upserts pre-registered SquareMCP OAuth app on startup with redirect URIs for mcp-callback, localhost:*, claude-desktop, opencode - GET /oauth/connect-mcp → server-side redirect (client_id off frontend) - GET /oauth/mcp-callback → exchanges code, renders config snippet page with copy buttons for Claude Desktop and Codex CLI Webhooks (Step 9) - webhook_url + webhook_secret columns on customers - deliverWebhook(): HMAC-SHA256 signing, 3× exponential retry (1s/4s/16s), Redis DLQ with 7-day TTL on total failure - isValidWebhookUrl(): SSRF protection (blocks RFC-1918, localhost, .local) - POST /api/webhooks/config (secret returned once), GET, DELETE - GET /api/admin/webhooks/dlq/:customerId - WhatsApp POST route uses express.raw() for raw body preservation - Dashboard Webhooks tab with secret-once display and copy button Developer docs (Step 10) - docs/ static HTML site (GitHub Pages, no build pipeline) - index.html: landing page with client + platform overview - getting-started.html: tabbed MCP config for Claude Desktop, Codex CLI, opencode - platforms.html: LinkedIn, TikTok, WhatsApp, Instagram, Twitter, Telegram guides - agent-tutorial.html: complete Node.js agent (Anthropic SDK + MCP SDK), LinkedIn posting loop, extensions for multi-platform + inbound webhook reaction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
95 lines
4.9 KiB
HTML
95 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>SquareMCP Docs — AI Social Media Gateway</title>
|
||
<meta name="description" content="Connect Claude, Codex CLI, and opencode to LinkedIn, TikTok, WhatsApp, and more via the Model Context Protocol.">
|
||
<link rel="stylesheet" href="styles.css">
|
||
</head>
|
||
<body>
|
||
|
||
<nav class="site-nav">
|
||
<div class="nav-inner">
|
||
<a href="index.html" class="nav-logo"><span class="nav-logo-mark">S</span> SquareMCP</a>
|
||
<div class="nav-links">
|
||
<a href="getting-started.html">Getting started</a>
|
||
<a href="platforms.html">Platform guides</a>
|
||
<a href="agent-tutorial.html">Agent tutorial</a>
|
||
<a href="https://hermes.squaremcp.com/openapi-social.json" target="_blank">API reference ↗</a>
|
||
</div>
|
||
<a href="https://squaremcp.com" class="nav-cta" target="_blank">Open app</a>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="page">
|
||
<div class="hero">
|
||
<h1>Build AI agents that<br>talk to the world</h1>
|
||
<p>SquareMCP connects Claude, Codex CLI, and opencode to LinkedIn, TikTok, WhatsApp, Instagram, Twitter, and more — through a single MCP server.</p>
|
||
</div>
|
||
|
||
<div class="card-grid">
|
||
<a href="getting-started.html" class="card" style="text-decoration:none;color:inherit;">
|
||
<h4>🚀 Getting started</h4>
|
||
<p>Add SquareMCP to Claude Desktop, Codex CLI, or opencode in five minutes.</p>
|
||
</a>
|
||
<a href="platforms.html" class="card" style="text-decoration:none;color:inherit;">
|
||
<h4>🔌 Platform guides</h4>
|
||
<p>Connect LinkedIn, TikTok, and WhatsApp. Step-by-step setup for each platform.</p>
|
||
</a>
|
||
<a href="agent-tutorial.html" class="card" style="text-decoration:none;color:inherit;">
|
||
<h4>🤖 Agent tutorial</h4>
|
||
<p>Real code: a Claude agent that researches news and posts to LinkedIn automatically.</p>
|
||
</a>
|
||
<a href="https://hermes.squaremcp.com/openapi-social.json" target="_blank" class="card" style="text-decoration:none;color:inherit;">
|
||
<h4>📖 API reference ↗</h4>
|
||
<p>Full OpenAPI spec for every social tool. Mail API available separately.</p>
|
||
</a>
|
||
</div>
|
||
|
||
<h2>Why MCP?</h2>
|
||
<p>The Model Context Protocol lets AI assistants call real tools without custom integrations. Instead of writing a bespoke connector for every model and platform, you configure SquareMCP once and every MCP-compatible client gains the same 50+ tools.</p>
|
||
<p>SquareMCP is multi-tenant by design: each customer's credentials are encrypted at rest, isolated per account, and never shared across sessions. Bearer tokens issued through OAuth are bound to your customer record so every tool call is attributable and rate-limited.</p>
|
||
|
||
<h2>Supported clients</h2>
|
||
<div class="card-grid">
|
||
<div class="card">
|
||
<h4>Claude Desktop</h4>
|
||
<p>Add a <code>mcpServers</code> entry to <code>claude_desktop_config.json</code>. No extra software needed.</p>
|
||
</div>
|
||
<div class="card">
|
||
<h4>Codex CLI</h4>
|
||
<p>Pass <code>--mcp-server</code> or configure in <code>~/.codex/config.json</code>. Full PKCE OAuth flow supported.</p>
|
||
</div>
|
||
<div class="card">
|
||
<h4>opencode</h4>
|
||
<p>Add SquareMCP to your opencode MCP providers list. HTTP Bearer transport.</p>
|
||
</div>
|
||
<div class="card">
|
||
<h4>Custom agents</h4>
|
||
<p>Any MCP client that supports Streamable HTTP transport works. See the agent tutorial for a from-scratch example.</p>
|
||
</div>
|
||
</div>
|
||
|
||
<h2>Supported platforms</h2>
|
||
<div class="card-grid">
|
||
<div class="card"><h4><span class="icon" style="background:#0a66c2;">in</span> LinkedIn</h4><p>Post text, images, and video. Search connections, send messages.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#000;">🎵</span> TikTok</h4><p>Upload and publish videos. View creator analytics.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#25d366;">💬</span> WhatsApp</h4><p>Send messages and templates. Receive inbound via webhook.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:linear-gradient(45deg,#f09433,#dc2743,#bc1888);">📷</span> Instagram</h4><p>Publish reels and image posts via Business API.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#000;">𝕏</span> Twitter / X</h4><p>Tweet with media. Search and read timeline.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#1877f2;">f</span> Facebook</h4><p>Post to pages, share photos and video.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#0088cc;">✈️</span> Telegram</h4><p>Send messages and photos via bot token.</p></div>
|
||
<div class="card"><h4><span class="icon" style="background:#5865f2;">🎮</span> Discord</h4><p>Send messages to channels via bot.</p></div>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// Highlight active nav link
|
||
document.querySelectorAll('.nav-links a').forEach(a => {
|
||
if (a.href === location.href) a.classList.add('active');
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|