@mirrai/mcp-server 0.8.0 → 0.9.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/client/api-client.d.ts +1 -0
- package/dist/client/api-client.d.ts.map +1 -1
- package/dist/client/api-client.js +15 -3
- package/dist/client/api-client.js.map +1 -1
- package/dist/client/sse-client.d.ts +2 -0
- package/dist/client/sse-client.d.ts.map +1 -1
- package/dist/client/sse-client.js +20 -5
- package/dist/client/sse-client.js.map +1 -1
- package/dist/server.d.ts +7 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -3
- package/dist/server.js.map +1 -1
- package/dist/tool-contracts.d.ts.map +1 -1
- package/dist/tool-contracts.js +189 -5
- package/dist/tool-contracts.js.map +1 -1
- package/dist/tools/content-ideation.d.ts +11 -0
- package/dist/tools/content-ideation.d.ts.map +1 -0
- package/dist/tools/content-ideation.js +214 -0
- package/dist/tools/content-ideation.js.map +1 -0
- package/dist/tools/persona.d.ts +11 -0
- package/dist/tools/persona.d.ts.map +1 -0
- package/dist/tools/persona.js +200 -0
- package/dist/tools/persona.js.map +1 -0
- package/dist/tools/publishing.d.ts +3 -1
- package/dist/tools/publishing.d.ts.map +1 -1
- package/dist/tools/publishing.js +66 -51
- package/dist/tools/publishing.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export declare class MirraApiError extends Error {
|
|
|
14
14
|
export declare class MirraApiClient {
|
|
15
15
|
readonly baseUrl: string;
|
|
16
16
|
readonly apiKey: string;
|
|
17
|
+
readonly internalApiKeyForwardingSecret?: string;
|
|
17
18
|
constructor(config: MirraConfig);
|
|
18
19
|
private get headers();
|
|
19
20
|
private handleResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/client/api-client.ts"],"names":[],"mappings":"AAAA;;;;;GA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AAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAkB7E"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Fetch-based HTTP client with API key authentication.
|
|
5
5
|
* Handles JSON requests/responses and error mapping.
|
|
6
6
|
*/
|
|
7
|
+
import { createHmac } from 'node:crypto';
|
|
7
8
|
export class MirraApiError extends Error {
|
|
8
9
|
statusCode;
|
|
9
10
|
code;
|
|
@@ -19,6 +20,7 @@ export class MirraApiError extends Error {
|
|
|
19
20
|
export class MirraApiClient {
|
|
20
21
|
baseUrl;
|
|
21
22
|
apiKey;
|
|
23
|
+
internalApiKeyForwardingSecret;
|
|
22
24
|
constructor(config) {
|
|
23
25
|
const url = new URL(config.baseUrl);
|
|
24
26
|
if (!['https:', 'http:'].includes(url.protocol)) {
|
|
@@ -26,12 +28,22 @@ export class MirraApiClient {
|
|
|
26
28
|
}
|
|
27
29
|
this.baseUrl = url.origin;
|
|
28
30
|
this.apiKey = config.apiKey;
|
|
31
|
+
this.internalApiKeyForwardingSecret = config.internalApiKeyForwardingSecret;
|
|
29
32
|
}
|
|
30
33
|
get headers() {
|
|
31
|
-
|
|
32
|
-
'Authorization': `Bearer ${this.apiKey}`,
|
|
34
|
+
const headers = {
|
|
33
35
|
'Content-Type': 'application/json',
|
|
34
36
|
};
|
|
37
|
+
if (this.internalApiKeyForwardingSecret) {
|
|
38
|
+
headers['X-Mirra-Api-Key'] = this.apiKey;
|
|
39
|
+
headers['X-Mirra-Internal-Mcp'] = createHmac('sha256', this.internalApiKeyForwardingSecret)
|
|
40
|
+
.update(this.apiKey)
|
|
41
|
+
.digest('base64url');
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
45
|
+
}
|
|
46
|
+
return headers;
|
|
35
47
|
}
|
|
36
48
|
async handleResponse(response) {
|
|
37
49
|
if (!response.ok) {
|
|
@@ -111,7 +123,7 @@ export class MirraApiClient {
|
|
|
111
123
|
'Content-Type': contentType,
|
|
112
124
|
'Content-Length': String(body.byteLength),
|
|
113
125
|
},
|
|
114
|
-
body,
|
|
126
|
+
body: new Uint8Array(body),
|
|
115
127
|
});
|
|
116
128
|
if (!response.ok) {
|
|
117
129
|
throw new MirraApiError(response.status, `Storage upload failed with status ${response.status}`, 'STORAGE_UPLOAD_FAILED');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/client/api-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/client/api-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,MAAM,OAAO,aAAc,SAAQ,KAAK;IAE7B;IAEA;IACA;IAJT,YACS,UAAkB,EACzB,OAAe,EACR,IAAa,EACb,OAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAA;QALP,eAAU,GAAV,UAAU,CAAQ;QAElB,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;IAC7B,CAAC;CACF;AAED,MAAM,OAAO,cAAc;IACT,OAAO,CAAQ;IACf,MAAM,CAAQ;IACd,8BAA8B,CAAS;IAEvD,YAAY,MAAmB;QAC7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACnC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAC5D,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,MA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,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,IAAY,EAAE,WAAmB;QAC1D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,cAAc,EAAE,WAAW;gBAC3B,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;aAC1C;YACD,IAAI,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,aAAa,CACrB,QAAQ,CAAC,MAAM,EACf,qCAAqC,QAAQ,CAAC,MAAM,EAAE,EACtD,uBAAuB,CACxB,CAAA;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -13,7 +13,9 @@ interface SSEEvent {
|
|
|
13
13
|
export declare class SSEClient {
|
|
14
14
|
private baseUrl;
|
|
15
15
|
private apiKey;
|
|
16
|
+
private internalApiKeyForwardingSecret?;
|
|
16
17
|
constructor(config: MirraConfig);
|
|
18
|
+
private get headers();
|
|
17
19
|
/**
|
|
18
20
|
* Consume an SSE stream from a POST endpoint.
|
|
19
21
|
* Returns accumulated events categorized by event type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-client.d.ts","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"sse-client.d.ts","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAMpD,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,8BAA8B,CAAC,CAAQ;gBAEnC,MAAM,EAAE,WAAW;IAU/B,OAAO,KAAK,OAAO,GAclB;IAED;;;OAGG;IACG,aAAa,CACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;KAC/B,GACL,OAAO,CAAC,QAAQ,EAAE,CAAC;IAoGtB;;OAEG;IACG,yBAAyB,CAC7B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;QACT,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAClE,CAAC;IAoDF;;OAEG;IACG,uBAAuB,CAC3B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;YA8Bd,uBAAuB;CAyBtC"}
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* and accumulates the final result. MCP tools are request-response,
|
|
6
6
|
* so this fully consumes the stream before returning.
|
|
7
7
|
*/
|
|
8
|
+
import { createHmac } from 'node:crypto';
|
|
8
9
|
const DEFAULT_STREAM_TIMEOUT_MS = 300_000;
|
|
9
10
|
const CAROUSEL_GENERATION_TIMEOUT_MS = 610_000;
|
|
10
11
|
const CAROUSEL_REFINE_TIMEOUT_MS = 310_000;
|
|
11
12
|
export class SSEClient {
|
|
12
13
|
baseUrl;
|
|
13
14
|
apiKey;
|
|
15
|
+
internalApiKeyForwardingSecret;
|
|
14
16
|
constructor(config) {
|
|
15
17
|
const url = new URL(config.baseUrl);
|
|
16
18
|
if (!['https:', 'http:'].includes(url.protocol)) {
|
|
@@ -18,6 +20,23 @@ export class SSEClient {
|
|
|
18
20
|
}
|
|
19
21
|
this.baseUrl = url.origin;
|
|
20
22
|
this.apiKey = config.apiKey;
|
|
23
|
+
this.internalApiKeyForwardingSecret = config.internalApiKeyForwardingSecret;
|
|
24
|
+
}
|
|
25
|
+
get headers() {
|
|
26
|
+
const headers = {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
'Accept': 'text/event-stream',
|
|
29
|
+
};
|
|
30
|
+
if (this.internalApiKeyForwardingSecret) {
|
|
31
|
+
headers['X-Mirra-Api-Key'] = this.apiKey;
|
|
32
|
+
headers['X-Mirra-Internal-Mcp'] = createHmac('sha256', this.internalApiKeyForwardingSecret)
|
|
33
|
+
.update(this.apiKey)
|
|
34
|
+
.digest('base64url');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
headers['Authorization'] = `Bearer ${this.apiKey}`;
|
|
38
|
+
}
|
|
39
|
+
return headers;
|
|
21
40
|
}
|
|
22
41
|
/**
|
|
23
42
|
* Consume an SSE stream from a POST endpoint.
|
|
@@ -30,11 +49,7 @@ export class SSEClient {
|
|
|
30
49
|
try {
|
|
31
50
|
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
32
51
|
method: 'POST',
|
|
33
|
-
headers:
|
|
34
|
-
'Authorization': `Bearer ${this.apiKey}`,
|
|
35
|
-
'Content-Type': 'application/json',
|
|
36
|
-
'Accept': 'text/event-stream',
|
|
37
|
-
},
|
|
52
|
+
headers: this.headers,
|
|
38
53
|
body: JSON.stringify(body),
|
|
39
54
|
signal: controller.signal,
|
|
40
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-client.js","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"sse-client.js","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO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|
* - Carousel (카드뉴스): 8 tools
|
|
6
6
|
* - Shorts (숏츠): 9 tools
|
|
7
7
|
* - Blog (블로그): 4 tools
|
|
8
|
-
* -
|
|
8
|
+
* - Content Ideation (대량기획): 4 tools
|
|
9
|
+
* - Persona Helper (페르소나): 5 tools
|
|
10
|
+
* - Publishing (예약발행)
|
|
9
11
|
* - Analytics (데이터분석): 5 tools
|
|
10
12
|
*/
|
|
11
13
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
12
14
|
import type { MirraConfig } from './types/index.js';
|
|
13
|
-
export
|
|
15
|
+
export interface MirraServerOptions {
|
|
16
|
+
enableLocalFileTools?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function createMirraServer(config: MirraConfig, options?: MirraServerOptions): McpServer;
|
|
14
19
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAWnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAcnD,MAAM,WAAW,kBAAkB;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,kBAAuB,GAAG,SAAS,CAwBlG"}
|
package/dist/server.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* - Carousel (카드뉴스): 8 tools
|
|
6
6
|
* - Shorts (숏츠): 9 tools
|
|
7
7
|
* - Blog (블로그): 4 tools
|
|
8
|
-
* -
|
|
8
|
+
* - Content Ideation (대량기획): 4 tools
|
|
9
|
+
* - Persona Helper (페르소나): 5 tools
|
|
10
|
+
* - Publishing (예약발행)
|
|
9
11
|
* - Analytics (데이터분석): 5 tools
|
|
10
12
|
*/
|
|
11
13
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
@@ -14,6 +16,8 @@ import { SSEClient } from './client/sse-client.js';
|
|
|
14
16
|
import { registerCarouselTools } from './tools/carousel.js';
|
|
15
17
|
import { registerShortsTools } from './tools/shorts.js';
|
|
16
18
|
import { registerBlogTools } from './tools/blog.js';
|
|
19
|
+
import { registerContentIdeationTools } from './tools/content-ideation.js';
|
|
20
|
+
import { registerPersonaTools } from './tools/persona.js';
|
|
17
21
|
import { registerPublishingTools } from './tools/publishing.js';
|
|
18
22
|
import { registerAnalyticsTools } from './tools/analytics.js';
|
|
19
23
|
import { registerDmAutomationTools } from './tools/dm-automation.js';
|
|
@@ -25,8 +29,10 @@ const MIRRA_SERVER_INSTRUCTIONS = [
|
|
|
25
29
|
'For carousel editing, use /{locale}/carousel-lab/create/{generationId}.',
|
|
26
30
|
'For shorts editing, use /{locale}/shorts-lab/create/{generationId}.',
|
|
27
31
|
'For longform blog editing, use /{locale}/ai/longform/{longformId}.',
|
|
32
|
+
'For bulk idea planning and generated social post drafts, use /{locale}/ai/bulk-generate.',
|
|
33
|
+
'For social-account persona settings, helper analysis, and knowledge-base review, use /{locale}/social-accounts/{accountId}.',
|
|
28
34
|
].join('\n');
|
|
29
|
-
export function createMirraServer(config) {
|
|
35
|
+
export function createMirraServer(config, options = {}) {
|
|
30
36
|
const server = new McpServer({
|
|
31
37
|
name: 'mirra',
|
|
32
38
|
version: '0.1.0',
|
|
@@ -39,7 +45,11 @@ export function createMirraServer(config) {
|
|
|
39
45
|
registerCarouselTools(server, api, sse);
|
|
40
46
|
registerShortsTools(server, api);
|
|
41
47
|
registerBlogTools(server, api);
|
|
42
|
-
|
|
48
|
+
registerContentIdeationTools(server, api);
|
|
49
|
+
registerPersonaTools(server, api);
|
|
50
|
+
registerPublishingTools(server, api, {
|
|
51
|
+
enableMediaUpload: options.enableLocalFileTools ?? true,
|
|
52
|
+
});
|
|
43
53
|
registerAnalyticsTools(server, api);
|
|
44
54
|
registerDmAutomationTools(server, api);
|
|
45
55
|
return server;
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAGpE,MAAM,yBAAyB,GAAG;IAChC,6FAA6F;IAC7F,gHAAgH;IAChH,sHAAsH;IACtH,iEAAiE;IACjE,yEAAyE;IACzE,qEAAqE;IACrE,oEAAoE;IACpE,0FAA0F;IAC1F,6HAA6H;CAC9H,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAMZ,MAAM,UAAU,iBAAiB,CAAC,MAAmB,EAAE,UAA8B,EAAE;IACrF,MAAM,MAAM,GAAG,IAAI,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|
1
|
+
{"version":3,"file":"tool-contracts.d.ts","sourceRoot":"","sources":["../src/tool-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtI,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,CAAC,CAAC,YAAY,CAAA;CACvB;AAwDD,eAAO,MAAM,uBAAuB,EAAE,oBAAoB,EA+uBzD,CAAA;AAMD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,wBAQnD"}
|
package/dist/tool-contracts.js
CHANGED
|
@@ -1,9 +1,61 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
const OUTPUT_LANGUAGE_CODES = ['auto', 'ko', 'en', 'ja', 'zh', 'es', 'fr', 'de', 'pt', 'ar'];
|
|
3
|
+
const mediaOrderItemSchema = z.object({
|
|
4
|
+
type: z.enum(['image', 'video']).describe('Media bucket type'),
|
|
5
|
+
index: z.number().int().min(0).describe('Zero-based index inside images or videos array'),
|
|
6
|
+
});
|
|
7
|
+
const tiktokOptionsSchema = z.object({
|
|
8
|
+
privacyLevel: z.enum(['PUBLIC_TO_EVERYONE', 'MUTUAL_FOLLOW_FRIENDS', 'FOLLOWER_OF_CREATOR', 'SELF_ONLY']).nullable().optional().describe('TikTok privacy level. Prefer values returned by the creator-info endpoint in the app.'),
|
|
9
|
+
disableComment: z.boolean().optional().describe('Disable TikTok comments'),
|
|
10
|
+
disableDuet: z.boolean().optional().describe('Disable TikTok duet'),
|
|
11
|
+
disableStitch: z.boolean().optional().describe('Disable TikTok stitch'),
|
|
12
|
+
brandContentToggle: z.boolean().optional().describe('TikTok branded content disclosure toggle'),
|
|
13
|
+
brandOrganicToggle: z.boolean().optional().describe('TikTok branded organic disclosure toggle'),
|
|
14
|
+
commercialContentEnabled: z.boolean().optional().describe('Commercial content flag used by the app UI'),
|
|
15
|
+
autoAddMusic: z.boolean().optional().describe('TikTok photo mode: auto-add music'),
|
|
16
|
+
photoCoverIndex: z.number().int().min(0).optional().describe('TikTok photo/card-news cover image index. Zero-based index into images array.'),
|
|
17
|
+
photoTitle: z.string().max(90).optional().describe('TikTok photo mode title, max 90 characters'),
|
|
18
|
+
tiktokPostMode: z.enum(['DIRECT_POST', 'MEDIA_UPLOAD']).optional().describe('TikTok post mode. DIRECT_POST publishes; MEDIA_UPLOAD sends to inbox/draft where supported.'),
|
|
19
|
+
}).optional().describe('TikTok-specific publish options. For card-news/photo posts, use photoCoverIndex to choose the thumbnail/cover.');
|
|
20
|
+
const instagramOptionsSchema = z.object({
|
|
21
|
+
collaboratorTags: z.array(z.string()).max(3).optional().describe('Instagram collaborator usernames, max 3'),
|
|
22
|
+
locationId: z.string().nullable().optional().describe('Instagram/Facebook place ID for feed posts'),
|
|
23
|
+
locationName: z.string().nullable().optional().describe('Location display name for UI reference'),
|
|
24
|
+
firstComment: z.string().nullable().optional().describe('First comment to publish after Instagram media publish'),
|
|
25
|
+
}).optional().describe('Instagram-specific publish options.');
|
|
26
|
+
const contentIdeaStatusSchema = z.enum(['pending', 'generated', 'completed', 'rejected']);
|
|
27
|
+
const contentPipelineStyleSchema = z.enum([
|
|
28
|
+
'experiential',
|
|
29
|
+
'informational',
|
|
30
|
+
'informational_internal',
|
|
31
|
+
'informational_trend',
|
|
32
|
+
'promotional',
|
|
33
|
+
'interactive',
|
|
34
|
+
'personal',
|
|
35
|
+
'announcement',
|
|
36
|
+
]).or(z.string());
|
|
37
|
+
const personaContentLengthSchema = z.enum(['extra-short', 'short', 'medium', 'long', 'extra-long']);
|
|
38
|
+
const personaPlatformSchema = z.enum(['threads', 'instagram', 'instagram_fb', 'twitter']);
|
|
39
|
+
const personaMixSourceSchema = z.object({
|
|
40
|
+
platform: personaPlatformSchema.optional().describe('Platform to benchmark. Required with handle for account-based sources.'),
|
|
41
|
+
handle: z.string().min(1).optional().describe('Public account handle to benchmark. Required with platform for account-based sources.'),
|
|
42
|
+
manualPosts: z.array(z.string().min(1)).min(3).optional().describe('At least three example posts for a manual source.'),
|
|
43
|
+
preAnalyzed: z.object({
|
|
44
|
+
concept: z.string().min(1),
|
|
45
|
+
targetAudience: z.string().min(1),
|
|
46
|
+
writingStyle: z.string().optional(),
|
|
47
|
+
}).optional().describe('Already analyzed persona source.'),
|
|
48
|
+
label: z.string().optional().describe('Optional human-readable label for this source.'),
|
|
49
|
+
});
|
|
50
|
+
const platformPublishFieldsSchema = {
|
|
51
|
+
videoThumbnails: z.array(z.string().url()).optional().describe('Custom video thumbnail image URLs. Instagram Reels uses the first URL as cover_url; YouTube also uses the first URL.'),
|
|
52
|
+
tiktokOptions: tiktokOptionsSchema,
|
|
53
|
+
instagramOptions: instagramOptionsSchema,
|
|
54
|
+
};
|
|
3
55
|
export const SHARED_TOOL_DEFINITIONS = [
|
|
4
56
|
{
|
|
5
57
|
name: 'media_upload',
|
|
6
|
-
description: 'Upload a local image, video, audio, or font file to Mirra storage. Returns a public URL that can be used in post_create images/videos or threadParts images.',
|
|
58
|
+
description: 'Upload a local image, video, audio, or font file to Mirra storage. Returns a public URL that can be used in post_create images/videos/videoThumbnails or threadParts images.',
|
|
7
59
|
category: 'media',
|
|
8
60
|
schema: z.object({
|
|
9
61
|
filePath: z.string().min(1).describe('Absolute or relative local file path accessible to this MCP server'),
|
|
@@ -41,6 +93,70 @@ export const SHARED_TOOL_DEFINITIONS = [
|
|
|
41
93
|
verbose: z.preprocess((v) => (typeof v === 'string' ? v === 'true' : v), z.boolean().default(false)).describe('Return full profile (writingStyle, userPrompt, tokens). Default false returns only id/username/platform/displayName.'),
|
|
42
94
|
}),
|
|
43
95
|
},
|
|
96
|
+
{
|
|
97
|
+
name: 'persona_get',
|
|
98
|
+
description: 'Get the current persona/settings for a connected social account, optionally including persona-helper knowledge-base data.',
|
|
99
|
+
category: 'social',
|
|
100
|
+
schema: z.object({
|
|
101
|
+
accountId: z.string().min(1).describe('Social account ID'),
|
|
102
|
+
includeKnowledge: z.boolean().default(true).describe('Also return knowledge-base/persona learning records for this account'),
|
|
103
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'persona_update',
|
|
108
|
+
description: 'Directly overwrite persona settings for a connected social account. Uses the same account settings API as the app.',
|
|
109
|
+
category: 'social',
|
|
110
|
+
schema: z.object({
|
|
111
|
+
accountId: z.string().min(1).describe('Social account ID'),
|
|
112
|
+
concept: z.string().nullable().optional().describe('Account persona concept'),
|
|
113
|
+
targetAudience: z.string().nullable().optional().describe('Target audience'),
|
|
114
|
+
language: z.string().optional().describe('Output/persona language label'),
|
|
115
|
+
contentLength: personaContentLengthSchema.optional().describe('Default content length'),
|
|
116
|
+
referencePosts: z.array(z.string()).nullable().optional().describe('Reference post examples used by generation'),
|
|
117
|
+
userPrompt: z.string().nullable().optional().describe('Extra generation instructions'),
|
|
118
|
+
writingStyle: z.string().nullable().optional().describe('Writing style/persona voice'),
|
|
119
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'persona_own_posts',
|
|
124
|
+
description: 'Analyze the current account’s own historical posts using the persona helper. This mirrors the app helper and does not decrement quota.',
|
|
125
|
+
category: 'social',
|
|
126
|
+
schema: z.object({
|
|
127
|
+
accountId: z.string().min(1).describe('Social account ID'),
|
|
128
|
+
apply: z.boolean().default(false).describe('Apply the analyzed persona to account settings after analysis'),
|
|
129
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'persona_copy',
|
|
134
|
+
description: 'Benchmark/copy a persona from a public account or manual example posts using the persona helper. Uses the same quota path as the app helper.',
|
|
135
|
+
category: 'social',
|
|
136
|
+
schema: z.object({
|
|
137
|
+
accountId: z.string().min(1).describe('Social account ID'),
|
|
138
|
+
platform: personaPlatformSchema.optional().describe('Benchmark source platform. Required with handle for account-based benchmarking.'),
|
|
139
|
+
handle: z.string().min(1).optional().describe('Public handle to benchmark. Required with platform for account-based benchmarking.'),
|
|
140
|
+
manualPosts: z.array(z.string().min(1)).min(3).optional().describe('At least three posts to benchmark manually instead of platform/handle.'),
|
|
141
|
+
disclaimerAccepted: z.boolean().default(true).describe('Must be true to confirm the helper disclaimer for public/manual persona benchmarking.'),
|
|
142
|
+
apply: z.boolean().default(false).describe('Apply the generated persona to account settings after benchmarking'),
|
|
143
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
144
|
+
}),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'persona_mix',
|
|
148
|
+
description: 'Mix 2-3 persona sources through the persona helper. Uses the same final mix quota path as the app helper.',
|
|
149
|
+
category: 'social',
|
|
150
|
+
schema: z.object({
|
|
151
|
+
accountId: z.string().min(1).describe('Social account ID'),
|
|
152
|
+
sources: z.array(personaMixSourceSchema).min(2).max(3).describe('Two or three account, manual-post, or pre-analyzed persona sources'),
|
|
153
|
+
mixStrategy: z.enum(['balanced', 'primary_enhanced', 'best_of_each', 'creative_fusion']).default('balanced'),
|
|
154
|
+
userGuidance: z.string().optional().describe('Optional direction for how the sources should be combined'),
|
|
155
|
+
disclaimerAccepted: z.boolean().default(true).describe('Must be true to confirm the helper disclaimer for persona mixing.'),
|
|
156
|
+
apply: z.boolean().default(false).describe('Apply the mixed persona to account settings after generation'),
|
|
157
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
158
|
+
}),
|
|
159
|
+
},
|
|
44
160
|
{
|
|
45
161
|
name: 'post_create',
|
|
46
162
|
description: 'Create a new post draft. Supports text, images, and videos for any connected social platform.',
|
|
@@ -50,10 +166,10 @@ export const SHARED_TOOL_DEFINITIONS = [
|
|
|
50
166
|
socialAccountId: z.string().describe('Social account ID to post from'),
|
|
51
167
|
images: z.array(z.string()).optional().describe('Array of image URLs'),
|
|
52
168
|
videos: z.array(z.string()).optional().describe('Array of video URLs'),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
169
|
+
videoThumbnails: platformPublishFieldsSchema.videoThumbnails,
|
|
170
|
+
mediaOrder: z.array(mediaOrderItemSchema).optional().describe('Display/publish order for mixed image/video posts. Example: [{type:"image",index:0},{type:"video",index:0},{type:"image",index:1}]. Post edit will show this order.'),
|
|
171
|
+
tiktokOptions: platformPublishFieldsSchema.tiktokOptions,
|
|
172
|
+
instagramOptions: platformPublishFieldsSchema.instagramOptions,
|
|
57
173
|
carouselGenerationId: z.string().optional().describe('Carousel generation ID. If provided and images is empty, the carousel is auto-rendered and its image URLs are used — skips manual carousel_render_images call.'),
|
|
58
174
|
threadParts: z.array(z.object({
|
|
59
175
|
content: z.string().describe('Reply content for the next threaded post'),
|
|
@@ -110,6 +226,27 @@ export const SHARED_TOOL_DEFINITIONS = [
|
|
|
110
226
|
postId: z.string().describe('Post ID to schedule'),
|
|
111
227
|
scheduledFor: z.string().describe('ISO 8601 datetime for scheduled publish (e.g., 2026-03-25T09:00:00Z)'),
|
|
112
228
|
scheduledAt: z.string().optional().describe('Deprecated alias for scheduledFor'),
|
|
229
|
+
videoThumbnails: platformPublishFieldsSchema.videoThumbnails,
|
|
230
|
+
tiktokOptions: platformPublishFieldsSchema.tiktokOptions,
|
|
231
|
+
instagramOptions: platformPublishFieldsSchema.instagramOptions,
|
|
232
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
233
|
+
}),
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'post_update',
|
|
237
|
+
description: 'Update an existing post (content, media, platform publish options, etc.). Only works for draft or scheduled posts.',
|
|
238
|
+
category: 'publishing',
|
|
239
|
+
schema: z.object({
|
|
240
|
+
postId: z.string().describe('Post ID to update'),
|
|
241
|
+
content: z.string().optional().describe('New content text'),
|
|
242
|
+
images: z.array(z.string()).optional().describe('New image URLs (replaces existing)'),
|
|
243
|
+
videos: z.array(z.string()).optional().describe('New video URLs (replaces existing)'),
|
|
244
|
+
videoThumbnails: platformPublishFieldsSchema.videoThumbnails,
|
|
245
|
+
mediaOrder: z.array(mediaOrderItemSchema).optional().describe('New mixed media order. Uses zero-based indexes into images/videos.'),
|
|
246
|
+
tiktokOptions: platformPublishFieldsSchema.tiktokOptions,
|
|
247
|
+
instagramOptions: platformPublishFieldsSchema.instagramOptions,
|
|
248
|
+
socialAccountId: z.string().optional().describe('Change target social account'),
|
|
249
|
+
scheduledAt: z.string().optional().describe('ISO 8601 datetime — update scheduled publish time'),
|
|
113
250
|
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
114
251
|
}),
|
|
115
252
|
},
|
|
@@ -392,6 +529,53 @@ export const SHARED_TOOL_DEFINITIONS = [
|
|
|
392
529
|
locale: z.string().default('en').describe('Editor UI language (en, ko, ja, etc.)'),
|
|
393
530
|
}),
|
|
394
531
|
},
|
|
532
|
+
{
|
|
533
|
+
name: 'content_ideas_generate',
|
|
534
|
+
description: 'Generate content ideas using the same AI idea generation flow as the /ai/bulk-generate page. Supports one or more pipeline styles and returns stored idea IDs.',
|
|
535
|
+
category: 'content',
|
|
536
|
+
schema: z.object({
|
|
537
|
+
accountId: z.string().uuid().describe('Connected social account ID to generate ideas for'),
|
|
538
|
+
pipelines: z.array(contentPipelineStyleSchema).min(1).max(6).default(['experiential']).describe('Bulk-generate pipeline styles to run. Common values: experiential, informational, informational_internal, informational_trend, promotional, interactive.'),
|
|
539
|
+
ideasPerPipeline: z.number().int().min(1).max(10).default(5).describe('Number of ideas to create per pipeline style'),
|
|
540
|
+
searchInput: z.string().optional().describe('Optional search/topic input. Used by informational-style pipelines for external/trend context.'),
|
|
541
|
+
selectedKnowledgeIds: z.array(z.string().uuid()).optional().describe('Optional internal knowledge IDs to use as context'),
|
|
542
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
543
|
+
}),
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'content_ideas_list',
|
|
547
|
+
description: 'List ideas from the bulk-generate board, including generated draft content when present. Use this to inspect pending/generated/completed/rejected planning state.',
|
|
548
|
+
category: 'content',
|
|
549
|
+
schema: z.object({
|
|
550
|
+
accountId: z.string().uuid().optional().describe('Filter by connected social account ID'),
|
|
551
|
+
status: contentIdeaStatusSchema.optional().describe('Filter by idea status'),
|
|
552
|
+
dateFrom: z.string().datetime().optional().describe('ISO 8601 datetime lower bound for idea creation'),
|
|
553
|
+
dateTo: z.string().datetime().optional().describe('ISO 8601 datetime upper bound for idea creation'),
|
|
554
|
+
page: z.number().int().min(1).default(1).describe('Page number'),
|
|
555
|
+
limit: z.number().int().min(1).max(100).default(50).describe('Number of ideas to return'),
|
|
556
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URL (en, ko, ja, etc.)'),
|
|
557
|
+
}),
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
name: 'content_idea_get',
|
|
561
|
+
description: 'Get one bulk-generate idea with its generated main post body, reply/subcomment parts, linked account, knowledge usage, and linked post info when available.',
|
|
562
|
+
category: 'content',
|
|
563
|
+
schema: z.object({
|
|
564
|
+
ideaId: z.string().uuid().describe('Content idea ID'),
|
|
565
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URLs (en, ko, ja, etc.)'),
|
|
566
|
+
}),
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'content_ideas_generate_drafts',
|
|
570
|
+
description: 'Generate post-copy drafts from one or more bulk-generate ideas. Returns the exact mainContent and replyParts that the page shows under each generated idea; optionally persists those drafts as Mirra post drafts.',
|
|
571
|
+
category: 'content',
|
|
572
|
+
schema: z.object({
|
|
573
|
+
ideaIds: z.array(z.string().uuid()).min(1).max(20).describe('Idea IDs to convert into generated post-copy drafts'),
|
|
574
|
+
concurrency: z.number().int().min(1).max(5).default(3).describe('How many idea-to-content generations to run at once'),
|
|
575
|
+
createPostDrafts: z.boolean().default(false).describe('Also create Mirra post drafts from the generated mainContent and replyParts. This may fail for media-required platforms such as Instagram, TikTok, or YouTube unless media is added later.'),
|
|
576
|
+
locale: z.string().default('en').describe('Dashboard UI language for returned URLs (en, ko, ja, etc.)'),
|
|
577
|
+
}),
|
|
578
|
+
},
|
|
395
579
|
{
|
|
396
580
|
name: 'analytics_posts_performance',
|
|
397
581
|
description: 'Get posts performance metrics with optional period comparison (views, likes, replies, reposts, etc.). Default response is slim — use summaryOnly=false, detailLevel=full to get raw data.',
|