@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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
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
+ }
@@ -0,0 +1,4 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { FetchLike } from "./client.js";
3
+ import type { CoolifyConfig } from "./config.js";
4
+ export declare function createServer(config: CoolifyConfig, fetchImpl?: FetchLike): McpServer;
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
+ }
@@ -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,2 @@
1
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
+ export declare function createStdioTransport(): StdioServerTransport;
@@ -0,0 +1,4 @@
1
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
+ export function createStdioTransport() {
3
+ return new StdioServerTransport();
4
+ }
@@ -0,0 +1 @@
1
+ export declare const pluginVersion: string;
@@ -0,0 +1,2 @@
1
+ import { readFileSync } from "node:fs";
2
+ export const pluginVersion = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
package/mcp.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
+ "mcpServers": {
4
+ "coolify": { "type": "stdio", "command": "bun", "args": ["dist/index.js"], "cwd": "./" }
5
+ }
6
+ }