@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 CHANGED
@@ -164,18 +164,30 @@ async function main() {
164
164
  }));
165
165
  logger.info('Telemetry enabled (PostHog)');
166
166
  }
167
- // Resolve project context (repo project environments/credentials)
168
- // This enriches tool descriptions with available credentials for the detected project.
169
- const projectCtx = await resolveProjectContext();
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: tools.map(t => t.name),
178
- detectedProject: projectCtx?.project.name ?? null,
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) {
@@ -15,7 +15,7 @@ export function detectRepoName() {
15
15
  try {
16
16
  const raw = execSync('git remote get-url origin', {
17
17
  encoding: 'utf-8',
18
- timeout: 5000,
18
+ timeout: 2000,
19
19
  stdio: ['ignore', 'pipe', 'ignore'],
20
20
  }).trim();
21
21
  cached = parseRepoName(raw);
@@ -23,14 +23,16 @@ const createLogger = () => {
23
23
  stderrLevels: ['error', 'warn', 'info', 'debug'],
24
24
  }),
25
25
  ],
26
- // Ensure uncaught exceptions and rejections are logged
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
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugg-ai/debugg-ai-mcp",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
5
5
  "type": "module",
6
6
  "bin": {