targetprocess-mcp-server 2.1.8-c → 2.2.0

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
@@ -55,13 +55,16 @@ Cards — Read
55
55
 
56
56
  Cards — Write
57
57
  - `add_comment` — Post a comment to any card (id, comment)
58
- - `create_bug` — Create a standalone bug (title, bugContent, optional origin)
58
+ - `create_bug` — Create a standalone bug (title, bugContent, optional origin, optional projectId, optional teamId)
59
59
  > `origin` accepted values: `Production - Customer`, `Production - Internal`, `Pre-Release - Customer`, `Pre-Release - Internal`, `Regression - Dev01`, `Regression - Team Env`, `Manual QA` *(default)*, `Developer Raised`, `Operations`
60
60
  > [!NOTE]
61
- > requires `TP_PROJECT_ID`, `TP_TEAM_ID`
62
- - `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)
61
+ > `projectId` and `teamId` are optional — fall back to `TP_PROJECT_ID` and `TP_TEAM_ID` from config
62
+ - `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, optional projectId, optional teamId)
63
63
  > [!NOTE]
64
- > requires `TP_PROJECT_ID`, `TP_TEAM_ID`
64
+ > `projectId` and `teamId` are optional — fall back to `TP_PROJECT_ID` and `TP_TEAM_ID` from config
65
+ - `create_user_story` — Create a new user story (title, optional description, optional featureId, optional releaseId, optional projectId, optional teamId)
66
+ > [!NOTE]
67
+ > `projectId` and `teamId` are optional — fall back to `TP_PROJECT_ID` and `TP_TEAM_ID` from config
65
68
  - `create_test_plan` — Create a test plan linked to a UserStory, Bug, or Feature (title, resourceId, optional resourceType, optional description/startDate/endDate)
66
69
  > [!NOTE]
67
70
  > requires `TP_PROJECT_ID`,
package/build/index.js CHANGED
@@ -633,9 +633,15 @@ server.registerTool('create_bug_based_on_card', {
633
633
  .default("Manual QA")
634
634
  .optional()
635
635
  .describe('Where the bug was found, defaults to "Manual QA"'),
636
+ projectId: z.string()
637
+ .optional()
638
+ .describe('Optional Project ID — defaults to TP_PROJECT_ID from config'),
639
+ teamId: z.string()
640
+ .optional()
641
+ .describe('Optional Team ID — defaults to TP_TEAM_ID from config'),
636
642
  },
637
- }, async ({ title, card, bugContent, origin }) => {
638
- const bugResponse = await tp.createBug({ title, card, bugContent, origin });
643
+ }, async ({ title, card, bugContent, origin, projectId, teamId }) => {
644
+ const bugResponse = await tp.createBug({ title, card, bugContent, origin, projectId, teamId });
639
645
  if (!bugResponse) {
640
646
  return {
641
647
  content: [{
@@ -676,9 +682,15 @@ server.registerTool('create_bug', {
676
682
  .default("Manual QA")
677
683
  .optional()
678
684
  .describe('Where the bug was found, defaults to "Manual QA"'),
685
+ projectId: z.string()
686
+ .optional()
687
+ .describe('Optional Project ID — defaults to TP_PROJECT_ID from config'),
688
+ teamId: z.string()
689
+ .optional()
690
+ .describe('Optional Team ID — defaults to TP_TEAM_ID from config'),
679
691
  },
680
- }, async ({ title, bugContent, origin }) => {
681
- const bugResponse = await tp.createBugOnly({ title, bugContent, origin });
692
+ }, async ({ title, bugContent, origin, projectId, teamId }) => {
693
+ const bugResponse = await tp.createBugOnly({ title, bugContent, origin, projectId, teamId });
682
694
  if (!bugResponse) {
683
695
  return {
684
696
  content: [{
@@ -694,6 +706,49 @@ server.registerTool('create_bug', {
694
706
  }],
695
707
  };
696
708
  });
709
+ server.registerTool('create_user_story', {
710
+ title: 'Create a new user story',
711
+ description: `Create a new user story in Targetprocess.`,
712
+ inputSchema: {
713
+ title: z.string()
714
+ .describe('User story title'),
715
+ description: z.string()
716
+ .optional()
717
+ .describe('Optional user story description (when provided, format as HTML)'),
718
+ featureId: z.string()
719
+ .min(5)
720
+ .max(6)
721
+ .optional()
722
+ .describe('Optional Feature ID to link this user story to (e.g. 145636)'),
723
+ releaseId: z.string()
724
+ .min(5)
725
+ .max(6)
726
+ .optional()
727
+ .describe('Optional Release ID to link this user story to (e.g. 145200)'),
728
+ projectId: z.string()
729
+ .optional()
730
+ .describe('Optional Project ID — defaults to TP_PROJECT_ID from config'),
731
+ teamId: z.string()
732
+ .optional()
733
+ .describe('Optional Team ID — defaults to TP_TEAM_ID from config'),
734
+ },
735
+ }, async ({ title, description, featureId, releaseId, projectId, teamId }) => {
736
+ const userStoryResponse = await tp.createUserStory({ title, description, featureId, releaseId, projectId, teamId });
737
+ if (!userStoryResponse) {
738
+ return {
739
+ content: [{
740
+ type: 'text',
741
+ text: `Failed to create user story "${title}"\n JSON: ${JSON.stringify(userStoryResponse, null, 2)}`
742
+ }]
743
+ };
744
+ }
745
+ return {
746
+ content: [{
747
+ type: 'text',
748
+ text: JSON.stringify(userStoryResponse)
749
+ }],
750
+ };
751
+ });
697
752
  server.registerTool('create_test_plan', {
698
753
  title: 'Create a new test plan linked to a TP card',
699
754
  description: `Create a new test plan linked to a UserStory, Bug, or Feature. Name and Project are required by the API; Description, StartDate, and EndDate are optional.`,
package/build/tp.js CHANGED
@@ -100,11 +100,11 @@ export class TpClient {
100
100
  });
101
101
  return response;
102
102
  }
103
- async createBug({ title, card, bugContent, origin = "Manual QA" }) {
103
+ async createBug({ title, card, bugContent, origin = "Manual QA", projectId, teamId }) {
104
104
  const bug = {
105
105
  "Name": title,
106
106
  "Project": {
107
- "Id": config.tp.projectId
107
+ "Id": projectId || config.tp.projectId
108
108
  },
109
109
  "customFields": [{
110
110
  "name": "Origin",
@@ -113,7 +113,7 @@ export class TpClient {
113
113
  }],
114
114
  "assignedTeams": [{
115
115
  "team": {
116
- "id": config.tp.teamId
116
+ "id": teamId || config.tp.teamId
117
117
  }
118
118
  }],
119
119
  "Description": bugContent,
@@ -128,11 +128,11 @@ export class TpClient {
128
128
  param: { "format": "json" },
129
129
  }, bug);
130
130
  }
131
- async createBugOnly({ title, bugContent, origin = "Manual QA" }) {
131
+ async createBugOnly({ title, bugContent, origin = "Manual QA", projectId, teamId }) {
132
132
  const bug = {
133
133
  "Name": title,
134
134
  "Project": {
135
- "Id": config.tp.projectId
135
+ "Id": projectId || config.tp.projectId
136
136
  },
137
137
  "customFields": [{
138
138
  "name": "Origin",
@@ -141,7 +141,7 @@ export class TpClient {
141
141
  }],
142
142
  "assignedTeams": [{
143
143
  "team": {
144
- "id": config.tp.teamId
144
+ "id": teamId || config.tp.teamId
145
145
  }
146
146
  }],
147
147
  "Description": bugContent,
@@ -151,6 +151,23 @@ export class TpClient {
151
151
  param: { "format": "json" },
152
152
  }, bug);
153
153
  }
154
+ async createUserStory({ title, description, featureId, releaseId, projectId, teamId }) {
155
+ const userStory = {
156
+ "Name": title,
157
+ "Project": { "Id": projectId || config.tp.projectId },
158
+ "assignedTeams": [{ "team": { "id": teamId || config.tp.teamId } }],
159
+ };
160
+ if (description)
161
+ userStory["Description"] = description;
162
+ if (featureId)
163
+ userStory["Feature"] = { "Id": featureId };
164
+ if (releaseId)
165
+ userStory["Release"] = { "Id": releaseId };
166
+ return this.post({
167
+ pathParam: { "UserStories": '' },
168
+ param: { "format": "json" },
169
+ }, userStory);
170
+ }
154
171
  async createBugBasedOnUserStory(title, userStoryId, bugContent) {
155
172
  const bug = {
156
173
  "Name": title,
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "2.1.8c",
28
+ "version": "2.2.0",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [