corent-mcp 0.4.2 → 0.5.1
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/server.js +33 -15
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared Corent MCP server definition — the
|
|
2
|
+
* Shared Corent MCP server definition — the 8 tools, used by both the
|
|
3
3
|
* stdio entrypoint (index.ts, for local `npx` use) and the hosted HTTP
|
|
4
4
|
* entrypoint (http.ts). Keeping the tools in one place means the two
|
|
5
5
|
* transports can never drift apart.
|
|
@@ -17,7 +17,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
import { MEDIA_WIDGET_HTML } from "./widget-html.js";
|
|
19
19
|
export const DEFAULT_API_URL = "https://api.corent.tech";
|
|
20
|
-
export const SERVER_VERSION = "0.
|
|
20
|
+
export const SERVER_VERSION = "0.5.1";
|
|
21
21
|
// --- MCP Apps (SEP-1865): the media tools render an inline widget in hosts
|
|
22
22
|
// that support it (claude.ai web/desktop, others). Hosts without the extension
|
|
23
23
|
// ignore the _meta and fall back to plain text results, so this is additive.
|
|
@@ -179,11 +179,7 @@ export function createCorentServer(config = {}) {
|
|
|
179
179
|
tier: z
|
|
180
180
|
.enum(["air", "lite", "premium", "pro", "max_pro"])
|
|
181
181
|
.optional()
|
|
182
|
-
.describe("Quality tier
|
|
183
|
-
preference: z
|
|
184
|
-
.enum(["fast", "cheap", "quality", "balanced"])
|
|
185
|
-
.default("balanced")
|
|
186
|
-
.describe("What to optimize for; Corent picks the best model tier automatically"),
|
|
182
|
+
.describe("Quality tier: air=cheapest/fastest, lite=everyday, premium=production, pro=advanced, max_pro=maximum fidelity (flagship models). Omit for a sensible default."),
|
|
187
183
|
style: z
|
|
188
184
|
.enum(["photorealistic", "artistic", "anime", "logo", "text_focused"])
|
|
189
185
|
.optional()
|
|
@@ -192,9 +188,9 @@ export function createCorentServer(config = {}) {
|
|
|
192
188
|
},
|
|
193
189
|
outputSchema: imageOutput,
|
|
194
190
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
195
|
-
}, wrap(async ({ prompt, tier,
|
|
191
|
+
}, wrap(async ({ prompt, tier, style, aspect_ratio }) => corent("/v1/images/generate", {
|
|
196
192
|
method: "POST",
|
|
197
|
-
body: JSON.stringify({ prompt, tier,
|
|
193
|
+
body: JSON.stringify({ prompt, tier, style, aspect_ratio }),
|
|
198
194
|
})));
|
|
199
195
|
server.registerTool("generate_video", {
|
|
200
196
|
title: "Generate video",
|
|
@@ -205,21 +201,43 @@ export function createCorentServer(config = {}) {
|
|
|
205
201
|
tier: z
|
|
206
202
|
.enum(["air", "lite", "premium", "pro", "max_pro"])
|
|
207
203
|
.optional()
|
|
208
|
-
.describe("Quality tier
|
|
209
|
-
preference: z.enum(["fast", "cheap", "quality", "balanced"]).default("balanced"),
|
|
204
|
+
.describe("Quality tier: air=cheapest/fastest, lite=everyday, premium=production, pro=advanced, max_pro=maximum fidelity (flagship models). Omit for a sensible default."),
|
|
210
205
|
aspect_ratio: z.enum(["16:9", "9:16", "1:1"]).default("16:9"),
|
|
211
206
|
duration_s: z.number().int().min(1).max(30).optional().describe("Requested duration in seconds"),
|
|
212
207
|
resolution: z
|
|
213
208
|
.enum(["720p", "1080p", "4k"])
|
|
214
209
|
.optional()
|
|
215
|
-
.describe("Pixel resolution (default 720p). Tier-capped:
|
|
210
|
+
.describe("Pixel resolution (default 720p). Tier-capped: pro allows up to 1080p, max_pro up to 4k; above the tier's cap it is clamped down, never rejected. Higher resolutions cost more (1080p ~2.5x, 4k ~5.5x). GET /v1/tiers lists each tier's menu with prices."),
|
|
216
211
|
image_url: z.string().url().optional().describe("If set, animates this image instead of pure text-to-video"),
|
|
217
212
|
},
|
|
218
213
|
outputSchema: jobOutput,
|
|
219
214
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
220
|
-
}, wrap(async ({ prompt, tier,
|
|
215
|
+
}, wrap(async ({ prompt, tier, aspect_ratio, duration_s, resolution, image_url }) => corent("/v1/videos/generate", {
|
|
221
216
|
method: "POST",
|
|
222
|
-
body: JSON.stringify({ prompt, tier,
|
|
217
|
+
body: JSON.stringify({ prompt, tier, aspect_ratio, duration_s, resolution, image_url }),
|
|
218
|
+
})));
|
|
219
|
+
server.registerTool("generate_speech", {
|
|
220
|
+
title: "Generate speech (voice)",
|
|
221
|
+
description: "Generate spoken audio (text to speech) from text. Synchronous: returns the finished audio URL and the exact charge. Billed per 1,000 characters of input text (a few cents for a short narration). Failed generations are never billed.",
|
|
222
|
+
inputSchema: {
|
|
223
|
+
text: z.string().min(1).max(5000).describe("The text to speak, max 5000 characters"),
|
|
224
|
+
voice_id: z
|
|
225
|
+
.string()
|
|
226
|
+
.regex(/^[A-Za-z0-9]{8,64}$/)
|
|
227
|
+
.optional()
|
|
228
|
+
.describe("Optional provider voice id; omit for the default narration voice"),
|
|
229
|
+
},
|
|
230
|
+
outputSchema: {
|
|
231
|
+
id: z.string().optional(),
|
|
232
|
+
status: z.string().optional(),
|
|
233
|
+
audio_url: z.string().optional(),
|
|
234
|
+
meta: mediaMeta.optional(),
|
|
235
|
+
error: z.string().optional(),
|
|
236
|
+
},
|
|
237
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
238
|
+
}, wrap(async ({ text, voice_id }) => corent("/v1/audio/speech", {
|
|
239
|
+
method: "POST",
|
|
240
|
+
body: JSON.stringify({ text, voice_id }),
|
|
223
241
|
})));
|
|
224
242
|
server.registerTool("get_job", {
|
|
225
243
|
title: "Check job status",
|
|
@@ -248,7 +266,7 @@ export function createCorentServer(config = {}) {
|
|
|
248
266
|
// prompt. The agent never picks a model or tier. ---
|
|
249
267
|
server.registerTool("plan", {
|
|
250
268
|
title: "Plan (cost preview, no generation)",
|
|
251
|
-
description: "Preview how Corent would handle a plain-language request WITHOUT generating anything (costs a fraction of a cent). Corent decides whether it's an image or video, which tier, aspect ratio, and duration, and returns the plan plus an estimated cost. Use this to decide or confirm cost before spending. If the request is something Corent can't generate (
|
|
269
|
+
description: "Preview how Corent would handle a plain-language request WITHOUT generating anything (costs a fraction of a cent). Corent decides whether it's an image or video, which tier, aspect ratio, and duration, and returns the plan plus an estimated cost. Use this to decide or confirm cost before spending. The planner covers image and video; for spoken audio call generate_speech directly. If the request is something Corent can't generate (text documents, 3D, editing, real-world actions), can_fulfill is false with a reason.",
|
|
252
270
|
inputSchema: {
|
|
253
271
|
intent: z
|
|
254
272
|
.string()
|
package/package.json
CHANGED