@mixio-pro/kalaasetu-mcp 2.1.0 → 2.1.2-beta
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/package.json +6 -2
- package/src/index.ts +6 -5
- package/src/storage/index.ts +4 -3
- package/src/tools/fal/config.ts +9 -8
- package/src/tools/fal/dynamic-tools.ts +214 -237
- package/src/tools/fal/models.ts +115 -93
- package/src/tools/fal/storage.ts +66 -61
- package/src/tools/gemini.ts +302 -281
- package/src/tools/get-status.ts +50 -46
- package/src/tools/image-to-video.ts +309 -300
- package/src/tools/perplexity.ts +188 -172
- package/src/tools/youtube.ts +45 -41
- package/src/utils/llm-prompt-enhancer.ts +3 -2
- package/src/utils/logger.ts +65 -0
- package/src/utils/openmeter.ts +123 -0
- package/src/utils/prompt-enhancer-presets.ts +7 -5
- package/src/utils/remote-sync.ts +19 -10
- package/src/utils/tool-credits.ts +104 -0
- package/src/utils/tool-wrapper.ts +37 -6
- package/src/utils/url-file.ts +4 -3
- package/src/test-context.ts +0 -52
- package/src/test-error-handling.ts +0 -31
- package/src/tools/image-to-video.sdk-backup.ts +0 -218
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mixio-pro/kalaasetu-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2-beta",
|
|
4
4
|
"description": "A powerful Model Context Protocol server providing AI tools for content generation and analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@fal-ai/client": "^1.7.2",
|
|
52
52
|
"@google/genai": "^1.28.0",
|
|
53
|
+
"@openmeter/sdk": "^1.0.0-beta.226",
|
|
54
|
+
"@sentry/node": "^10.36.0",
|
|
53
55
|
"@types/node": "^24.10.1",
|
|
54
56
|
"@types/wav": "^1.0.4",
|
|
55
57
|
"fastmcp": "3.26.8",
|
|
@@ -57,6 +59,8 @@
|
|
|
57
59
|
"google-auth-library": "^10.5.0",
|
|
58
60
|
"jsonata": "^2.1.0",
|
|
59
61
|
"wav": "^1.0.2",
|
|
62
|
+
"winston": "^3.19.0",
|
|
63
|
+
"winston-transport-sentry-node": "^3.0.0",
|
|
60
64
|
"zod": "^4.1.12"
|
|
61
65
|
}
|
|
62
|
-
}
|
|
66
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { getGenerationStatus } from "./tools/get-status";
|
|
|
13
13
|
|
|
14
14
|
import { syncFalConfig } from "./tools/fal/config";
|
|
15
15
|
import { syncPromptEnhancerConfigs } from "./utils/prompt-enhancer-presets";
|
|
16
|
+
import { logger } from "./utils/logger";
|
|
16
17
|
|
|
17
18
|
const server = new FastMCP({
|
|
18
19
|
name: "Kalaasetu MCP Server",
|
|
@@ -20,14 +21,14 @@ const server = new FastMCP({
|
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
async function main() {
|
|
23
|
-
|
|
24
|
+
logger.info("🚀 Initializing Kalaasetu MCP Server...");
|
|
24
25
|
|
|
25
26
|
// 1. Sync Remote Configs
|
|
26
27
|
await Promise.all([syncFalConfig(), syncPromptEnhancerConfigs()]);
|
|
27
28
|
|
|
28
29
|
// 2. Add Gemini Tools
|
|
29
|
-
server.addTool(geminiTextToImage);
|
|
30
|
-
server.addTool(geminiEditImage);
|
|
30
|
+
// server.addTool(geminiTextToImage);
|
|
31
|
+
// server.addTool(geminiEditImage);
|
|
31
32
|
server.addTool(imageToVideo);
|
|
32
33
|
|
|
33
34
|
// 3. Add Discovery Tools
|
|
@@ -45,13 +46,13 @@ async function main() {
|
|
|
45
46
|
// 5. Add Status Tool
|
|
46
47
|
server.addTool(getGenerationStatus);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
logger.info("✅ Starting server transport...");
|
|
49
50
|
server.start({
|
|
50
51
|
transportType: "stdio",
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
main().catch((err) => {
|
|
55
|
-
|
|
56
|
+
logger.error("❌ Failed to start server:", err);
|
|
56
57
|
process.exit(1);
|
|
57
58
|
});
|
package/src/storage/index.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { StorageProvider } from "./interface";
|
|
2
2
|
import { LocalStorageProvider } from "./local";
|
|
3
3
|
import { GCSStorageProvider } from "./gcs";
|
|
4
|
+
import { logger } from "../utils/logger";
|
|
4
5
|
|
|
5
6
|
let storageInstance: StorageProvider | null = null;
|
|
6
7
|
|
|
7
8
|
export function getStorage(): StorageProvider {
|
|
8
9
|
if (!storageInstance) {
|
|
9
10
|
const type = process.env.STORAGE_PROVIDER || "local";
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
logger.info(`Initializing storage provider: ${type}`);
|
|
12
|
+
logger.info(`Base path (cwd): ${process.cwd()}`);
|
|
12
13
|
|
|
13
14
|
if (type === "gcs") {
|
|
14
15
|
const bucket = process.env.GCS_BUCKET;
|
|
@@ -25,7 +26,7 @@ export function getStorage(): StorageProvider {
|
|
|
25
26
|
// Initialize async
|
|
26
27
|
storageInstance
|
|
27
28
|
.init()
|
|
28
|
-
.catch((err) =>
|
|
29
|
+
.catch((err) => logger.error("Failed to init storage:", err));
|
|
29
30
|
}
|
|
30
31
|
return storageInstance;
|
|
31
32
|
}
|
package/src/tools/fal/config.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import type { PromptEnhancerConfig } from "../../utils/prompt-enhancer";
|
|
7
|
+
import { logger } from "../../utils/logger";
|
|
7
8
|
|
|
8
9
|
// API URLs
|
|
9
10
|
export const FAL_BASE_URL = "https://fal.ai/api";
|
|
@@ -112,9 +113,9 @@ export const DEFAULT_PRESETS: FalPresetConfig[] = [
|
|
|
112
113
|
},
|
|
113
114
|
transformers: {
|
|
114
115
|
types: {
|
|
115
|
-
duration: "number"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
116
|
+
duration: "number",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
121
|
presetName: "ltx_retake_video",
|
|
@@ -133,13 +134,13 @@ export const DEFAULT_PRESETS: FalPresetConfig[] = [
|
|
|
133
134
|
start_time: {
|
|
134
135
|
type: "number",
|
|
135
136
|
description: "Start timestamp for the edit.",
|
|
136
|
-
default: 0
|
|
137
|
+
default: 0,
|
|
137
138
|
},
|
|
138
139
|
end_time: {
|
|
139
140
|
type: "number",
|
|
140
|
-
description: "End timestamp for the edit."
|
|
141
|
+
description: "End timestamp for the edit.",
|
|
141
142
|
},
|
|
142
|
-
}
|
|
143
|
+
},
|
|
143
144
|
},
|
|
144
145
|
];
|
|
145
146
|
|
|
@@ -193,7 +194,7 @@ export function saveFalConfig(config: FalConfig): boolean {
|
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
if (!configPath) {
|
|
196
|
-
|
|
197
|
+
logger.warn("Cannot save config: no config file path found.");
|
|
197
198
|
return false;
|
|
198
199
|
}
|
|
199
200
|
|
|
@@ -203,7 +204,7 @@ export function saveFalConfig(config: FalConfig): boolean {
|
|
|
203
204
|
fs.writeFileSync(absolutePath, JSON.stringify(config, null, 2), "utf-8");
|
|
204
205
|
return true;
|
|
205
206
|
} catch (error: any) {
|
|
206
|
-
|
|
207
|
+
logger.error(`Error saving FAL config: ${error.message}`);
|
|
207
208
|
return false;
|
|
208
209
|
}
|
|
209
210
|
}
|