@debugg-ai/debugg-ai-mcp 1.0.49 → 1.0.51
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/dist/index.js +20 -8
- package/dist/utils/gitContext.js +1 -1
- package/dist/utils/logger.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -164,18 +164,30 @@ async function main() {
|
|
|
164
164
|
}));
|
|
165
165
|
logger.info('Telemetry enabled (PostHog)');
|
|
166
166
|
}
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
initTools(projectCtx);
|
|
171
|
-
// Create and connect transport
|
|
167
|
+
// Connect transport FIRST so the MCP client handshake succeeds immediately.
|
|
168
|
+
// Tools start with no project context; enriched once the API responds.
|
|
169
|
+
initTools(null);
|
|
172
170
|
const transport = new StdioServerTransport();
|
|
173
171
|
await server.connect(transport);
|
|
174
|
-
const tools = getTools();
|
|
175
172
|
logger.info('DebuggAI MCP Server is running and ready to accept requests', {
|
|
176
173
|
transport: 'stdio',
|
|
177
|
-
toolsAvailable:
|
|
178
|
-
|
|
174
|
+
toolsAvailable: getTools().map(t => t.name),
|
|
175
|
+
});
|
|
176
|
+
// Resolve project context in the background — enriches tool descriptions
|
|
177
|
+
// with available environments/credentials once the API responds.
|
|
178
|
+
resolveProjectContext().then((projectCtx) => {
|
|
179
|
+
if (projectCtx) {
|
|
180
|
+
initTools(projectCtx);
|
|
181
|
+
logger.info('Tool descriptions enriched with project context', {
|
|
182
|
+
project: projectCtx.project.name,
|
|
183
|
+
environments: projectCtx.environments.length,
|
|
184
|
+
credentials: projectCtx.environments.reduce((n, e) => n + e.credentials.length, 0),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}).catch((err) => {
|
|
188
|
+
logger.warn('Background project context resolution failed', {
|
|
189
|
+
error: err instanceof Error ? err.message : String(err),
|
|
190
|
+
});
|
|
179
191
|
});
|
|
180
192
|
}
|
|
181
193
|
catch (error) {
|
package/dist/utils/gitContext.js
CHANGED
package/dist/utils/logger.js
CHANGED
|
@@ -23,14 +23,16 @@ const createLogger = () => {
|
|
|
23
23
|
stderrLevels: ['error', 'warn', 'info', 'debug'],
|
|
24
24
|
}),
|
|
25
25
|
],
|
|
26
|
-
// Ensure uncaught exceptions and rejections
|
|
26
|
+
// Ensure uncaught exceptions and rejections go to stderr (NOT stdout — stdout is the MCP transport)
|
|
27
27
|
exceptionHandlers: [
|
|
28
28
|
new winston.transports.Console({
|
|
29
|
+
stderrLevels: ['error', 'warn', 'info', 'debug'],
|
|
29
30
|
format: winston.format.combine(winston.format.timestamp(), winston.format.errors({ stack: true }), winston.format.json()),
|
|
30
31
|
}),
|
|
31
32
|
],
|
|
32
33
|
rejectionHandlers: [
|
|
33
34
|
new winston.transports.Console({
|
|
35
|
+
stderrLevels: ['error', 'warn', 'info', 'debug'],
|
|
34
36
|
format: winston.format.combine(winston.format.timestamp(), winston.format.errors({ stack: true }), winston.format.json()),
|
|
35
37
|
}),
|
|
36
38
|
],
|