targetprocess-mcp-server 2.5.0 → 2.5.1

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
@@ -132,6 +132,11 @@ Time Tracking
132
132
  - `log_time` — Log time spent on a Task, User Story, or Bug (entityId, entityType: Task | UserStory | Bug, hours, optional description, optional date)
133
133
  - `get_my_time_logs` — Get recent time log entries submitted by the current user (optional take)
134
134
 
135
+ Assignments
136
+ - `assign_role` — Assign a user to a role (e.g. Business Analyst, Developer, QA Engineer) on a TP card (cardId, userId, roleId)
137
+ - `assign_role_to_feature` — Assign a user to a role on all user stories in a feature in one call (featureId, userId, roleId)
138
+ - `get_assignment_roles` — List all available assignment roles with their IDs
139
+
135
140
  Developer Tools
136
141
  - `get_commit_message` — Returns a formatted commit message string for a task or bug ID (id, type: task | bug)
137
142
  > Format for task on a user story: `F#<featureId> US#<userStoryId> T#<taskId> <title>`
package/build/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { z } from "zod";
4
4
  import { JSDOM } from "jsdom";
5
+ import { createRequire } from "module";
5
6
  import { TpClient } from "./tp.js";
6
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
8
  import { config } from "./config.js";
@@ -478,9 +479,12 @@ server.registerTool('update_user_story', {
478
479
  entityStateId: z.string()
479
480
  .optional()
480
481
  .describe('Optional Entity State ID — if user gave a state name, resolve it via "get_user_story_workflows" first'),
482
+ featureId: z.string()
483
+ .optional()
484
+ .describe('Optional Feature ID — moves this user story to the specified feature'),
481
485
  },
482
- }, async ({ id, title, description, projectId, teamId, entityStateId }) => {
483
- const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId });
486
+ }, async ({ id, title, description, projectId, teamId, entityStateId, featureId }) => {
487
+ const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId });
484
488
  if (!response) {
485
489
  return {
486
490
  content: [{
@@ -1447,6 +1451,15 @@ server.registerTool('get_my_time_logs', {
1447
1451
  .describe('Number of entries to return, default is 25'),
1448
1452
  },
1449
1453
  }, async ({ take }) => handleGetMyTimeLogs(tp, take));
1454
+ const require = createRequire(import.meta.url);
1455
+ const { version } = require("../package.json");
1456
+ server.registerTool('get_version', {
1457
+ title: 'Get server version',
1458
+ description: 'Returns the current version of the MCP server from package.json.',
1459
+ inputSchema: {},
1460
+ }, async () => ({
1461
+ content: [{ type: "text", text: version }]
1462
+ }));
1450
1463
  async function main() {
1451
1464
  const transport = new StdioServerTransport();
1452
1465
  await server.connect(transport);
package/build/tp.js CHANGED
@@ -197,7 +197,7 @@ export class TpClient {
197
197
  param: { "format": "json" },
198
198
  }, userStory);
199
199
  }
200
- async updateUserStory({ id, title, description, projectId, teamId, entityStateId }) {
200
+ async updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId }) {
201
201
  const userStory = { "Id": id };
202
202
  if (title)
203
203
  userStory["Name"] = title;
@@ -209,6 +209,8 @@ export class TpClient {
209
209
  userStory["assignedTeams"] = [{ "team": { "id": teamId } }];
210
210
  if (entityStateId)
211
211
  userStory["EntityState"] = { "Id": entityStateId };
212
+ if (featureId)
213
+ userStory["Feature"] = { "Id": featureId };
212
214
  return this.post({
213
215
  pathParam: ["UserStories"],
214
216
  param: { "format": "json" },
@@ -818,6 +820,38 @@ export class TpClient {
818
820
  param: { "format": "json" },
819
821
  }, body);
820
822
  }
823
+ async assignRole(cardId, userId, roleId) {
824
+ return this.post({
825
+ pathParam: ["Assignments"],
826
+ param: { "format": "json" },
827
+ }, {
828
+ Assignable: { Id: parseInt(cardId) },
829
+ GeneralUser: { Id: parseInt(userId) },
830
+ Role: { Id: parseInt(roleId) },
831
+ });
832
+ }
833
+ async assignRoleToAllStoriesInFeature(featureId, userId, roleId) {
834
+ const storiesResponse = await this.getFeatureUserStories(featureId);
835
+ const storyItems = storiesResponse?.items?.[0]?.userStories?.items ?? [];
836
+ const succeeded = [];
837
+ const failed = [];
838
+ await Promise.all(storyItems.map(async (story) => {
839
+ const result = await this.assignRole(String(story.id), userId, roleId);
840
+ if (result) {
841
+ succeeded.push(result);
842
+ }
843
+ else {
844
+ failed.push(story.id);
845
+ }
846
+ }));
847
+ return { succeeded, failed };
848
+ }
849
+ async getAssignmentRoles() {
850
+ return this.get({
851
+ pathParam: ["Roles"],
852
+ param: { "format": "json" },
853
+ });
854
+ }
821
855
  async getMyTimeLogs(take = 25) {
822
856
  return this.get({
823
857
  pathParam: ["Times"],
package/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "engines": {
28
28
  "node": ">=20.x"
29
29
  },
30
- "version": "2.5.0",
30
+ "version": "2.5.1",
31
31
  "description": "MCP server for Tartget Process",
32
32
  "main": "build/index.js",
33
33
  "keywords": [