targetprocess-mcp-server 1.0.15 → 1.0.17

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 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 Bugs based on user story
16
- - Retreive TP entities: bugs, user stories
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 new bug linked to a card (card object with id+type, title, bugContent)
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
@@ -724,6 +724,86 @@ server.registerTool('create_test_plan', {
724
724
  }],
725
725
  };
726
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
+ try {
771
+ for (const userStory of userStoriesResults) {
772
+ const covered = userStory.CustomFields.find((field) => field.Name === "Test Automation")?.Value === "Done";
773
+ userStories.push({
774
+ id: userStory.Id,
775
+ name: userStory.Name,
776
+ description: userStory.Description,
777
+ featureId: userStory.Feature.Id,
778
+ featureName: userStory.Feature.Name,
779
+ covered,
780
+ });
781
+ }
782
+ if (userStories.length === 0) {
783
+ return {
784
+ content: [{
785
+ type: 'text',
786
+ text: `No user stories unable to convert to TP card found for feature id: ${id}`,
787
+ }],
788
+ };
789
+ }
790
+ }
791
+ catch (error) {
792
+ console.error("Error getting user stories:", error);
793
+ return {
794
+ content: [{
795
+ type: 'text',
796
+ text: `Failed to get user stories array for feature id: ${id}`,
797
+ }],
798
+ };
799
+ }
800
+ return {
801
+ content: [{
802
+ type: 'text',
803
+ text: JSON.stringify(userStories)
804
+ }],
805
+ };
806
+ });
727
807
  server.registerTool('get_feature_user_stories', {
728
808
  title: 'Get feature user stories',
729
809
  description: 'Get user stories for a TP feature by its ID',
package/build/tp.js CHANGED
@@ -80,12 +80,8 @@ export class TpClient {
80
80
  }
81
81
  async getUserStory(userStoryId) {
82
82
  const response = await this.get({
83
- pathParam: {
84
- "userStories": userStoryId,
85
- },
86
- param: {
87
- "format": "json",
88
- },
83
+ pathParam: { "userStories": userStoryId },
84
+ param: { "format": "json" },
89
85
  });
90
86
  return response;
91
87
  }
@@ -332,6 +328,17 @@ export class TpClient {
332
328
  apiVersion: this.v2
333
329
  });
334
330
  }
331
+ async getUserStoriesByFeatureId(featureId) {
332
+ return this.get({
333
+ pathParam: { "userstories": '' },
334
+ param: {
335
+ "format": "json",
336
+ "where": `(Feature.Id==${featureId})`,
337
+ "select": `{id}`,
338
+ },
339
+ apiVersion: this.v2
340
+ });
341
+ }
335
342
  async getContext() {
336
343
  return this.get({
337
344
  pathParam: { "Context": '' },
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "1.0.15",
28
+ "version": "1.0.17",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [