An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
JavaScript aicursorcursor-aicursorailovablelovable-devroocodetask-managertaskstasks-listwindsurfwindsurf-ai
feat(extension): implement simple solution to --package flag (#1090)
Ralph Khreisha464e550b886
diff --git a/.changeset/upset-ants-return.md b/.changeset/upset-ants-return.mdnew file mode 100644index 00000000..8f77e9e1--- /dev/null+++ b/.changeset/upset-ants-return.md@@ -0,0 +1,5 @@+---+"extension": patch+---++Fix issues with some users not being able to connect to Taskmaster MCP server while using the extensiondiff --git a/apps/extension/package.json b/apps/extension/package.jsonindex 227c575f..1f572fa7 100644--- a/apps/extension/package.json+++ b/apps/extension/package.json@@ -64,16 +64,16 @@"properties": {"taskmaster.mcp.command": {"type": "string",- "default": "npx",- "description": "The command or absolute path to execute for the MCP server (e.g., 'npx' or '/usr/local/bin/task-master-ai')."+ "default": "node",+ "description": "The command to execute for the MCP server (e.g., 'node' for bundled server or 'npx' for remote)."},"taskmaster.mcp.args": {"type": "array","items": {"type": "string"},- "default": ["task-master-ai"],- "description": "An array of arguments to pass to the MCP server command."+ "default": [],+ "description": "Arguments for the MCP server (leave empty to use bundled server)."},"taskmaster.mcp.cwd": {"type": "string",@@ -238,6 +238,9 @@"watch:css": "npx @tailwindcss/cli -i ./src/webview/index.css -o ./dist/index.css --watch","check-types": "tsc --noEmit"},+ "dependencies": {+ "task-master-ai": "*"+ },"devDependencies": {"@dnd-kit/core": "^6.3.1","@dnd-kit/modifiers": "^9.0.0",diff --git a/apps/extension/package.publish.json b/apps/extension/package.publish.jsonindex d9949c4e..9fce709f 100644--- a/apps/extension/package.publish.json+++ b/apps/extension/package.publish.json@@ -2,7 +2,7 @@"name": "task-master-hamster","displayName": "Taskmaster AI","description": "A visual Kanban board interface for Taskmaster projects in VS Code",- "version": "0.22.3",+ "version": "0.23.0","publisher": "Hamster","icon": "assets/icon.png","engines": {diff --git a/apps/extension/src/utils/mcpClient.ts b/apps/extension/src/utils/mcpClient.tsindex 0fd07a19..4ce28363 100644--- a/apps/extension/src/utils/mcpClient.ts+++ b/apps/extension/src/utils/mcpClient.ts@@ -1,6 +1,7 @@import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';import * as vscode from 'vscode';+import * as path from 'path';import { logger } from './logger';export interface MCPConfig {@@ -143,7 +144,7 @@ export class MCPClientManager {// Create the clientthis.client = new Client({- name: 'taskr-vscode-extension',+ name: 'task-master-vscode-extension',version: '1.0.0'},{@@ -211,6 +212,30 @@ export class MCPClientManager {};logger.log('MCP client connected successfully');++ // Log Task Master version information after successful connection+ try {+ const versionResult = await this.callTool('get_tasks', {});+ if (versionResult?.content?.[0]?.text) {+ const response = JSON.parse(versionResult.content[0].text);+ if (response?.version) {+ logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ logger.log('✅ Task Master MCP Server Connected');+ logger.log(` Version: ${response.version.version || 'unknown'}`);+ logger.log(+ ` Package: ${response.version.name || 'task-master-ai'}`+ );+ if (response.tag) {+ logger.log(+ ` Current Tag: ${response.tag.currentTag || 'master'}`+ );+ }+ logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ }+ }+ } catch (versionError) {+ logger.log('Note: Could not retrieve Task Master version information');+ }} catch (error) {logger.error('Failed to connect to MCP server:', error);this.status = {@@ -312,6 +337,34 @@ export class MCPClientManager {'Available MCP tools:',result.tools?.map((t) => t.name) || []);++ // Try to get version information by calling a simple tool+ // The get_tasks tool is lightweight and returns version info+ try {+ const versionResult = await this.callTool('get_tasks', {});+ if (versionResult?.content?.[0]?.text) {+ // Parse the response to extract version info+ const response = JSON.parse(versionResult.content[0].text);+ if (response?.version) {+ logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ logger.log('📦 Task Master MCP Server Connected');+ logger.log(` Version: ${response.version.version || 'unknown'}`);+ logger.log(+ ` Package: ${response.version.name || 'task-master-ai'}`+ );+ if (response.tag) {+ logger.log(+ ` Current Tag: ${response.tag.currentTag || 'master'}`+ );+ }+ logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ }+ }+ } catch (versionError) {+ // Don't fail the connection test if we can't get version info+ logger.log('Could not retrieve Task Master version information');+ }+return true;} catch (error) {logger.error('Connection test failed:', error);@@ -345,8 +398,34 @@ export function createMCPConfigFromSettings(): MCPConfig {);const config = vscode.workspace.getConfiguration('taskmaster');- let command = config.get<string>('mcp.command', 'npx');- const args = config.get<string[]>('mcp.args', ['task-master-ai']);+ let command = config.get<string>('mcp.command', 'node');+ let args = config.get<string[]>('mcp.args', []);++ // If using default settings, use the bundled MCP server+ if (command === 'node' && args.length === 0) {+ try {+ // Try to resolve the bundled MCP server+ const taskMasterPath = require.resolve('task-master-ai');+ const mcpServerPath = path.resolve(+ path.dirname(taskMasterPath),+ 'mcp-server/server.js'+ );++ // Verify the server file exists+ const fs = require('fs');+ if (!fs.existsSync(mcpServerPath)) {+ throw new Error('MCP server file not found at: ' + mcpServerPath);+ }++ args = [mcpServerPath];+ logger.log(`📦 Using bundled MCP server at: ${mcpServerPath}`);+ } catch (error) {+ logger.error('❌ Could not find bundled task-master-ai server:', error);+ // Fallback to npx+ command = 'npx';+ args = ['-y', 'task-master-ai'];+ }+ }// Use proper VS Code workspace detectionconst defaultCwd =diff --git a/package-lock.json b/package-lock.jsonindex 60ade081..f5186830 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "task-master-ai",- "version": "0.23.0",+ "version": "0.23.1-rc.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "task-master-ai",- "version": "0.23.0",+ "version": "0.23.1-rc.0","license": "MIT WITH Commons-Clause","workspaces": ["apps/*",@@ -86,6 +86,9 @@},"apps/extension": {"version": "0.23.0",+ "dependencies": {+ "task-master-ai": "*"+ },"devDependencies": {"@dnd-kit/core": "^6.3.1","@dnd-kit/modifiers": "^9.0.0",