Skip to main content
Glama
README.md
# CHC SOCIAL v0.3.0

**One MCP server. Ten networks. A signed receipt for every action.**

Built because every existing social MCP is one of two things: a hosted service that wants
your accounts behind their OAuth, or a Facebook-Pages-only wrapper. We wanted one server we
own, that tells the truth about what each network can actually do, learns the ones with no
usable API, and records every action in an append-only signed chain.

## Networks (10)

| network | post | read | media | delete | auth | the honest bit |
|---|---|---|---|---|---|---|
| telegram | ✅ | ✅ | ✅ | ✅ | bot token | Real public API, free, no review. Best first channel. |
| discord | ✅ | – | ✅ | – | webhook URL | Webhook posting, no bot registration. |
| facebook | ✅ | ✅ | – | – | page token | **Pages only** — profiles and groups are not available via Graph. Use `browser` for those. |
| instagram | ✅ | – | ✅ | – | IG business + page token | Media required; no text-only posts. |
| x | ✅ | – | – | ✅ | OAuth bearer | API v2 write is a paid tier. `browser` works without it. |
| whatsapp | ✅ | ✅ | – | – | Cloud API token | Business number + approved templates. Not a personal-account channel. |
| soundcloud | ✅ | – | ✅ | – | OAuth | Real multipart upload (OAuth token with `upload` scope) + comments. |
| **bluesky** | ✅ | ✅ | ✅ | ✅ | handle + app password | AT Protocol: 300 chars, link facets by **byte** offset, image blobs. Free, no review. |
| **mastodon** | ✅ | ✅ | ✅ | ✅ | instance + token | Any instance, any account: 500 chars default, real multipart media, delete, identity. Free, no review. |
| **threads** | ✅ | ✅ | – | – | long-lived token | Two-step publish (container → publish). 500 chars. Images must be a **public URL**. |
| browser | ✅ | ✅ | – | – | logged-in session | Last resort for any site with no usable API; driven by learned recipes. |

## What is real, and what is proven

- **Implemented against documented endpoints, dry-run first.** Every driver can print the exact request it
  would send (`--dry-run`) before a byte leaves the machine. No credential and no network are needed for that.
- **Proven here:** Telegram post/read/media/delete, Discord webhook, Facebook Pages, Instagram media,
  X API + X browser, WhatsApp Cloud, SoundCloud multipart upload, browser driver, the ledger, the queue,
  the scheduler, and the 13-driver test suite (`tests/`) — all offline-testable.
- **Added in v0.3.0 and offline-tested (not yet live-fired on a real account from this house):** Bluesky,
  Mastodon, Threads. Their requests, limits and failure messages are covered by tests; a live post to each
  needs the credentials below.
- **Facebook profiles/groups and X without a paid tier** are real browser drivers: they click what a human
  clicks and report each step. They break if a site changes its layout; that is stated, not hidden.
- **A recipe is only ever called *working* after a real post returns steps with no error.** Recipes start at
  `verified: false` and stay there until proven.

Nothing in this repo posts on your behalf without credentials or a logged-in browser you control.

## Credentials, network by network

| network | env |
|---|---|
| telegram | `CHC_TELEGRAM_BOT_TOKEN`, `CHC_TELEGRAM_CHAT_ID` |
| discord | `CHC_DISCORD_WEBHOOK` |
| facebook | `CHC_FB_PAGE_TOKEN`, `CHC_FB_PAGE_ID` |
| instagram | `CHC_IG_USER_ID`, `CHC_FB_PAGE_TOKEN` |
| x | `CHC_X_BEARER` |
| whatsapp | `CHC_WA_TOKEN`, `CHC_WA_PHONE_ID` |
| soundcloud | `CHC_SC_CLIENT_ID`, `CHC_SC_TOKEN` |
| bluesky | `CHC_BSKY_HANDLE`, `CHC_BSKY_APP_PASSWORD` (app password, never the account password) |
| mastodon | `CHC_MASTODON_HOST`, `CHC_MASTODON_TOKEN` (+ optional `CHC_MASTODON_LIMIT`) |
| threads | `CHC_THREADS_USER_ID`, `CHC_THREADS_TOKEN` |
| browser | `CHC_CDP_PORT` |

`python3 -m chc_social.cli networks` prints which of these are present and ready, and which are missing.

## Scheduler

```bash
sudo deploy/install.sh     # systemd timer, drains the queue every 2 minutes
```

## Install

```bash
git clone <this> && cd chc_social
python3 -m pip install -e .     # no dependencies beyond the standard library
python3 -m chc_social.cli networks
```

## Use as an MCP server

Any MCP client that can launch a local stdio server will take this block:

```json
{"mcpServers": {"chc-social": {"command": "python3", "args": ["-m", "chc_social.mcp"]}}}
```

**VS Code / GitHub Copilot — one line:** Copilot does not list products, it lists MCP servers
registered with VS Code, and the tool picker hands their tools to the agent:

```
code --add-mcp '{"name":"chc-social","command":"python3","args":["-m","chc_social.mcp"]}'
```

Then in Copilot Chat: **Agent mode → Tools → chc-social**, and the ten `social_*` tools appear.
Claude Desktop, Cursor, Zed, Continue and Cline read the same JSON block above.

Registry listing: https://glama.ai/mcp/servers/CHCDOLADEEPSEEKMKSEC/chc-social (TDQS **B 3/5.0**, scored 2026-11-10).

Tools (10): `social_networks`, `social_post`, `social_read`, `social_schedule`, `social_queue`,
`social_learn`, `social_recipes`, `social_delete`, `social_account`, `social_ledger_selftest`.

## Use from the shell

```bash
chc_social networks
chc_social post telegram "hello from the house" --dry-run
chc_social post facebook "page post" --dry-run
chc_social schedule telegram "later" --in 3600
chc_social queue --drain
chc_social learn x https://x.com --save        # probe the live DOM, propose selectors
chc_social recipes
chc_social delete telegram 42 --dry-run
chc_social whoami                       # which account do these credentials belong to?
```

## The learning layer

There is no way to give a clean API to a site that has none, so we do the honest thing:
**observe, propose, store, verify.**

1. `social_learn` probes the live page over CDP and scores candidate selectors
   (contenteditable boxes, submit buttons, article containers) by match count and visibility.
2. It returns a **draft recipe** with a confidence score, always `verified: false`.
3. Saving bumps the version and signs a receipt.
4. A recipe is only ever described as working once a real post returns steps with no error.

`absorb_from_dom` does the same offline from a saved DOM/text snapshot, at low confidence.
Recipes are JSON, versioned, and never overwrite history silently.

## The ledger

Every post, queued send, recipe save and selftest appends a receipt. If the house chain is
available (`tools/seal.py`) it is signed and chained. If the chain is unavailable the record
is **still kept**, self-hashed, and marked `unsigned: true` with a warning — a broken chain
must never lose the record.

## Tests

```bash
python3 tests/test_core.py     # 27 checks, no pytest, no network
```

## Licence

Same as the rest of the house: source-available, all rights reserved. Read it, run it
unmodified; do not repackage it.

TDQS

B3/5.0

Scored across 10 tools

Disambiguation4/5

Most tools have clearly distinct purposes: posting, reading, scheduling, deleting, and discovering networks/accounts are easy to tell apart. The closest overlaps are social_schedule vs social_queue (queue a post vs list/drain jobs) and social_learn vs social_recipes (create/inspect learned recipes), but the descriptions make the boundaries reasonably clear.

Naming Consistency4/5

All names share a predictable 'social_' prefix and snake_case formatting, which makes the set feel cohesive. There is a minor mix of verb-style (social_post, social_read, social_delete) and noun-style (social_networks, social_queue, social_recipes) names, but this is still readable and mostly intuitive.

Tool Count5/5

Ten tools is well within the sweet spot for a social-posting automation server, and each tool maps to a concrete operation (publish, schedule, queue, read, learn, verify account, delete). Nothing appears redundant or purely decorative.

Completeness4/5

The surface covers the core lifecycle: discover networks, authenticate/verify accounts, post, schedule, queue, read, and delete, plus a learning mechanism for new sites. Minor gaps exist around editing/updating an existing post, reply/thread handling, and engagement metrics, but agents can work around these for typical posting workflows.

Maintenance

ActivityMaintained
ResponsivenessOutdated data