qorrelate-mcp-server 0.1.3 → 0.3.0
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 +30 -2
- package/dist/client.d.ts +100 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +324 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -6
- package/dist/index.js.map +1 -1
- package/dist/tools/ai-chat.d.ts +15 -0
- package/dist/tools/ai-chat.d.ts.map +1 -0
- package/dist/tools/ai-chat.js +133 -0
- package/dist/tools/ai-chat.js.map +1 -0
- package/dist/tools/alerts.d.ts.map +1 -1
- package/dist/tools/alerts.js +11 -5
- package/dist/tools/alerts.js.map +1 -1
- package/dist/tools/analytics.d.ts +15 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +327 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/auth.d.ts +16 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +204 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/notifications.d.ts +16 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +244 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/organizations.d.ts.map +1 -1
- package/dist/tools/organizations.js +285 -0
- package/dist/tools/organizations.js.map +1 -1
- package/dist/tools/saved-searches.d.ts +15 -0
- package/dist/tools/saved-searches.d.ts.map +1 -0
- package/dist/tools/saved-searches.js +110 -0
- package/dist/tools/saved-searches.js.map +1 -0
- package/dist/tools/services.d.ts.map +1 -1
- package/dist/tools/services.js +21 -4
- package/dist/tools/services.js.map +1 -1
- package/dist/tools/user.d.ts +15 -0
- package/dist/tools/user.d.ts.map +1 -0
- package/dist/tools/user.js +136 -0
- package/dist/tools/user.js.map +1 -0
- package/dist/tools/workflows.d.ts +16 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +297 -0
- package/dist/tools/workflows.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Web Analytics Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for analyzing web traffic, user behavior, and performance metrics.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.registerAnalyticsTools = registerAnalyticsTools;
|
|
9
|
+
exports.handleAnalyticsTool = handleAnalyticsTool;
|
|
10
|
+
const index_js_1 = require("../index.js");
|
|
11
|
+
function registerAnalyticsTools() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
name: "analytics_overview",
|
|
15
|
+
description: "Get web analytics overview with page views, unique visitors, bounce rate, and session duration",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
organization_id: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Organization ID",
|
|
22
|
+
},
|
|
23
|
+
start_time: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Start of time range (ISO 8601)",
|
|
26
|
+
},
|
|
27
|
+
end_time: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "End of time range (ISO 8601)",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: ["organization_id"],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "analytics_pages",
|
|
37
|
+
description: "Get top pages by page views",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
organization_id: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Organization ID",
|
|
44
|
+
},
|
|
45
|
+
start_time: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Start of time range (ISO 8601)",
|
|
48
|
+
},
|
|
49
|
+
end_time: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "End of time range (ISO 8601)",
|
|
52
|
+
},
|
|
53
|
+
limit: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Max number of pages to return (default: 20)",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["organization_id"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "analytics_devices",
|
|
63
|
+
description: "Get breakdown of visitors by device type, browser, and OS",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
organization_id: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Organization ID",
|
|
70
|
+
},
|
|
71
|
+
start_time: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "Start of time range (ISO 8601)",
|
|
74
|
+
},
|
|
75
|
+
end_time: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "End of time range (ISO 8601)",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
required: ["organization_id"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "analytics_geographic",
|
|
85
|
+
description: "Get visitor breakdown by country and city",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
organization_id: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Organization ID",
|
|
92
|
+
},
|
|
93
|
+
start_time: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "Start of time range (ISO 8601)",
|
|
96
|
+
},
|
|
97
|
+
end_time: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "End of time range (ISO 8601)",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
required: ["organization_id"],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "analytics_web_vitals",
|
|
107
|
+
description: "Get Core Web Vitals (LCP, FID, CLS) and other performance metrics",
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
organization_id: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Organization ID",
|
|
114
|
+
},
|
|
115
|
+
start_time: {
|
|
116
|
+
type: "string",
|
|
117
|
+
description: "Start of time range (ISO 8601)",
|
|
118
|
+
},
|
|
119
|
+
end_time: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "End of time range (ISO 8601)",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
required: ["organization_id"],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "get_service_map",
|
|
129
|
+
description: "Get service dependency map showing how services communicate",
|
|
130
|
+
inputSchema: {
|
|
131
|
+
type: "object",
|
|
132
|
+
properties: {
|
|
133
|
+
start_time: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Start of time range (ISO 8601)",
|
|
136
|
+
},
|
|
137
|
+
end_time: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "End of time range (ISO 8601)",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "get_log_patterns",
|
|
146
|
+
description: "Detect and analyze log patterns to identify common log messages",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
service: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Filter by service name",
|
|
153
|
+
},
|
|
154
|
+
start_time: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Start of time range (ISO 8601)",
|
|
157
|
+
},
|
|
158
|
+
end_time: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "End of time range (ISO 8601)",
|
|
161
|
+
},
|
|
162
|
+
limit: {
|
|
163
|
+
type: "number",
|
|
164
|
+
description: "Max number of patterns to return (default: 50)",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "get_guardrails",
|
|
171
|
+
description: "Get guardrail settings and limits for the organization",
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: "object",
|
|
174
|
+
properties: {
|
|
175
|
+
organization_id: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Organization ID",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
required: ["organization_id"],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "estimate_query_cost",
|
|
185
|
+
description: "Estimate the cost/resource usage of running a query",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {
|
|
189
|
+
organization_id: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "Organization ID",
|
|
192
|
+
},
|
|
193
|
+
query: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "Query to estimate cost for",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
required: ["organization_id", "query"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "get_cardinality_analysis",
|
|
203
|
+
description: "Analyze metric cardinality to identify high-cardinality labels that increase costs",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
organization_id: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Organization ID",
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
required: ["organization_id"],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
async function handleAnalyticsTool(client, name, args) {
|
|
218
|
+
const orgId = args.organization_id || index_js_1.defaultOrgId;
|
|
219
|
+
switch (name) {
|
|
220
|
+
case "analytics_overview": {
|
|
221
|
+
if (!orgId)
|
|
222
|
+
throw new Error("organization_id is required");
|
|
223
|
+
const result = await client.getWebAnalyticsOverview(orgId, {
|
|
224
|
+
start_time: args.start_time,
|
|
225
|
+
end_time: args.end_time,
|
|
226
|
+
});
|
|
227
|
+
return {
|
|
228
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
case "analytics_pages": {
|
|
232
|
+
if (!orgId)
|
|
233
|
+
throw new Error("organization_id is required");
|
|
234
|
+
const result = await client.getWebAnalyticsPages(orgId, {
|
|
235
|
+
start_time: args.start_time,
|
|
236
|
+
end_time: args.end_time,
|
|
237
|
+
limit: args.limit,
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
case "analytics_devices": {
|
|
244
|
+
if (!orgId)
|
|
245
|
+
throw new Error("organization_id is required");
|
|
246
|
+
const result = await client.getWebAnalyticsDevices(orgId, {
|
|
247
|
+
start_time: args.start_time,
|
|
248
|
+
end_time: args.end_time,
|
|
249
|
+
});
|
|
250
|
+
return {
|
|
251
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
case "analytics_geographic": {
|
|
255
|
+
if (!orgId)
|
|
256
|
+
throw new Error("organization_id is required");
|
|
257
|
+
const result = await client.getWebAnalyticsGeographic(orgId, {
|
|
258
|
+
start_time: args.start_time,
|
|
259
|
+
end_time: args.end_time,
|
|
260
|
+
});
|
|
261
|
+
return {
|
|
262
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
case "analytics_web_vitals": {
|
|
266
|
+
if (!orgId)
|
|
267
|
+
throw new Error("organization_id is required");
|
|
268
|
+
const result = await client.getWebVitals(orgId, {
|
|
269
|
+
start_time: args.start_time,
|
|
270
|
+
end_time: args.end_time,
|
|
271
|
+
});
|
|
272
|
+
return {
|
|
273
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
case "get_service_map": {
|
|
277
|
+
const result = await client.getServiceMap({
|
|
278
|
+
start_time: args.start_time,
|
|
279
|
+
end_time: args.end_time,
|
|
280
|
+
});
|
|
281
|
+
return {
|
|
282
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
case "get_log_patterns": {
|
|
286
|
+
const result = await client.getLogPatterns({
|
|
287
|
+
service: args.service,
|
|
288
|
+
start_time: args.start_time,
|
|
289
|
+
end_time: args.end_time,
|
|
290
|
+
limit: args.limit,
|
|
291
|
+
});
|
|
292
|
+
return {
|
|
293
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
case "get_guardrails": {
|
|
297
|
+
if (!orgId)
|
|
298
|
+
throw new Error("organization_id is required");
|
|
299
|
+
const result = await client.getGuardrails(orgId);
|
|
300
|
+
return {
|
|
301
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
case "estimate_query_cost": {
|
|
305
|
+
if (!orgId)
|
|
306
|
+
throw new Error("organization_id is required");
|
|
307
|
+
const query = args.query;
|
|
308
|
+
if (!query)
|
|
309
|
+
throw new Error("query is required");
|
|
310
|
+
const result = await client.estimateQueryCost(orgId, query);
|
|
311
|
+
return {
|
|
312
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
case "get_cardinality_analysis": {
|
|
316
|
+
if (!orgId)
|
|
317
|
+
throw new Error("organization_id is required");
|
|
318
|
+
const result = await client.getCardinalityAnalysis(orgId);
|
|
319
|
+
return {
|
|
320
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
default:
|
|
324
|
+
throw new Error(`Unknown analytics tool: ${name}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAMH,wDA6MC;AAED,kDAmHC;AApUD,0CAA2C;AAE3C,SAAgB,sBAAsB;IACpC,OAAO;QACL;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,gGAAgG;YAC7G,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,eAAe,EAAE;wBACf,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iBAAiB;qBAC/B;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,gCAAgC;qBAC9C;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,8BAA8B;qBAC5C;iBACF;gBACD,QAAQ,EAAE,CAAC,iBAAiB,CAAC;aAC9B;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,eAAe,EAAE;wBACf,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iBAAiB;qBAC/B;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,gCAAgC;qBAC9C;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,8BAA8B;qBAC5C;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,6CAA6C;qBAC3D;iBACF;gBACD,QAAQ,EAAE,CAAC,iBAAiB,CAAC;aAC9B;SACF;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,2DAA2D;YACxE,WAAW,EAAE;gBACX,IAAI,EAAE,QA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
|
2
|
+
* Authentication MCP tools
|
|
3
|
+
*
|
|
4
|
+
* Provides device authorization flow for browser-based Auth0 login.
|
|
5
|
+
* This allows users to authenticate the MCP without manually copying API keys.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
export declare function registerAuthTools(): Tool[];
|
|
9
|
+
export declare function handleAuthTool(toolName: string, args: Record<string, unknown> | undefined): Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/tools/auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAM/D,wBAAgB,iBAAiB,IAAI,IAAI,EAAE,CAgC1C;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmLhF"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Authentication MCP tools
|
|
4
|
+
*
|
|
5
|
+
* Provides device authorization flow for browser-based Auth0 login.
|
|
6
|
+
* This allows users to authenticate the MCP without manually copying API keys.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.registerAuthTools = registerAuthTools;
|
|
10
|
+
exports.handleAuthTool = handleAuthTool;
|
|
11
|
+
// Store for tracking login state
|
|
12
|
+
let pendingDeviceCode = null;
|
|
13
|
+
let pendingEndpoint = null;
|
|
14
|
+
function registerAuthTools() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
name: "login",
|
|
18
|
+
description: `Start the login flow to authenticate with Qorrelate via your browser.
|
|
19
|
+
|
|
20
|
+
This initiates a device authorization flow:
|
|
21
|
+
1. A verification URL is returned
|
|
22
|
+
2. Open the URL in your browser
|
|
23
|
+
3. Log in with your Auth0 account
|
|
24
|
+
4. Return here and use login_status to complete
|
|
25
|
+
|
|
26
|
+
After logging in, you'll receive an access token that can be used for API calls.`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
endpoint: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Qorrelate endpoint (default: https://qorrelate.io)",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "login_status",
|
|
39
|
+
description: "Check if the browser login flow has completed. Call this after opening the verification URL.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
async function handleAuthTool(toolName, args) {
|
|
48
|
+
const params = args || {};
|
|
49
|
+
switch (toolName) {
|
|
50
|
+
case "login": {
|
|
51
|
+
const endpoint = params.endpoint || process.env.QORRELATE_ENDPOINT || "https://qorrelate.io";
|
|
52
|
+
try {
|
|
53
|
+
// Request a device code from the Qorrelate API
|
|
54
|
+
const response = await fetch(`${endpoint}/v1/auth/device-code`, {
|
|
55
|
+
method: "POST",
|
|
56
|
+
headers: { "Content-Type": "application/json" },
|
|
57
|
+
});
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
const text = await response.text();
|
|
60
|
+
return {
|
|
61
|
+
content: [{ type: "text", text: `Failed to start login: ${response.status} - ${text}` }],
|
|
62
|
+
isError: true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const data = await response.json();
|
|
66
|
+
// Store for polling
|
|
67
|
+
pendingDeviceCode = data.device_code;
|
|
68
|
+
pendingEndpoint = endpoint;
|
|
69
|
+
return {
|
|
70
|
+
content: [{
|
|
71
|
+
type: "text",
|
|
72
|
+
text: `# Login to Qorrelate
|
|
73
|
+
|
|
74
|
+
## Step 1: Open this URL in your browser
|
|
75
|
+
|
|
76
|
+
${data.verification_url}
|
|
77
|
+
|
|
78
|
+
## Step 2: Log in with your account
|
|
79
|
+
|
|
80
|
+
Sign in using Google, GitHub, or email.
|
|
81
|
+
|
|
82
|
+
## Step 3: Return here and check status
|
|
83
|
+
|
|
84
|
+
After logging in, use the \`login_status\` tool to complete authentication.
|
|
85
|
+
|
|
86
|
+
**Code expires in:** ${Math.floor(data.expires_in / 60)} minutes
|
|
87
|
+
**User code:** ${data.user_code}
|
|
88
|
+
`,
|
|
89
|
+
}],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
94
|
+
return {
|
|
95
|
+
content: [{ type: "text", text: `Login failed: ${message}` }],
|
|
96
|
+
isError: true,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
case "login_status": {
|
|
101
|
+
if (!pendingDeviceCode || !pendingEndpoint) {
|
|
102
|
+
return {
|
|
103
|
+
content: [{ type: "text", text: "No login in progress. Use the `login` tool first." }],
|
|
104
|
+
isError: true,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
const response = await fetch(`${pendingEndpoint}/v1/auth/device-code/${pendingDeviceCode}`);
|
|
109
|
+
if (response.status === 202) {
|
|
110
|
+
return {
|
|
111
|
+
content: [{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: `⏳ **Waiting for login...**
|
|
114
|
+
|
|
115
|
+
Please complete the login in your browser.
|
|
116
|
+
|
|
117
|
+
If you haven't opened the link yet, use the \`login\` tool to get the URL again.`,
|
|
118
|
+
}],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (response.status === 410) {
|
|
122
|
+
pendingDeviceCode = null;
|
|
123
|
+
pendingEndpoint = null;
|
|
124
|
+
return {
|
|
125
|
+
content: [{ type: "text", text: "Login expired. Please use the `login` tool to start again." }],
|
|
126
|
+
isError: true,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (response.status === 404) {
|
|
130
|
+
pendingDeviceCode = null;
|
|
131
|
+
pendingEndpoint = null;
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: "text", text: "Login session not found. Please use the `login` tool to start again." }],
|
|
134
|
+
isError: true,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (!response.ok) {
|
|
138
|
+
const text = await response.text();
|
|
139
|
+
return {
|
|
140
|
+
content: [{ type: "text", text: `Failed to check login status: ${text}` }],
|
|
141
|
+
isError: true,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const data = await response.json();
|
|
145
|
+
// Clear pending state
|
|
146
|
+
pendingDeviceCode = null;
|
|
147
|
+
pendingEndpoint = null;
|
|
148
|
+
return {
|
|
149
|
+
content: [{
|
|
150
|
+
type: "text",
|
|
151
|
+
text: `# ✅ Login Successful!
|
|
152
|
+
|
|
153
|
+
**Email:** ${data.email}
|
|
154
|
+
**User ID:** ${data.user_id}
|
|
155
|
+
|
|
156
|
+
## Next Steps
|
|
157
|
+
|
|
158
|
+
Your access token has been received. To use the MCP tools, you'll need to:
|
|
159
|
+
|
|
160
|
+
1. **Create an API key** using the Qorrelate dashboard at ${pendingEndpoint}/settings
|
|
161
|
+
2. **Configure the MCP** with your API key:
|
|
162
|
+
|
|
163
|
+
\`\`\`json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"qorrelate": {
|
|
167
|
+
"command": "npx",
|
|
168
|
+
"args": ["qorrelate-mcp-server"],
|
|
169
|
+
"env": {
|
|
170
|
+
"QORRELATE_API_KEY": "your-api-key",
|
|
171
|
+
"QORRELATE_ENDPOINT": "${pendingEndpoint}"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
\`\`\`
|
|
177
|
+
|
|
178
|
+
## Access Token (for manual API calls)
|
|
179
|
+
|
|
180
|
+
\`\`\`
|
|
181
|
+
${data.access_token.substring(0, 50)}...
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
Note: This is a JWT token valid for API calls. For long-term MCP usage, create an API key instead.
|
|
185
|
+
`,
|
|
186
|
+
}],
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
191
|
+
return {
|
|
192
|
+
content: [{ type: "text", text: `Failed to check login status: ${message}` }],
|
|
193
|
+
isError: true,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
default:
|
|
198
|
+
return {
|
|
199
|
+
content: [{ type: "text", text: `Unknown auth tool: ${toolName}` }],
|
|
200
|
+
isError: true,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/tools/auth.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAQH,8CAgCC;AAED,wCAsLC;AA5ND,iCAAiC;AACjC,IAAI,iBAAiB,GAAkB,IAAI,CAAC;AAC5C,IAAI,eAAe,GAAkB,IAAI,CAAC;AAE1C,SAAgB,iBAAiB;IAC/B,OAAO;QACL;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE;;;;;;;;iFAQ8D;YAC3E,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB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C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,OAAO,EAAE,EAAE,CAAC;oBAC7E,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;QAED;YACE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,QAAQ,EAAE,EAAE,CAAC;gBACnE,OAAO,EAAE,IAAI;aACd,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Destination Management Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing notification destinations (Slack, email, PagerDuty, webhooks)
|
|
5
|
+
* and alert templates.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { QorrelateClient } from "../client.js";
|
|
9
|
+
export declare function registerNotificationTools(): Tool[];
|
|
10
|
+
export declare function handleNotificationTool(client: QorrelateClient, name: string, args: Record<string, unknown>): Promise<{
|
|
11
|
+
content: Array<{
|
|
12
|
+
type: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,wBAAgB,yBAAyB,IAAI,IAAI,EAAE,CAmJlD;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA+E7D"}
|