Skip to content

Use GEMINI_API_KEY instead of GOOGLE_API_KEY #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ This will show the available commands and options.
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:

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

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

```bash
export OPENAI_API_KEY="your-api-key"
export GOOGLE_API_KEY="your-api-key"
export GEMINI_API_KEY="your-api-key"
export DEEPSEEK_API_KEY="your-api-key"
```

Expand All @@ -61,7 +61,7 @@ Or you can include them in your MCP client configuration to generate project pla
"args": ["-y", "taskqueue-mcp"],
"env": {
"OPENAI_API_KEY": "your-api-key",
"GOOGLE_API_KEY": "your-api-key",
"GEMINI_API_KEY": "your-api-key",
"DEEPSEEK_API_KEY": "your-api-key"
}
}
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprot
const server = new Server(
{
name: "task-manager-server",
version: "1.3.3"
version: "1.3.4"
},
{
capabilities: {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taskqueue-mcp",
"version": "1.3.3",
"version": "1.3.4",
"description": "Task Queue MCP Server",
"author": "Christopher C. Smith ([email protected])",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/client/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const program = new Command();
program
.name("taskqueue")
.description("CLI for the Task Manager MCP Server")
.version("1.3.3")
.version("1.3.4")
.option(
'-f, --file-path <path>',
'Specify the path to the tasks JSON file. Overrides TASK_MANAGER_FILE_PATH env var.'
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/TaskManager.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ describe('TaskManager Integration', () => {

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

// --- Test Google ---
if (process.env.GOOGLE_API_KEY) {
if (process.env.GEMINI_API_KEY) {
console.log("Testing Google Gemini API...");
try {
const googleResult = await server.generateProjectPlan({
Expand Down Expand Up @@ -578,7 +578,7 @@ describe('TaskManager Integration', () => {
expect(error).toBeNull();
}
} else {
console.warn("Skipping Google test: GOOGLE_API_KEY not found in environment.");
console.warn("Skipping Google test: GEMINI_API_KEY not found in environment.");
}

// --- Test DeepSeek ---
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/cli.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ describe("CLI Integration Tests", () => {
beforeEach(() => {
// Set mock API keys for testing
process.env.OPENAI_API_KEY = 'test-key';
process.env.GOOGLE_API_KEY = 'test-key';
process.env.GEMINI_API_KEY = 'test-key';
process.env.DEEPSEEK_API_KEY = 'test-key';
});

afterEach(() => {
delete process.env.OPENAI_API_KEY;
delete process.env.GOOGLE_API_KEY;
delete process.env.GEMINI_API_KEY;
delete process.env.DEEPSEEK_API_KEY;
});

Expand Down
64 changes: 62 additions & 2 deletions tests/integration/e2e.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ describe('MCP Client Integration', () => {
TASK_MANAGER_FILE_PATH: testFilePath,
NODE_ENV: "test",
DEBUG: "mcp:*", // Enable MCP debug logging
// Pass the API key from the test runner's env to the child process env
OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? ''
// Pass API keys from the test runner's env to the child process env
OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? '',
GEMINI_API_KEY: process.env.GEMINI_API_KEY ?? ''
}
});

Expand Down Expand Up @@ -349,4 +350,63 @@ describe('MCP Client Integration', () => {
// The temporary file will be cleaned up by the afterAll hook that removes tempDir
console.log('Successfully generated project plan with tasks');
});

// Skip by default as it requires Google API key
it.skip('should generate a project plan using Google Gemini', async () => {
console.log('Testing project plan generation with Google Gemini...');

// Skip if no Google API key is set
const googleApiKey = process.env.GEMINI_API_KEY;
if (!googleApiKey) {
console.log('Skipping test: GEMINI_API_KEY not set');
return;
}

// Create a temporary requirements file
const requirementsPath = path.join(tempDir, 'google-requirements.md');
const requirements = `# Project Plan Requirements (Google Test)

- This is a test of whether we are correctly attaching files to our prompt for Google models
- Return a JSON project plan with one task
- Task title must be 'GeminiTask'
- Task description must be 'GeminiDescription'
- Project plan attribute should be 'GeminiPlan'`;

await fs.writeFile(requirementsPath, requirements, 'utf-8');

// Test prompt and context
const testPrompt = "Create a step-by-step project plan to develop a cloud-native microservice using Go";

// Generate project plan using Google Gemini
const generateResult = await client.callTool({
name: "generate_project_plan",
arguments: {
prompt: testPrompt,
provider: "google",
model: "gemini-1.5-flash-latest", // Using a generally available model, adjust if needed
attachments: [requirementsPath]
}
}) as ToolResponse;

expect(generateResult.isError).toBeFalsy();
const planData = JSON.parse((generateResult.content[0] as { text: string }).text);

// Verify the generated plan structure
expect(planData).toHaveProperty('data');
expect(planData.data).toHaveProperty('tasks');
expect(Array.isArray(planData.data.tasks)).toBe(true);
expect(planData.data.tasks.length).toBeGreaterThan(0);

// Verify task structure based on requirements file
const firstTask = planData.data.tasks[0];
expect(firstTask).toHaveProperty('title');
expect(firstTask).toHaveProperty('description');

// Verify that the generated task adheres to the requirements file context
expect(firstTask.title).toBe('GeminiTask');
expect(firstTask.description).toBe('GeminiDescription');

// The temporary file will be cleaned up by the afterAll hook that removes tempDir
console.log('Successfully generated project plan with Google Gemini');
});
});