@cmo-so/mcp 0.4.0 → 0.5.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/dist/cmo-mcp.mjs +126 -11
- package/package.json +1 -1
package/dist/cmo-mcp.mjs
CHANGED
|
@@ -7199,7 +7199,7 @@ var require_dist = __commonJS({
|
|
|
7199
7199
|
// package.json
|
|
7200
7200
|
var package_default = {
|
|
7201
7201
|
name: "@cmo-so/cli",
|
|
7202
|
-
version: "0.
|
|
7202
|
+
version: "0.5.0",
|
|
7203
7203
|
description: "CMO.so on the command line: your websites, ideas, blog posts, LinkedIn queue and results, plus a local MCP server for Claude Desktop, Cursor and other MCP clients.",
|
|
7204
7204
|
type: "module",
|
|
7205
7205
|
license: "MIT",
|
|
@@ -7537,7 +7537,8 @@ var MEMORY_CHANNELS = [
|
|
|
7537
7537
|
"facebook",
|
|
7538
7538
|
"instagram",
|
|
7539
7539
|
"google_business",
|
|
7540
|
-
"youtube"
|
|
7540
|
+
"youtube",
|
|
7541
|
+
"tiktok"
|
|
7541
7542
|
];
|
|
7542
7543
|
function addWebsite(api2, url) {
|
|
7543
7544
|
return api2.request("/v1/domains", {
|
|
@@ -7789,6 +7790,20 @@ function domainApi(api2, domain) {
|
|
|
7789
7790
|
),
|
|
7790
7791
|
/** Disconnect: the token is deleted and Google's access revoked (YouTube's policy). */
|
|
7791
7792
|
disconnectYouTube: (connectionId) => api2.request(`${base}/social/youtube/${connectionId}`, { method: "DELETE" }),
|
|
7793
|
+
/** A TikTok sign-in link for this website (docs/prd/tiktok.md §7); back with ?tiktok=connected (error&message=…). */
|
|
7794
|
+
connectTikTok: (returnTo = "close") => post(`${base}/social/tiktok/connect`, { return_to: returnTo }),
|
|
7795
|
+
/** What the TikTok account allows right now: show it in the TikTok post editor (TikTok's guidelines). */
|
|
7796
|
+
tiktokCreator: () => api2.request(`${base}/social/tiktok/creator`),
|
|
7797
|
+
/** Disconnect: TikTok's access is revoked and the token deleted. */
|
|
7798
|
+
disconnectTikTok: (connectionId) => api2.request(`${base}/social/tiktok/${connectionId}`, { method: "DELETE" }),
|
|
7799
|
+
/** A TikTok post's settings: who can view it, comments / Duet / Stitch, content disclosure, AI label. */
|
|
7800
|
+
setSocialTikTok: (id, answers) => api2.request(`${base}/social/${id}`, {
|
|
7801
|
+
method: "PATCH",
|
|
7802
|
+
headers: { "Content-Type": "application/json" },
|
|
7803
|
+
body: JSON.stringify({ tiktok: answers })
|
|
7804
|
+
}),
|
|
7805
|
+
/** Ask to join the beta of these channels: an email says what we need (reply or WhatsApp); the team is told. */
|
|
7806
|
+
requestBeta: (req) => post(`${base}/social/beta-request`, req),
|
|
7792
7807
|
/** One channel's own pause switch (pauseSocial / resumeSocial hold every channel). */
|
|
7793
7808
|
setChannelPaused: (channel, paused) => post(`${base}/social/channels/${channel}/${paused ? "pause" : "resume"}`),
|
|
7794
7809
|
/** How often one channel posts. */
|
|
@@ -7971,7 +7986,8 @@ function domainApi(api2, domain) {
|
|
|
7971
7986
|
video: (videoId) => api2.request(`${base}/social/video/${videoId}`),
|
|
7972
7987
|
/** Another part or framing; prepared again in the background. */
|
|
7973
7988
|
editVideo: (videoId, edit) => post(`${base}/social/video/${videoId}/edit`, { edit }),
|
|
7974
|
-
/** A YouTube
|
|
7989
|
+
/** A post on one video channel (YouTube by default, or TikTok) from a ready video, waiting in Review; Maggie
|
|
7990
|
+
* writes the details (YouTube) or the caption (TikTok) unless write is false. */
|
|
7975
7991
|
postFromVideo: (videoId, opts = {}) => post(`${base}/social/video/${videoId}/post`, opts),
|
|
7976
7992
|
youtubeSettings: () => api2.request(`${base}/social/youtube/settings`),
|
|
7977
7993
|
setYouTubeSettings: (s) => put(`${base}/social/youtube/settings`, s),
|
|
@@ -8220,6 +8236,9 @@ var list = (xs, n = 5) => {
|
|
|
8220
8236
|
};
|
|
8221
8237
|
var ids = (a) => (Array.isArray(a.ids) && a.ids.length ? a.ids : a.id != null ? [a.id] : []).map(Number);
|
|
8222
8238
|
var keys = (a) => Object.keys(a ?? {}).filter((k) => a[k] !== void 0);
|
|
8239
|
+
var videoChannels = (a) => (Array.isArray(a.channels) && a.channels.length ? a.channels : ["youtube"]).map(
|
|
8240
|
+
(c) => c === "tiktok" ? "TikTok" : "YouTube"
|
|
8241
|
+
);
|
|
8223
8242
|
var confirmCopy = {
|
|
8224
8243
|
// --------------------------------------------------------- account / setup
|
|
8225
8244
|
website_add: {
|
|
@@ -8405,9 +8424,23 @@ var confirmCopy = {
|
|
|
8405
8424
|
en: () => "Make a link to connect your YouTube channel.",
|
|
8406
8425
|
"zh-Hant": () => "\u7522\u751F\u9023\u63A5\u4F60 YouTube \u983B\u9053\u7684\u9023\u7D50\u3002"
|
|
8407
8426
|
},
|
|
8427
|
+
tiktok_connect_link: {
|
|
8428
|
+
en: () => "Make a link to connect your TikTok account.",
|
|
8429
|
+
"zh-Hant": () => "\u7522\u751F\u9023\u63A5\u4F60 TikTok \u5E33\u865F\u7684\u9023\u7D50\u3002"
|
|
8430
|
+
},
|
|
8408
8431
|
social_video_add: {
|
|
8409
|
-
en: (a) =>
|
|
8410
|
-
|
|
8432
|
+
en: (a) => {
|
|
8433
|
+
const names = videoChannels(a).join(" and ");
|
|
8434
|
+
return `Make a ${names} post from ${a.url}${a.write === false ? "" : ` (Maggie writes it: one AI generation per channel)`}; it waits for your OK.`;
|
|
8435
|
+
},
|
|
8436
|
+
"zh-Hant": (a) => {
|
|
8437
|
+
const names = videoChannels(a).join(" \u548C ");
|
|
8438
|
+
return `\u7528 ${a.url} \u505A ${names} \u5F71\u7247\u8CBC\u6587${a.write === false ? "" : "\uFF08Maggie \u4F86\u5BEB\uFF1A\u6BCF\u500B\u6E20\u9053\u7528\u4E00\u6B21 AI \u751F\u6210\uFF09"}\uFF0C\u7B49\u4F60\u78BA\u8A8D\u5F8C\u624D\u767C\u3002`;
|
|
8439
|
+
}
|
|
8440
|
+
},
|
|
8441
|
+
social_tiktok_set: {
|
|
8442
|
+
en: (a) => `Set TikTok post #${a.id}: ${keys(a).filter((k) => k !== "id").map((k) => `${k} ${String(a[k])}`).join(", ") || "its settings"}.`,
|
|
8443
|
+
"zh-Hant": (a) => `\u8A2D\u5B9A TikTok \u8CBC\u6587 #${a.id}\uFF1A${keys(a).filter((k) => k !== "id").map((k) => `${k} ${String(a[k])}`).join("\u3001") || "\u8A2D\u5B9A"}\u3002`
|
|
8411
8444
|
},
|
|
8412
8445
|
social_youtube_set: {
|
|
8413
8446
|
en: (a) => `Change YouTube post #${a.id}: ${keys(a).filter((k) => k !== "id").join(", ") || "its details"}.`,
|
|
@@ -10430,11 +10463,13 @@ var read5 = { resource: "autopilot", level: "read" };
|
|
|
10430
10463
|
var write5 = { resource: "autopilot", level: "write" };
|
|
10431
10464
|
var moves2 = ["up", "down", "top"];
|
|
10432
10465
|
var CHANNEL_KEYS = ["linkedin", "facebook", "instagram", "google_business"];
|
|
10433
|
-
var ALL_CHANNEL_KEYS = [...CHANNEL_KEYS, "youtube"];
|
|
10466
|
+
var ALL_CHANNEL_KEYS = [...CHANNEL_KEYS, "youtube", "tiktok"];
|
|
10467
|
+
var VIDEO_KEYS = ["youtube", "tiktok"];
|
|
10468
|
+
var TIKTOK_PRIVACY = ["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "FOLLOWER_OF_CREATOR", "SELF_ONLY"];
|
|
10434
10469
|
var channelsParam = {
|
|
10435
10470
|
type: "array",
|
|
10436
10471
|
items: { type: "string", enum: CHANNEL_KEYS },
|
|
10437
|
-
description: "Which channels to write for: linkedin, facebook, instagram, google_business. Leave out to write for every connected channel (one post each, one credit each); give one only when the user names it. YouTube
|
|
10472
|
+
description: "Which channels to write for: linkedin, facebook, instagram, google_business. Leave out to write for every connected channel (one post each, one credit each); give one only when the user names it. YouTube and TikTok take a video: use social_video_add."
|
|
10438
10473
|
};
|
|
10439
10474
|
var channelsOf = (value) => {
|
|
10440
10475
|
const list2 = Array.isArray(value) ? value.map((v) => String(v).toLowerCase()).filter((v) => CHANNEL_KEYS.includes(v)) : [];
|
|
@@ -10461,6 +10496,10 @@ var item = (i) => ({
|
|
|
10461
10496
|
...i.provider === "youtube" ? {
|
|
10462
10497
|
youtube: i.youtube ?? null,
|
|
10463
10498
|
video: i.video ? { status: i.video.status, seconds: i.video.duration, shape: i.video.shape, error: i.video.error } : null
|
|
10499
|
+
} : {},
|
|
10500
|
+
...i.provider === "tiktok" ? {
|
|
10501
|
+
tiktok: i.tiktok ?? null,
|
|
10502
|
+
video: i.video ? { status: i.video.status, seconds: i.video.duration, shape: i.video.shape, error: i.video.error } : null
|
|
10464
10503
|
} : {}
|
|
10465
10504
|
});
|
|
10466
10505
|
var socialTools = [
|
|
@@ -11439,13 +11478,72 @@ var socialTools = [
|
|
|
11439
11478
|
return { url: out.url, expires_in_seconds: out.expires_in_seconds };
|
|
11440
11479
|
}
|
|
11441
11480
|
}),
|
|
11481
|
+
tool({
|
|
11482
|
+
name: "tiktok_connect_link",
|
|
11483
|
+
description: "A link for the user to connect their TikTok account (or reconnect): they sign in to TikTok and allow Maggie to see their profile and post videos. Give them the link to open; never ask for a password. TikTok is in beta (testers only; until TikTok reviews our app, videos post as 'Only me' and the account must be private). TikTok posts are short videos (5-30 seconds) that the user approves one by one.",
|
|
11484
|
+
parameters: none,
|
|
11485
|
+
group: "social",
|
|
11486
|
+
need: write5,
|
|
11487
|
+
risk: "W1",
|
|
11488
|
+
gates: ["VER"],
|
|
11489
|
+
run: async (ctx) => {
|
|
11490
|
+
const out = await ws(ctx).connectTikTok("close");
|
|
11491
|
+
return { url: out.url, expires_in_seconds: out.expires_in_seconds };
|
|
11492
|
+
}
|
|
11493
|
+
}),
|
|
11494
|
+
tool({
|
|
11495
|
+
name: "tiktok_creator",
|
|
11496
|
+
description: "What the user's TikTok account allows right now (TikTok asks to check before every post): its name and @username, who a video can be shown to (privacy_options), whether comments / Duet / Stitch are turned off on the account, the longest video it can post, and whether it can post now (problem). Read it before asking the user the TikTok settings of a post.",
|
|
11497
|
+
parameters: none,
|
|
11498
|
+
group: "social",
|
|
11499
|
+
need: read5,
|
|
11500
|
+
risk: "R0",
|
|
11501
|
+
run: async (ctx) => ws(ctx).tiktokCreator()
|
|
11502
|
+
}),
|
|
11503
|
+
tool({
|
|
11504
|
+
name: "social_tiktok_set",
|
|
11505
|
+
description: "Set a TikTok post's settings, ONLY as the user chose them (TikTok's rules: never pick for them, nothing is preset): privacy (one of the account's privacy_options from tiktok_creator: PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY), allow_comment / allow_duet / allow_stitch (off unless the user turns them on; not possible when the account turned them off), disclose (the video promotes a brand, product or service) with your_brand (their own: labelled 'Promotional content') and / or branded (a third party: labelled 'Paid partnership'; can't be SELF_ONLY), is_aigc (AI-generated content label). The caption is the post's text (social_update_copy). Before the user approves, tell them: 'By posting, you agree to TikTok's Music Usage Confirmation' (with branded content: 'TikTok's Branded Content Policy and Music Usage Confirmation'). Preview first.",
|
|
11506
|
+
parameters: {
|
|
11507
|
+
type: "object",
|
|
11508
|
+
properties: {
|
|
11509
|
+
id: { type: "integer", description: "A TikTok post (from social_list)" },
|
|
11510
|
+
privacy: { type: "string", enum: TIKTOK_PRIVACY },
|
|
11511
|
+
allow_comment: { type: "boolean" },
|
|
11512
|
+
allow_duet: { type: "boolean" },
|
|
11513
|
+
allow_stitch: { type: "boolean" },
|
|
11514
|
+
disclose: { type: "boolean" },
|
|
11515
|
+
your_brand: { type: "boolean" },
|
|
11516
|
+
branded: { type: "boolean" },
|
|
11517
|
+
is_aigc: { type: "boolean" }
|
|
11518
|
+
},
|
|
11519
|
+
required: ["id"]
|
|
11520
|
+
},
|
|
11521
|
+
group: "social",
|
|
11522
|
+
need: write5,
|
|
11523
|
+
risk: "W1",
|
|
11524
|
+
gates: ["VER"],
|
|
11525
|
+
run: async (ctx, { id, privacy, ...rest }) => {
|
|
11526
|
+
const answers = Object.fromEntries(
|
|
11527
|
+
Object.entries(rest).filter(([, v]) => v !== void 0)
|
|
11528
|
+
);
|
|
11529
|
+
if (privacy) answers.privacy = privacy;
|
|
11530
|
+
const out = await ws(ctx).setSocialTikTok(Number(id), answers);
|
|
11531
|
+
return item(out);
|
|
11532
|
+
}
|
|
11533
|
+
}),
|
|
11442
11534
|
tool({
|
|
11443
11535
|
name: "social_video_add",
|
|
11444
|
-
description: "Make a YouTube post from a video: a DIRECT link to a video file (an .mp4 on their website, a public Dropbox link), never a YouTube / TikTok / Instagram page (we never download those; tell the user to upload the video in the app instead). The video must be 5-30 seconds: give start/end (seconds) to use a part of a longer one. vertical: make a wide video vertical (a Short) cropped at left, middle or right. Maggie writes
|
|
11536
|
+
description: "Make a YouTube and / or TikTok post (channels; default youtube) from a video: a DIRECT link to a video file (an .mp4 on their website, a public Dropbox link), never a YouTube / TikTok / Instagram page (we never download those; tell the user to upload the video in the app instead). The video must be 5-30 seconds: give start/end (seconds) to use a part of a longer one. vertical: make a wide video vertical (a Short) cropped at left, middle or right. Maggie writes YouTube's title, description and tags, or TikTok's caption, from the video and the note (one AI generation per channel) unless write is false. Each post waits in Review: video posts are always approved by the user. YouTube asks whether it's made for kids; TikTok asks who can view it and the other TikTok settings (social_tiktok_set, as the user chooses). is_aigc: TikTok's AI-generated label, only when the user says the video was made with AI. Preview first.",
|
|
11445
11537
|
parameters: {
|
|
11446
11538
|
type: "object",
|
|
11447
11539
|
properties: {
|
|
11448
11540
|
url: { type: "string", description: "Direct https link to the video file" },
|
|
11541
|
+
channels: {
|
|
11542
|
+
type: "array",
|
|
11543
|
+
items: { type: "string", enum: [...VIDEO_KEYS] },
|
|
11544
|
+
description: "youtube, tiktok or both (one post each); default youtube"
|
|
11545
|
+
},
|
|
11546
|
+
is_aigc: { type: "boolean", description: "TikTok: the video is AI-generated (the user said so)" },
|
|
11449
11547
|
note: { type: "string", description: "What the video is about, in the user's words" },
|
|
11450
11548
|
write: { type: "boolean", description: "Let Maggie write the details (default true)" },
|
|
11451
11549
|
start: { type: "number", description: "Start of the part to use, seconds" },
|
|
@@ -11473,11 +11571,28 @@ var socialTools = [
|
|
|
11473
11571
|
}
|
|
11474
11572
|
if (v.status !== "ready")
|
|
11475
11573
|
return { ok: false, video: { status: v.status, error: v.error, seconds: v.source_duration } };
|
|
11476
|
-
const
|
|
11574
|
+
const wanted = (a.channels ?? ["youtube"]).filter(
|
|
11575
|
+
(c) => VIDEO_KEYS.includes(c)
|
|
11576
|
+
);
|
|
11577
|
+
const posts = [];
|
|
11578
|
+
for (const channel of wanted.length ? wanted : ["youtube"]) {
|
|
11579
|
+
posts.push(
|
|
11580
|
+
await d.postFromVideo(v.id, {
|
|
11581
|
+
channel,
|
|
11582
|
+
note: a.note ?? "",
|
|
11583
|
+
write: a.write !== false,
|
|
11584
|
+
...channel === "tiktok" && a.is_aigc != null ? { is_aigc: a.is_aigc } : {}
|
|
11585
|
+
})
|
|
11586
|
+
);
|
|
11587
|
+
}
|
|
11477
11588
|
return {
|
|
11478
11589
|
ok: true,
|
|
11479
|
-
post: item(
|
|
11480
|
-
next:
|
|
11590
|
+
...posts.length === 1 ? { post: item(posts[0]) } : { posts: posts.map(item) },
|
|
11591
|
+
next: [
|
|
11592
|
+
posts.some((p) => p.provider === "youtube") ? "YouTube: show the title and description; ask whether it's made for kids and which visibility, then social_youtube_set." : "",
|
|
11593
|
+
posts.some((p) => p.provider === "tiktok") ? "TikTok: show the caption; read tiktok_creator and ask who can view it, whether to allow comments / Duet / Stitch and whether it promotes a brand, then social_tiktok_set exactly as they say; tell them the Music Usage Confirmation line." : "",
|
|
11594
|
+
"The user approves each post."
|
|
11595
|
+
].filter(Boolean).join(" ")
|
|
11481
11596
|
};
|
|
11482
11597
|
}
|
|
11483
11598
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmo-so/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CMO.so's MCP server for Claude Desktop, Cursor, VS Code and other MCP clients: manage your websites, blog posts, LinkedIn queue and results with Maggie.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|