@cmo-so/mcp 0.12.13 → 0.12.14
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 +24 -12
- 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.12.
|
|
7202
|
+
version: "0.12.14",
|
|
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",
|
|
@@ -17539,7 +17539,7 @@ async function llmsTxt(site, o = {}) {
|
|
|
17539
17539
|
const base = (site.url ?? "").replace(/\/+$/, "");
|
|
17540
17540
|
const s = await site.request({
|
|
17541
17541
|
path: "/wp/v2/settings",
|
|
17542
|
-
query: { _fields: "title,description,page_on_front,page_for_posts" }
|
|
17542
|
+
query: { _fields: "title,description,page_on_front,page_for_posts,blog_public" }
|
|
17543
17543
|
}).then((r) => r.status === 200 ? r.data : {});
|
|
17544
17544
|
const pages = await listPages(site, { status: "publish" });
|
|
17545
17545
|
const posts = await all(
|
|
@@ -17548,10 +17548,20 @@ async function llmsTxt(site, o = {}) {
|
|
|
17548
17548
|
{ status: "publish", per_page: 100, _fields: "link,title,excerpt,meta", orderby: "date", order: "desc" },
|
|
17549
17549
|
o.posts ?? 25
|
|
17550
17550
|
);
|
|
17551
|
-
const
|
|
17551
|
+
const clip3 = (t, n2 = 200) => {
|
|
17552
|
+
const x = t.replace(/\s+/g, " ").trim();
|
|
17553
|
+
if (x.length <= n2) return x;
|
|
17554
|
+
const cut = x.slice(0, n2);
|
|
17555
|
+
return `${cut.slice(0, Math.max(cut.lastIndexOf(" "), n2 - 30)).replace(/[\s,;:–-]+$/, "")}\u2026`;
|
|
17556
|
+
};
|
|
17557
|
+
const desc = (m, fallback = "") => clip3(String(m?.maggie_seo_description || fallback));
|
|
17558
|
+
const isSample = (link, title) => /\/(sample-page|hello-world)\/?$/.test(link) || title === "Sample Page" || title === "Hello world!";
|
|
17552
17559
|
const home = pages.find((p) => p.id === s.page_on_front);
|
|
17553
17560
|
const noise = /privacy|terms|cookie|thank|cart|checkout|my-account|login/i;
|
|
17554
|
-
const visible = pages.filter(
|
|
17561
|
+
const visible = pages.filter(
|
|
17562
|
+
(p) => p.id !== s.page_on_front && p.id !== s.page_for_posts && !noise.test(p.link) && !isSample(p.link, titleOf(p.title))
|
|
17563
|
+
);
|
|
17564
|
+
const realPosts = posts.filter((p) => !isSample(p.link, strip(p.title.rendered ?? "")));
|
|
17555
17565
|
const byParent = /* @__PURE__ */ new Map();
|
|
17556
17566
|
for (const p of visible) byParent.set(p.parent, [...byParent.get(p.parent) ?? [], p]);
|
|
17557
17567
|
const line = (title, url, d) => `- [${title.replace(/[[\]]/g, "")}](${url})${d ? `: ${d}` : ""}`;
|
|
@@ -17559,25 +17569,27 @@ async function llmsTxt(site, o = {}) {
|
|
|
17559
17569
|
const summary = desc(home?.meta, s.description ?? "");
|
|
17560
17570
|
if (summary) out.push(`> ${summary}`, "");
|
|
17561
17571
|
const top = byParent.get(0) ?? [];
|
|
17562
|
-
if (top.length) {
|
|
17572
|
+
if (top.length || home) {
|
|
17563
17573
|
out.push("## Pages", "");
|
|
17574
|
+
if (home) out.push(line(titleOf(home.title) || "Home", home.link, summary));
|
|
17564
17575
|
for (const p of top) {
|
|
17565
17576
|
out.push(line(titleOf(p.title), p.link, desc(p.meta)));
|
|
17566
17577
|
for (const c of byParent.get(p.id) ?? []) out.push(` ${line(titleOf(c.title), c.link, desc(c.meta))}`);
|
|
17567
17578
|
}
|
|
17568
17579
|
out.push("");
|
|
17569
17580
|
}
|
|
17570
|
-
if (
|
|
17581
|
+
if (realPosts.length) {
|
|
17571
17582
|
out.push("## Articles", "");
|
|
17572
|
-
for (const p of
|
|
17573
|
-
out.push(
|
|
17574
|
-
line(strip(p.title.rendered ?? ""), p.link, desc(p.meta, strip(p.excerpt?.rendered ?? "").slice(0, 160)))
|
|
17575
|
-
);
|
|
17583
|
+
for (const p of realPosts)
|
|
17584
|
+
out.push(line(strip(p.title.rendered ?? ""), p.link, desc(p.meta, strip(p.excerpt?.rendered ?? ""))));
|
|
17576
17585
|
out.push("");
|
|
17577
17586
|
}
|
|
17578
17587
|
const legal = pages.filter((p) => /privacy|terms/i.test(p.link));
|
|
17579
|
-
|
|
17580
|
-
|
|
17588
|
+
const optional2 = [
|
|
17589
|
+
...s.blog_public === 0 ? [] : [line("Sitemap", `${base}/wp-sitemap.xml`, "every page and article")],
|
|
17590
|
+
...legal.map((p) => line(titleOf(p.title), p.link, ""))
|
|
17591
|
+
];
|
|
17592
|
+
if (optional2.length) out.push("## Optional", "", ...optional2);
|
|
17581
17593
|
return `${out.join("\n").replace(/\n{3,}/g, "\n\n").trim()}
|
|
17582
17594
|
`;
|
|
17583
17595
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmo-so/mcp",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.14",
|
|
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",
|