targetprocess-mcp-server 2.2.4 → 2.2.6

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
@@ -46,7 +46,7 @@ Features
46
46
  - `get_not_covered_user_stories_in_feature` — Get user stories in a feature not yet covered by tests, includes `covered` field based on "Test Automation" custom field (id)
47
47
 
48
48
  Cards — Read
49
- - `get_card_status` — Get EntityState, TeamState, and assigned teams for a card (id, optional resourceType: UserStory | Bug | Feature, default: UserStory)
49
+ - `get_card_current_status` — Get EntityState, TeamState, and assigned teams for a card (id, optional resourceType: UserStory | Bug | Feature, default: UserStory)
50
50
  - `get_bug_content` — Fetch full content of a bug by ID (id)
51
51
  - `get_user_story_content` — Fetch full content of a user story by ID (id)
52
52
  - `get_bug_comments` — Get comments on a bug (id, optional results)
@@ -56,8 +56,13 @@ Cards — Read
56
56
 
57
57
  Cards — Write
58
58
  - `add_comment` — Post a comment to any card (id, comment)
59
- - `create_bug` — Create a standalone bug (title, bugContent, optional origin, optional projectId, optional teamId)
59
+ - `update_bug` — Update an existing bug (id, optional title, optional bugContent, optional origin, optional projectId, optional teamId, optional entityStateId)
60
+ > Resolve state name → ID via `get_bug_workflows` before passing `entityStateId`
61
+ - `update_user_story` — Update an existing user story (id, optional title, optional description, optional projectId, optional teamId, optional entityStateId)
62
+ > Resolve state name → ID via `get_user_story_workflows` before passing `entityStateId`
63
+ - `create_bug` — Create a standalone bug (title, bugContent, optional origin, optional projectId, optional teamId, optional entityStateName)
60
64
  > `origin` accepted values: `Production - Customer`, `Production - Internal`, `Pre-Release - Customer`, `Pre-Release - Internal`, `Regression - Dev01`, `Regression - Team Env`, `Manual QA` *(default)*, `Developer Raised`, `Operations`
65
+ > `entityStateName` accepted values: `Backlog`, `In Triage`, `Ready for Dev`, `In Dev`, `Blocked`, `PR Raised`, `Ready for Feature PCH`, `Ready for Feature QA`, `In Feature QA`, `Failed Feature QA`, `Ready for Merge`, `Ready to Deploy to Dev01`, `Ready for Dev01 QA`, `In Dev01 QA`, `Failed Dev01 QA`, `Ready to Deploy to prod`, `Closed`
61
66
  > [!NOTE]
62
67
  > `projectId` and `teamId` are optional — fall back to `TP_PROJECT_ID` and `TP_TEAM_ID` from config
63
68
  - `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)
@@ -77,6 +82,12 @@ Test Case Workflows
77
82
  - `write_test_cases` — Fetch a card (UserStory, Bug, or Feature) by ID and trigger the full test case writing workflow: Claude analyzes the card, generates detailed test cases covering happy path, edge cases, and error scenarios, creates a linked test plan via `create_test_plan`, then calls `add_test_cases_to_test_plan`. Each test case description contains Preconditions and Test Type as HTML; steps are passed as a structured array (resourceId, optional resourceType)
78
83
  - `add_test_cases_to_test_plan` — Add pre-generated test cases to an existing test plan. Each test case has a `name`, an HTML `description` (Preconditions and Test Type only), and a `steps` array of `{ description, result }` objects — steps are created via the TP test step API rather than embedded in the description (testPlanId, testCases array of {name, description, steps})
79
84
 
85
+ Processes & Workflows
86
+ - `get_processes` — Get all Targetprocess processes (no params needed)
87
+ - `get_process_workflows` — Get workflows for a specific process (processId)
88
+ - `get_bug_workflows` — Get all bug entity states/workflows for the configured process (no params needed)
89
+ - `get_user_story_workflows` — Get all user story entity states/workflows for the configured process (no params needed)
90
+
80
91
  Projects
81
92
  - `get_projects` — Get all Targetprocess projects (no params needed)
82
93
 
package/build/config.js CHANGED
@@ -6,5 +6,8 @@ export const config = {
6
6
  ownerId: process.env.TP_OWNER_ID || "1504",
7
7
  projectId: process.env.TP_PROJECT_ID || "",
8
8
  teamId: process.env.TP_TEAM_ID || "",
9
+ processId: process.env.TP_PROCESS_ID || "89",
10
+ userStoryWorkflowId: process.env.TP_USER_STORY_WORKFLOW_ID || "",
11
+ bugWorkflowId: process.env.TP_BUG_WORKFLOW_ID || "",
9
12
  }
10
13
  };
package/build/index.js CHANGED
@@ -661,6 +661,111 @@ server.registerTool('create_bug_based_on_card', {
661
661
  }],
662
662
  };
663
663
  });
664
+ server.registerTool('update_bug', {
665
+ title: 'Update a bug card',
666
+ description: `Update a bug card with data proded from user input.
667
+ NOTE: pass only the fields that user wants to update.
668
+ CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
669
+ 1) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
670
+ 2) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;
671
+ 3) IF the user specified a state by name (not ID), call "get_bug_workflows" to find the matching state and use its ID as entityStateId;`,
672
+ inputSchema: {
673
+ id: z.string()
674
+ .min(5)
675
+ .max(6)
676
+ .describe('Bug card ID (e.g. 145789)'),
677
+ title: z.string()
678
+ .optional()
679
+ .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'),
680
+ bugContent: z.string()
681
+ .optional()
682
+ .describe(`Bug description content, explain what happened in detail. Include expected behaviour and what actually occurred. Be specific and avoid assumptions. Clearly outline the actions needed to trigger the bug. Number each step so anyone can follow them easily`),
683
+ origin: z.enum([
684
+ "Production - Customer",
685
+ "Production - Internal",
686
+ "Pre-Release - Customer",
687
+ "Pre-Release - Internal",
688
+ "Regression - Dev01",
689
+ "Regression - Team Env",
690
+ "Manual QA",
691
+ "Developer Raised",
692
+ "Operations",
693
+ ])
694
+ .optional()
695
+ .describe('Where the bug was found, defaults to "Manual QA"'),
696
+ projectId: z.string()
697
+ .optional()
698
+ .describe('Optional Project ID — if user gave a project name, resolve it via "get_projects" first; defaults to TP_PROJECT_ID from config'),
699
+ teamId: z.string()
700
+ .optional()
701
+ .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first; defaults to TP_TEAM_ID from config'),
702
+ entityStateId: z.string()
703
+ .optional()
704
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_bug_workflows" first; defaults to "Done"'),
705
+ },
706
+ }, async ({ id, title, bugContent, origin, projectId, teamId, entityStateId }) => {
707
+ const bugResponse = await tp.updateBug({ id, title, bugContent, origin, projectId, teamId, entityStateId });
708
+ if (!bugResponse) {
709
+ return {
710
+ content: [{
711
+ type: 'text',
712
+ text: `Failed to update bug "${title}"\n JSON: ${JSON.stringify(bugResponse, null, 2)}`
713
+ }]
714
+ };
715
+ }
716
+ return {
717
+ content: [{
718
+ type: 'text',
719
+ text: JSON.stringify(bugResponse)
720
+ }],
721
+ };
722
+ });
723
+ server.registerTool('update_user_story', {
724
+ title: 'Update a user story card',
725
+ description: `Update a user story card with data provided from user input.
726
+ NOTE: pass only the fields that user wants to update.
727
+ CRITICAL WORKFLOW: Before calling this tool, you MUST follow these steps:
728
+ 1) IF the user specified a team by name (not ID), call "get_teams" to find the matching team and use its ID as teamId;
729
+ 2) IF the user specified a project by name (not ID), call "get_projects" to find the matching project and use its ID as projectId;
730
+ 3) IF the user specified a state by name (not ID), call "get_user_story_workflows" to find the matching state and use its ID as entityStateId;`,
731
+ inputSchema: {
732
+ id: z.string()
733
+ .min(5)
734
+ .max(6)
735
+ .describe('User story card ID (e.g. 145789)'),
736
+ title: z.string()
737
+ .optional()
738
+ .describe('Updated user story title'),
739
+ description: z.string()
740
+ .optional()
741
+ .describe('Updated user story description (format as HTML)'),
742
+ projectId: z.string()
743
+ .optional()
744
+ .describe('Optional Project ID — if user gave a project name, resolve it via "get_projects" first'),
745
+ teamId: z.string()
746
+ .optional()
747
+ .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first'),
748
+ entityStateId: z.string()
749
+ .optional()
750
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_user_story_workflows" first'),
751
+ },
752
+ }, async ({ id, title, description, projectId, teamId, entityStateId }) => {
753
+ const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId });
754
+ if (!response) {
755
+ return {
756
+ content: [{
757
+ type: 'text',
758
+ text: `Failed to update user story id: ${id}\n JSON: ${JSON.stringify(response, null, 2)}`
759
+ }]
760
+ };
761
+ }
762
+ return {
763
+ content: [{
764
+ type: 'text',
765
+ text: JSON.stringify(response)
766
+ }],
767
+ };
768
+ });
664
769
  server.registerTool('create_bug', {
665
770
  title: 'Create a new bug card',
666
771
  description: `Create a new bug card that summarizes the problem in concise, descriptive manner answering questions "What? Where? When?" and content explaining what happened in detail.
@@ -694,9 +799,12 @@ server.registerTool('create_bug', {
694
799
  teamId: z.string()
695
800
  .optional()
696
801
  .describe('Optional Team ID — if user gave a team name, resolve it via "get_teams" first; defaults to TP_TEAM_ID from config'),
802
+ entityStateId: z.string()
803
+ .optional()
804
+ .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_bug_workflows" first; defaults to "Done"'),
697
805
  },
698
- }, async ({ title, bugContent, origin, projectId, teamId }) => {
699
- const bugResponse = await tp.createBugOnly({ title, bugContent, origin, projectId, teamId });
806
+ }, async ({ title, bugContent, origin, projectId, teamId, entityStateId }) => {
807
+ const bugResponse = await tp.createBugOnly({ title, bugContent, origin, projectId, teamId, entityStateId });
700
808
  if (!bugResponse) {
701
809
  return {
702
810
  content: [{
@@ -1244,7 +1352,147 @@ server.registerTool('add_test_cases_to_test_plan', {
1244
1352
  }]
1245
1353
  };
1246
1354
  });
1247
- server.registerTool('get_card_status', {
1355
+ server.registerTool('get_process_workflows', {
1356
+ title: 'Get process workflows',
1357
+ description: 'Get all Targetprocess process workflows',
1358
+ inputSchema: {
1359
+ processId: z.string()
1360
+ .describe('Process ID (e.g. 145636)'),
1361
+ },
1362
+ }, async ({ processId }) => {
1363
+ const response = await tp.getProcessWorkflows({ processId });
1364
+ if (!response) {
1365
+ return {
1366
+ content: [{
1367
+ type: 'text',
1368
+ text: `Failed to get process workflows, JSON: ${JSON.stringify(response, null, 2)}`
1369
+ }],
1370
+ };
1371
+ }
1372
+ const items = response.items || [];
1373
+ if (items.length === 0) {
1374
+ return {
1375
+ content: [{
1376
+ type: 'text',
1377
+ text: `No process workflows found`,
1378
+ }],
1379
+ };
1380
+ }
1381
+ return {
1382
+ content: [{
1383
+ type: 'text',
1384
+ text: JSON.stringify(items)
1385
+ }],
1386
+ };
1387
+ });
1388
+ server.registerTool('get_processes', {
1389
+ title: 'Get processes',
1390
+ description: 'Get all Targetprocess processes',
1391
+ }, async ({}) => {
1392
+ const response = await tp.getProcesses();
1393
+ if (!response) {
1394
+ return {
1395
+ content: [{
1396
+ type: 'text',
1397
+ text: `Failed to get processes, JSON: ${JSON.stringify(response, null, 2)}`
1398
+ }],
1399
+ };
1400
+ }
1401
+ const items = response.items || [];
1402
+ if (items.length === 0) {
1403
+ return {
1404
+ content: [{
1405
+ type: 'text',
1406
+ text: `No processes found`,
1407
+ }],
1408
+ };
1409
+ }
1410
+ return {
1411
+ content: [{
1412
+ type: 'text',
1413
+ text: JSON.stringify(items)
1414
+ }],
1415
+ };
1416
+ });
1417
+ server.registerTool('get_bug_workflows', {
1418
+ title: 'Get bug workflows',
1419
+ description: 'Get all Targetprocess bug workflows',
1420
+ }, async ({}) => {
1421
+ const response = await tp.getBugWorkflows();
1422
+ if (!response) {
1423
+ return {
1424
+ content: [{
1425
+ type: 'text',
1426
+ text: `Failed to get bug entity statuses, JSON: ${JSON.stringify(response, null, 2)}`
1427
+ }],
1428
+ };
1429
+ }
1430
+ const items = response.items || [];
1431
+ if (items.length === 0) {
1432
+ return {
1433
+ content: [{
1434
+ type: 'text',
1435
+ text: `No status data found for workflows`
1436
+ }],
1437
+ };
1438
+ }
1439
+ const workflows = items.map((w) => ({
1440
+ id: w.id,
1441
+ name: w.name,
1442
+ processId: w.process,
1443
+ entityType: w.entityType,
1444
+ entityStates: w.entityStates.map((es) => ({
1445
+ id: es.id,
1446
+ name: es.name,
1447
+ })),
1448
+ }));
1449
+ return {
1450
+ content: [{
1451
+ type: 'text',
1452
+ text: JSON.stringify(workflows)
1453
+ }],
1454
+ };
1455
+ });
1456
+ server.registerTool('get_user_story_workflows', {
1457
+ title: 'Get User Story workflows',
1458
+ description: 'Get all Targetprocess user story workflows',
1459
+ }, async ({}) => {
1460
+ const response = await tp.getUserStoryWorkflows();
1461
+ if (!response) {
1462
+ return {
1463
+ content: [{
1464
+ type: 'text',
1465
+ text: `Failed to get user story entity statuses, JSON: ${JSON.stringify(response, null, 2)}`
1466
+ }],
1467
+ };
1468
+ }
1469
+ const items = response.items || [];
1470
+ if (items.length === 0) {
1471
+ return {
1472
+ content: [{
1473
+ type: 'text',
1474
+ text: `No status data found for workflows`
1475
+ }],
1476
+ };
1477
+ }
1478
+ const workflows = items.map((w) => ({
1479
+ id: w.id,
1480
+ name: w.name,
1481
+ processId: w.process,
1482
+ entityType: w.entityType,
1483
+ entityStates: w.entityStates.map((es) => ({
1484
+ id: es.id,
1485
+ name: es.name,
1486
+ })),
1487
+ }));
1488
+ return {
1489
+ content: [{
1490
+ type: 'text',
1491
+ text: JSON.stringify(workflows)
1492
+ }],
1493
+ };
1494
+ });
1495
+ server.registerTool('get_card_current_status', {
1248
1496
  title: 'Get card status',
1249
1497
  description: 'Get the EntityState, TeamState, and assigned teams for a TP card (UserStory, Bug, or Feature) by ID',
1250
1498
  inputSchema: {
package/build/tp.js CHANGED
@@ -130,7 +130,51 @@ export class TpClient {
130
130
  param: { "format": "json" },
131
131
  }, bug);
132
132
  }
133
- async createBugOnly({ title, bugContent, origin = "Manual QA", projectId, teamId }) {
133
+ async updateUserStory({ id, title, description, projectId, teamId, entityStateId }) {
134
+ const userStory = { "Id": id };
135
+ if (title)
136
+ userStory["Name"] = title;
137
+ if (description)
138
+ userStory["Description"] = description;
139
+ if (projectId)
140
+ userStory["Project"] = { "Id": projectId };
141
+ if (teamId)
142
+ userStory["assignedTeams"] = [{ "team": { "id": teamId } }];
143
+ if (entityStateId)
144
+ userStory["EntityState"] = { "Id": entityStateId };
145
+ return this.post({
146
+ pathParam: ["UserStories"],
147
+ param: { "format": "json" },
148
+ }, userStory);
149
+ }
150
+ async updateBug({ id, title, bugContent, origin, projectId, teamId, entityStateId }) {
151
+ const bug = { "Id": id };
152
+ if (title)
153
+ bug["Name"] = title;
154
+ if (bugContent)
155
+ bug["Description"] = bugContent;
156
+ if (origin)
157
+ bug["customFields"] = [{
158
+ "name": "Origin",
159
+ "type": "DropDown",
160
+ "value": origin
161
+ }];
162
+ if (projectId)
163
+ bug["Project"] = { "Id": projectId };
164
+ if (teamId)
165
+ bug["assignedTeams"] = [{
166
+ "team": {
167
+ "id": teamId || config.tp.teamId
168
+ }
169
+ }];
170
+ if (entityStateId)
171
+ bug["entityState"] = { "id": entityStateId };
172
+ return this.post({
173
+ pathParam: ["bugs"],
174
+ param: { "format": "json" },
175
+ }, bug);
176
+ }
177
+ async createBugOnly({ title, bugContent, origin = "Manual QA", projectId, teamId, entityStateId }) {
134
178
  const bug = {
135
179
  "Name": title,
136
180
  "Project": {
@@ -148,6 +192,8 @@ export class TpClient {
148
192
  }],
149
193
  "Description": bugContent,
150
194
  };
195
+ if (entityStateId)
196
+ bug["EntityState"] = { "Id": entityStateId };
151
197
  return this.post({
152
198
  pathParam: ["bugs"],
153
199
  param: { "format": "json" },
@@ -460,12 +506,63 @@ export class TpClient {
460
506
  param: { "format": "json" },
461
507
  });
462
508
  }
509
+ async getProcessWorkflows({ processId }) {
510
+ return this.get({
511
+ pathParam: ["Process"],
512
+ param: {
513
+ "format": "json",
514
+ "where": `id=(${processId})`,
515
+ "select": `{Workflows}`
516
+ },
517
+ apiVersion: this.v2
518
+ });
519
+ }
520
+ async getUserStories({ take = 100 }) {
521
+ return this.get({
522
+ pathParam: ["userStories"],
523
+ param: {
524
+ "format": "json",
525
+ "take": take,
526
+ },
527
+ apiVersion: this.v2
528
+ });
529
+ }
530
+ async getProcesses() {
531
+ return this.get({
532
+ pathParam: ["Processes"],
533
+ param: { "format": "json" },
534
+ });
535
+ }
463
536
  async getTeams() {
464
537
  return this.get({
465
538
  pathParam: ["Teams"],
466
539
  param: { "format": "json" },
467
540
  });
468
541
  }
542
+ async getUserStoryWorkflows() {
543
+ return this.get({
544
+ pathParam: ["workflow"],
545
+ param: {
546
+ "format": "json",
547
+ "select": `{Id,Name,Process,EntityType,EntityStates.Select({Id,Name}) as EntityStates}`,
548
+ "where": `(process.id=${config.tp.processId} and entityType.name="userStory" and parentWorkflow=null)`,
549
+ "take": "1",
550
+ },
551
+ apiVersion: this.v2
552
+ });
553
+ }
554
+ async getBugWorkflows() {
555
+ return this.get({
556
+ pathParam: ["workflow"],
557
+ param: {
558
+ "format": "json",
559
+ "select": `{Id,Name,Process,EntityType,EntityStates.Select({Id,Name}) as EntityStates}`,
560
+ "where": `(process.id=${config.tp.processId} and entityType.name="bug" and parentWorkflow=null)`,
561
+ "take": "1",
562
+ },
563
+ apiVersion: this.v2
564
+ });
565
+ }
469
566
  async getCardStatus(cardId, resourceType = 'UserStory') {
470
567
  const pathMap = { UserStory: 'userStory', Bug: 'bug', Feature: 'feature' };
471
568
  return this.get({
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "2.2.4",
28
+ "version": "2.2.6",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [