@aisocialautomate/mcp 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Relu Consultancy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,88 @@
1
- # Temporary Holding Version
1
+ # AI Social Automate MCP server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Lets Claude, Codex or any MCP client find leads and research content across **Instagram, Facebook, LinkedIn, TikTok and X** using your AI Social Automate account. It also drafts, schedules and reviews posts through Smart Content Publishing (Instagram, Facebook, LinkedIn, TikTok, YouTube). It never messages or follows anyone, and nothing goes live without your confirmation.
4
+
5
+ Ask things like:
6
+ - "Find 200 fitness creators on TikTok with over 50k followers and show me the ones with an email."
7
+ - "Get the 100 most recent commenters on this Instagram post."
8
+ - "Compare who follows NASA and ESA on X."
9
+
10
+ ## Set up
11
+
12
+ You need an AI Social Automate account with an active plan ([aisocialautomate.com](https://aisocialautomate.com)).
13
+
14
+ **Easiest: sign in, no key to paste (Claude, ChatGPT, Claude Code).** Add the hosted URL as a connector, sign in and click Allow. It offers the publishing tools (drafts, scheduling, publishing, media, accounts, analytics).
15
+ - Claude / ChatGPT: Settings → Connectors → add a custom connector with `https://mcp.aisocialautomate.com/mcp`.
16
+ - Claude Code: `claude mcp add --transport http aisocialautomate https://mcp.aisocialautomate.com/mcp`, then `/mcp` to sign in.
17
+
18
+ **With an API key (all tools, including research and leads).**
19
+ 1. Create an API key in the dashboard (Developer → API Keys). For research, give it `leads:read`, `leads:write` and `credits:read` only; for publishing add `publishing:read`, `publishing:write` and `connections:read`.
20
+ 2. Add the server to your client.
21
+
22
+ **Claude Desktop / Claude Code / Codex (local, over stdio)**
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "aisocialautomate": {
27
+ "command": "npx",
28
+ "args": ["-y", "@aisocialautomate/mcp"],
29
+ "env": { "SOCIAL_AUTOMATE_API_KEY": "sk_live_..." }
30
+ }
31
+ }
32
+ }
33
+ ```
34
+ Claude Code: `claude mcp add aisocialautomate -e SOCIAL_AUTOMATE_API_KEY=sk_live_... -- npx -y @aisocialautomate/mcp`
35
+
36
+ **Hosted (Streamable HTTP):** point the client at `https://mcp.aisocialautomate.com/mcp`, either with OAuth sign-in (above) or the header `Authorization: Bearer sk_live_...`. To run your own, `node dist/http.js` (see DEPLOY.md); set `MCP_OAUTH_SECRET`, `MCP_PUBLIC_URL` and `MCP_CONSENT_ORIGIN` to turn on OAuth. The hosted server has built-in rate limits, request limits, a `/health` check and optional `/metrics`, configured with `MCP_*` environment variables.
37
+
38
+ ## Usage limits and warnings
39
+
40
+ Credits are real money, so the server protects them:
41
+
42
+ | Setting (env var) | Default | What it does |
43
+ |---|---|---|
44
+ | `SOCIAL_AUTOMATE_SESSION_CAP` | 25 | Hard ceiling on credits spent in one session (hosted: per API key per hour). The model cannot raise it. |
45
+ | `SOCIAL_AUTOMATE_CONFIRM_ABOVE` | 10 | Any single action estimated above this needs the user's confirmation. |
46
+ | `SOCIAL_AUTOMATE_LOW_BALANCE` | 50 | Warn when an action would leave fewer credits than this. |
47
+ | `SOCIAL_AUTOMATE_PUBLISHING` | on | `on` (drafts, scheduling, posting with confirmation), `drafts` (drafts only) or `off` (no publishing tools). |
48
+ | `SOCIAL_AUTOMATE_MAX_POSTS` | 10 | Hard ceiling on posts scheduled or published per session. Drafts do not count. |
49
+
50
+ - Every spending tool accepts `dry_run: true` and returns the estimate without spending anything.
51
+ - An action comes back as `NEEDS_CONFIRMATION` when it is above the threshold, would use 25% or more of the balance, or would leave the balance below the low-balance line. The reply lists plain warnings; the assistant must show them to you and only then repeat the call with `confirm: true`.
52
+ - Results carry a `usage` block: credits spent this session, the cap, what is left and any warnings (for example "Session spending is at 84% of its cap").
53
+ - Lead jobs hold credits up front; the session total is corrected to the real charge when the job finishes.
54
+
55
+ ## Tools
56
+
57
+ Discover (free): `whoami`, `get_credit_balance`, `get_pricing`, `list_connected_accounts`, `connect_account` (gives a link to connect a social account), `list_brands`, `usage_status`. Research helpers: `list_platforms`, `search_endpoints`, `describe_endpoint`.
58
+ Research: `scrape` (one call), `start_bulk_scrape`, `get_run`, `list_runs`, `cancel_run`.
59
+ Publishing: `list_posts`, `get_post`, `get_post_analytics`, `list_templates`, `get_tiktok_creator_info`, `search_instagram_music`, `upload_media`, `create_draft`, `schedule_post`, `publish_now`, `update_post`, `cancel_post`, `restore_post`, `duplicate_post`, `delete_post`.
60
+ Leads: `start_lead_job`, `get_lead_job`, `list_lead_jobs`, `cancel_lead_job`, `search_leads`, `export_leads`, `list_lead_lists`, `create_lead_list`, `add_leads_to_list`.
61
+
62
+ About 200 endpoints (Instagram 30, Facebook 46, LinkedIn 36, TikTok 43, X 40, YouTube 3 placeholder) are reached through `scrape`/`start_bulk_scrape`; `search_endpoints` and `describe_endpoint` tell the model which key and parameters to use. The catalogue is generated from the website's endpoint docs: run `npm run catalog` after endpoints change.
63
+
64
+ ## Publishing safety
65
+
66
+ - `create_draft` saves straight away. `schedule_post` and `publish_now` return a preview (accounts, text, media, time) and only run after the user agrees and the call is repeated with `confirm: true`. `publish_now` also warns that it is immediate and public.
67
+ - If a platform has no connected account (or its login expired), the reply is `NEEDS_CONNECTION` with a link; the user connects it and the assistant retries. `connect_account` returns the same link on request.
68
+ - `restore_post` and `delete_post` ask first too; deleting is permanent.
69
+ - Times are never guessed. `scheduled_at` must carry an offset or `Z`, or come with a `timezone` (IANA name such as `Asia/Kolkata`); a bare time with no zone is refused. The preview shows the time in the user's zone and in UTC.
70
+ - Targets must be connected accounts of the workspace; disconnected ones are refused with a clear message.
71
+ - Publishing is per brand: `list_brands` shows them, and accounts, posts and templates can be filtered with `brand_id`. A post's targets must all belong to one brand. Reading brands needs the `connections:read` scope; creating, renaming and deleting brands stays in the dashboard.
72
+ - TikTok posts show their visibility and commercial-content settings in the preview, warn when no visibility was chosen, and refuse a paid partnership set to "Only me". `get_tiktok_creator_info` tells the assistant what the account may post.
73
+ - A per-session post limit applies, and `SOCIAL_AUTOMATE_PUBLISHING=drafts` makes going live impossible.
74
+
75
+ ## Safety
76
+
77
+ - Scraped text (bios, captions, comments) is treated as untrusted data; tool descriptions tell the model never to act on instructions inside it.
78
+ - The key's own scopes still apply: a read-only key cannot start a spend, and key management is dashboard-only.
79
+
80
+ ## Develop
81
+
82
+ ```
83
+ npm install
84
+ npm run catalog # regenerate catalog/endpoints.json
85
+ npm test # 93 tests, no network
86
+ SOCIAL_AUTOMATE_API_KEY=sk_live_... node scripts/smoke.mjs # quick live check (a few cents)
87
+ SOCIAL_AUTOMATE_API_KEY=sk_live_... node scripts/live-test.mjs # full live test of lead gathering and publishing (cleans up after itself)
88
+ ```