@techery/appspector-mcp 1.0.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/LICENSE +21 -0
- package/README.md +293 -0
- package/dist/__tests__/api-client.test.d.ts +2 -0
- package/dist/__tests__/api-client.test.d.ts.map +1 -0
- package/dist/__tests__/api-client.test.js +88 -0
- package/dist/__tests__/api-client.test.js.map +1 -0
- package/dist/__tests__/session-loader.test.d.ts +2 -0
- package/dist/__tests__/session-loader.test.d.ts.map +1 -0
- package/dist/__tests__/session-loader.test.js +189 -0
- package/dist/__tests__/session-loader.test.js.map +1 -0
- package/dist/api-client.d.ts +29 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +97 -0
- package/dist/api-client.js.map +1 -0
- package/dist/http-server.d.ts +3 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +426 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +579 -0
- package/dist/index.js.map +1 -0
- package/dist/session-loader.d.ts +16 -0
- package/dist/session-loader.d.ts.map +1 -0
- package/dist/session-loader.js +258 -0
- package/dist/session-loader.js.map +1 -0
- package/dist/types.d.ts +177 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/package.json +74 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { AppSpectorApiClient } from './api-client.js';
|
|
6
|
+
import { createCurlString, executeCurl, loadSessionHistory } from './session-loader.js';
|
|
7
|
+
const sessionCache = new Map();
|
|
8
|
+
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
9
|
+
// Environment-based authentication
|
|
10
|
+
const EMAIL = process.env.EMAIL;
|
|
11
|
+
const PASSWORD = process.env.PASSWORD;
|
|
12
|
+
// API client instance
|
|
13
|
+
const apiClient = new AppSpectorApiClient();
|
|
14
|
+
// Auto-login flag
|
|
15
|
+
let isAutoLoggedIn = false;
|
|
16
|
+
const autoLogin = async () => {
|
|
17
|
+
if (isAutoLoggedIn)
|
|
18
|
+
return true;
|
|
19
|
+
if (EMAIL && PASSWORD) {
|
|
20
|
+
try {
|
|
21
|
+
apiClient.setCredentials({ email: EMAIL, password: PASSWORD });
|
|
22
|
+
const session = await apiClient.login(EMAIL, PASSWORD);
|
|
23
|
+
console.error(`Auto-logged in as ${session.email}`);
|
|
24
|
+
isAutoLoggedIn = true;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Auto-login failed:', error instanceof Error ? error.message : error);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
// Create MCP server
|
|
35
|
+
const server = new McpServer({
|
|
36
|
+
name: 'appspector-mcp',
|
|
37
|
+
version: '1.0.0',
|
|
38
|
+
});
|
|
39
|
+
// Login tool
|
|
40
|
+
server.tool('login', 'Login to AppSpector with email and password', {
|
|
41
|
+
email: z.string().describe('Your AppSpector email'),
|
|
42
|
+
password: z.string().describe('Your AppSpector password'),
|
|
43
|
+
}, async ({ email, password }) => {
|
|
44
|
+
try {
|
|
45
|
+
apiClient.setCredentials({ email, password });
|
|
46
|
+
const session = await apiClient.login(email, password);
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: `Successfully logged in as ${session.email}. Account: ${session.account.accountType}.`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: `Login failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
isError: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// Get apps tool
|
|
69
|
+
server.tool('get_apps', 'Get list of all apps in AppSpector', {}, async () => {
|
|
70
|
+
try {
|
|
71
|
+
await autoLogin();
|
|
72
|
+
const apps = await apiClient.getApps();
|
|
73
|
+
const appsList = apps
|
|
74
|
+
.map((app) => `- ${app.name} (ID: ${app.id}, Platform: ${app.platform}, Bundle: ${app.bundleId})`)
|
|
75
|
+
.join('\n');
|
|
76
|
+
return {
|
|
77
|
+
content: [
|
|
78
|
+
{
|
|
79
|
+
type: 'text',
|
|
80
|
+
text: `Found ${apps.length} app(s):\n\n${appsList}`,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: 'text',
|
|
90
|
+
text: `Failed to get apps: ${error instanceof Error ? error.message : String(error)}`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
isError: true,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// Get sessions tool
|
|
98
|
+
server.tool('get_sessions', 'Get sessions for an app or all online sessions', {
|
|
99
|
+
app_id: z.number().optional().describe('App ID to get sessions for (optional, if not provided returns all online sessions)'),
|
|
100
|
+
limit: z.number().optional().default(20).describe('Maximum number of sessions to return'),
|
|
101
|
+
}, async ({ app_id, limit }) => {
|
|
102
|
+
try {
|
|
103
|
+
await autoLogin();
|
|
104
|
+
let sessions;
|
|
105
|
+
if (app_id) {
|
|
106
|
+
sessions = await apiClient.getSessionsByApp({ appId: app_id, limit });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
sessions = await apiClient.getOnlineSessions();
|
|
110
|
+
}
|
|
111
|
+
if (sessions.length === 0) {
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: 'No sessions found.',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const sessionsList = sessions
|
|
122
|
+
.map((session) => {
|
|
123
|
+
const device = session.device;
|
|
124
|
+
const monitors = session.monitors.filter((m) => m.enable).map((m) => m.id);
|
|
125
|
+
return `- Session ${session.id}
|
|
126
|
+
App: ${session.appName} (v${session.appVersion})
|
|
127
|
+
Device: ${device.deviceName} (${device.platform} ${device.OSVersion})
|
|
128
|
+
State: ${session.state}
|
|
129
|
+
Created: ${new Date(session.createdAt).toISOString()}
|
|
130
|
+
Monitors: ${monitors.join(', ') || 'none'}`;
|
|
131
|
+
})
|
|
132
|
+
.join('\n\n');
|
|
133
|
+
return {
|
|
134
|
+
content: [
|
|
135
|
+
{
|
|
136
|
+
type: 'text',
|
|
137
|
+
text: `Found ${sessions.length} session(s):\n\n${sessionsList}`,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
return {
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: `Failed to get sessions: ${error instanceof Error ? error.message : String(error)}`,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
isError: true,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
// Helper to load session logs with caching
|
|
155
|
+
const loadSessionLogs = async ({ appId, sessionId, }) => {
|
|
156
|
+
await autoLogin();
|
|
157
|
+
const cacheKey = `${appId}-${sessionId}`;
|
|
158
|
+
const cached = sessionCache.get(cacheKey);
|
|
159
|
+
if (cached && Date.now() - cached.loadedAt < CACHE_TTL) {
|
|
160
|
+
return cached;
|
|
161
|
+
}
|
|
162
|
+
const session = await apiClient.getSession({ appId, sessionId });
|
|
163
|
+
const token = apiClient.getToken();
|
|
164
|
+
if (!token) {
|
|
165
|
+
throw new Error('Not authenticated. Please login first.');
|
|
166
|
+
}
|
|
167
|
+
const logs = await loadSessionHistory({ session, userToken: token });
|
|
168
|
+
const cacheEntry = {
|
|
169
|
+
...logs,
|
|
170
|
+
loadedAt: Date.now(),
|
|
171
|
+
};
|
|
172
|
+
sessionCache.set(cacheKey, cacheEntry);
|
|
173
|
+
return cacheEntry;
|
|
174
|
+
};
|
|
175
|
+
// Get console logs tool
|
|
176
|
+
server.tool('get_console_logs', 'Get console logs from a session', {
|
|
177
|
+
app_id: z.number().describe('App ID'),
|
|
178
|
+
session_id: z.string().describe('Session ID'),
|
|
179
|
+
limit: z.number().optional().default(100).describe('Maximum number of logs to return'),
|
|
180
|
+
level: z.string().optional().describe('Filter by log level (verbose, debug, info, warning, error)'),
|
|
181
|
+
search: z.string().optional().describe('Search term to filter logs'),
|
|
182
|
+
}, async ({ app_id, session_id, limit, level, search }) => {
|
|
183
|
+
try {
|
|
184
|
+
const { consoleLogs } = await loadSessionLogs({ appId: app_id, sessionId: session_id });
|
|
185
|
+
let filteredLogs = consoleLogs;
|
|
186
|
+
if (level) {
|
|
187
|
+
filteredLogs = filteredLogs.filter((log) => log.level?.toLowerCase() === level.toLowerCase());
|
|
188
|
+
}
|
|
189
|
+
if (search) {
|
|
190
|
+
const searchLower = search.toLowerCase();
|
|
191
|
+
filteredLogs = filteredLogs.filter((log) => log.message.toLowerCase().includes(searchLower) ||
|
|
192
|
+
log.tag?.toLowerCase().includes(searchLower));
|
|
193
|
+
}
|
|
194
|
+
// Sort by timestamp descending (newest first)
|
|
195
|
+
filteredLogs = filteredLogs.sort((a, b) => b.timestamp - a.timestamp).slice(0, limit);
|
|
196
|
+
if (filteredLogs.length === 0) {
|
|
197
|
+
return {
|
|
198
|
+
content: [
|
|
199
|
+
{
|
|
200
|
+
type: 'text',
|
|
201
|
+
text: 'No console logs found matching criteria.',
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
const logsList = filteredLogs
|
|
207
|
+
.map((log) => {
|
|
208
|
+
const time = new Date(log.timestamp).toISOString();
|
|
209
|
+
const levelStr = log.level ? `[${log.level.toUpperCase()}]` : '';
|
|
210
|
+
const tagStr = log.tag ? `[${log.tag}]` : '';
|
|
211
|
+
return `${time} ${levelStr}${tagStr} ${log.message}`;
|
|
212
|
+
})
|
|
213
|
+
.join('\n');
|
|
214
|
+
return {
|
|
215
|
+
content: [
|
|
216
|
+
{
|
|
217
|
+
type: 'text',
|
|
218
|
+
text: `Found ${filteredLogs.length} console log(s):\n\n${logsList}`,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
return {
|
|
225
|
+
content: [
|
|
226
|
+
{
|
|
227
|
+
type: 'text',
|
|
228
|
+
text: `Failed to get console logs: ${error instanceof Error ? error.message : String(error)}`,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
isError: true,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
// Get HTTP logs tool
|
|
236
|
+
server.tool('get_http_logs', 'Get HTTP/network logs from a session', {
|
|
237
|
+
app_id: z.number().describe('App ID'),
|
|
238
|
+
session_id: z.string().describe('Session ID'),
|
|
239
|
+
limit: z.number().optional().default(50).describe('Maximum number of logs to return'),
|
|
240
|
+
method: z.string().optional().describe('Filter by HTTP method (GET, POST, PUT, DELETE, etc.)'),
|
|
241
|
+
status: z.number().optional().describe('Filter by status code'),
|
|
242
|
+
host: z.string().optional().describe('Filter by host'),
|
|
243
|
+
search: z.string().optional().describe('Search term to filter by URL'),
|
|
244
|
+
}, async ({ app_id, session_id, limit, method, status, host, search }) => {
|
|
245
|
+
try {
|
|
246
|
+
const { httpLogs } = await loadSessionLogs({ appId: app_id, sessionId: session_id });
|
|
247
|
+
let filteredLogs = httpLogs;
|
|
248
|
+
if (method) {
|
|
249
|
+
filteredLogs = filteredLogs.filter((log) => log.request.method.toUpperCase() === method.toUpperCase());
|
|
250
|
+
}
|
|
251
|
+
if (status !== undefined) {
|
|
252
|
+
filteredLogs = filteredLogs.filter((log) => log.response?.statusCode === status);
|
|
253
|
+
}
|
|
254
|
+
if (host) {
|
|
255
|
+
const hostLower = host.toLowerCase();
|
|
256
|
+
filteredLogs = filteredLogs.filter((log) => log.request.host.toLowerCase().includes(hostLower));
|
|
257
|
+
}
|
|
258
|
+
if (search) {
|
|
259
|
+
const searchLower = search.toLowerCase();
|
|
260
|
+
filteredLogs = filteredLogs.filter((log) => log.request.url.toLowerCase().includes(searchLower));
|
|
261
|
+
}
|
|
262
|
+
// Sort by timestamp descending (newest first)
|
|
263
|
+
filteredLogs = filteredLogs.sort((a, b) => b.timestamp - a.timestamp).slice(0, limit);
|
|
264
|
+
if (filteredLogs.length === 0) {
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
{
|
|
268
|
+
type: 'text',
|
|
269
|
+
text: 'No HTTP logs found matching criteria.',
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const logsList = filteredLogs
|
|
275
|
+
.map((log, index) => {
|
|
276
|
+
const time = new Date(log.timestamp).toISOString();
|
|
277
|
+
const statusStr = log.response ? `${log.response.statusCode}` : 'pending';
|
|
278
|
+
const duration = log.response ? `${log.response.duration}ms` : '-';
|
|
279
|
+
const error = log.response?.error ? ` [ERROR: ${log.response.error}]` : '';
|
|
280
|
+
return `${index + 1}. [${log.uid}] ${time}
|
|
281
|
+
${log.request.method} ${log.request.url}
|
|
282
|
+
Status: ${statusStr} | Duration: ${duration}${error}`;
|
|
283
|
+
})
|
|
284
|
+
.join('\n\n');
|
|
285
|
+
return {
|
|
286
|
+
content: [
|
|
287
|
+
{
|
|
288
|
+
type: 'text',
|
|
289
|
+
text: `Found ${filteredLogs.length} HTTP log(s):\n\n${logsList}`,
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
return {
|
|
296
|
+
content: [
|
|
297
|
+
{
|
|
298
|
+
type: 'text',
|
|
299
|
+
text: `Failed to get HTTP logs: ${error instanceof Error ? error.message : String(error)}`,
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
isError: true,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
// Get HTTP log details tool
|
|
307
|
+
server.tool('get_http_log_details', 'Get detailed information about a specific HTTP request', {
|
|
308
|
+
app_id: z.number().describe('App ID'),
|
|
309
|
+
session_id: z.string().describe('Session ID'),
|
|
310
|
+
request_uid: z.string().describe('Request UID from get_http_logs'),
|
|
311
|
+
}, async ({ app_id, session_id, request_uid }) => {
|
|
312
|
+
try {
|
|
313
|
+
const { httpLogs } = await loadSessionLogs({ appId: app_id, sessionId: session_id });
|
|
314
|
+
const log = httpLogs.find((l) => l.uid === request_uid);
|
|
315
|
+
if (!log) {
|
|
316
|
+
return {
|
|
317
|
+
content: [
|
|
318
|
+
{
|
|
319
|
+
type: 'text',
|
|
320
|
+
text: `HTTP request with UID "${request_uid}" not found.`,
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
isError: true,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
const { request, response } = log;
|
|
327
|
+
let details = `HTTP Request Details (${request_uid})
|
|
328
|
+
========================================
|
|
329
|
+
|
|
330
|
+
REQUEST:
|
|
331
|
+
Method: ${request.method}
|
|
332
|
+
URL: ${request.url}
|
|
333
|
+
Protocol: ${request.protocol}
|
|
334
|
+
Host: ${request.host}
|
|
335
|
+
Path: ${request.pathname}
|
|
336
|
+
|
|
337
|
+
REQUEST HEADERS:
|
|
338
|
+
${Object.entries(request.headers)
|
|
339
|
+
.map(([k, v]) => ` ${k}: ${v}`)
|
|
340
|
+
.join('\n') || ' (none)'}`;
|
|
341
|
+
if (request.body?.length) {
|
|
342
|
+
const decoder = new TextDecoder('utf-8');
|
|
343
|
+
try {
|
|
344
|
+
const bodyText = decoder.decode(request.body);
|
|
345
|
+
details += `\n\nREQUEST BODY (${request.body.length} bytes):\n${bodyText}`;
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
details += `\n\nREQUEST BODY: (${request.body.length} bytes, binary data)`;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (response) {
|
|
352
|
+
details += `\n\nRESPONSE:
|
|
353
|
+
Status: ${response.statusCode}
|
|
354
|
+
Duration: ${response.duration}ms
|
|
355
|
+
${response.error ? `Error: ${response.error}` : ''}
|
|
356
|
+
|
|
357
|
+
RESPONSE HEADERS:
|
|
358
|
+
${Object.entries(response.headers)
|
|
359
|
+
.map(([k, v]) => ` ${k}: ${v}`)
|
|
360
|
+
.join('\n') || ' (none)'}`;
|
|
361
|
+
if (response.body?.length) {
|
|
362
|
+
const decoder = new TextDecoder('utf-8');
|
|
363
|
+
try {
|
|
364
|
+
const bodyText = decoder.decode(response.body);
|
|
365
|
+
// Limit response body size for display
|
|
366
|
+
const truncated = bodyText.length > 5000 ? bodyText.substring(0, 5000) + '\n...(truncated)' : bodyText;
|
|
367
|
+
details += `\n\nRESPONSE BODY (${response.body.length} bytes):\n${truncated}`;
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
details += `\n\nRESPONSE BODY: (${response.body.length} bytes, binary data)`;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (response.timings) {
|
|
374
|
+
details += `\n\nTIMINGS:
|
|
375
|
+
DNS Lookup: ${response.timings.domainLookupDuration / 1000000}ms
|
|
376
|
+
Connect: ${response.timings.connectDuration / 1000000}ms
|
|
377
|
+
SSL Handshake: ${response.timings.secureHandshakeDuration / 1000000}ms
|
|
378
|
+
Request: ${response.timings.requestDuration / 1000000}ms
|
|
379
|
+
Response: ${response.timings.responseDuration / 1000000}ms`;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
details += '\n\nRESPONSE: (pending or no response)';
|
|
384
|
+
}
|
|
385
|
+
return {
|
|
386
|
+
content: [
|
|
387
|
+
{
|
|
388
|
+
type: 'text',
|
|
389
|
+
text: details,
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
return {
|
|
396
|
+
content: [
|
|
397
|
+
{
|
|
398
|
+
type: 'text',
|
|
399
|
+
text: `Failed to get HTTP log details: ${error instanceof Error ? error.message : String(error)}`,
|
|
400
|
+
},
|
|
401
|
+
],
|
|
402
|
+
isError: true,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
// Get curl command tool
|
|
407
|
+
server.tool('get_curl', 'Generate a curl command from an HTTP request', {
|
|
408
|
+
app_id: z.number().describe('App ID'),
|
|
409
|
+
session_id: z.string().describe('Session ID'),
|
|
410
|
+
request_uid: z.string().describe('Request UID from get_http_logs'),
|
|
411
|
+
}, async ({ app_id, session_id, request_uid }) => {
|
|
412
|
+
try {
|
|
413
|
+
const { httpLogs } = await loadSessionLogs({ appId: app_id, sessionId: session_id });
|
|
414
|
+
const log = httpLogs.find((l) => l.uid === request_uid);
|
|
415
|
+
if (!log) {
|
|
416
|
+
return {
|
|
417
|
+
content: [
|
|
418
|
+
{
|
|
419
|
+
type: 'text',
|
|
420
|
+
text: `HTTP request with UID "${request_uid}" not found.`,
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
isError: true,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
const curlCommand = createCurlString(log);
|
|
427
|
+
if (!curlCommand) {
|
|
428
|
+
return {
|
|
429
|
+
content: [
|
|
430
|
+
{
|
|
431
|
+
type: 'text',
|
|
432
|
+
text: 'Failed to generate curl command for this request.',
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
isError: true,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
content: [
|
|
440
|
+
{
|
|
441
|
+
type: 'text',
|
|
442
|
+
text: `Curl command for ${log.request.method} ${log.request.url}:\n\n${curlCommand}`,
|
|
443
|
+
},
|
|
444
|
+
],
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
catch (error) {
|
|
448
|
+
return {
|
|
449
|
+
content: [
|
|
450
|
+
{
|
|
451
|
+
type: 'text',
|
|
452
|
+
text: `Failed to generate curl: ${error instanceof Error ? error.message : String(error)}`,
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
isError: true,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
// Execute curl command tool
|
|
460
|
+
server.tool('execute_curl', 'Execute a curl command (generated from HTTP request or custom)', {
|
|
461
|
+
app_id: z.number().optional().describe('App ID (optional, if request_uid is provided)'),
|
|
462
|
+
session_id: z.string().optional().describe('Session ID (optional, if request_uid is provided)'),
|
|
463
|
+
request_uid: z.string().optional().describe('Request UID to replay (optional)'),
|
|
464
|
+
curl_command: z.string().optional().describe('Custom curl command to execute (optional, if not using request_uid)'),
|
|
465
|
+
}, async ({ app_id, session_id, request_uid, curl_command }) => {
|
|
466
|
+
try {
|
|
467
|
+
let curlToExecute = curl_command;
|
|
468
|
+
if (request_uid && app_id && session_id) {
|
|
469
|
+
const { httpLogs } = await loadSessionLogs({ appId: app_id, sessionId: session_id });
|
|
470
|
+
const log = httpLogs.find((l) => l.uid === request_uid);
|
|
471
|
+
if (!log) {
|
|
472
|
+
return {
|
|
473
|
+
content: [
|
|
474
|
+
{
|
|
475
|
+
type: 'text',
|
|
476
|
+
text: `HTTP request with UID "${request_uid}" not found.`,
|
|
477
|
+
},
|
|
478
|
+
],
|
|
479
|
+
isError: true,
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
curlToExecute = createCurlString(log);
|
|
483
|
+
}
|
|
484
|
+
if (!curlToExecute) {
|
|
485
|
+
return {
|
|
486
|
+
content: [
|
|
487
|
+
{
|
|
488
|
+
type: 'text',
|
|
489
|
+
text: 'No curl command provided. Either provide curl_command or app_id + session_id + request_uid.',
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
isError: true,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
const result = await executeCurl(curlToExecute);
|
|
496
|
+
let output = `Curl execution result (exit code: ${result.exitCode}):\n\n`;
|
|
497
|
+
if (result.stderr) {
|
|
498
|
+
output += `STDERR:\n${result.stderr}\n\n`;
|
|
499
|
+
}
|
|
500
|
+
if (result.stdout) {
|
|
501
|
+
// Limit output size
|
|
502
|
+
const truncated = result.stdout.length > 10000
|
|
503
|
+
? result.stdout.substring(0, 10000) + '\n...(truncated)'
|
|
504
|
+
: result.stdout;
|
|
505
|
+
output += `STDOUT:\n${truncated}`;
|
|
506
|
+
}
|
|
507
|
+
return {
|
|
508
|
+
content: [
|
|
509
|
+
{
|
|
510
|
+
type: 'text',
|
|
511
|
+
text: output,
|
|
512
|
+
},
|
|
513
|
+
],
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
catch (error) {
|
|
517
|
+
return {
|
|
518
|
+
content: [
|
|
519
|
+
{
|
|
520
|
+
type: 'text',
|
|
521
|
+
text: `Failed to execute curl: ${error instanceof Error ? error.message : String(error)}`,
|
|
522
|
+
},
|
|
523
|
+
],
|
|
524
|
+
isError: true,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
// Clear cache tool
|
|
529
|
+
server.tool('clear_cache', 'Clear the session data cache', {
|
|
530
|
+
session_id: z.string().optional().describe('Specific session ID to clear (optional, clears all if not provided)'),
|
|
531
|
+
}, async ({ session_id }) => {
|
|
532
|
+
if (session_id) {
|
|
533
|
+
// Clear specific session cache
|
|
534
|
+
let cleared = 0;
|
|
535
|
+
for (const key of sessionCache.keys()) {
|
|
536
|
+
if (key.includes(session_id)) {
|
|
537
|
+
sessionCache.delete(key);
|
|
538
|
+
cleared++;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return {
|
|
542
|
+
content: [
|
|
543
|
+
{
|
|
544
|
+
type: 'text',
|
|
545
|
+
text: `Cleared ${cleared} cache entries for session ${session_id}.`,
|
|
546
|
+
},
|
|
547
|
+
],
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
const size = sessionCache.size;
|
|
551
|
+
sessionCache.clear();
|
|
552
|
+
return {
|
|
553
|
+
content: [
|
|
554
|
+
{
|
|
555
|
+
type: 'text',
|
|
556
|
+
text: `Cleared all ${size} cache entries.`,
|
|
557
|
+
},
|
|
558
|
+
],
|
|
559
|
+
};
|
|
560
|
+
});
|
|
561
|
+
// Start the server
|
|
562
|
+
const main = async () => {
|
|
563
|
+
// Try auto-login at startup
|
|
564
|
+
if (EMAIL && PASSWORD) {
|
|
565
|
+
console.error('Attempting auto-login with environment credentials...');
|
|
566
|
+
await autoLogin();
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
console.error('No EMAIL/PASSWORD set - manual login required via login tool');
|
|
570
|
+
}
|
|
571
|
+
const transport = new StdioServerTransport();
|
|
572
|
+
await server.connect(transport);
|
|
573
|
+
console.error('AppSpector MCP server started');
|
|
574
|
+
};
|
|
575
|
+
main().catch((error) => {
|
|
576
|
+
console.error('Failed to start server:', error);
|
|
577
|
+
process.exit(1);
|
|
578
|
+
});
|
|
579
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iB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AM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTTPSummaryLog, LogRecord, Session } from './types.js';
|
|
2
|
+
export interface SessionLogs {
|
|
3
|
+
httpLogs: HTTPSummaryLog[];
|
|
4
|
+
consoleLogs: LogRecord[];
|
|
5
|
+
}
|
|
6
|
+
export declare const loadSessionHistory: ({ session, userToken, }: {
|
|
7
|
+
session: Session;
|
|
8
|
+
userToken: string;
|
|
9
|
+
}) => Promise<SessionLogs>;
|
|
10
|
+
export declare const createCurlString: (log: HTTPSummaryLog) => string | undefined;
|
|
11
|
+
export declare const executeCurl: (curlCommand: string) => Promise<{
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
exitCode: number;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=session-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-loader.d.ts","sourceRoot":"","sources":["../src/session-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,cAAc,EACd,SAAS,EACT,OAAO,EAER,MAAM,YAAY,CAAC;AAoDpB,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,EAAE,SAAS,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,GAAU,yBAGtC;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG,OAAO,CAAC,WAAW,CAkBtB,CAAC;AA6JF,eAAO,MAAM,gBAAgB,GAAI,KAAK,cAAc,KAAG,MAAM,GAAG,SAiD/D,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,aAAa,MAAM,KAClB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAoB9D,CAAC"}
|