Files
conversation-history/product-incubation/2026-05-01-hermes-mcp-social-integrations-session.md

159 lines
6.4 KiB
Markdown

# Session: Hermes MCP Social Integrations + ChatGPT GPT Setup
**Date:** 2026-05-01
**Status:** Implemented, deployed, committed
**Tool count:** 36 total (24 exposed in OpenAPI for ChatGPT)
---
## What was built
### WhatsApp Business API (Meta Cloud API)
- `src/clients/whatsapp.ts`
- Tools: `whatsapp_send_message`, `whatsapp_send_template`, `whatsapp_list_templates`
- REST endpoints: `/api/whatsapp/send`, `/api/whatsapp/template`, `/api/whatsapp/templates`
- **Status:** Code deployed, but number is ON_PREMISE — needs Cloud API migration or new number
- Phone Number ID: `1077257378810472` (ON_PREMISE)
- WABA ID: `1211565867488794`
### LinkedIn API (OpenID Connect)
- `src/clients/linkedin.ts`
- Tools: `linkedin_get_profile`, `linkedin_create_post`, `linkedin_search_connections`, `linkedin_send_message`
- REST endpoints: `/api/linkedin/profile`, `/api/linkedin/post`
- **Status:** ✅ Working — token deployed, posts verified
- Uses `/v2/userinfo` (OpenID Connect) instead of deprecated `/v2/me`
### Telegram Bot API
- `src/clients/telegram.ts`
- Tools: `telegram_get_me`, `telegram_send_message`, `telegram_send_photo`, `telegram_get_updates`, `telegram_get_chat`
- REST endpoints: `/api/telegram/me`, `/api/telegram/message`, `/api/telegram/photo`, `/api/telegram/updates`, `/api/telegram/chat`
- **Status:** ✅ Working — bot `@squaremcp_bot` (ID: 8721585313), messages delivered to user
- User chat ID: `5097884976` (@TravellingMan171)
### Discord Bot API
- `src/clients/discord.ts`
- Tools: `discord_get_me`, `discord_get_guilds`, `discord_get_channels`, `discord_send_message`, `discord_get_messages`
- REST endpoints: `/api/discord/me`, `/api/discord/guilds`, `/api/discord/channels`, `/api/discord/message`, `/api/discord/messages`
- **Status:** Code deployed, needs bot token
### Instagram Graph API
- `src/clients/instagram.ts`
- Tools: `instagram_get_profile`, `instagram_get_media`, `instagram_create_post`
- REST endpoints: `/api/instagram/profile`, `/api/instagram/media`, `/api/instagram/post`
- **Status:** Code deployed, needs Business Account + Facebook Page + access token
### Twitter/X API (Free Tier)
- `src/clients/twitter.ts`
- Tools: `twitter_search_tweets`, `twitter_get_user_profile`, `twitter_get_user_tweets`, `twitter_create_tweet`
- REST endpoints: `/api/twitter/search`, `/api/twitter/user`, `/api/twitter/tweets`, `/api/twitter/tweet`
- **Status:** Code deployed, needs Bearer Token
- Free tier: 500 tweets/month read-only. `twitter_create_tweet` returns clear error about paid tier requirement.
---
## Domain Migration
- `hermes.fetcherpay.com` → `hermes.squaremcp.com`
- K8s ingress, TLS cert, `SERVER_URL` env updated
- DNS already correct via GoDaddy
- `opencode.json` added to `.gitignore` (contains live API key)
---
## ChatGPT Custom GPT Setup
### OAuth Client Registered
```json
{
"client_id": "72ea04ad-ddd4-40fd-823a-b331c3fa7549",
"client_secret": "89170cade0b616e5be89bfcad8a8010e49d33f29d986ce579ae590d483820b61",
"redirect_uris": ["https://chat.openai.com/aip/g-69faa2cab0748191a687599f8c0be85a/oauth/callback"]
}
```
### GPT ID
`g-69faa2cab0748191a687599f8c0be85a`
### Issues encountered
1. **OpenAPI schema only had 4 paths initially** — fixed by adding all REST endpoints to `getOpenApiSpec()` in `src/manifest.ts`
2. **ChatGPT 30-operation limit** — trimmed from 32 to 25 operations:
- Removed: create email draft, list email folders, Telegram bot info/photo/chat, Discord bot info/channel list, create tweet
3. **"Array schema missing items"** — `components` in `whatsapp_send_template` needed `items: { type: 'object' }`
4. **"Invalid MCP tool schema"** — same array issue in tools.ts and manifest.ts
### Current ChatGPT-exposed operations (25)
| Endpoint | Method |
|----------|--------|
| `/api/obsidian/search` | GET |
| `/api/obsidian/note` | GET, PUT |
| `/api/obsidian/note/append` | POST |
| `/api/obsidian/sync` | GET |
| `/api/email/profile` | GET |
| `/api/email/search` | GET |
| `/api/email/read` | GET |
| `/api/email/send` | POST |
| `/api/whatsapp/send` | POST |
| `/api/whatsapp/template` | POST |
| `/api/whatsapp/templates` | GET |
| `/api/linkedin/profile` | GET |
| `/api/linkedin/post` | POST |
| `/api/telegram/message` | POST |
| `/api/telegram/updates` | GET |
| `/api/discord/guilds` | GET |
| `/api/discord/message` | POST |
| `/api/discord/messages` | GET |
| `/api/instagram/profile` | GET |
| `/api/instagram/media` | GET |
| `/api/instagram/post` | POST |
| `/api/twitter/search` | GET |
| `/api/twitter/user` | GET |
| `/api/twitter/tweets` | GET |
---
## Performance Issue: GPT "Thinking" Too Long
**Root cause:** ChatGPT evaluates all 25 operations for every prompt.
### Options to evaluate (First Principles: Revenue Generation + UX)
| Option | Description | Revenue Impact | UX Impact |
|--------|-------------|---------------|-----------|
| **A. Split into 2 GPTs** | Hermes Mail (email+obsidian) + Hermes Social (LinkedIn+Telegram+Twitter) | Higher conversion — users pick specific need | Faster, cleaner UX per GPT |
| **B. Reduce to 20 ops** | Remove 5 more niche endpoints (WhatsApp templates, Instagram media, etc.) | Minimal — all features still exist | Slightly faster |
| **C. Keep as-is** | 25 ops in one GPT | Single product, simpler marketing | Slower, more cognitive load |
| **D. Tiered access** | Free GPT = 10 ops. Pro GPT = 25 ops. | Monetization path | Clear upgrade incentive |
**Decision needed:** Which architecture maximizes user activation while minimizing friction?
---
## Credentials Status
| Platform | Credential | Status |
|----------|-----------|--------|
| LinkedIn | `LINKEDIN_DEFAULT_ACCESS_TOKEN` | ✅ Deployed |
| Telegram | `TELEGRAM_DEFAULT_BOT_TOKEN` | ✅ Deployed |
| WhatsApp | `WHATSAPP_DEFAULT_*` | ❌ Not set (ON_PREMISE number) |
| Discord | `DISCORD_DEFAULT_BOT_TOKEN` | ❌ Not set |
| Instagram | `INSTAGRAM_DEFAULT_ACCESS_TOKEN` + `BUSINESS_ACCOUNT_ID` | ❌ Not set |
| Twitter/X | `TWITTER_DEFAULT_BEARER_TOKEN` | ❌ Not set |
---
## Git Commits
1. `73f83c0` — WhatsApp + LinkedIn + SquareMCP rebrand + opencode docs
2. `385f91d` — Telegram Bot API
3. `e1e7d88` — Discord + Instagram
4. `59501f1` — Twitter/X (read-only free tier)
5. `136bc25` — ChatGPT Custom GPT setup guide
---
## Next Steps
1. Evaluate GPT architecture options (split vs unified)
2. Obtain Discord bot token
3. Obtain Twitter/X Bearer token
4. Obtain Instagram Business Account credentials
5. Resolve WhatsApp Cloud API number
6. Test ChatGPT GPT end-to-end with optimized tool set