corent-mcp 0.5.1 → 0.5.2
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 +23 -9
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -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.5.
|
|
20
|
+
export const SERVER_VERSION = "0.5.2";
|
|
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,7 +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: air=cheapest
|
|
182
|
+
.describe("Quality tier: air=cheapest (best value, not the quickest), lite=everyday, premium=production, pro=advanced, max_pro=maximum fidelity (flagship models). Omit for a sensible default."),
|
|
183
183
|
style: z
|
|
184
184
|
.enum(["photorealistic", "artistic", "anime", "logo", "text_focused"])
|
|
185
185
|
.optional()
|
|
@@ -201,7 +201,7 @@ export function createCorentServer(config = {}) {
|
|
|
201
201
|
tier: z
|
|
202
202
|
.enum(["air", "lite", "premium", "pro", "max_pro"])
|
|
203
203
|
.optional()
|
|
204
|
-
.describe("Quality tier: air=cheapest
|
|
204
|
+
.describe("Quality tier: air=cheapest (best value, not the quickest), lite=everyday, premium=production, pro=advanced, max_pro=maximum fidelity (flagship models). Omit for a sensible default."),
|
|
205
205
|
aspect_ratio: z.enum(["16:9", "9:16", "1:1"]).default("16:9"),
|
|
206
206
|
duration_s: z.number().int().min(1).max(30).optional().describe("Requested duration in seconds"),
|
|
207
207
|
resolution: z
|
|
@@ -218,7 +218,7 @@ export function createCorentServer(config = {}) {
|
|
|
218
218
|
})));
|
|
219
219
|
server.registerTool("generate_speech", {
|
|
220
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
|
|
221
|
+
description: "Generate spoken audio (text to speech) from text. Synchronous: returns the finished audio URL and the exact charge. Billed in started blocks of 1,000 input characters, so even a one-sentence request bills the full first block (roughly 25-30 cents); longer scripts amortize better. Failed generations are never billed.",
|
|
222
222
|
inputSchema: {
|
|
223
223
|
text: z.string().min(1).max(5000).describe("The text to speak, max 5000 characters"),
|
|
224
224
|
voice_id: z
|
|
@@ -258,7 +258,12 @@ export function createCorentServer(config = {}) {
|
|
|
258
258
|
title: "Check service status",
|
|
259
259
|
description: "Get live operational status of Corent's generation tiers (operational/degraded). Read-only and free; useful to pick a healthy tier.",
|
|
260
260
|
inputSchema: {},
|
|
261
|
-
|
|
261
|
+
// /v1/status returns tiers as an ARRAY of {name, status} — declaring it
|
|
262
|
+
// as a record made every call fail output validation (audit 2026-07-20).
|
|
263
|
+
outputSchema: {
|
|
264
|
+
status: z.string().optional(),
|
|
265
|
+
tiers: z.array(z.object({ name: z.string(), status: z.string() }).passthrough()).optional(),
|
|
266
|
+
},
|
|
262
267
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
263
268
|
}, wrap(async () => corent("/v1/status")));
|
|
264
269
|
// --- Intent tools: Corent's differentiator. Describe what you want in plain
|
|
@@ -298,9 +303,18 @@ export function createCorentServer(config = {}) {
|
|
|
298
303
|
message: z.string().nullable().optional(),
|
|
299
304
|
},
|
|
300
305
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
301
|
-
}, wrap(async ({ intent, max_cost_cents }) =>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
}, wrap(async ({ intent, max_cost_cents }) => {
|
|
307
|
+
const res = await corent("/v1/intent/execute", {
|
|
308
|
+
method: "POST",
|
|
309
|
+
body: JSON.stringify({ intent, confirm_estimated_cost_cents_up_to: max_cost_cents }),
|
|
310
|
+
});
|
|
311
|
+
// The API names the ceiling confirm_estimated_cost_cents_up_to; this tool
|
|
312
|
+
// exposes it as max_cost_cents. Translate the over-ceiling message so the
|
|
313
|
+
// agent is told to raise a parameter that actually exists here.
|
|
314
|
+
if (res && typeof res.message === "string") {
|
|
315
|
+
res.message = res.message.replace("confirm_estimated_cost_cents_up_to", "max_cost_cents");
|
|
316
|
+
}
|
|
317
|
+
return res;
|
|
318
|
+
}));
|
|
305
319
|
return server;
|
|
306
320
|
}
|
package/package.json
CHANGED