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

**One MCP server. Every network. 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

| network | post | read | media | 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 | Comments/reads are easy; audio upload is multipart and **not implemented yet** (it says so). |
| browser | ✅ | ✅ | – | logged-in session | Last resort, driven by **learned recipes**, fragile by nature. |

## What is real, and what is not

- **Telegram, Discord, X (API), Facebook Pages, Instagram, WhatsApp** — real HTTP APIs, implemented against
  the documented endpoints, dry-run mode shows you the exact request before it sends anything.
- **Facebook profiles/groups and X without a paid tier** — real browser drivers, proven on this machine:
  they click what a human clicks and report each step. They break if a site changes its layout; that is
  stated, not hidden.
- **SoundCloud** — real multipart upload (needs an OAuth token with upload scope).
- **The learning layer** — 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.

## 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

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

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
ResponsivenessNo recent community issues