@rlabs-inc/gemini-mcp 0.6.2 → 0.6.3

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.
@@ -141,6 +141,7 @@ export interface DeepResearchResult {
141
141
  text?: string;
142
142
  }[];
143
143
  error?: string;
144
+ savedPath?: string;
144
145
  }
145
146
  /**
146
147
  * Start a deep research task
@@ -418,14 +418,14 @@ const DEEP_RESEARCH_AGENT = 'deep-research-pro-preview-12-2025';
418
418
  */
419
419
  export async function startDeepResearch(prompt) {
420
420
  try {
421
- // The Interactions API - cast to any since it may not be in SDK types yet
421
+ // The Interactions API is properly typed in @google/genai v1.34.0+
422
422
  const interaction = await genAI.interactions.create({
423
423
  input: prompt,
424
424
  agent: DEEP_RESEARCH_AGENT,
425
425
  background: true,
426
- agentConfig: {
426
+ agent_config: {
427
427
  type: 'deep-research',
428
- thinkingSummaries: 'auto',
428
+ thinking_summaries: 'auto',
429
429
  },
430
430
  });
431
431
  return {
@@ -446,17 +446,36 @@ export async function checkDeepResearch(researchId) {
446
446
  const interaction = await genAI.interactions.get(researchId);
447
447
  const status = interaction.status || 'unknown';
448
448
  if (status === 'completed') {
449
+ // Save the FULL raw response to the output directory
450
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
451
+ const outputPath = path.join(getOutputDir(), `deep-research-${timestamp}.json`);
452
+ const fullResponse = {
453
+ id: researchId,
454
+ status: interaction.status,
455
+ created: interaction.created,
456
+ agent: interaction.agent,
457
+ model: interaction.model,
458
+ outputs: interaction.outputs,
459
+ rawInteraction: interaction,
460
+ };
461
+ fs.writeFileSync(outputPath, JSON.stringify(fullResponse, null, 2));
462
+ logger.info(`Full deep research response saved to: ${outputPath}`);
463
+ // Extract text for the summary (but full data is saved)
464
+ const textOutputs = (interaction.outputs || [])
465
+ .filter((output) => 'type' in output && output.type === 'text')
466
+ .map(output => ({ text: output.text }));
449
467
  return {
450
468
  id: researchId,
451
469
  status: 'completed',
452
- outputs: interaction.outputs,
470
+ outputs: textOutputs,
471
+ savedPath: outputPath,
453
472
  };
454
473
  }
455
- else if (status === 'failed') {
474
+ else if (status === 'failed' || status === 'cancelled') {
456
475
  return {
457
476
  id: researchId,
458
477
  status: 'failed',
459
- error: interaction.error || 'Unknown error',
478
+ error: 'Research task failed or was cancelled',
460
479
  };
461
480
  }
462
481
  return {
@@ -477,10 +496,18 @@ export async function followUpResearch(researchId, question) {
477
496
  const interaction = await genAI.interactions.create({
478
497
  input: question,
479
498
  model: proModelName,
480
- previousInteractionId: researchId,
499
+ previous_interaction_id: researchId,
481
500
  });
501
+ // Extract text from TextContent outputs
482
502
  const outputs = interaction.outputs || [];
483
- return outputs.length > 0 ? outputs[outputs.length - 1].text || 'No response' : 'No response received';
503
+ const textOutputs = outputs
504
+ .filter((output) => 'type' in output && output.type === 'text')
505
+ .map(output => output.text)
506
+ .filter((text) => !!text);
507
+ if (textOutputs.length > 0) {
508
+ return textOutputs[textOutputs.length - 1];
509
+ }
510
+ return 'No text response received';
484
511
  }
485
512
  catch (error) {
486
513
  const message = error instanceof Error ? error.message : String(error);
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ async function main() {
113
113
  // Create MCP server
114
114
  const server = new McpServer({
115
115
  name: 'Gemini',
116
- version: '0.6.2',
116
+ version: '0.6.3',
117
117
  });
118
118
  // Register tools
119
119
  registerQueryTool(server);
@@ -111,6 +111,10 @@ The Interactions API required for Deep Research may not be available yet in your
111
111
  ? outputs[outputs.length - 1].text || 'No text output'
112
112
  : 'Research completed but no output found';
113
113
  logger.info(`Research completed: ${researchId}`);
114
+ // Build the saved path info if available
115
+ const savedPathInfo = result.savedPath
116
+ ? `| **Full Response** | \`${result.savedPath}\` |`
117
+ : '';
114
118
  return {
115
119
  content: [
116
120
  {
@@ -122,6 +126,9 @@ The Interactions API required for Deep Research may not be available yet in your
122
126
  | **Research ID** | \`${researchId}\` |
123
127
  | **Status** | ✅ Completed |
124
128
  | **Duration** | ${elapsedMinutes}m ${elapsedSeconds}s |
129
+ ${savedPathInfo}
130
+
131
+ > **Note:** The full response (including citations, images, and all metadata) has been saved to the file above.
125
132
 
126
133
  ---
127
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlabs-inc/gemini-mcp",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "MCP server for Gemini 3 integration with Claude Code - full frontier AI capabilities",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",