From 73f83c0d8677c0ffb34c6a6b06025d94ac5303cd Mon Sep 17 00:00:00 2001 From: Garfield Date: Tue, 5 May 2026 01:25:26 -0400 Subject: [PATCH] feat: WhatsApp + LinkedIn integrations, SquareMCP rebrand, opencode docs WhatsApp Business API (Meta Cloud API) - New client: src/clients/whatsapp.ts - Tools: whatsapp_send_message, whatsapp_send_template, whatsapp_list_templates - REST endpoints: POST /api/whatsapp/send, POST /api/whatsapp/template, GET /api/whatsapp/templates - Multi-account env var pattern: WHATSAPP_{ACCOUNT}_* LinkedIn API (OpenID Connect) - New client: src/clients/linkedin.ts - Tools: linkedin_get_profile, linkedin_create_post, linkedin_search_connections, linkedin_send_message - REST endpoints: GET /api/linkedin/profile, POST /api/linkedin/post, POST /api/linkedin/search-connections, POST /api/linkedin/message - Multi-account env var pattern: LINKEDIN_{ACCOUNT}_* - Uses /v2/userinfo (OpenID Connect) for profile reads Domain migration - hermes.fetcherpay.com -> hermes.squaremcp.com - Updated K8s ingress, TLS cert, SERVER_URL env var - Updated OPENCODE.md and opencode.json references SquareMCP site - Added logo assets (SVG, LinkedIn variants) - Added terms.html - Updated Dockerfile, nginx config, styles, index, privacy pages Docs - Added OPENCODE.md for opencode AI integration setup - Updated .env.example with WhatsApp and LinkedIn credentials - Added opencode.json to .gitignore (contains live API key) Total tools: 19 (email 6, obsidian 5, whatsapp 4, linkedin 4) --- .env.example | 17 ++ .gitignore | 1 + OPENCODE.md | 93 +++++++++ product/site/Dockerfile | 2 + product/site/index.html | 6 +- product/site/nginx-site.conf | 2 +- product/site/privacy.html | 161 +++++++++++---- .../squaremcp-logo-linkedin-transparent.png | Bin 0 -> 9038 bytes product/site/squaremcp-logo-linkedin.jpg | Bin 0 -> 18690 bytes product/site/squaremcp-logo-linkedin.png | Bin 0 -> 67792 bytes product/site/squaremcp-logo.svg | 18 ++ product/site/styles.css | 92 ++++++++- product/site/terms.html | 140 +++++++++++++ src/clients/linkedin.ts | 142 ++++++++++++++ src/clients/whatsapp.ts | 145 ++++++++++++++ src/index.ts | 76 +++++++ src/manifest.ts | 185 ++++++++++++++++++ src/tools.ts | 172 ++++++++++++++++ 18 files changed, 1207 insertions(+), 45 deletions(-) create mode 100644 OPENCODE.md create mode 100644 product/site/squaremcp-logo-linkedin-transparent.png create mode 100644 product/site/squaremcp-logo-linkedin.jpg create mode 100644 product/site/squaremcp-logo-linkedin.png create mode 100644 product/site/squaremcp-logo.svg create mode 100644 product/site/terms.html create mode 100644 src/clients/linkedin.ts create mode 100644 src/clients/whatsapp.ts diff --git a/.env.example b/.env.example index 090ea1e..32c8963 100644 --- a/.env.example +++ b/.env.example @@ -37,3 +37,20 @@ SYNCTHING_URL=http://host.docker.internal:8384 SYNCTHING_API_KEY=your-syncthing-api-key # Folder ID as set in Syncthing config SYNCTHING_FOLDER_ID=obsidian-vault + +# ── WhatsApp Business API (Meta Cloud API) ─────────────────────────────────── +# Get these from https://business.facebook.com/settings/whatsapp-business-accounts +# For default account: +WHATSAPP_DEFAULT_PHONE_NUMBER_ID=your-phone-number-id +WHATSAPP_DEFAULT_ACCESS_TOKEN=your-permanent-access-token +WHATSAPP_DEFAULT_BUSINESS_ACCOUNT_ID=your-business-account-id +# For additional accounts, duplicate with WHATSAPP_{ACCOUNT}_* + +# ── LinkedIn ───────────────────────────────────────────────────────────────── +# Get an access token from LinkedIn Developer Portal: https://www.linkedin.com/developers/ +# Required scopes: r_liteprofile, w_member_social +# For default account: +LINKEDIN_DEFAULT_ACCESS_TOKEN=your-linkedin-access-token +LINKEDIN_DEFAULT_CLIENT_ID=your-linkedin-client-id +LINKEDIN_DEFAULT_CLIENT_SECRET=your-linkedin-client-secret +# For additional accounts, duplicate with LINKEDIN_{ACCOUNT}_* diff --git a/.gitignore b/.gitignore index 60535af..5cab9d3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ README.private.md hermes.log .claude/ .codex +opencode.json diff --git a/OPENCODE.md b/OPENCODE.md new file mode 100644 index 0000000..f7a0956 --- /dev/null +++ b/OPENCODE.md @@ -0,0 +1,93 @@ +# Connecting hermes-mcp to opencode AI + +The server is deployed at `https://hermes.squaremcp.com` with a Streamable HTTP MCP endpoint (MCP 1.x). + +## Quick setup + +An `opencode.json` is already in this repo with the connection pre-configured. Open opencode in this directory and hermes-mcp will be available automatically. + +## Manual configuration + +### Project-level (`opencode.json` in project root) + +```json +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "hermes": { + "type": "remote", + "url": "https://hermes.squaremcp.com/mcp", + "headers": { + "x-api-key": "YOUR_MCP_API_KEY" + } + } + } +} +``` + +### Global (`~/.config/opencode/config.json`) + +```json +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "hermes": { + "type": "remote", + "url": "https://hermes.squaremcp.com/mcp", + "headers": { + "x-api-key": "YOUR_MCP_API_KEY" + } + } + } +} +``` + +Replace `YOUR_MCP_API_KEY` with the value of `MCP_API_KEY` from your `.env` or Kubernetes secret. + +## Connection details + +| Field | Value | +|-------|-------| +| Transport | Streamable HTTP (MCP 1.x) | +| Endpoint | `https://hermes.squaremcp.com/mcp` | +| Auth | `x-api-key` header (or `?key=` query param, or `Authorization: Bearer`) | +| Legacy SSE | `https://hermes.squaremcp.com/sse` | + +## Fallback: SSE transport + +If opencode requires SSE transport instead of Streamable HTTP: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "hermes": { + "type": "sse", + "url": "https://hermes.squaremcp.com/sse", + "headers": { + "x-api-key": "YOUR_MCP_API_KEY" + } + } + } +} +``` + +## Available tools + +| Tool | Description | +|------|-------------| +| `get_profile` | Get email address for an account | +| `search_messages` | Search INBOX by keyword / sender / subject | +| `read_message` | Read full message body by UID | +| `list_folders` | List all mailbox folders | +| `create_draft` | Save a draft to the Drafts folder | +| `send_email` | Send an email | +| `whatsapp_send_message` | Send a WhatsApp message | +| `whatsapp_send_template` | Send an approved WhatsApp template message | +| `whatsapp_get_message_status` | Check WhatsApp message delivery status | +| `whatsapp_list_templates` | List approved WhatsApp templates | +| `obsidian_search_notes` | Search notes in the Obsidian vault | +| `obsidian_read_note` | Read a specific note | +| `obsidian_append_to_note` | Append content to a note | +| `obsidian_update_note` | Overwrite a note | +| `obsidian_sync_status` | Check Obsidian sync status | diff --git a/product/site/Dockerfile b/product/site/Dockerfile index 4cc5422..7e2382f 100644 --- a/product/site/Dockerfile +++ b/product/site/Dockerfile @@ -4,6 +4,8 @@ COPY product/site/nginx-site.conf /etc/nginx/conf.d/default.conf COPY product/site/index.html /usr/share/nginx/html/index.html COPY product/site/styles.css /usr/share/nginx/html/styles.css COPY product/site/script.js /usr/share/nginx/html/script.js +COPY product/site/squaremcp-logo.svg /usr/share/nginx/html/squaremcp-logo.svg COPY product/site/squaremcp_launch.gif /usr/share/nginx/html/squaremcp_launch.gif COPY product/site/squaremcp_launch_poster.png /usr/share/nginx/html/squaremcp_launch_poster.png COPY product/site/privacy.html /usr/share/nginx/html/privacy.html +COPY product/site/terms.html /usr/share/nginx/html/terms.html diff --git a/product/site/index.html b/product/site/index.html index ff8d8d4..d09abab 100644 --- a/product/site/index.html +++ b/product/site/index.html @@ -8,13 +8,13 @@ name="description" content="SquareMCP is a managed MCP gateway for internal tools with authentication, permissions, audit logs, and observability." /> - +