targetprocess-mcp-server 1.0.14 → 1.0.16
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.
- package/README.md +6 -3
- package/build/index.js +139 -3
- package/build/tp.js +36 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ It acts as a **bridge between LLM agents and the Targetprocess API**, providing:
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
|
-
- Create
|
|
16
|
-
-
|
|
15
|
+
- Create standalone bugs or bugs linked to a user story/bug card
|
|
16
|
+
- Retrieve TP entities: bugs, user stories, features, releases
|
|
17
17
|
|
|
18
18
|
- **LLM-Friendly Tools**
|
|
19
19
|
- Designed for Claude MCP AI agents
|
|
@@ -50,8 +50,11 @@ Cards — Read
|
|
|
50
50
|
|
|
51
51
|
Cards — Write
|
|
52
52
|
- `add_comment` — Post a comment to any card (id, comment)
|
|
53
|
-
- `create_bug` — Create a
|
|
53
|
+
- `create_bug` — Create a standalone bug (title, bugContent, optional origin)
|
|
54
|
+
- `create_bug_based_on_card` — Create a bug linked to an existing user story or bug card (card object with id+type, title, bugContent, optional origin)
|
|
54
55
|
- `create_test_plan` — Create a test plan linked to a user story (title, userStoryId)
|
|
56
|
+
|
|
57
|
+
> `origin` accepted values: `Production - Customer`, `Production - Internal`, `Pre-Release - Customer`, `Pre-Release - Internal`, `Regression - Dev01`, `Regression - Team Env`, `Manual QA` *(default)*, `Developer Raised`, `Operations`
|
|
55
58
|
---
|
|
56
59
|
|
|
57
60
|
## Installation
|
package/build/index.js
CHANGED
|
@@ -589,7 +589,7 @@ server.registerTool('get_bug_comments', {
|
|
|
589
589
|
}],
|
|
590
590
|
};
|
|
591
591
|
});
|
|
592
|
-
server.registerTool('
|
|
592
|
+
server.registerTool('create_bug_based_on_card', {
|
|
593
593
|
title: 'Create a new bug card based on provided card id',
|
|
594
594
|
description: `Create a new bug card based on provided card id that summarizes the problem in concise,
|
|
595
595
|
descriptive manner answering questions What? Where? When?,
|
|
@@ -615,9 +615,72 @@ server.registerTool('create_bug', {
|
|
|
615
615
|
Be specific and avoid assumptions.
|
|
616
616
|
Clearly outline the actions needed to trigger the bug.
|
|
617
617
|
Number each step so anyone can follow them easily`),
|
|
618
|
+
origin: z.enum([
|
|
619
|
+
"Production - Customer",
|
|
620
|
+
"Production - Internal",
|
|
621
|
+
"Pre-Release - Customer",
|
|
622
|
+
"Pre-Release - Internal",
|
|
623
|
+
"Regression - Dev01",
|
|
624
|
+
"Regression - Team Env",
|
|
625
|
+
"Manual QA",
|
|
626
|
+
"Developer Raised",
|
|
627
|
+
"Operations",
|
|
628
|
+
])
|
|
629
|
+
.default("Manual QA")
|
|
630
|
+
.optional()
|
|
631
|
+
.describe('Where the bug was found, defaults to "Manual QA"'),
|
|
632
|
+
},
|
|
633
|
+
}, async ({ title, card, bugContent, origin }) => {
|
|
634
|
+
const bugResponse = await tp.createBug({ title, card, bugContent, origin });
|
|
635
|
+
if (!bugResponse) {
|
|
636
|
+
return {
|
|
637
|
+
content: [{
|
|
638
|
+
type: 'text',
|
|
639
|
+
text: `Failed to create bug "${title}"\n JSON: ${JSON.stringify(bugResponse, null, 2)}`
|
|
640
|
+
}]
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
return {
|
|
644
|
+
content: [{
|
|
645
|
+
type: 'text',
|
|
646
|
+
text: JSON.stringify(bugResponse)
|
|
647
|
+
}],
|
|
648
|
+
};
|
|
649
|
+
});
|
|
650
|
+
server.registerTool('create_bug', {
|
|
651
|
+
title: 'Create a new bug card',
|
|
652
|
+
description: `Create a new bug card that summarizes the problem in concise,
|
|
653
|
+
descriptive manner answering questions What? Where? When?,
|
|
654
|
+
and content explaining what happened in detail.
|
|
655
|
+
CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
|
|
656
|
+
1) format the new bug inside html <div> tags with Issue Description, Steps to Reproduce, Expected Behavior, Actual Behavior;
|
|
657
|
+
2) add a comment to the newly created bug with its Id and Title`,
|
|
658
|
+
inputSchema: {
|
|
659
|
+
title: z.string()
|
|
660
|
+
.describe('Bug card title that summarizes the problem in concise, descriptive, and actionable manner, enabling a developer to understand the issue without opening the report'),
|
|
661
|
+
bugContent: z.string()
|
|
662
|
+
.describe(`Bug description content, explain what happened in detail.
|
|
663
|
+
Include expected behaviour and what actually occurred.
|
|
664
|
+
Be specific and avoid assumptions.
|
|
665
|
+
Clearly outline the actions needed to trigger the bug.
|
|
666
|
+
Number each step so anyone can follow them easily`),
|
|
667
|
+
origin: z.enum([
|
|
668
|
+
"Production - Customer",
|
|
669
|
+
"Production - Internal",
|
|
670
|
+
"Pre-Release - Customer",
|
|
671
|
+
"Pre-Release - Internal",
|
|
672
|
+
"Regression - Dev01",
|
|
673
|
+
"Regression - Team Env",
|
|
674
|
+
"Manual QA",
|
|
675
|
+
"Developer Raised",
|
|
676
|
+
"Operations",
|
|
677
|
+
])
|
|
678
|
+
.default("Manual QA")
|
|
679
|
+
.optional()
|
|
680
|
+
.describe('Where the bug was found, defaults to "Manual QA"'),
|
|
618
681
|
},
|
|
619
|
-
}, async ({ title,
|
|
620
|
-
const bugResponse = await tp.
|
|
682
|
+
}, async ({ title, bugContent, origin }) => {
|
|
683
|
+
const bugResponse = await tp.createBugOnly({ title, bugContent, origin });
|
|
621
684
|
if (!bugResponse) {
|
|
622
685
|
return {
|
|
623
686
|
content: [{
|
|
@@ -661,6 +724,79 @@ server.registerTool('create_test_plan', {
|
|
|
661
724
|
}],
|
|
662
725
|
};
|
|
663
726
|
});
|
|
727
|
+
server.registerTool('get_not_covered_user_stories_in_feature', {
|
|
728
|
+
title: 'Get not covered user stories in feature',
|
|
729
|
+
description: 'Get user stories for a TP feature by its ID that are not covered by any tests',
|
|
730
|
+
inputSchema: {
|
|
731
|
+
id: z.string()
|
|
732
|
+
.min(5)
|
|
733
|
+
.max(6)
|
|
734
|
+
.describe('TP feature ID (e.g. 145636)'),
|
|
735
|
+
},
|
|
736
|
+
}, async ({ id }) => {
|
|
737
|
+
const response = await tp.getUserStoriesByFeatureId(id);
|
|
738
|
+
if (!response) {
|
|
739
|
+
return {
|
|
740
|
+
content: [{
|
|
741
|
+
type: 'text',
|
|
742
|
+
text: `Failed to get user stories for feature id: ${id}`
|
|
743
|
+
}],
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
const userStoriesIds = response.items || [];
|
|
747
|
+
if (userStoriesIds.length === 0) {
|
|
748
|
+
return {
|
|
749
|
+
content: [{
|
|
750
|
+
type: 'text',
|
|
751
|
+
text: `No user stories found in outer items for feature id: ${id}`,
|
|
752
|
+
}],
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
const userStoriesPromise = userStoriesIds.map((id) => tp.getUserStory(id));
|
|
756
|
+
let userStoriesResults = [];
|
|
757
|
+
try {
|
|
758
|
+
userStoriesResults = await Promise.all(userStoriesPromise);
|
|
759
|
+
}
|
|
760
|
+
catch (error) {
|
|
761
|
+
console.error("Error getting user stories:", error);
|
|
762
|
+
return {
|
|
763
|
+
content: [{
|
|
764
|
+
type: 'text',
|
|
765
|
+
text: `Failed to get user stories for feature id: ${id}`,
|
|
766
|
+
}],
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
let userStories = [];
|
|
770
|
+
for (const userStory of userStoriesResults) {
|
|
771
|
+
const userStoryId = userStory.Id;
|
|
772
|
+
const feature = userStory.Feature;
|
|
773
|
+
const featureId = feature.Id;
|
|
774
|
+
const featureName = feature.Name;
|
|
775
|
+
const covered = userStory.CustomFields.find((field) => field.Name === "Test Automation")?.Value === "Done";
|
|
776
|
+
userStories.push({
|
|
777
|
+
id: userStoryId,
|
|
778
|
+
name: userStory.Name,
|
|
779
|
+
description: userStory.Description,
|
|
780
|
+
featureId,
|
|
781
|
+
featureName,
|
|
782
|
+
covered,
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
if (userStories.length === 0) {
|
|
786
|
+
return {
|
|
787
|
+
content: [{
|
|
788
|
+
type: 'text',
|
|
789
|
+
text: `No user stories unable to convert to TP card found for feature id: ${id}`,
|
|
790
|
+
}],
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
return {
|
|
794
|
+
content: [{
|
|
795
|
+
type: 'text',
|
|
796
|
+
text: JSON.stringify(userStories)
|
|
797
|
+
}],
|
|
798
|
+
};
|
|
799
|
+
});
|
|
664
800
|
server.registerTool('get_feature_user_stories', {
|
|
665
801
|
title: 'Get feature user stories',
|
|
666
802
|
description: 'Get user stories for a TP feature by its ID',
|
package/build/tp.js
CHANGED
|
@@ -96,7 +96,7 @@ export class TpClient {
|
|
|
96
96
|
});
|
|
97
97
|
return response;
|
|
98
98
|
}
|
|
99
|
-
async createBug({ title, card, bugContent }) {
|
|
99
|
+
async createBug({ title, card, bugContent, origin = "Manual QA" }) {
|
|
100
100
|
const bug = {
|
|
101
101
|
"Name": title,
|
|
102
102
|
"Project": {
|
|
@@ -105,7 +105,7 @@ export class TpClient {
|
|
|
105
105
|
"customFields": [{
|
|
106
106
|
"name": "Origin",
|
|
107
107
|
"type": "DropDown",
|
|
108
|
-
"value":
|
|
108
|
+
"value": origin
|
|
109
109
|
}],
|
|
110
110
|
"assignedTeams": [{
|
|
111
111
|
"team": {
|
|
@@ -124,6 +124,29 @@ export class TpClient {
|
|
|
124
124
|
param: { "format": "json" },
|
|
125
125
|
}, bug);
|
|
126
126
|
}
|
|
127
|
+
async createBugOnly({ title, bugContent, origin = "Manual QA" }) {
|
|
128
|
+
const bug = {
|
|
129
|
+
"Name": title,
|
|
130
|
+
"Project": {
|
|
131
|
+
"Id": config.tp.projectId
|
|
132
|
+
},
|
|
133
|
+
"customFields": [{
|
|
134
|
+
"name": "Origin",
|
|
135
|
+
"type": "DropDown",
|
|
136
|
+
"value": origin
|
|
137
|
+
}],
|
|
138
|
+
"assignedTeams": [{
|
|
139
|
+
"team": {
|
|
140
|
+
"id": config.tp.teamId
|
|
141
|
+
}
|
|
142
|
+
}],
|
|
143
|
+
"Description": bugContent,
|
|
144
|
+
};
|
|
145
|
+
return this.post({
|
|
146
|
+
pathParam: { "bugs": '' },
|
|
147
|
+
param: { "format": "json" },
|
|
148
|
+
}, bug);
|
|
149
|
+
}
|
|
127
150
|
async createBugBasedOnUserStory(title, userStoryId, bugContent) {
|
|
128
151
|
const bug = {
|
|
129
152
|
"Name": title,
|
|
@@ -309,6 +332,17 @@ export class TpClient {
|
|
|
309
332
|
apiVersion: this.v2
|
|
310
333
|
});
|
|
311
334
|
}
|
|
335
|
+
async getUserStoriesByFeatureId(featureId) {
|
|
336
|
+
return this.get({
|
|
337
|
+
pathParam: { "userstories": '' },
|
|
338
|
+
param: {
|
|
339
|
+
"format": "json",
|
|
340
|
+
"where": `(Feature.Id==${featureId})`,
|
|
341
|
+
"select": `{id}`,
|
|
342
|
+
},
|
|
343
|
+
apiVersion: this.v2
|
|
344
|
+
});
|
|
345
|
+
}
|
|
312
346
|
async getContext() {
|
|
313
347
|
return this.get({
|
|
314
348
|
pathParam: { "Context": '' },
|