@centrali-io/centrali-mcp 4.4.5 → 4.4.7
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/README.md +147 -14
- package/dist/index.js +5 -1
- package/dist/tools/auth-providers.d.ts +3 -0
- package/dist/tools/auth-providers.js +267 -0
- package/dist/tools/compute.d.ts +1 -1
- package/dist/tools/compute.js +184 -7
- package/dist/tools/describe.js +537 -9
- package/dist/tools/insights.js +1 -1
- package/dist/tools/orchestrations.js +9 -9
- package/dist/tools/pages.js +31 -12
- package/dist/tools/service-accounts.d.ts +3 -0
- package/dist/tools/service-accounts.js +856 -0
- package/package.json +2 -2
- package/src/index.ts +5 -1
- package/src/tools/auth-providers.ts +290 -0
- package/src/tools/compute.ts +202 -7
- package/src/tools/describe.ts +560 -9
- package/src/tools/insights.ts +1 -1
- package/src/tools/orchestrations.ts +9 -9
- package/src/tools/pages.ts +27 -9
- package/src/tools/service-accounts.ts +1051 -0
package/src/tools/insights.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function registerInsightTools(server: McpServer, sdk: CentraliSDK) {
|
|
|
41
41
|
.optional()
|
|
42
42
|
.describe("Filter by insight status"),
|
|
43
43
|
severity: z
|
|
44
|
-
.enum(["
|
|
44
|
+
.enum(["info", "warning", "critical"])
|
|
45
45
|
.optional()
|
|
46
46
|
.describe("Filter by severity level"),
|
|
47
47
|
},
|
|
@@ -63,7 +63,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
63
63
|
"get_orchestration",
|
|
64
64
|
"Get full details of a single orchestration by ID, including its step definitions.",
|
|
65
65
|
{
|
|
66
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
66
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
67
67
|
},
|
|
68
68
|
async ({ orchestrationId }) => {
|
|
69
69
|
try {
|
|
@@ -89,7 +89,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
89
89
|
"trigger_orchestration",
|
|
90
90
|
"Trigger an orchestration run. Creates a new run instance and starts executing the workflow. Optionally pass input data to the run.",
|
|
91
91
|
{
|
|
92
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
92
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to trigger"),
|
|
93
93
|
input: z
|
|
94
94
|
.record(z.string(), z.any())
|
|
95
95
|
.optional()
|
|
@@ -130,7 +130,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
130
130
|
"list_orchestration_runs",
|
|
131
131
|
"List all runs for an orchestration. Runs represent individual executions of the workflow.",
|
|
132
132
|
{
|
|
133
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
133
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
134
134
|
offset: z.number().optional().describe("Number of results to skip (for pagination)"),
|
|
135
135
|
limit: z.number().optional().describe("Results per page"),
|
|
136
136
|
status: z
|
|
@@ -173,8 +173,8 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
173
173
|
"get_orchestration_run",
|
|
174
174
|
"Get details of a specific orchestration run. Set includeSteps=true to see step-by-step execution history.",
|
|
175
175
|
{
|
|
176
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
177
|
-
runId: z.string().describe("The run ID (
|
|
176
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
177
|
+
runId: z.string().describe("The run ID (prefixed, e.g. orun_abc123)"),
|
|
178
178
|
includeSteps: z
|
|
179
179
|
.boolean()
|
|
180
180
|
.optional()
|
|
@@ -248,7 +248,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
248
248
|
"update_orchestration",
|
|
249
249
|
"Update an existing orchestration by ID. Only include the fields you want to change.",
|
|
250
250
|
{
|
|
251
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
251
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to update"),
|
|
252
252
|
name: z.string().optional().describe("Updated name"),
|
|
253
253
|
description: z.string().optional().describe("Updated description"),
|
|
254
254
|
status: z
|
|
@@ -295,7 +295,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
295
295
|
"delete_orchestration",
|
|
296
296
|
"Delete an orchestration by ID. This also deletes all runs associated with the orchestration.",
|
|
297
297
|
{
|
|
298
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
298
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to delete"),
|
|
299
299
|
},
|
|
300
300
|
async ({ orchestrationId }) => {
|
|
301
301
|
try {
|
|
@@ -326,7 +326,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
326
326
|
"activate_orchestration",
|
|
327
327
|
"Activate an orchestration. Active orchestrations can be triggered by scheduled events, record events, and webhooks.",
|
|
328
328
|
{
|
|
329
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
329
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to activate"),
|
|
330
330
|
},
|
|
331
331
|
async ({ orchestrationId }) => {
|
|
332
332
|
try {
|
|
@@ -352,7 +352,7 @@ export function registerOrchestrationTools(server: McpServer, sdk: CentraliSDK)
|
|
|
352
352
|
"pause_orchestration",
|
|
353
353
|
"Pause an orchestration. Paused orchestrations cannot be triggered by any mechanism.",
|
|
354
354
|
{
|
|
355
|
-
orchestrationId: z.string().describe("The orchestration ID (
|
|
355
|
+
orchestrationId: z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to pause"),
|
|
356
356
|
},
|
|
357
357
|
async ({ orchestrationId }) => {
|
|
358
358
|
try {
|
package/src/tools/pages.ts
CHANGED
|
@@ -41,8 +41,28 @@ function getPagesBaseUrl(centraliUrl: string): string {
|
|
|
41
41
|
return `${url.protocol}//${hostname}/pages`;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Ensures the SDK has a valid token by making a lightweight SDK call.
|
|
46
|
+
* The SDK's internal axios interceptor handles client-credentials token
|
|
47
|
+
* fetch and 401 refresh automatically — we just need to trigger it.
|
|
48
|
+
*/
|
|
49
|
+
async function ensureToken(sdk: CentraliSDK): Promise<string | null> {
|
|
50
|
+
let token = sdk.getToken();
|
|
51
|
+
if (token) return token;
|
|
52
|
+
|
|
53
|
+
// Token not yet fetched — trigger the SDK's internal auth flow
|
|
54
|
+
// by making a lightweight call. The SDK will fetch and cache the token.
|
|
55
|
+
try {
|
|
56
|
+
await sdk.functions.list({ limit: 1 });
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore errors — we only need the token refresh side effect
|
|
59
|
+
}
|
|
60
|
+
return sdk.getToken();
|
|
61
|
+
}
|
|
62
|
+
|
|
44
63
|
/**
|
|
45
64
|
* Creates an axios instance for the pages API that uses the SDK's token.
|
|
65
|
+
* Auth is handled through the SDK's public getToken() API — no internal casting.
|
|
46
66
|
*/
|
|
47
67
|
function createPagesClient(sdk: CentraliSDK, centraliUrl: string, workspaceId: string): {
|
|
48
68
|
client: AxiosInstance;
|
|
@@ -53,7 +73,7 @@ function createPagesClient(sdk: CentraliSDK, centraliUrl: string, workspaceId: s
|
|
|
53
73
|
|
|
54
74
|
// Attach the SDK's bearer token to every request
|
|
55
75
|
client.interceptors.request.use(async (config) => {
|
|
56
|
-
const token =
|
|
76
|
+
const token = await ensureToken(sdk);
|
|
57
77
|
if (token) {
|
|
58
78
|
config.headers.Authorization = `Bearer ${token}`;
|
|
59
79
|
}
|
|
@@ -70,16 +90,14 @@ function createPagesClient(sdk: CentraliSDK, centraliUrl: string, workspaceId: s
|
|
|
70
90
|
if (isAuthError && !originalRequest._hasRetried) {
|
|
71
91
|
originalRequest._hasRetried = true;
|
|
72
92
|
|
|
73
|
-
// Force SDK
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
await (sdk as any).axios?.get?.('/health');
|
|
79
|
-
} catch { /* ignore — we just want the token refresh side effect */ }
|
|
93
|
+
// Force a fresh token by making an SDK call (triggers internal 401 refresh)
|
|
94
|
+
try {
|
|
95
|
+
await sdk.functions.list({ limit: 1 });
|
|
96
|
+
} catch {
|
|
97
|
+
// Ignore — we only need the token refresh side effect
|
|
80
98
|
}
|
|
81
99
|
|
|
82
|
-
const token =
|
|
100
|
+
const token = sdk.getToken();
|
|
83
101
|
if (token) {
|
|
84
102
|
originalRequest.headers.Authorization = `Bearer ${token}`;
|
|
85
103
|
return client.request(originalRequest);
|