corent-mcp 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9,13 +9,14 @@
9
9
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
10
10
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
11
  import { z } from "zod";
12
- const API_URL = process.env.CORENT_API_URL ?? "https://corent-api.fly.dev";
12
+ const API_URL = process.env.CORENT_API_URL ?? "https://api.corent.tech";
13
13
  const API_KEY = process.env.CORENT_API_KEY;
14
- if (!API_KEY) {
15
- console.error("CORENT_API_KEY environment variable is required. Get a key at https://corent.tech");
16
- process.exit(1);
17
- }
18
14
  async function corent(path, init) {
15
+ // Key is enforced here (at call time) rather than at startup, so the server
16
+ // can advertise its tools to catalogs/agents without a key configured.
17
+ if (!API_KEY) {
18
+ throw new Error("CORENT_API_KEY is not set. Get a key at https://corent.tech and add it to your MCP client config.");
19
+ }
19
20
  const res = await fetch(`${API_URL}${path}`, {
20
21
  ...init,
21
22
  headers: {
@@ -33,7 +34,7 @@ async function corent(path, init) {
33
34
  function textResult(data) {
34
35
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
35
36
  }
36
- const server = new McpServer({ name: "corent", version: "0.2.1" });
37
+ const server = new McpServer({ name: "corent", version: "0.2.2" });
37
38
  server.tool("generate_image", "Generate an image from a text prompt. Returns a permanent public URL. Synchronous: typically completes in 2-20 seconds. Costs a few cents, billed to the Corent account.", {
38
39
  prompt: z.string().describe("What to generate, in plain language"),
39
40
  preference: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corent-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for the Corent media generation API — give any AI agent the ability to generate images and videos.",
5
5
  "mcpName": "io.github.gg13121/corent-mcp",
6
6
  "license": "MIT",