Skip to content

Commit 0e010d7

Browse files
Merge pull request #43 from chriscarrollsmith/gemini_api_key
Use GEMINI_API_KEY instead of GOOGLE_API_KEY
2 parents c4c4b78 + a3ffdc5 commit 0e010d7

8 files changed

+75
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ This will show the available commands and options.
4040
The task manager supports multiple LLM providers for generating project plans. You can configure one or more of the following environment variables depending on which providers you want to use:
4141

4242
- `OPENAI_API_KEY`: Required for using OpenAI models (e.g., GPT-4)
43-
- `GOOGLE_API_KEY`: Required for using Google's Gemini models
43+
- `GEMINI_API_KEY`: Required for using Google's Gemini models
4444
- `DEEPSEEK_API_KEY`: Required for using Deepseek models
4545

4646
To generate project plans using the CLI, set these environment variables in your shell:
4747

4848
```bash
4949
export OPENAI_API_KEY="your-api-key"
50-
export GOOGLE_API_KEY="your-api-key"
50+
export GEMINI_API_KEY="your-api-key"
5151
export DEEPSEEK_API_KEY="your-api-key"
5252
```
5353

@@ -61,7 +61,7 @@ Or you can include them in your MCP client configuration to generate project pla
6161
"args": ["-y", "taskqueue-mcp"],
6262
"env": {
6363
"OPENAI_API_KEY": "your-api-key",
64-
"GOOGLE_API_KEY": "your-api-key",
64+
"GEMINI_API_KEY": "your-api-key",
6565
"DEEPSEEK_API_KEY": "your-api-key"
6666
}
6767
}

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprot
1010
const server = new Server(
1111
{
1212
name: "task-manager-server",
13-
version: "1.3.3"
13+
version: "1.3.4"
1414
},
1515
{
1616
capabilities: {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "taskqueue-mcp",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "Task Queue MCP Server",
55
"author": "Christopher C. Smith ([email protected])",
66
"main": "dist/index.js",

src/client/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const program = new Command();
1616
program
1717
.name("taskqueue")
1818
.description("CLI for the Task Manager MCP Server")
19-
.version("1.3.3")
19+
.version("1.3.4")
2020
.option(
2121
'-f, --file-path <path>',
2222
'Specify the path to the tasks JSON file. Overrides TASK_MANAGER_FILE_PATH env var.'

tests/integration/TaskManager.integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ describe('TaskManager Integration', () => {
504504

505505
// --- NEW API TEST ---
506506
// Skip this test by default, as it requires live API keys and makes external calls.
507-
// Remove '.skip' and ensure OPENAI_API_KEY, GOOGLE_API_KEY, DEEPSEEK_API_KEY are in .env to run.
507+
// Remove '.skip' and ensure OPENAI_API_KEY, GEMINI_API_KEY, DEEPSEEK_API_KEY are in .env to run.
508508
it.skip("should generate a project plan using live APIs", async () => {
509509
const testPrompt = "Create a plan for a simple web server using Node.js and Express.";
510510
const attachments: string[] = []; // Add mock attachment content if needed
@@ -546,7 +546,7 @@ describe('TaskManager Integration', () => {
546546
}
547547

548548
// --- Test Google ---
549-
if (process.env.GOOGLE_API_KEY) {
549+
if (process.env.GEMINI_API_KEY) {
550550
console.log("Testing Google Gemini API...");
551551
try {
552552
const googleResult = await server.generateProjectPlan({
@@ -578,7 +578,7 @@ describe('TaskManager Integration', () => {
578578
expect(error).toBeNull();
579579
}
580580
} else {
581-
console.warn("Skipping Google test: GOOGLE_API_KEY not found in environment.");
581+
console.warn("Skipping Google test: GEMINI_API_KEY not found in environment.");
582582
}
583583

584584
// --- Test DeepSeek ---

tests/integration/cli.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ describe("CLI Integration Tests", () => {
140140
beforeEach(() => {
141141
// Set mock API keys for testing
142142
process.env.OPENAI_API_KEY = 'test-key';
143-
process.env.GOOGLE_API_KEY = 'test-key';
143+
process.env.GEMINI_API_KEY = 'test-key';
144144
process.env.DEEPSEEK_API_KEY = 'test-key';
145145
});
146146

147147
afterEach(() => {
148148
delete process.env.OPENAI_API_KEY;
149-
delete process.env.GOOGLE_API_KEY;
149+
delete process.env.GEMINI_API_KEY;
150150
delete process.env.DEEPSEEK_API_KEY;
151151
});
152152

tests/integration/e2e.integration.test.ts

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ describe('MCP Client Integration', () => {
3939
TASK_MANAGER_FILE_PATH: testFilePath,
4040
NODE_ENV: "test",
4141
DEBUG: "mcp:*", // Enable MCP debug logging
42-
// Pass the API key from the test runner's env to the child process env
43-
OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? ''
42+
// Pass API keys from the test runner's env to the child process env
43+
OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? '',
44+
GEMINI_API_KEY: process.env.GEMINI_API_KEY ?? ''
4445
}
4546
});
4647

@@ -349,4 +350,63 @@ describe('MCP Client Integration', () => {
349350
// The temporary file will be cleaned up by the afterAll hook that removes tempDir
350351
console.log('Successfully generated project plan with tasks');
351352
});
353+
354+
// Skip by default as it requires Google API key
355+
it.skip('should generate a project plan using Google Gemini', async () => {
356+
console.log('Testing project plan generation with Google Gemini...');
357+
358+
// Skip if no Google API key is set
359+
const googleApiKey = process.env.GEMINI_API_KEY;
360+
if (!googleApiKey) {
361+
console.log('Skipping test: GEMINI_API_KEY not set');
362+
return;
363+
}
364+
365+
// Create a temporary requirements file
366+
const requirementsPath = path.join(tempDir, 'google-requirements.md');
367+
const requirements = `# Project Plan Requirements (Google Test)
368+
369+
- This is a test of whether we are correctly attaching files to our prompt for Google models
370+
- Return a JSON project plan with one task
371+
- Task title must be 'GeminiTask'
372+
- Task description must be 'GeminiDescription'
373+
- Project plan attribute should be 'GeminiPlan'`;
374+
375+
await fs.writeFile(requirementsPath, requirements, 'utf-8');
376+
377+
// Test prompt and context
378+
const testPrompt = "Create a step-by-step project plan to develop a cloud-native microservice using Go";
379+
380+
// Generate project plan using Google Gemini
381+
const generateResult = await client.callTool({
382+
name: "generate_project_plan",
383+
arguments: {
384+
prompt: testPrompt,
385+
provider: "google",
386+
model: "gemini-1.5-flash-latest", // Using a generally available model, adjust if needed
387+
attachments: [requirementsPath]
388+
}
389+
}) as ToolResponse;
390+
391+
expect(generateResult.isError).toBeFalsy();
392+
const planData = JSON.parse((generateResult.content[0] as { text: string }).text);
393+
394+
// Verify the generated plan structure
395+
expect(planData).toHaveProperty('data');
396+
expect(planData.data).toHaveProperty('tasks');
397+
expect(Array.isArray(planData.data.tasks)).toBe(true);
398+
expect(planData.data.tasks.length).toBeGreaterThan(0);
399+
400+
// Verify task structure based on requirements file
401+
const firstTask = planData.data.tasks[0];
402+
expect(firstTask).toHaveProperty('title');
403+
expect(firstTask).toHaveProperty('description');
404+
405+
// Verify that the generated task adheres to the requirements file context
406+
expect(firstTask.title).toBe('GeminiTask');
407+
expect(firstTask.description).toBe('GeminiDescription');
408+
409+
// The temporary file will be cleaned up by the afterAll hook that removes tempDir
410+
console.log('Successfully generated project plan with Google Gemini');
411+
});
352412
});

0 commit comments

Comments
 (0)