@voxburst/mcp-server 0.2.2 → 0.3.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/__tests__/tools.test.js +13 -6
- package/dist/__tests__/tools.test.js.map +1 -1
- package/dist/client.d.ts +134 -14
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +49 -3
- package/dist/client.js.map +1 -1
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/dist/middleware/auth.d.ts +2 -6
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +2 -4
- package/dist/middleware/auth.js.map +1 -1
- package/dist/resources/accounts.d.ts +2 -1
- package/dist/resources/accounts.d.ts.map +1 -1
- package/dist/resources/accounts.js +30 -18
- package/dist/resources/accounts.js.map +1 -1
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +3 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/posts.d.ts +2 -1
- package/dist/resources/posts.d.ts.map +1 -1
- package/dist/resources/posts.js +32 -23
- package/dist/resources/posts.js.map +1 -1
- package/dist/tools/accounts.js +2 -2
- package/dist/tools/accounts.js.map +1 -1
- package/dist/tools/analytics.d.ts +35 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +31 -1
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/index.d.ts +131 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +5 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/posts.d.ts +198 -14
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +174 -22
- package/dist/tools/posts.js.map +1 -1
- package/package.json +2 -1
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
* Account Resources - Expose accounts as MCP resources
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
6
|
+
exports.VOXBURST_ACCOUNTS_URI = exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
7
7
|
exports.getAccountResourceTemplates = getAccountResourceTemplates;
|
|
8
8
|
exports.getAccountResources = getAccountResources;
|
|
9
9
|
exports.readAccountResource = readAccountResource;
|
|
10
10
|
exports.formatAccount = formatAccount;
|
|
11
11
|
exports.formatAccountsList = formatAccountsList;
|
|
12
|
-
exports.ACCOUNTS_LIST_URI =
|
|
13
|
-
exports.ACCOUNT_URI_PREFIX =
|
|
12
|
+
exports.ACCOUNTS_LIST_URI = "accounts://list";
|
|
13
|
+
exports.ACCOUNT_URI_PREFIX = "accounts://";
|
|
14
|
+
exports.VOXBURST_ACCOUNTS_URI = "voxburst://accounts";
|
|
14
15
|
/**
|
|
15
16
|
* Get resource templates for accounts
|
|
16
17
|
*/
|
|
17
18
|
function getAccountResourceTemplates() {
|
|
18
19
|
return [
|
|
19
20
|
{
|
|
20
|
-
uriTemplate:
|
|
21
|
-
name:
|
|
22
|
-
description:
|
|
23
|
-
mimeType:
|
|
21
|
+
uriTemplate: "accounts://{accountId}",
|
|
22
|
+
name: "Social Media Account",
|
|
23
|
+
description: "A connected social media account with platform details and status",
|
|
24
|
+
mimeType: "application/json",
|
|
24
25
|
},
|
|
25
26
|
];
|
|
26
27
|
}
|
|
@@ -31,9 +32,15 @@ function getAccountResources() {
|
|
|
31
32
|
return [
|
|
32
33
|
{
|
|
33
34
|
uri: exports.ACCOUNTS_LIST_URI,
|
|
34
|
-
name:
|
|
35
|
-
description:
|
|
36
|
-
mimeType:
|
|
35
|
+
name: "All Connected Accounts",
|
|
36
|
+
description: "List of all connected social media accounts",
|
|
37
|
+
mimeType: "application/json",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
uri: exports.VOXBURST_ACCOUNTS_URI,
|
|
41
|
+
name: "VoxBurst Accounts",
|
|
42
|
+
description: "Connected social media accounts for the workspace (id, platform, handle, displayName, connected)",
|
|
43
|
+
mimeType: "application/json",
|
|
37
44
|
},
|
|
38
45
|
];
|
|
39
46
|
}
|
|
@@ -41,22 +48,22 @@ function getAccountResources() {
|
|
|
41
48
|
* Read account resource content
|
|
42
49
|
*/
|
|
43
50
|
async function readAccountResource(client, uri) {
|
|
44
|
-
if (uri === exports.ACCOUNTS_LIST_URI) {
|
|
51
|
+
if (uri === exports.ACCOUNTS_LIST_URI || uri === exports.VOXBURST_ACCOUNTS_URI) {
|
|
45
52
|
const accounts = await client.listAccounts();
|
|
46
53
|
return {
|
|
47
54
|
uri,
|
|
48
|
-
mimeType:
|
|
55
|
+
mimeType: "application/json",
|
|
49
56
|
text: JSON.stringify(accounts, null, 2),
|
|
50
57
|
};
|
|
51
58
|
}
|
|
52
59
|
// Handle individual account URIs like accounts://acc_123
|
|
53
60
|
if (uri.startsWith(exports.ACCOUNT_URI_PREFIX) && uri !== exports.ACCOUNTS_LIST_URI) {
|
|
54
61
|
const accountId = uri.slice(exports.ACCOUNT_URI_PREFIX.length);
|
|
55
|
-
if (accountId && accountId !==
|
|
62
|
+
if (accountId && accountId !== "list") {
|
|
56
63
|
const account = await client.getAccount(accountId);
|
|
57
64
|
return {
|
|
58
65
|
uri,
|
|
59
|
-
mimeType:
|
|
66
|
+
mimeType: "application/json",
|
|
60
67
|
text: JSON.stringify(account, null, 2),
|
|
61
68
|
};
|
|
62
69
|
}
|
|
@@ -67,16 +74,21 @@ async function readAccountResource(client, uri) {
|
|
|
67
74
|
* Format account for display
|
|
68
75
|
*/
|
|
69
76
|
function formatAccount(account) {
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
// `status` is the API's own lowercased connection state. There is no boolean
|
|
78
|
+
// `connected` field — anything other than 'active' means the account cannot
|
|
79
|
+
// publish until it is reconnected.
|
|
80
|
+
const status = account.status === "active" ? "Connected" : "Disconnected";
|
|
81
|
+
const handle = account.username ? `@${account.username}` : "(no handle)";
|
|
82
|
+
const name = account.displayName ?? "unnamed";
|
|
83
|
+
return `${account.platform}: ${handle} (${name}) - ${status}`;
|
|
72
84
|
}
|
|
73
85
|
/**
|
|
74
86
|
* Format accounts list for display
|
|
75
87
|
*/
|
|
76
88
|
function formatAccountsList(accounts) {
|
|
77
89
|
if (accounts.length === 0) {
|
|
78
|
-
return
|
|
90
|
+
return "No accounts connected. Connect accounts at https://app.voxburst.io/accounts";
|
|
79
91
|
}
|
|
80
|
-
return accounts.map(formatAccount).join(
|
|
92
|
+
return accounts.map(formatAccount).join("\n");
|
|
81
93
|
}
|
|
82
94
|
//# sourceMappingURL=accounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/resources/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/resources/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,kEASC;AAKD,kDAeC;AAKD,kDA2BC;AAKD,sCAQC;AAKD,gDAMC;AA5FY,QAAA,iBAAiB,GAAG,iBAAiB,CAAC;AACtC,QAAA,kBAAkB,GAAG,aAAa,CAAC;AACnC,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAE3D;;GAEG;AACH,SAAgB,2BAA2B;IACzC,OAAO;QACL;YACE,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,mEAAmE;YAChF,QAAQ,EAAE,kBAAkB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO;QACL;YACE,GAAG,EAAE,yBAAiB;YACtB,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,GAAG,EAAE,6BAAqB;YAC1B,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,kGAAkG;Y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AAa,CAAC;IACzE,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,IAAI,SAAS,CAAC;IAC9C,OAAO,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,KAAK,IAAI,OAAO,MAAM,EAAE,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,QAAmB;IACpD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,6EAA6E,CAAC;IACvF,CAAC;IAED,OAAO,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resource Registry - Exports all MCP resources
|
|
3
3
|
*/
|
|
4
|
-
export { ACCOUNTS_LIST_URI, ACCOUNT_URI_PREFIX, getAccountResources, getAccountResourceTemplates, readAccountResource, formatAccount, formatAccountsList, } from
|
|
5
|
-
export { POSTS_RECENT_URI, POST_URI_PREFIX, getPostResources, getPostResourceTemplates, readPostResource, formatPost, formatPostsList, } from
|
|
4
|
+
export { ACCOUNTS_LIST_URI, ACCOUNT_URI_PREFIX, VOXBURST_ACCOUNTS_URI, getAccountResources, getAccountResourceTemplates, readAccountResource, formatAccount, formatAccountsList, } from "./accounts.js";
|
|
5
|
+
export { POSTS_RECENT_URI, POST_URI_PREFIX, VOXBURST_POSTS_URI, getPostResources, getPostResourceTemplates, readPostResource, formatPost, formatPostsList, } from "./posts.js";
|
|
6
6
|
/**
|
|
7
7
|
* Get all static resources
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,wBAAgB,eAAe;;;;;IAK9B;AAED;;GAEG;AACH,wBAAgB,uBAAuB;;;;;IAKtC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,wBAAgB,eAAe;;;;;IAK9B;AAED;;GAEG;AACH,wBAAgB,uBAAuB;;;;;IAKtC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* Resource Registry - Exports all MCP resources
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.formatPostsList = exports.formatPost = exports.readPostResource = exports.getPostResourceTemplates = exports.getPostResources = exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = exports.formatAccountsList = exports.formatAccount = exports.readAccountResource = exports.getAccountResourceTemplates = exports.getAccountResources = exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
6
|
+
exports.formatPostsList = exports.formatPost = exports.readPostResource = exports.getPostResourceTemplates = exports.getPostResources = exports.VOXBURST_POSTS_URI = exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = exports.formatAccountsList = exports.formatAccount = exports.readAccountResource = exports.getAccountResourceTemplates = exports.getAccountResources = exports.VOXBURST_ACCOUNTS_URI = exports.ACCOUNT_URI_PREFIX = exports.ACCOUNTS_LIST_URI = void 0;
|
|
7
7
|
exports.getAllResources = getAllResources;
|
|
8
8
|
exports.getAllResourceTemplates = getAllResourceTemplates;
|
|
9
9
|
var accounts_js_1 = require("./accounts.js");
|
|
10
10
|
Object.defineProperty(exports, "ACCOUNTS_LIST_URI", { enumerable: true, get: function () { return accounts_js_1.ACCOUNTS_LIST_URI; } });
|
|
11
11
|
Object.defineProperty(exports, "ACCOUNT_URI_PREFIX", { enumerable: true, get: function () { return accounts_js_1.ACCOUNT_URI_PREFIX; } });
|
|
12
|
+
Object.defineProperty(exports, "VOXBURST_ACCOUNTS_URI", { enumerable: true, get: function () { return accounts_js_1.VOXBURST_ACCOUNTS_URI; } });
|
|
12
13
|
Object.defineProperty(exports, "getAccountResources", { enumerable: true, get: function () { return accounts_js_1.getAccountResources; } });
|
|
13
14
|
Object.defineProperty(exports, "getAccountResourceTemplates", { enumerable: true, get: function () { return accounts_js_1.getAccountResourceTemplates; } });
|
|
14
15
|
Object.defineProperty(exports, "readAccountResource", { enumerable: true, get: function () { return accounts_js_1.readAccountResource; } });
|
|
@@ -17,6 +18,7 @@ Object.defineProperty(exports, "formatAccountsList", { enumerable: true, get: fu
|
|
|
17
18
|
var posts_js_1 = require("./posts.js");
|
|
18
19
|
Object.defineProperty(exports, "POSTS_RECENT_URI", { enumerable: true, get: function () { return posts_js_1.POSTS_RECENT_URI; } });
|
|
19
20
|
Object.defineProperty(exports, "POST_URI_PREFIX", { enumerable: true, get: function () { return posts_js_1.POST_URI_PREFIX; } });
|
|
21
|
+
Object.defineProperty(exports, "VOXBURST_POSTS_URI", { enumerable: true, get: function () { return posts_js_1.VOXBURST_POSTS_URI; } });
|
|
20
22
|
Object.defineProperty(exports, "getPostResources", { enumerable: true, get: function () { return posts_js_1.getPostResources; } });
|
|
21
23
|
Object.defineProperty(exports, "getPostResourceTemplates", { enumerable: true, get: function () { return posts_js_1.getPostResourceTemplates; } });
|
|
22
24
|
Object.defineProperty(exports, "readPostResource", { enumerable: true, get: function () { return posts_js_1.readPostResource; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA8BH,0CAKC;AAKD,0DAKC;AA3CD,6CASuB;AARrB,gHAAA,iBAAiB,OAAA;AACjB,iHAAA,kBAAkB,OAAA;AAClB,oHAAA,qBAAqB,OAAA;AACrB,kHAAA,mBAAmB,OAAA;AACnB,0HAAA,2BAA2B,OAAA;AAC3B,kHAAA,mBAAmB,OAAA;AACnB,4GAAA,aAAa,OAAA;AACb,iHAAA,kBAAkB,OAAA;AAGpB,uCASoB;AARlB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,4GAAA,gBAAgB,OAAA;AAChB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AACV,2GAAA,eAAe,OAAA;AAGjB,+CAAiF;AACjF,yCAAwE;AAExE;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,IAAA,iCAAmB,GAAE;QACxB,GAAG,IAAA,2BAAgB,GAAE;KACtB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,OAAO;QACL,GAAG,IAAA,yCAA2B,GAAE;QAChC,GAAG,IAAA,mCAAwB,GAAE;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Post Resources - Expose posts as MCP resources
|
|
3
3
|
*/
|
|
4
|
-
import type { VoxBurstClient, Post } from
|
|
4
|
+
import type { VoxBurstClient, Post } from "../client.js";
|
|
5
5
|
export declare const POSTS_RECENT_URI = "posts://recent";
|
|
6
6
|
export declare const POST_URI_PREFIX = "posts://";
|
|
7
|
+
export declare const VOXBURST_POSTS_URI = "voxburst://posts";
|
|
7
8
|
/**
|
|
8
9
|
* Get resource templates for posts
|
|
9
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,eAAe,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;GAEG;AACH,wBAAgB,wBAAwB;;;;;IASvC;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;;;;IAe/B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAwBjE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAwB7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAMrD"}
|
package/dist/resources/posts.js
CHANGED
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
* Post Resources - Expose posts as MCP resources
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = void 0;
|
|
6
|
+
exports.VOXBURST_POSTS_URI = exports.POST_URI_PREFIX = exports.POSTS_RECENT_URI = void 0;
|
|
7
7
|
exports.getPostResourceTemplates = getPostResourceTemplates;
|
|
8
8
|
exports.getPostResources = getPostResources;
|
|
9
9
|
exports.readPostResource = readPostResource;
|
|
10
10
|
exports.formatPost = formatPost;
|
|
11
11
|
exports.formatPostsList = formatPostsList;
|
|
12
|
-
exports.POSTS_RECENT_URI =
|
|
13
|
-
exports.POST_URI_PREFIX =
|
|
12
|
+
exports.POSTS_RECENT_URI = "posts://recent";
|
|
13
|
+
exports.POST_URI_PREFIX = "posts://";
|
|
14
|
+
exports.VOXBURST_POSTS_URI = "voxburst://posts";
|
|
14
15
|
/**
|
|
15
16
|
* Get resource templates for posts
|
|
16
17
|
*/
|
|
17
18
|
function getPostResourceTemplates() {
|
|
18
19
|
return [
|
|
19
20
|
{
|
|
20
|
-
uriTemplate:
|
|
21
|
-
name:
|
|
22
|
-
description:
|
|
23
|
-
mimeType:
|
|
21
|
+
uriTemplate: "posts://{postId}",
|
|
22
|
+
name: "Social Media Post",
|
|
23
|
+
description: "A social media post with content, status, and scheduling details",
|
|
24
|
+
mimeType: "application/json",
|
|
24
25
|
},
|
|
25
26
|
];
|
|
26
27
|
}
|
|
@@ -31,9 +32,15 @@ function getPostResources() {
|
|
|
31
32
|
return [
|
|
32
33
|
{
|
|
33
34
|
uri: exports.POSTS_RECENT_URI,
|
|
34
|
-
name:
|
|
35
|
-
description:
|
|
36
|
-
mimeType:
|
|
35
|
+
name: "Recent Posts",
|
|
36
|
+
description: "List of recent posts across all accounts (last 20)",
|
|
37
|
+
mimeType: "application/json",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
uri: exports.VOXBURST_POSTS_URI,
|
|
41
|
+
name: "VoxBurst Posts",
|
|
42
|
+
description: "Recent posts for the workspace (id, content, accounts, status, scheduledFor)",
|
|
43
|
+
mimeType: "application/json",
|
|
37
44
|
},
|
|
38
45
|
];
|
|
39
46
|
}
|
|
@@ -41,22 +48,22 @@ function getPostResources() {
|
|
|
41
48
|
* Read post resource content
|
|
42
49
|
*/
|
|
43
50
|
async function readPostResource(client, uri) {
|
|
44
|
-
if (uri === exports.POSTS_RECENT_URI) {
|
|
51
|
+
if (uri === exports.POSTS_RECENT_URI || uri === exports.VOXBURST_POSTS_URI) {
|
|
45
52
|
const posts = await client.listPosts({ limit: 20 });
|
|
46
53
|
return {
|
|
47
54
|
uri,
|
|
48
|
-
mimeType:
|
|
55
|
+
mimeType: "application/json",
|
|
49
56
|
text: JSON.stringify(posts, null, 2),
|
|
50
57
|
};
|
|
51
58
|
}
|
|
52
59
|
// Handle individual post URIs like posts://post_123
|
|
53
60
|
if (uri.startsWith(exports.POST_URI_PREFIX) && uri !== exports.POSTS_RECENT_URI) {
|
|
54
61
|
const postId = uri.slice(exports.POST_URI_PREFIX.length);
|
|
55
|
-
if (postId && postId !==
|
|
62
|
+
if (postId && postId !== "recent") {
|
|
56
63
|
const post = await client.getPost(postId);
|
|
57
64
|
return {
|
|
58
65
|
uri,
|
|
59
|
-
mimeType:
|
|
66
|
+
mimeType: "application/json",
|
|
60
67
|
text: JSON.stringify(post, null, 2),
|
|
61
68
|
};
|
|
62
69
|
}
|
|
@@ -67,16 +74,18 @@ async function readPostResource(client, uri) {
|
|
|
67
74
|
* Format post for display
|
|
68
75
|
*/
|
|
69
76
|
function formatPost(post) {
|
|
70
|
-
const
|
|
71
|
-
draft:
|
|
72
|
-
scheduled:
|
|
73
|
-
published:
|
|
74
|
-
failed:
|
|
77
|
+
const statusLabel = {
|
|
78
|
+
draft: "[DRAFT]",
|
|
79
|
+
scheduled: "[SCHEDULED]",
|
|
80
|
+
published: "[PUBLISHED]",
|
|
81
|
+
failed: "[FAILED]",
|
|
82
|
+
cancelled: "[CANCELLED]",
|
|
83
|
+
unpublished: "[UNPUBLISHED]",
|
|
75
84
|
};
|
|
76
85
|
const preview = post.content.length > 100
|
|
77
|
-
? post.content.slice(0, 100) +
|
|
86
|
+
? post.content.slice(0, 100) + "..."
|
|
78
87
|
: post.content;
|
|
79
|
-
let info = `${
|
|
88
|
+
let info = `${statusLabel[post.status] ?? "[UNKNOWN]"} ${preview}`;
|
|
80
89
|
if (post.scheduledFor) {
|
|
81
90
|
info += `\n Scheduled: ${new Date(post.scheduledFor).toLocaleString()}`;
|
|
82
91
|
}
|
|
@@ -90,8 +99,8 @@ function formatPost(post) {
|
|
|
90
99
|
*/
|
|
91
100
|
function formatPostsList(posts) {
|
|
92
101
|
if (posts.length === 0) {
|
|
93
|
-
return
|
|
102
|
+
return "No posts found.";
|
|
94
103
|
}
|
|
95
|
-
return posts.map((post, index) => `${index + 1}. ${formatPost(post)}`).join(
|
|
104
|
+
return posts.map((post, index) => `${index + 1}. ${formatPost(post)}`).join("\n\n");
|
|
96
105
|
}
|
|
97
106
|
//# sourceMappingURL=posts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/resources/posts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,4DASC;AAKD,4CAeC;AAKD,4CA2BC;AAKD,gCAwBC;AAKD,0CAMC;AA5GY,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACpC,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,SAAgB,wBAAwB;IACtC,OAAO;QACL;YACE,WAAW,EAAE,kBAAkB;YAC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AAI,CAAC,MAAM,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/tools/accounts.js
CHANGED
|
@@ -17,7 +17,7 @@ function getAccountTools() {
|
|
|
17
17
|
return [
|
|
18
18
|
{
|
|
19
19
|
name: 'list_accounts',
|
|
20
|
-
description: 'List all connected social media accounts.
|
|
20
|
+
description: 'List all connected social media accounts. Each account returns id, platform and status (both lowercased), username, displayName, avatarUrl, accountType and connectedAt. Platform-specific fields (followers, oauthVersion, flobProbe, needsPlaylistReauth, needsOrgScopeReauth, gmbLocationsConfigured, scopeHealth) are omitted rather than null when they do not apply — a missing scopeHealth means permissions were never verified, NOT that they are healthy.',
|
|
21
21
|
inputSchema: {
|
|
22
22
|
type: 'object',
|
|
23
23
|
properties: {},
|
|
@@ -26,7 +26,7 @@ function getAccountTools() {
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
name: 'get_account',
|
|
29
|
-
description: 'Get detailed information about a specific connected account by its ID.',
|
|
29
|
+
description: 'Get detailed information about a specific connected account by its ID. Returns the same fields as list_accounts. Does not return OAuth tokens, scopes or raw account metadata.',
|
|
30
30
|
inputSchema: {
|
|
31
31
|
type: 'object',
|
|
32
32
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,0CA0BC;AAGD,gDAIC;AAED,4CAMC;AAlDD,6BAAwB;AAGxB,gBAAgB;AACH,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CACvE,CAAC,CAAC;AAEH,mBAAmB;AACnB,SAAgB,eAAe;IAC7B,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,0CA0BC;AAGD,gDAIC;AAED,4CAMC;AAlDD,6BAAwB;AAGxB,gBAAgB;AACH,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CACvE,CAAC,CAAC;AAEH,mBAAmB;AACnB,SAAgB,eAAe;IAC7B,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,qcAAqc;YACld,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,gLAAgL;YAC7L,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,SAAS,EAAE;wBACT,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sCAAsC;qBACpD;iBACF;gBACD,QAAQ,EAAE,CAAC,WAAW,CAAC;aACxB;SACF;KACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AACT,KAAK,UAAU,kBAAkB,CACtC,MAAsB;IAEtB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC;AAC/B,CAAC;AAEM,KAAK,UAAU,gBAAgB,CACpC,MAAsB,EACtB,IAAa;IAEb,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Analytics MCP Tools
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import type { VoxBurstClient, PostMetrics, AccountMetrics } from '../client.js';
|
|
5
|
+
import type { VoxBurstClient, PostMetrics, AccountMetrics, AnalyticsOverview } from '../client.js';
|
|
6
6
|
export declare const GetPostMetricsSchema: z.ZodObject<{
|
|
7
7
|
postId: z.ZodString;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -17,6 +17,16 @@ export declare const GetAccountMetricsSchema: z.ZodObject<{
|
|
|
17
17
|
}, {
|
|
18
18
|
accountId: string;
|
|
19
19
|
}>;
|
|
20
|
+
export declare const GetAnalyticsOverviewSchema: z.ZodObject<{
|
|
21
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
22
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
startDate?: string | undefined;
|
|
25
|
+
endDate?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
startDate?: string | undefined;
|
|
28
|
+
endDate?: string | undefined;
|
|
29
|
+
}>;
|
|
20
30
|
export declare function getAnalyticsTools(): ({
|
|
21
31
|
name: string;
|
|
22
32
|
description: string;
|
|
@@ -28,6 +38,8 @@ export declare function getAnalyticsTools(): ({
|
|
|
28
38
|
description: string;
|
|
29
39
|
};
|
|
30
40
|
accountId?: undefined;
|
|
41
|
+
startDate?: undefined;
|
|
42
|
+
endDate?: undefined;
|
|
31
43
|
};
|
|
32
44
|
required: string[];
|
|
33
45
|
};
|
|
@@ -42,10 +54,32 @@ export declare function getAnalyticsTools(): ({
|
|
|
42
54
|
description: string;
|
|
43
55
|
};
|
|
44
56
|
postId?: undefined;
|
|
57
|
+
startDate?: undefined;
|
|
58
|
+
endDate?: undefined;
|
|
45
59
|
};
|
|
46
60
|
required: string[];
|
|
47
61
|
};
|
|
62
|
+
} | {
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: "object";
|
|
67
|
+
properties: {
|
|
68
|
+
startDate: {
|
|
69
|
+
type: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
endDate: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
postId?: undefined;
|
|
77
|
+
accountId?: undefined;
|
|
78
|
+
};
|
|
79
|
+
required: never[];
|
|
80
|
+
};
|
|
48
81
|
})[];
|
|
49
82
|
export declare function handleGetPostMetrics(client: VoxBurstClient, args: unknown): Promise<PostMetrics>;
|
|
50
83
|
export declare function handleGetAccountMetrics(client: VoxBurstClient, args: unknown): Promise<AccountMetrics>;
|
|
84
|
+
export declare function handleGetAnalyticsOverview(client: VoxBurstClient, args: unknown): Promise<AnalyticsOverview>;
|
|
51
85
|
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGnG,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAGH,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDhC;AAGD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,WAAW,CAAC,CAGtB;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,cAAc,CAAC,CAGzB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,iBAAiB,CAAC,CAM5B"}
|
package/dist/tools/analytics.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Analytics MCP Tools
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GetAccountMetricsSchema = exports.GetPostMetricsSchema = void 0;
|
|
6
|
+
exports.GetAnalyticsOverviewSchema = exports.GetAccountMetricsSchema = exports.GetPostMetricsSchema = void 0;
|
|
7
7
|
exports.getAnalyticsTools = getAnalyticsTools;
|
|
8
8
|
exports.handleGetPostMetrics = handleGetPostMetrics;
|
|
9
9
|
exports.handleGetAccountMetrics = handleGetAccountMetrics;
|
|
10
|
+
exports.handleGetAnalyticsOverview = handleGetAnalyticsOverview;
|
|
10
11
|
const zod_1 = require("zod");
|
|
11
12
|
// Input schemas
|
|
12
13
|
exports.GetPostMetricsSchema = zod_1.z.object({
|
|
@@ -15,6 +16,10 @@ exports.GetPostMetricsSchema = zod_1.z.object({
|
|
|
15
16
|
exports.GetAccountMetricsSchema = zod_1.z.object({
|
|
16
17
|
accountId: zod_1.z.string().describe('The unique identifier of the account'),
|
|
17
18
|
});
|
|
19
|
+
exports.GetAnalyticsOverviewSchema = zod_1.z.object({
|
|
20
|
+
startDate: zod_1.z.string().optional().describe('Start date for the analytics period (ISO date, e.g. 2024-01-01)'),
|
|
21
|
+
endDate: zod_1.z.string().optional().describe('End date for the analytics period (ISO date, e.g. 2024-01-31)'),
|
|
22
|
+
});
|
|
18
23
|
// Tool definitions
|
|
19
24
|
function getAnalyticsTools() {
|
|
20
25
|
return [
|
|
@@ -46,6 +51,24 @@ function getAnalyticsTools() {
|
|
|
46
51
|
required: ['accountId'],
|
|
47
52
|
},
|
|
48
53
|
},
|
|
54
|
+
{
|
|
55
|
+
name: 'get_analytics_overview',
|
|
56
|
+
description: 'Get an overview of analytics across all connected accounts for a date range. Returns total impressions, engagements, top posts, and best posting time.',
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
startDate: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Start date for the analytics period (ISO date, e.g. 2024-01-01)',
|
|
63
|
+
},
|
|
64
|
+
endDate: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'End date for the analytics period (ISO date, e.g. 2024-01-31)',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
required: [],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
49
72
|
];
|
|
50
73
|
}
|
|
51
74
|
// Tool handlers
|
|
@@ -57,4 +80,11 @@ async function handleGetAccountMetrics(client, args) {
|
|
|
57
80
|
const { accountId } = exports.GetAccountMetricsSchema.parse(args);
|
|
58
81
|
return client.getAccountMetrics(accountId);
|
|
59
82
|
}
|
|
83
|
+
async function handleGetAnalyticsOverview(client, args) {
|
|
84
|
+
const params = exports.GetAnalyticsOverviewSchema.parse(args);
|
|
85
|
+
return client.getAnalyticsOverview({
|
|
86
|
+
startDate: params.startDate,
|
|
87
|
+
endDate: params.endDate,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
60
90
|
//# sourceMappingURL=analytics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAoBH,8CAiDC;AAGD,oDAMC;AAED,0DAMC;AAED,gEASC;AA/FD,6BAAwB;AAGxB,gBAAgB;AACH,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,M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