@superblocksteam/mcp-server 2.0.114 → 2.0.115-next.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-apps-by-integration.d.ts","sourceRoot":"","sources":["../../src/tools/find-apps-by-integration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"find-apps-by-integration.d.ts","sourceRoot":"","sources":["../../src/tools/find-apps-by-integration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA0FpD,eAAO,MAAM,qBAAqB,EAAE,cA0EnC,CAAC"}
|
|
@@ -13,15 +13,53 @@ const findAppsByIntegrationInputSchema = z
|
|
|
13
13
|
offset: z.number().int().nonnegative().optional(),
|
|
14
14
|
})
|
|
15
15
|
.strict();
|
|
16
|
+
// Minimum fields we surface to MCP callers. The server returns a richer
|
|
17
|
+
// shape (creator, folderId, entryPointCount, …) that we pass through
|
|
18
|
+
// untouched via `.passthrough()` so callers keep working if the backend
|
|
19
|
+
// adds more fields. Validating the core fields at item-level catches
|
|
20
|
+
// field-rename regressions before they surface as silent `undefined`s in
|
|
21
|
+
// tool output.
|
|
22
|
+
const integrationUsageAppSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
applicationId: z.string(),
|
|
25
|
+
applicationName: z.string(),
|
|
26
|
+
organizationId: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.passthrough();
|
|
29
|
+
function parseApps(items) {
|
|
30
|
+
return items.map((item, index) => {
|
|
31
|
+
try {
|
|
32
|
+
return integrationUsageAppSchema.parse(item);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
36
|
+
throw new Error(`Unexpected application shape at index ${index} from /api/v1/integrations/apps: ${detail}`);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
16
40
|
function normalizeApplicationsResponse(response) {
|
|
17
41
|
if (Array.isArray(response)) {
|
|
18
|
-
return response;
|
|
42
|
+
return { kind: "legacy", items: parseApps(response) };
|
|
19
43
|
}
|
|
20
|
-
if (response &&
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
if (response && typeof response === "object") {
|
|
45
|
+
const obj = response;
|
|
46
|
+
if (Array.isArray(obj.items)) {
|
|
47
|
+
const items = parseApps(obj.items);
|
|
48
|
+
if (typeof obj.total === "number" &&
|
|
49
|
+
typeof obj.limit === "number" &&
|
|
50
|
+
typeof obj.offset === "number") {
|
|
51
|
+
return {
|
|
52
|
+
kind: "paginated",
|
|
53
|
+
items,
|
|
54
|
+
total: obj.total,
|
|
55
|
+
limit: obj.limit,
|
|
56
|
+
offset: obj.offset,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Envelope missing pagination metadata: treat as legacy so we fall
|
|
60
|
+
// back to client-side slicing rather than reporting a bogus total.
|
|
61
|
+
return { kind: "legacy", items };
|
|
62
|
+
}
|
|
25
63
|
}
|
|
26
64
|
throw new Error("Unexpected response shape from /api/v1/integrations/apps");
|
|
27
65
|
}
|
|
@@ -48,10 +86,34 @@ export const findAppsByIntegration = {
|
|
|
48
86
|
path: "/api/v1/integrations/apps",
|
|
49
87
|
query: {
|
|
50
88
|
integrationId: input.integration_id,
|
|
89
|
+
limit: input.limit,
|
|
90
|
+
offset: input.offset,
|
|
51
91
|
},
|
|
52
92
|
});
|
|
53
|
-
const
|
|
54
|
-
|
|
93
|
+
const normalized = normalizeApplicationsResponse(response);
|
|
94
|
+
// When the server paginates (new shape: { items, total, limit, offset })
|
|
95
|
+
// trust its totals and skip client-side slicing. When the server
|
|
96
|
+
// returns a bare array (legacy shape) fall back to client-side
|
|
97
|
+
// pagination so the tool keeps working against older deployments.
|
|
98
|
+
if (normalized.kind === "paginated") {
|
|
99
|
+
const hasMore = normalized.offset + normalized.items.length < normalized.total;
|
|
100
|
+
return {
|
|
101
|
+
integration_id: input.integration_id,
|
|
102
|
+
applications: normalized.items,
|
|
103
|
+
auth_source: auth.source,
|
|
104
|
+
base_url: baseUrl,
|
|
105
|
+
environment: detectEnvironment(baseUrl),
|
|
106
|
+
has_more: hasMore,
|
|
107
|
+
limit: normalized.limit,
|
|
108
|
+
next_offset: hasMore
|
|
109
|
+
? normalized.offset + normalized.items.length
|
|
110
|
+
: null,
|
|
111
|
+
offset: normalized.offset,
|
|
112
|
+
returned_count: normalized.items.length,
|
|
113
|
+
total_count: normalized.total,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const paged = applyPagination(normalized.items, {
|
|
55
117
|
limit: input.limit,
|
|
56
118
|
offset: input.offset,
|
|
57
119
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-apps-by-integration.js","sourceRoot":"","sources":["../../src/tools/find-apps-by-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,gCAAgC,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,C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AC,MAAM;YACpB,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblocksteam/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.115-next.1",
|
|
4
4
|
"description": "Superblocks MCP server",
|
|
5
5
|
"license": "Superblocks Community Software License",
|
|
6
6
|
"bin": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
43
43
|
"fs-extra": "^11.3.0",
|
|
44
44
|
"zod": "^4.3.6",
|
|
45
|
-
"@superblocksteam/
|
|
46
|
-
"@superblocksteam/
|
|
47
|
-
"@superblocksteam/
|
|
45
|
+
"@superblocksteam/sdk": "2.0.115-next.1",
|
|
46
|
+
"@superblocksteam/shared": "0.9585.0",
|
|
47
|
+
"@superblocksteam/util": "2.0.115-next.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/fs-extra": "^11.0.4",
|