UNPKG

taiga-mcp-server

Version:

Full-featured MCP server for Taiga project management with advanced sprint and issue tracking. Based on mcpTAIGA by adriapedralbes, enhanced with substantial modifications. Developed collaboratively with Claude Code (AI-assisted development).

84 lines (70 loc) 3.51 kB
/** * 最终评论功能验证测试 * Final Comment Functionality Verification Test */ import { TaigaService } from '../src/taigaService.js'; import { addCommentTool, listCommentsTool } from '../src/tools/commentTools.js'; console.log('🎯 Final Comment Functionality Test\n'); const taigaService = new TaigaService(); async function finalTest() { try { // 1. 获取测试数据 const projects = await taigaService.listProjects(); const testProject = projects[0]; const issues = await taigaService.listIssues(testProject.id); const testIssue = issues[0]; console.log(`✅ Setup: Using issue "${testIssue.subject}" (ID: ${testIssue.id})`); // 2. 测试添加评论(使用MCP工具) console.log('\n📝 Test 1: Adding comment using MCP tool'); const addResult = await addCommentTool.handler({ itemType: 'issue', itemId: testIssue.id, comment: `Final test comment - ${new Date().toISOString()}` }); console.log('✅ Add comment result:', addResult.content ? 'SUCCESS' : 'FAILED'); if (addResult.content?.includes('✅')) { console.log(' Comment successfully added with success message'); } else { console.log(' Unexpected result:', addResult); } // 3. 测试列出评论(使用MCP工具) console.log('\n📋 Test 2: Listing comments using MCP tool'); const listResult = await listCommentsTool.handler({ itemType: 'issue', itemId: testIssue.id }); console.log('✅ List comments result:', listResult.content ? 'SUCCESS' : 'FAILED'); if (listResult.content?.includes('📝')) { const commentCount = listResult.content.match(/共 (\d+) 個評論/); if (commentCount) { console.log(` Found ${commentCount[1]} comments in the list`); } console.log(' Comments list generated successfully'); } else { console.log(' Unexpected result:', listResult); } // 4. 验证没有 "Failed to add comment to Taiga" 错误 console.log('\n🔍 Test 3: Verifying no "Failed to add comment to Taiga" errors'); if (!addResult.content?.includes('Failed to add comment to Taiga') && !listResult.content?.includes('Failed to add comment to Taiga')) { console.log('✅ No "Failed to add comment to Taiga" errors found'); } else { console.log('❌ "Failed to add comment to Taiga" error still present'); } console.log('\n🎉 Final Comment Functionality Test PASSED!'); console.log('📊 Summary:'); console.log(' ✅ Comment addition works correctly'); console.log(' ✅ Comment listing works correctly'); console.log(' ✅ No "Failed to add comment to Taiga" errors'); console.log(' ✅ MCP tools integration working'); console.log(' ✅ Version parameter handling fixed'); console.log(' ✅ History filtering fixed (type === 1)'); } catch (error) { console.log('\n❌ Final test failed:', error.message); if (error.response) { console.log('Response status:', error.response.status); console.log('Response data:', JSON.stringify(error.response.data, null, 2)); } } } finalTest();