flutterflow-mcp 0.2.0 → 0.2.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/build/index.js +1 -1
- package/build/tools/get-yaml.d.ts +1 -2
- package/build/tools/get-yaml.js +28 -22
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -29,7 +29,7 @@ const client = createClient();
|
|
|
29
29
|
// Register tools
|
|
30
30
|
registerListProjectsTool(server, client);
|
|
31
31
|
registerListFilesTool(server, client);
|
|
32
|
-
registerGetYamlTool(server
|
|
32
|
+
registerGetYamlTool(server);
|
|
33
33
|
registerValidateYamlTool(server, client);
|
|
34
34
|
registerUpdateYamlTool(server, client);
|
|
35
35
|
registerListPagesTool(server, client);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
|
|
3
|
-
export declare function registerGetYamlTool(server: McpServer, client: FlutterFlowClient): void;
|
|
2
|
+
export declare function registerGetYamlTool(server: McpServer): void;
|
package/build/tools/get-yaml.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
server.tool("get_project_yaml", "Download YAML files from a FlutterFlow project. Returns one file if fileName is specified, otherwise returns all files.", {
|
|
2
|
+
import { cacheRead, listCachedKeys } from "../utils/cache.js";
|
|
3
|
+
export function registerGetYamlTool(server) {
|
|
4
|
+
server.tool("get_project_yaml", "Read YAML files from the local project cache. Requires sync_project to be run first. Returns one file if fileName is specified, or lists all cached file keys if omitted.", {
|
|
6
5
|
projectId: z.string().describe("The FlutterFlow project ID"),
|
|
7
6
|
fileName: z
|
|
8
7
|
.string()
|
|
9
8
|
.optional()
|
|
10
|
-
.describe("Specific YAML file name to
|
|
9
|
+
.describe("Specific YAML file name to read (e.g. 'app-details', 'page/id-xxx'). Omit to list all cached file keys."),
|
|
11
10
|
}, async ({ projectId, fileName }) => {
|
|
12
|
-
// Cache-first for single-file requests
|
|
13
11
|
if (fileName) {
|
|
14
12
|
const cached = await cacheRead(projectId, fileName);
|
|
15
13
|
if (cached) {
|
|
@@ -17,31 +15,39 @@ export function registerGetYamlTool(server, client) {
|
|
|
17
15
|
content: [
|
|
18
16
|
{
|
|
19
17
|
type: "text",
|
|
20
|
-
text: `# ${fileName}
|
|
18
|
+
text: `# ${fileName}\n${cached}`,
|
|
21
19
|
},
|
|
22
20
|
],
|
|
23
21
|
};
|
|
24
22
|
}
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: `File "${fileName}" not found in local cache for project "${projectId}". Run sync_project(projectId: "${projectId}") first to download all YAML files, then retry.`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
for (const [name, yaml] of Object.entries(decoded)) {
|
|
30
|
-
const cleanName = name.endsWith(".yaml") ? name.slice(0, -".yaml".length) : name;
|
|
31
|
-
await cacheWrite(projectId, cleanName, yaml);
|
|
32
|
-
}
|
|
33
|
-
const entries = Object.entries(decoded);
|
|
34
|
-
if (entries.length === 1) {
|
|
35
|
-
const [name, yaml] = entries[0];
|
|
32
|
+
// No fileName: list all cached keys
|
|
33
|
+
const keys = await listCachedKeys(projectId);
|
|
34
|
+
if (keys.length === 0) {
|
|
36
35
|
return {
|
|
37
|
-
content: [
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: `No cached files found for project "${projectId}". Run sync_project(projectId: "${projectId}") first to download all YAML files.`,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
44
|
return {
|
|
41
|
-
content:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: `# Cached files (${keys.length})\n${keys.join("\n")}`,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
45
51
|
};
|
|
46
52
|
});
|
|
47
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flutterflow-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP server for the FlutterFlow Project API — AI-assisted FlutterFlow development through Claude and other MCP-compatible clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|