@jurislm/coolify-plugin 3.7.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/.app.json.example +4 -0
- package/.codex-plugin/plugin.json +25 -0
- package/.mcp.json +5 -0
- package/.mcp.json.example +9 -0
- package/LICENSE +21 -0
- package/README.md +46 -0
- package/api/manifest.json +9 -0
- package/dist/capabilities.d.ts +3 -0
- package/dist/capabilities.js +201 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.js +95 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +30 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +12 -0
- package/dist/generated/coolify-api.d.ts +16445 -0
- package/dist/generated/coolify-api.js +5 -0
- package/dist/generated/coolify-zod.d.ts +490 -0
- package/dist/generated/coolify-zod.js +22 -0
- package/dist/generated/operations.d.ts +21 -0
- package/dist/generated/operations.js +279 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +35 -0
- package/dist/stream.d.ts +1 -0
- package/dist/stream.js +13 -0
- package/dist/transports/stdio.d.ts +2 -0
- package/dist/transports/stdio.js +4 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/mcp.json +6 -0
- package/openapi/coolify-openapi.json +23077 -0
- package/package.json +57 -0
- package/plugin.json +28 -0
- package/skills/coolify/SKILL.md +8 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { loadConfig } from "./config.js";
|
|
3
|
+
import { createServer } from "./server.js";
|
|
4
|
+
import { createStdioTransport } from "./transports/stdio.js";
|
|
5
|
+
try {
|
|
6
|
+
await createServer(loadConfig()).connect(createStdioTransport());
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
console.error(`Coolify MCP server failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
}
|
package/dist/server.d.ts
ADDED
package/dist/server.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { CoolifyApiError, CoolifyClient, redactSensitive } from "./client.js";
|
|
4
|
+
import { registerV36Capabilities } from "./capabilities.js";
|
|
5
|
+
import { operations } from "./generated/operations.js";
|
|
6
|
+
import { pluginVersion } from "./version.js";
|
|
7
|
+
const outputRequestSchema = z.object({ method: z.string(), path: z.string() });
|
|
8
|
+
export function createServer(config, fetchImpl) {
|
|
9
|
+
const client = new CoolifyClient(config, fetchImpl);
|
|
10
|
+
const server = new McpServer({ name: "coolify-plugin", version: pluginVersion }, { instructions: "Use read tools to identify exact Coolify resources before mutations. Never expose tokens or secret values." });
|
|
11
|
+
for (const operation of operations) {
|
|
12
|
+
server.registerTool(operation.name, {
|
|
13
|
+
title: operation.name,
|
|
14
|
+
description: operation.description,
|
|
15
|
+
inputSchema: operation.inputSchema,
|
|
16
|
+
outputSchema: z.object({ data: operation.responseSchema, status: z.number(), request: outputRequestSchema }),
|
|
17
|
+
annotations: operation.annotations,
|
|
18
|
+
}, async (input) => {
|
|
19
|
+
try {
|
|
20
|
+
const envelope = await client.request(operation, input);
|
|
21
|
+
const data = operation.responseSchema.parse(envelope.data);
|
|
22
|
+
const structuredContent = redactSensitive({ data, status: envelope.status, request: envelope.request });
|
|
23
|
+
return { structuredContent, content: [{ type: "text", text: JSON.stringify(structuredContent) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const details = error instanceof CoolifyApiError
|
|
27
|
+
? { code: "COOLIFY_API_ERROR", status: error.status, method: error.method, path: error.path, message: error.message }
|
|
28
|
+
: { code: "COOLIFY_TOOL_ERROR", message: error instanceof Error ? error.message : String(error) };
|
|
29
|
+
return { isError: true, content: [{ type: "text", text: JSON.stringify({ error: details }) }] };
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
registerV36Capabilities(server, client);
|
|
34
|
+
return server;
|
|
35
|
+
}
|
package/dist/stream.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseServerSentEvents(input: string): unknown[];
|
package/dist/stream.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function parseServerSentEvents(input) {
|
|
2
|
+
return input.split(/\r?\n\r?\n/u).flatMap((frame) => {
|
|
3
|
+
const data = frame.split(/\r?\n/u).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trimStart()).join("\n");
|
|
4
|
+
if (!data)
|
|
5
|
+
return [];
|
|
6
|
+
try {
|
|
7
|
+
return [JSON.parse(data)];
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return [data];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pluginVersion: string;
|
package/dist/version.js
ADDED