@arvoretech/runtime-lens-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/.vscodeignore +21 -0
- package/README.md +136 -0
- package/agent/index.ts +263 -0
- package/agent/tsconfig.json +17 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/log-collector.d.ts +73 -0
- package/dist/log-collector.d.ts.map +1 -0
- package/dist/log-collector.js +349 -0
- package/dist/log-collector.js.map +1 -0
- package/dist/process-inspector.d.ts +44 -0
- package/dist/process-inspector.d.ts.map +1 -0
- package/dist/process-inspector.js +190 -0
- package/dist/process-inspector.js.map +1 -0
- package/dist/runtime-interceptor.d.ts +18 -0
- package/dist/runtime-interceptor.d.ts.map +1 -0
- package/dist/runtime-interceptor.js +133 -0
- package/dist/runtime-interceptor.js.map +1 -0
- package/dist/server.d.ts +26 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +301 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +280 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +102 -0
- package/dist/types.js.map +1 -0
- package/eslint.config.js +41 -0
- package/extension/decorator.ts +144 -0
- package/extension/extension.ts +98 -0
- package/extension/runtime-bridge.ts +206 -0
- package/extension/tsconfig.json +17 -0
- package/package.json +134 -0
- package/src/index.ts +18 -0
- package/src/log-collector.ts +441 -0
- package/src/process-inspector.ts +235 -0
- package/src/runtime-interceptor.ts +152 -0
- package/src/server.ts +387 -0
- package/src/types.ts +128 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +13 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const LEVEL_MAP = {
|
|
2
|
+
log: "info",
|
|
3
|
+
info: "info",
|
|
4
|
+
warn: "warn",
|
|
5
|
+
error: "error",
|
|
6
|
+
debug: "debug",
|
|
7
|
+
};
|
|
8
|
+
export class RuntimeInterceptor {
|
|
9
|
+
originalConsole = {};
|
|
10
|
+
intercepting = false;
|
|
11
|
+
collector;
|
|
12
|
+
framework;
|
|
13
|
+
constructor(collector, framework = "unknown") {
|
|
14
|
+
this.collector = collector;
|
|
15
|
+
this.framework = framework;
|
|
16
|
+
}
|
|
17
|
+
startIntercepting() {
|
|
18
|
+
if (this.intercepting)
|
|
19
|
+
return;
|
|
20
|
+
const methods = ["log", "info", "warn", "error", "debug"];
|
|
21
|
+
for (const method of methods) {
|
|
22
|
+
this.originalConsole[method] = console[method].bind(console);
|
|
23
|
+
console[method] = (...args) => {
|
|
24
|
+
this.collector.addLog({
|
|
25
|
+
level: LEVEL_MAP[method],
|
|
26
|
+
message: args.map((a) => this.serialize(a)).join(" "),
|
|
27
|
+
source: "console",
|
|
28
|
+
framework: this.framework,
|
|
29
|
+
stackTrace: method === "error" ? this.captureStack() : undefined,
|
|
30
|
+
metadata: args.length === 1 && typeof args[0] === "object" ? args[0] : undefined,
|
|
31
|
+
});
|
|
32
|
+
this.originalConsole[method](...args);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
this.interceptStderr();
|
|
36
|
+
this.interceptUncaughtErrors();
|
|
37
|
+
this.intercepting = true;
|
|
38
|
+
}
|
|
39
|
+
stopIntercepting() {
|
|
40
|
+
if (!this.intercepting)
|
|
41
|
+
return;
|
|
42
|
+
const methods = ["log", "info", "warn", "error", "debug"];
|
|
43
|
+
for (const method of methods) {
|
|
44
|
+
if (this.originalConsole[method]) {
|
|
45
|
+
console[method] = this.originalConsole[method];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
this.intercepting = false;
|
|
49
|
+
}
|
|
50
|
+
isActive() {
|
|
51
|
+
return this.intercepting;
|
|
52
|
+
}
|
|
53
|
+
interceptStderr() {
|
|
54
|
+
const originalWrite = process.stderr.write.bind(process.stderr);
|
|
55
|
+
process.stderr.write = ((chunk, encodingOrCallback, callback) => {
|
|
56
|
+
const text = typeof chunk === "string" ? chunk : chunk.toString();
|
|
57
|
+
if (text.trim() && !text.includes("MCP Server")) {
|
|
58
|
+
this.collector.addLog({
|
|
59
|
+
level: this.inferLevel(text),
|
|
60
|
+
message: text.trim(),
|
|
61
|
+
source: "stderr",
|
|
62
|
+
framework: this.framework,
|
|
63
|
+
stackTrace: text.includes("Error") ? text : undefined,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (typeof encodingOrCallback === "function") {
|
|
67
|
+
return originalWrite(chunk, encodingOrCallback);
|
|
68
|
+
}
|
|
69
|
+
return originalWrite(chunk, encodingOrCallback, callback);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
interceptUncaughtErrors() {
|
|
73
|
+
process.on("uncaughtException", (error) => {
|
|
74
|
+
this.collector.addLog({
|
|
75
|
+
level: "fatal",
|
|
76
|
+
message: error.message,
|
|
77
|
+
source: "uncaughtException",
|
|
78
|
+
framework: this.framework,
|
|
79
|
+
stackTrace: error.stack,
|
|
80
|
+
metadata: { name: error.name },
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
process.on("unhandledRejection", (reason) => {
|
|
84
|
+
this.collector.addLog({
|
|
85
|
+
level: "error",
|
|
86
|
+
message: reason instanceof Error ? reason.message : String(reason),
|
|
87
|
+
source: "unhandledRejection",
|
|
88
|
+
framework: this.framework,
|
|
89
|
+
stackTrace: reason instanceof Error ? reason.stack : undefined,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
serialize(value) {
|
|
94
|
+
if (value === null)
|
|
95
|
+
return "null";
|
|
96
|
+
if (value === undefined)
|
|
97
|
+
return "undefined";
|
|
98
|
+
if (typeof value === "string")
|
|
99
|
+
return value;
|
|
100
|
+
if (value instanceof Error)
|
|
101
|
+
return `${value.name}: ${value.message}\n${value.stack}`;
|
|
102
|
+
if (typeof value === "object") {
|
|
103
|
+
try {
|
|
104
|
+
return JSON.stringify(value, null, 2);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return Object.prototype.toString.call(value);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return String(value);
|
|
111
|
+
}
|
|
112
|
+
captureStack() {
|
|
113
|
+
const stack = new Error().stack || "";
|
|
114
|
+
return stack
|
|
115
|
+
.split("\n")
|
|
116
|
+
.slice(3)
|
|
117
|
+
.filter((line) => !line.includes("runtime-interceptor"))
|
|
118
|
+
.join("\n");
|
|
119
|
+
}
|
|
120
|
+
inferLevel(text) {
|
|
121
|
+
const lower = text.toLowerCase();
|
|
122
|
+
if (lower.includes("fatal") || lower.includes("critical"))
|
|
123
|
+
return "fatal";
|
|
124
|
+
if (lower.includes("error"))
|
|
125
|
+
return "error";
|
|
126
|
+
if (lower.includes("warn"))
|
|
127
|
+
return "warn";
|
|
128
|
+
if (lower.includes("debug") || lower.includes("verbose"))
|
|
129
|
+
return "debug";
|
|
130
|
+
return "info";
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=runtime-interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-interceptor.js","sourceRoot":"","sources":["../src/runtime-interceptor.ts"],"names":[],"mappings":"AAKA,MAAM,SAAS,GAAoC;IACjD,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,OAAO,kBAAkB;IACrB,eAAe,GAAwD,EAAS,CAAC;IACjF,YAAY,GAAG,KAAK,CAAC;IACZ,SAAS,CAAe;IACxB,SAAS,CAAY;IAEtC,YAAY,SAAuB,EAAE,YAAuB,SAAS;QACnE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAE9B,MAAM,OAAO,GAA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IAChB,CAAC;CACF"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class RuntimeLensMCPServer {
|
|
2
|
+
private readonly server;
|
|
3
|
+
private readonly collector;
|
|
4
|
+
private readonly inspector;
|
|
5
|
+
private readonly interceptor;
|
|
6
|
+
constructor(projectRoot?: string, logPaths?: string[]);
|
|
7
|
+
static fromEnvironment(): RuntimeLensMCPServer;
|
|
8
|
+
private setupTools;
|
|
9
|
+
private registerTailLogs;
|
|
10
|
+
private registerSearchLogs;
|
|
11
|
+
private registerGetErrors;
|
|
12
|
+
private registerInspectRequests;
|
|
13
|
+
private registerGetPerformance;
|
|
14
|
+
private registerGetEnvInfo;
|
|
15
|
+
private registerClearLogs;
|
|
16
|
+
private registerGetStats;
|
|
17
|
+
private registerStartInterceptor;
|
|
18
|
+
private registerStopInterceptor;
|
|
19
|
+
private registerCollectLogs;
|
|
20
|
+
private registerScanProject;
|
|
21
|
+
private registerFindProcesses;
|
|
22
|
+
private registerGetPorts;
|
|
23
|
+
start(): Promise<void>;
|
|
24
|
+
setupGracefulShutdown(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAaA,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;gBAErC,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAarD,MAAM,CAAC,eAAe,IAAI,oBAAoB;IAM9C,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,kBAAkB;IA0B1B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,uBAAuB;IA0B/B,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,gBAAgB;IAoBlB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAc5B,qBAAqB,IAAI,IAAI;CAU9B"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { LogCollector } from "./log-collector.js";
|
|
4
|
+
import { ProcessInspector } from "./process-inspector.js";
|
|
5
|
+
import { RuntimeInterceptor } from "./runtime-interceptor.js";
|
|
6
|
+
import { TailLogsParamsSchema, SearchLogsParamsSchema, GetErrorsParamsSchema, InspectRequestParamsSchema, GetPerformanceParamsSchema, } from "./types.js";
|
|
7
|
+
export class RuntimeLensMCPServer {
|
|
8
|
+
server;
|
|
9
|
+
collector;
|
|
10
|
+
inspector;
|
|
11
|
+
interceptor;
|
|
12
|
+
constructor(projectRoot, logPaths) {
|
|
13
|
+
this.server = new McpServer({
|
|
14
|
+
name: "runtime-lens-mcp",
|
|
15
|
+
version: "1.0.0",
|
|
16
|
+
});
|
|
17
|
+
this.collector = new LogCollector(projectRoot, logPaths);
|
|
18
|
+
this.inspector = new ProcessInspector(projectRoot);
|
|
19
|
+
this.interceptor = new RuntimeInterceptor(this.collector);
|
|
20
|
+
this.setupTools();
|
|
21
|
+
}
|
|
22
|
+
static fromEnvironment() {
|
|
23
|
+
const projectRoot = process.env.RUNTIME_LENS_PROJECT_ROOT || process.cwd();
|
|
24
|
+
const logPaths = process.env.RUNTIME_LENS_LOG_PATHS?.split(",").filter(Boolean) || [];
|
|
25
|
+
return new RuntimeLensMCPServer(projectRoot, logPaths);
|
|
26
|
+
}
|
|
27
|
+
setupTools() {
|
|
28
|
+
this.registerTailLogs();
|
|
29
|
+
this.registerSearchLogs();
|
|
30
|
+
this.registerGetErrors();
|
|
31
|
+
this.registerInspectRequests();
|
|
32
|
+
this.registerGetPerformance();
|
|
33
|
+
this.registerGetEnvInfo();
|
|
34
|
+
this.registerClearLogs();
|
|
35
|
+
this.registerGetStats();
|
|
36
|
+
this.registerStartInterceptor();
|
|
37
|
+
this.registerStopInterceptor();
|
|
38
|
+
this.registerCollectLogs();
|
|
39
|
+
this.registerScanProject();
|
|
40
|
+
this.registerFindProcesses();
|
|
41
|
+
this.registerGetPorts();
|
|
42
|
+
}
|
|
43
|
+
registerTailLogs() {
|
|
44
|
+
this.server.registerTool("tail_logs", {
|
|
45
|
+
title: "Tail Logs",
|
|
46
|
+
description: "Retrieve recent log entries from the application buffer. Supports filtering by level, framework, and source.",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
lines: TailLogsParamsSchema.shape.lines,
|
|
49
|
+
level: TailLogsParamsSchema.shape.level,
|
|
50
|
+
framework: TailLogsParamsSchema.shape.framework,
|
|
51
|
+
source: TailLogsParamsSchema.shape.source,
|
|
52
|
+
},
|
|
53
|
+
}, async (params) => {
|
|
54
|
+
const logs = this.collector.getLogs(params);
|
|
55
|
+
return {
|
|
56
|
+
content: [{
|
|
57
|
+
type: "text",
|
|
58
|
+
text: JSON.stringify(logs, null, 2),
|
|
59
|
+
}],
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
registerSearchLogs() {
|
|
64
|
+
this.server.registerTool("search_logs", {
|
|
65
|
+
title: "Search Logs",
|
|
66
|
+
description: "Search through collected logs using regex patterns. Filter by level, framework, and time range.",
|
|
67
|
+
inputSchema: {
|
|
68
|
+
query: SearchLogsParamsSchema.shape.query,
|
|
69
|
+
level: SearchLogsParamsSchema.shape.level,
|
|
70
|
+
framework: SearchLogsParamsSchema.shape.framework,
|
|
71
|
+
limit: SearchLogsParamsSchema.shape.limit,
|
|
72
|
+
since: SearchLogsParamsSchema.shape.since,
|
|
73
|
+
},
|
|
74
|
+
}, async (params) => {
|
|
75
|
+
const logs = this.collector.searchLogs(params);
|
|
76
|
+
return {
|
|
77
|
+
content: [{
|
|
78
|
+
type: "text",
|
|
79
|
+
text: JSON.stringify(logs, null, 2),
|
|
80
|
+
}],
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
registerGetErrors() {
|
|
85
|
+
this.server.registerTool("get_errors", {
|
|
86
|
+
title: "Get Errors",
|
|
87
|
+
description: "Retrieve recent errors with stack traces. Optionally group similar errors together to identify patterns.",
|
|
88
|
+
inputSchema: {
|
|
89
|
+
limit: GetErrorsParamsSchema.shape.limit,
|
|
90
|
+
framework: GetErrorsParamsSchema.shape.framework,
|
|
91
|
+
grouped: GetErrorsParamsSchema.shape.grouped,
|
|
92
|
+
},
|
|
93
|
+
}, async (params) => {
|
|
94
|
+
const errors = this.collector.getErrors(params);
|
|
95
|
+
return {
|
|
96
|
+
content: [{
|
|
97
|
+
type: "text",
|
|
98
|
+
text: JSON.stringify(errors, null, 2),
|
|
99
|
+
}],
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
registerInspectRequests() {
|
|
104
|
+
this.server.registerTool("inspect_requests", {
|
|
105
|
+
title: "Inspect HTTP Requests",
|
|
106
|
+
description: "Inspect captured HTTP requests and responses. Filter by method, URL pattern, status code, or specific request ID.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
id: InspectRequestParamsSchema.shape.id,
|
|
109
|
+
method: InspectRequestParamsSchema.shape.method,
|
|
110
|
+
urlPattern: InspectRequestParamsSchema.shape.urlPattern,
|
|
111
|
+
statusCode: InspectRequestParamsSchema.shape.statusCode,
|
|
112
|
+
limit: InspectRequestParamsSchema.shape.limit,
|
|
113
|
+
},
|
|
114
|
+
}, async (params) => {
|
|
115
|
+
const requests = this.collector.getRequests(params);
|
|
116
|
+
return {
|
|
117
|
+
content: [{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: JSON.stringify(requests, null, 2),
|
|
120
|
+
}],
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
registerGetPerformance() {
|
|
125
|
+
this.server.registerTool("get_performance", {
|
|
126
|
+
title: "Get Performance Metrics",
|
|
127
|
+
description: "Retrieve performance metrics including memory usage, CPU, and custom metrics from the application.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
metric: GetPerformanceParamsSchema.shape.metric,
|
|
130
|
+
since: GetPerformanceParamsSchema.shape.since,
|
|
131
|
+
limit: GetPerformanceParamsSchema.shape.limit,
|
|
132
|
+
},
|
|
133
|
+
}, async (params) => {
|
|
134
|
+
await this.collector.collectFromProcess();
|
|
135
|
+
const metrics = this.collector.getMetrics(params);
|
|
136
|
+
return {
|
|
137
|
+
content: [{
|
|
138
|
+
type: "text",
|
|
139
|
+
text: JSON.stringify(metrics, null, 2),
|
|
140
|
+
}],
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
registerGetEnvInfo() {
|
|
145
|
+
this.server.registerTool("get_env_info", {
|
|
146
|
+
title: "Get Environment Info",
|
|
147
|
+
description: "Get comprehensive environment information including running Node.js processes, listening ports, project framework detection, and system resources.",
|
|
148
|
+
inputSchema: {},
|
|
149
|
+
}, async () => {
|
|
150
|
+
const info = await this.inspector.getEnvironmentInfo();
|
|
151
|
+
return {
|
|
152
|
+
content: [{
|
|
153
|
+
type: "text",
|
|
154
|
+
text: JSON.stringify(info, null, 2),
|
|
155
|
+
}],
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
registerClearLogs() {
|
|
160
|
+
this.server.registerTool("clear_logs", {
|
|
161
|
+
title: "Clear Log Buffer",
|
|
162
|
+
description: "Clear all collected logs, requests, and metrics from the buffer.",
|
|
163
|
+
inputSchema: {},
|
|
164
|
+
}, async () => {
|
|
165
|
+
const result = this.collector.clearLogs();
|
|
166
|
+
return {
|
|
167
|
+
content: [{
|
|
168
|
+
type: "text",
|
|
169
|
+
text: JSON.stringify({ message: `Cleared ${result.cleared} entries` }),
|
|
170
|
+
}],
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
registerGetStats() {
|
|
175
|
+
this.server.registerTool("get_stats", {
|
|
176
|
+
title: "Get Log Statistics",
|
|
177
|
+
description: "Get statistics about collected logs including counts by level and framework.",
|
|
178
|
+
inputSchema: {},
|
|
179
|
+
}, async () => {
|
|
180
|
+
const stats = this.collector.getStats();
|
|
181
|
+
return {
|
|
182
|
+
content: [{
|
|
183
|
+
type: "text",
|
|
184
|
+
text: JSON.stringify(stats, null, 2),
|
|
185
|
+
}],
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
registerStartInterceptor() {
|
|
190
|
+
this.server.registerTool("start_interceptor", {
|
|
191
|
+
title: "Start Console Interceptor",
|
|
192
|
+
description: "Start intercepting console.log/warn/error/debug calls and stderr output in real-time. Captured output is stored in the log buffer.",
|
|
193
|
+
inputSchema: {},
|
|
194
|
+
}, async () => {
|
|
195
|
+
this.interceptor.startIntercepting();
|
|
196
|
+
return {
|
|
197
|
+
content: [{
|
|
198
|
+
type: "text",
|
|
199
|
+
text: JSON.stringify({ message: "Console interceptor started", active: true }),
|
|
200
|
+
}],
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
registerStopInterceptor() {
|
|
205
|
+
this.server.registerTool("stop_interceptor", {
|
|
206
|
+
title: "Stop Console Interceptor",
|
|
207
|
+
description: "Stop intercepting console output. Previously captured logs remain in the buffer.",
|
|
208
|
+
inputSchema: {},
|
|
209
|
+
}, async () => {
|
|
210
|
+
this.interceptor.stopIntercepting();
|
|
211
|
+
return {
|
|
212
|
+
content: [{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: JSON.stringify({ message: "Console interceptor stopped", active: false }),
|
|
215
|
+
}],
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
registerCollectLogs() {
|
|
220
|
+
this.server.registerTool("collect_from_files", {
|
|
221
|
+
title: "Collect Logs from Files",
|
|
222
|
+
description: "Scan and collect logs from log files in the project directory. Automatically discovers .log and .json files in common log directories.",
|
|
223
|
+
inputSchema: {},
|
|
224
|
+
}, async () => {
|
|
225
|
+
await this.collector.collectFromFiles();
|
|
226
|
+
const stats = this.collector.getStats();
|
|
227
|
+
return {
|
|
228
|
+
content: [{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: JSON.stringify({ message: "Log collection complete", stats }),
|
|
231
|
+
}],
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
registerScanProject() {
|
|
236
|
+
this.server.registerTool("scan_project", {
|
|
237
|
+
title: "Scan Project Structure",
|
|
238
|
+
description: "Analyze the project to detect framework (React/Next.js/NestJS), find log files, and list configuration files.",
|
|
239
|
+
inputSchema: {},
|
|
240
|
+
}, async () => {
|
|
241
|
+
const structure = await this.collector.scanProjectStructure();
|
|
242
|
+
return {
|
|
243
|
+
content: [{
|
|
244
|
+
type: "text",
|
|
245
|
+
text: JSON.stringify(structure, null, 2),
|
|
246
|
+
}],
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
registerFindProcesses() {
|
|
251
|
+
this.server.registerTool("find_processes", {
|
|
252
|
+
title: "Find Running Node Processes",
|
|
253
|
+
description: "Find running Node.js processes related to React, Next.js, or NestJS applications.",
|
|
254
|
+
inputSchema: {},
|
|
255
|
+
}, async () => {
|
|
256
|
+
const processes = await this.inspector.findRunningProcesses();
|
|
257
|
+
return {
|
|
258
|
+
content: [{
|
|
259
|
+
type: "text",
|
|
260
|
+
text: JSON.stringify(processes, null, 2),
|
|
261
|
+
}],
|
|
262
|
+
};
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
registerGetPorts() {
|
|
266
|
+
this.server.registerTool("get_listening_ports", {
|
|
267
|
+
title: "Get Listening Ports",
|
|
268
|
+
description: "List all TCP ports currently being listened on by Node.js processes.",
|
|
269
|
+
inputSchema: {},
|
|
270
|
+
}, async () => {
|
|
271
|
+
const ports = await this.inspector.getPortListeners();
|
|
272
|
+
return {
|
|
273
|
+
content: [{
|
|
274
|
+
type: "text",
|
|
275
|
+
text: JSON.stringify(ports, null, 2),
|
|
276
|
+
}],
|
|
277
|
+
};
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
async start() {
|
|
281
|
+
try {
|
|
282
|
+
const transport = new StdioServerTransport();
|
|
283
|
+
await this.server.connect(transport);
|
|
284
|
+
console.error("Runtime Lens MCP Server started successfully");
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
console.error("Failed to start Runtime Lens MCP Server:", error instanceof Error ? error.message : error);
|
|
288
|
+
process.exit(1);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
setupGracefulShutdown() {
|
|
292
|
+
const shutdown = async (signal) => {
|
|
293
|
+
console.error(`Received ${signal}, shutting down gracefully...`);
|
|
294
|
+
this.interceptor.stopIntercepting();
|
|
295
|
+
process.exit(0);
|
|
296
|
+
};
|
|
297
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
298
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CA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