@marlinjai/studio-mcp 0.13.0 → 0.14.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/README.md CHANGED
@@ -91,6 +91,7 @@ The token is held in memory only. It is never logged, never serialized into a re
91
91
  | `studio_get_job` | Read a job's status, cost, error and fresh result URL; `wait=true` blocks until terminal. |
92
92
  | `studio_list_characters` | List the characters the key can use: its company's own, plus the ones another company shared with everyone (`owned: false`, usable in generations, read-only). A slug is unique within one company. |
93
93
  | `studio_get_character` | One character with its frozen reference images (category + URL). For a character the company owns the URL is a direct image URL; for one another company shared (`owned: false`) it is a Studio address that works unchanged as an image input to any Studio tool, is not a public image URL, and stops working when the owner stops sharing. |
94
+ | `studio_prompt_enhance` | Rewrite a short prompt into a richer one for an image or video model (subject, setting, light, lens, composition; for video the camera movement), in the prompt's language, without changing what it asks for. Mentions travel as tokens (`@[character:<slug>]`, `@[product:<slug>]`, `@[location:<slug>]`) listed in `mentions`, and the rewrite keeps each exactly once. Free for the company, limited per key and per company per day (`429` with the wait in the error text). Generates nothing. |
94
95
  | `studio_create_character` | Create an empty character record (for your own references). Requires `likenessRightsConfirmed: true`. |
95
96
  | `studio_mint_character` | Run the curated character-sheet workflow inline, wait, create the character, upload the 7 views as references. Requires `likenessRightsConfirmed: true` and refuses before the run starts without it. Returns `slug`, `referenceCount`, `costUsd`, `runId`. |
96
97
  | `studio_create_brand` | Create a brand (style prefix + context). |
package/dist/cli.js CHANGED
@@ -228,6 +228,15 @@ var StudioClient = class {
228
228
  getCharacter(slug2) {
229
229
  return this.json("GET", `/api/characters/${encodeURIComponent(slug2)}`);
230
230
  }
231
+ // ── Prompts ──
232
+ /**
233
+ * Enhance: the prompt rewritten into a richer one for an image or video
234
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
235
+ * Free for the company, limited per key (429 with the wait in `error`).
236
+ */
237
+ enhancePrompt(body) {
238
+ return this.json("POST", "/api/v1/prompts/enhance", { json: body });
239
+ }
231
240
  createCharacter(body) {
232
241
  return this.json("POST", "/api/characters", { json: body });
233
242
  }
@@ -7138,6 +7147,35 @@ var studioGetCharacter = defineTool({
7138
7147
  return { character };
7139
7148
  }
7140
7149
  });
7150
+ var studioPromptEnhance = defineTool({
7151
+ name: "studio_prompt_enhance",
7152
+ description: "Rewrite a short prompt into a richer one an image or video model renders well: subject, setting, light, lens and composition (for video also the camera movement and the action over the shot), in the language of the prompt, without changing what it asks for. Free for your company (nothing is charged, no job is created), but limited per API key over a few minutes and per company per day: past either it answers an error that says when to try again, so wait that long rather than retrying. A person, product or place of your company goes into the prompt as a mention token, `@[character:<slug>]`, `@[product:<slug>]` or `@[location:<slug>]` (slugs from studio_list_characters, GET /api/products, GET /api/locations), and every token must also be listed in `mentions`; the rewrite keeps each token exactly once, so pass the returned prompt and mentions on unchanged. A mention or brandSlug your company cannot use is refused with 404 input_not_found. With brandSlug the rewrite follows the brand's style guide without copying it (studio_generate_image applies it again). Nothing is generated: pass the returned prompt and mentions unchanged to studio_generate_image as its prompt and mentions.",
7153
+ inputSchema: {
7154
+ prompt: z11.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
7155
+ target: z11.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
7156
+ mentions: z11.array(
7157
+ z11.object({
7158
+ kind: z11.enum(["character", "product", "location"]),
7159
+ id: slug.describe("The slug, exactly as the token in the prompt carries it."),
7160
+ name: z11.string().max(200).optional()
7161
+ })
7162
+ ).max(10).optional().describe("Every mention token of the prompt (at most 10). The returned mentions carry the names your company gave them."),
7163
+ model: z11.string().optional().describe('Optional. The image or video model the prompt will be rendered with (e.g. "kie/nano-banana-2"), so the rewrite suits it. It must make the target.'),
7164
+ brandSlug: slug.optional().describe("Optional. A brand of your company whose style the rewrite should follow."),
7165
+ brandMode: z11.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
7166
+ },
7167
+ annotations: { readOnlyHint: true },
7168
+ handler: async (args, ctx) => {
7169
+ return ctx.client.enhancePrompt({
7170
+ prompt: args.prompt,
7171
+ target: args.target,
7172
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
7173
+ ...args.model ? { model: args.model } : {},
7174
+ ...args.brandSlug ? { brandSlug: args.brandSlug } : {},
7175
+ ...args.brandMode ? { brandMode: args.brandMode } : {}
7176
+ });
7177
+ }
7178
+ });
7141
7179
  var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
7142
7180
  var likenessRightsConfirmed = z11.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7143
7181
  function assertLikenessRightsConfirmed(value) {
@@ -7548,6 +7586,7 @@ var TOOLS = [
7548
7586
  studioGetJob,
7549
7587
  studioListCharacters,
7550
7588
  studioGetCharacter,
7589
+ studioPromptEnhance,
7551
7590
  studioCreateCharacter,
7552
7591
  studioMintCharacter,
7553
7592
  studioCreateBrand,
@@ -7633,7 +7672,7 @@ function registerTools(server, base) {
7633
7672
 
7634
7673
  // src/server.ts
7635
7674
  var SERVER_NAME = "lumitra-studio";
7636
- var SERVER_VERSION = "0.13.0";
7675
+ var SERVER_VERSION = "0.14.0";
7637
7676
  function createStudioMcpServer(opts = {}) {
7638
7677
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7639
7678
  const client = new StudioClient(config, {
package/dist/index.d.ts CHANGED
@@ -1326,6 +1326,25 @@ interface GenerateImageResponse {
1326
1326
  candidates?: CandidatePlan;
1327
1327
  notice?: string;
1328
1328
  }
1329
+ /** One @ mention of a prompt: a character, product or location of the company, by slug. */
1330
+ interface PromptMention {
1331
+ kind: 'character' | 'product' | 'location';
1332
+ /** The slug, as the prompt's token `@[kind:slug]` carries it. */
1333
+ id: string;
1334
+ name?: string;
1335
+ }
1336
+ interface EnhancePromptRequest {
1337
+ prompt: string;
1338
+ target: 'image' | 'video';
1339
+ mentions?: PromptMention[];
1340
+ model?: string;
1341
+ brandSlug?: string;
1342
+ brandMode?: string;
1343
+ }
1344
+ interface EnhancePromptResponse {
1345
+ prompt: string;
1346
+ mentions: Array<Required<PromptMention>>;
1347
+ }
1329
1348
  interface CharacterSummary {
1330
1349
  /** Unique within the key's company, not across companies. */
1331
1350
  slug: string;
@@ -1725,6 +1744,12 @@ declare class StudioClient {
1725
1744
  [k: string]: unknown;
1726
1745
  };
1727
1746
  }>;
1747
+ /**
1748
+ * Enhance: the prompt rewritten into a richer one for an image or video
1749
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
1750
+ * Free for the company, limited per key (429 with the wait in `error`).
1751
+ */
1752
+ enhancePrompt(body: EnhancePromptRequest): Promise<EnhancePromptResponse>;
1728
1753
  createCharacter(body: {
1729
1754
  name: string;
1730
1755
  slug: string;
@@ -2086,7 +2111,7 @@ declare function registerTools(server: McpServer, base: ToolContext): void;
2086
2111
  */
2087
2112
 
2088
2113
  declare const SERVER_NAME = "lumitra-studio";
2089
- declare const SERVER_VERSION = "0.13.0";
2114
+ declare const SERVER_VERSION = "0.14.0";
2090
2115
  interface CreateServerOptions {
2091
2116
  config?: StudioConfig;
2092
2117
  env?: NodeJS.ProcessEnv;
@@ -3454,4 +3479,4 @@ declare function parseArgs(argv: string[]): CliArgs;
3454
3479
  declare function createHttpHandler(): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
3455
3480
  declare function main(argv?: string[]): Promise<void>;
3456
3481
 
3457
- export { type AllTenantsUsageResponse, type AssetReference, type AssetUsage, type Binding, type BrandKitResponse, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CampaignContents, type CampaignListing, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, type CompositionRecord, type CompositionSummary, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectAsset, type ProjectContents, type ProjectSummary, type Projection, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SavedWorkflowListing, type SocialProjectSummary, type SocialSendView, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };
3482
+ export { type AllTenantsUsageResponse, type AssetReference, type AssetUsage, type Binding, type BrandKitResponse, CHARACTER_SHEET_DEFINITION, CHARACTER_SHEET_NODES, type CampaignContents, type CampaignListing, type CandidatePlan, type CharacterReference, type CharacterSummary, type CharacterSwapInput, type CompositionRecord, type CompositionSummary, ConfigError, ContractError, type CreateServerOptions, DEFAULT_BASE_URL, DEFAULT_MOTION_PROMPT, DEFAULT_SWAP_EDIT_MODEL, DEFAULT_SWAP_PROMPT, DEFAULT_SWAP_VIDEO_MODEL, DEFAULT_TIMEOUT_MS, type DocumentSummary, type EnhancePromptRequest, type EnhancePromptResponse, type FetchLike, type GenerateImageResponse, type JobResponse, type JobStatus, type JudgeCandidate, MINT_REFERENCE_CATEGORIES, type NodeResultResponse, type NodeRun, type NodeStatus, type NodeSummary, type NodeTypesResponse, type PollOptions, PollTimeoutError, type ProjectAsset, type ProjectContents, type ProjectSummary, type Projection, type PromptMention, type RemovedNode, type RunResponse, type RunStartResponse, type RunStatus, SERVER_NAME, SERVER_VERSION, SUMMARY_TEXT_CHARS, SWAP_SCOPES, type SavedWorkflowListing, type SocialProjectSummary, type SocialSendView, type SpendLedger, StudioApiError, StudioClient, type StudioClientOptions, type StudioConfig, type StudioMcp, type SummaryMeta, type SwapPromptOptions, type SwapScope, TOOLS, TOOL_NAMES, type TaskDescriptor, type TenantSpendSummary, type TenantUsageResponse, type ToolContext, type ToolDef, ToolInputError, type ToolResult, type TurnaroundView, type UploadFile, type UsageByModel, type UsageResponse, WORKFLOW_TOOLS, type WorkflowApplyResponse, type WorkflowCreateResponse, type WorkflowDefinition, type WorkflowDocumentResponse, type WorkflowNode, type WorkflowValidateResponse, affectedNodes, buildCharacterSheetParams, buildCharacterSwapDefinition, categoryForNode, characterSheetDefinition, composeSwapPrompt, createHttpHandler, createStudioMcpServer, extensionForMime, filenameFromUrl, invokeTool, main, mimeForFilename, parseArgs, parseDocument, parseOps, pollUntil, projectionOf, redactSecret, registerTools, resolveConfig, seedFacePrompt, studioWorkflowApply, studioWorkflowCreate, studioWorkflowDescribe, studioWorkflowGet, studioWorkflowScreenshot, studioWorkflowValidate, summarizeDocument, summarizeNode, touchedNodeIds, turnaroundViewPrompt, waitForJob, waitForRun };
package/dist/index.js CHANGED
@@ -175,6 +175,15 @@ var StudioClient = class {
175
175
  getCharacter(slug2) {
176
176
  return this.json("GET", `/api/characters/${encodeURIComponent(slug2)}`);
177
177
  }
178
+ // ── Prompts ──
179
+ /**
180
+ * Enhance: the prompt rewritten into a richer one for an image or video
181
+ * model, every mention token (`@[character:<slug>]`) kept exactly once.
182
+ * Free for the company, limited per key (429 with the wait in `error`).
183
+ */
184
+ enhancePrompt(body) {
185
+ return this.json("POST", "/api/v1/prompts/enhance", { json: body });
186
+ }
178
187
  createCharacter(body) {
179
188
  return this.json("POST", "/api/characters", { json: body });
180
189
  }
@@ -7133,6 +7142,35 @@ var studioGetCharacter = defineTool({
7133
7142
  return { character };
7134
7143
  }
7135
7144
  });
7145
+ var studioPromptEnhance = defineTool({
7146
+ name: "studio_prompt_enhance",
7147
+ description: "Rewrite a short prompt into a richer one an image or video model renders well: subject, setting, light, lens and composition (for video also the camera movement and the action over the shot), in the language of the prompt, without changing what it asks for. Free for your company (nothing is charged, no job is created), but limited per API key over a few minutes and per company per day: past either it answers an error that says when to try again, so wait that long rather than retrying. A person, product or place of your company goes into the prompt as a mention token, `@[character:<slug>]`, `@[product:<slug>]` or `@[location:<slug>]` (slugs from studio_list_characters, GET /api/products, GET /api/locations), and every token must also be listed in `mentions`; the rewrite keeps each token exactly once, so pass the returned prompt and mentions on unchanged. A mention or brandSlug your company cannot use is refused with 404 input_not_found. With brandSlug the rewrite follows the brand's style guide without copying it (studio_generate_image applies it again). Nothing is generated: pass the returned prompt and mentions unchanged to studio_generate_image as its prompt and mentions.",
7148
+ inputSchema: {
7149
+ prompt: z11.string().min(1).max(4e3).describe("The prompt to rewrite, mention tokens included."),
7150
+ target: z11.enum(["image", "video"]).default("image").describe('What the prompt is for: "image" (default) or "video".'),
7151
+ mentions: z11.array(
7152
+ z11.object({
7153
+ kind: z11.enum(["character", "product", "location"]),
7154
+ id: slug.describe("The slug, exactly as the token in the prompt carries it."),
7155
+ name: z11.string().max(200).optional()
7156
+ })
7157
+ ).max(10).optional().describe("Every mention token of the prompt (at most 10). The returned mentions carry the names your company gave them."),
7158
+ model: z11.string().optional().describe('Optional. The image or video model the prompt will be rendered with (e.g. "kie/nano-banana-2"), so the rewrite suits it. It must make the target.'),
7159
+ brandSlug: slug.optional().describe("Optional. A brand of your company whose style the rewrite should follow."),
7160
+ brandMode: z11.string().optional().describe('Optional brand mode (e.g. "hero"). Only meaningful with brandSlug.')
7161
+ },
7162
+ annotations: { readOnlyHint: true },
7163
+ handler: async (args, ctx) => {
7164
+ return ctx.client.enhancePrompt({
7165
+ prompt: args.prompt,
7166
+ target: args.target,
7167
+ ...args.mentions && args.mentions.length > 0 ? { mentions: args.mentions } : {},
7168
+ ...args.model ? { model: args.model } : {},
7169
+ ...args.brandSlug ? { brandSlug: args.brandSlug } : {},
7170
+ ...args.brandMode ? { brandMode: args.brandMode } : {}
7171
+ });
7172
+ }
7173
+ });
7136
7174
  var LIKENESS_REFUSAL = `${LIKENESS_CONFIRMATION_REQUIRED_CODE}: ${likenessConfirmationRequiredMessage()}`;
7137
7175
  var likenessRightsConfirmed = z11.literal(true, { error: LIKENESS_REFUSAL }).describe(likenessConfirmationToolDescription());
7138
7176
  function assertLikenessRightsConfirmed(value) {
@@ -7543,6 +7581,7 @@ var TOOLS = [
7543
7581
  studioGetJob,
7544
7582
  studioListCharacters,
7545
7583
  studioGetCharacter,
7584
+ studioPromptEnhance,
7546
7585
  studioCreateCharacter,
7547
7586
  studioMintCharacter,
7548
7587
  studioCreateBrand,
@@ -7628,7 +7667,7 @@ function registerTools(server, base) {
7628
7667
 
7629
7668
  // src/server.ts
7630
7669
  var SERVER_NAME = "lumitra-studio";
7631
- var SERVER_VERSION = "0.13.0";
7670
+ var SERVER_VERSION = "0.14.0";
7632
7671
  function createStudioMcpServer(opts = {}) {
7633
7672
  const config = opts.config ?? resolveConfig(opts.env ?? process.env);
7634
7673
  const client = new StudioClient(config, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/studio-mcp",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "private": false,
5
5
  "description": "Model Context Protocol (MCP) server over the Lumitra Studio HTTP API: generate images, mint characters, run workflows, swap characters into video.",
6
6
  "license": "MIT",