v0.2: twitter module, feed/notifications/reply/open_link tools, dashboard
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
# socialmag
|
||||
|
||||
MCP server that posts to Threads / Facebook / Instagram / YouTube / TikTok by
|
||||
driving abang's already-logged-in Brave over CDP. No API keys, no OAuth.
|
||||
|
||||
Built to `PROPOSAL.md` (2026-09-10). **Nothing here has been run against a live
|
||||
platform yet** — every step whose selector or timing needs a real page is
|
||||
marked `# TODO: VALIDATE LIVE`.
|
||||
MCP server that posts, reads, and replies across 6 platforms — Threads, Facebook,
|
||||
Instagram, YouTube, TikTok, and Twitter/X — by driving abang's already-logged-in
|
||||
Brave over CDP. No API keys, no OAuth.
|
||||
|
||||
## Run
|
||||
|
||||
@@ -26,24 +23,35 @@ Requires `websockets` (17.1 present on this box). Everything else is stdlib.
|
||||
|
||||
## Tools
|
||||
|
||||
| Tool | Args | Returns |
|
||||
|---|---|---|
|
||||
| `create_post` | `platforms[]`, `text`, `media`, `visibility` | `{platform: {status, detail}}` |
|
||||
| `check_login` | `platforms[]` (default all) | `{platform: true/false/"error: ..."}` |
|
||||
| `get_status` | — | last run's results + queue history |
|
||||
| Tool | Description |
|
||||
|------|-------------|
|
||||
| `create_post` | Post to one or more platforms (threads, fb, ig, yt, tiktok, twitter) |
|
||||
| `check_login` | Check which platforms are signed in |
|
||||
| `get_status` | Last post results + open browser tabs |
|
||||
| `get_feed` | Read Twitter timeline or search with X operators |
|
||||
| `reply_tweet` | Reply to a tweet found by search |
|
||||
| `get_notifications` | Check platform activity/notifications (Threads) |
|
||||
| `open_link` | Navigate platform's browser tab to a URL (tab reuse) |
|
||||
|
||||
`text` is required for threads/fb/yt and used as the caption for ig/tiktok.
|
||||
`media` must be an **absolute path to an existing file**; it is required for
|
||||
ig/tiktok, optional for threads/fb, and rejected for yt.
|
||||
`create_post` — `text` is required for threads/fb/yt and used as the caption for
|
||||
ig/tiktok. `media` must be an **absolute path to an existing file**; required for
|
||||
ig/tiktok, optional for threads/fb, rejected for yt.
|
||||
|
||||
## Dashboard
|
||||
|
||||
`dashboard.html` is a local viewer — open it in a browser tab to see platform
|
||||
status, post timeline, and Twitter intel. Reads from `dashboard.json` (written
|
||||
by the server at runtime), auto-refreshes every 10 seconds.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
server.py MCP stdio JSON-RPC loop + the 3 tools
|
||||
server.py MCP stdio JSON-RPC loop + 7 tools
|
||||
cdp.py CDP client: CDPClient (browser) + Tab (page verbs)
|
||||
queue.py PostQueue — strictly sequential, one tab at a time
|
||||
selectors.py every platform selector, one file
|
||||
selectors.py every platform selector + PLATFORMS dict, one file
|
||||
platforms/ one module per platform: post() + check_login()
|
||||
dashboard.html local status/timeline viewer (reads dashboard.json)
|
||||
```
|
||||
|
||||
Each platform module exposes:
|
||||
@@ -53,6 +61,9 @@ async def post(cdp_client, text, media_path, options) -> {"status": ..., "detail
|
||||
async def check_login(cdp_client) -> bool
|
||||
```
|
||||
|
||||
Twitter additionally exposes `get_feed`, `reply`, and `check_login` (reusing
|
||||
the existing selector set). Threads exposes `get_notifications`.
|
||||
|
||||
`post` opens its own tab, drives the flow, closes the tab. A failure inside the
|
||||
flow is caught by `platforms.guard`, which screenshots the page as it actually
|
||||
looked into `/tmp/socialmag/` and puts the path in the result.
|
||||
|
||||
Reference in New Issue
Block a user