targetprocess-mcp-server 2.1.8 → 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
@@ -335,17 +335,21 @@ server.registerTool('get_release_open_user_stories', {
335
335
  server.registerTool('search_tp_cards', {
336
336
  title: 'Search TP cards by keyword or phrase in description',
337
337
  description: `Searches TP cards (UserStories or Bugs) by keyword or phrase or partial keyphrase in Card Description e.g. "Text Element", "Font field"
338
- NOTE: after results are returned, try analyze and filter results by most relevant to what user is looking for in the description text`,
338
+ NOTE: after results are returned, try analyze and filter results by most relevant to what user is looking for in the description text
339
+ FALLBACK: if no results are found, try spliting phrase by spaces and searching for each word and with "Generals" entity type`,
339
340
  inputSchema: {
340
341
  keyword: z.string()
341
342
  .describe('Keyword or partial name or keyphrase to search for in description'),
342
- entityType: z.enum(["UserStories", "Bugs"])
343
+ entityType: z.enum(["UserStories", "Bugs", "Generals"])
343
344
  .default("UserStories")
344
345
  .optional()
345
346
  .describe('Type of TP entity to search — UserStories or Bugs (default: UserStories)'),
346
347
  },
347
348
  }, async ({ keyword, entityType = "UserStories" }) => {
348
- const results = await tp.searchContainsDescriptionText({ text: keyword, entityType });
349
+ const results = await Promise.all([
350
+ tp.searchContainsNameText({ text: keyword, entityType }),
351
+ tp.searchContainsDescriptionText({ text: keyword, entityType })
352
+ ]);
349
353
  if (!results) {
350
354
  return {
351
355
  content: [{
@@ -354,7 +358,7 @@ server.registerTool('search_tp_cards', {
354
358
  }],
355
359
  };
356
360
  }
357
- const items = results.Items || [];
361
+ const items = results.map((item) => item.Items).flat();
358
362
  if (items.length == 0) {
359
363
  return {
360
364
  content: [{
@@ -629,9 +633,15 @@ server.registerTool('create_bug_based_on_card', {
629
633
  .default("Manual QA")
630
634
  .optional()
631
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'),
632
642
  },
633
- }, async ({ title, card, bugContent, origin }) => {
634
- 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 });
635
645
  if (!bugResponse) {
636
646
  return {
637
647
  content: [{
@@ -672,9 +682,15 @@ server.registerTool('create_bug', {
672
682
  .default("Manual QA")
673
683
  .optional()
674
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'),
675
691
  },
676
- }, async ({ title, bugContent, origin }) => {
677
- 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 });
678
694
  if (!bugResponse) {
679
695
  return {
680
696
  content: [{
@@ -690,6 +706,49 @@ server.registerTool('create_bug', {
690
706
  }],
691
707
  };
692
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
+ });
693
752
  server.registerTool('create_test_plan', {
694
753
  title: 'Create a new test plan linked to a TP card',
695
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.8",
28
+ "version": "2.2.0",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [