targetprocess-mcp-server 2.5.0 → 2.5.2
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 +5 -0
- package/build/handlers/get_release_bugs.js +2 -2
- package/build/index.js +18 -3
- package/build/tp.js +38 -3
- package/package.json +1 -1
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>`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export async function handleGetReleaseBugs(tp, name, results) {
|
|
2
|
-
const release = await tp.getReleaseBugs({ name, results });
|
|
1
|
+
export async function handleGetReleaseBugs(tp, name, results, withDescription) {
|
|
2
|
+
const release = await tp.getReleaseBugs({ name, results, withDescription });
|
|
3
3
|
if (!release) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
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";
|
|
@@ -97,8 +98,10 @@ server.registerTool('get_release_bugs', {
|
|
|
97
98
|
.default(100)
|
|
98
99
|
.optional()
|
|
99
100
|
.describe('Number of results to return, default is 100'),
|
|
101
|
+
withDescription: z.boolean()
|
|
102
|
+
.describe('Include description in the response'),
|
|
100
103
|
},
|
|
101
|
-
}, async ({ name, results }) => handleGetReleaseBugs(tp, name, results));
|
|
104
|
+
}, async ({ name, results, withDescription }) => handleGetReleaseBugs(tp, name, results, withDescription));
|
|
102
105
|
server.registerTool('get_release_features', {
|
|
103
106
|
title: 'Get release features',
|
|
104
107
|
description: 'Get release features',
|
|
@@ -478,9 +481,12 @@ server.registerTool('update_user_story', {
|
|
|
478
481
|
entityStateId: z.string()
|
|
479
482
|
.optional()
|
|
480
483
|
.describe('Optional Entity State ID — if user gave a state name, resolve it via "get_user_story_workflows" first'),
|
|
484
|
+
featureId: z.string()
|
|
485
|
+
.optional()
|
|
486
|
+
.describe('Optional Feature ID — moves this user story to the specified feature'),
|
|
481
487
|
},
|
|
482
|
-
}, async ({ id, title, description, projectId, teamId, entityStateId }) => {
|
|
483
|
-
const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId });
|
|
488
|
+
}, async ({ id, title, description, projectId, teamId, entityStateId, featureId }) => {
|
|
489
|
+
const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId });
|
|
484
490
|
if (!response) {
|
|
485
491
|
return {
|
|
486
492
|
content: [{
|
|
@@ -1447,6 +1453,15 @@ server.registerTool('get_my_time_logs', {
|
|
|
1447
1453
|
.describe('Number of entries to return, default is 25'),
|
|
1448
1454
|
},
|
|
1449
1455
|
}, async ({ take }) => handleGetMyTimeLogs(tp, take));
|
|
1456
|
+
const require = createRequire(import.meta.url);
|
|
1457
|
+
const { version } = require("../package.json");
|
|
1458
|
+
server.registerTool('get_version', {
|
|
1459
|
+
title: 'Get server version',
|
|
1460
|
+
description: 'Returns the current version of the MCP server from package.json.',
|
|
1461
|
+
inputSchema: {},
|
|
1462
|
+
}, async () => ({
|
|
1463
|
+
content: [{ type: "text", text: version }]
|
|
1464
|
+
}));
|
|
1450
1465
|
async function main() {
|
|
1451
1466
|
const transport = new StdioServerTransport();
|
|
1452
1467
|
await server.connect(transport);
|
package/build/tp.js
CHANGED
|
@@ -45,6 +45,7 @@ export class TpClient {
|
|
|
45
45
|
async get(params) {
|
|
46
46
|
params.param["access_token"] = this.token;
|
|
47
47
|
let _url = this.params(params);
|
|
48
|
+
console.error(JSON.stringify({ "TP_GET_URL": _url }));
|
|
48
49
|
try {
|
|
49
50
|
const response = await fetch(_url, {
|
|
50
51
|
method: "GET",
|
|
@@ -197,7 +198,7 @@ export class TpClient {
|
|
|
197
198
|
param: { "format": "json" },
|
|
198
199
|
}, userStory);
|
|
199
200
|
}
|
|
200
|
-
async updateUserStory({ id, title, description, projectId, teamId, entityStateId }) {
|
|
201
|
+
async updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId }) {
|
|
201
202
|
const userStory = { "Id": id };
|
|
202
203
|
if (title)
|
|
203
204
|
userStory["Name"] = title;
|
|
@@ -209,6 +210,8 @@ export class TpClient {
|
|
|
209
210
|
userStory["assignedTeams"] = [{ "team": { "id": teamId } }];
|
|
210
211
|
if (entityStateId)
|
|
211
212
|
userStory["EntityState"] = { "Id": entityStateId };
|
|
213
|
+
if (featureId)
|
|
214
|
+
userStory["Feature"] = { "Id": featureId };
|
|
212
215
|
return this.post({
|
|
213
216
|
pathParam: ["UserStories"],
|
|
214
217
|
param: { "format": "json" },
|
|
@@ -564,8 +567,8 @@ export class TpClient {
|
|
|
564
567
|
}
|
|
565
568
|
});
|
|
566
569
|
}
|
|
567
|
-
async getReleaseBugs({ name, results =
|
|
568
|
-
const includeFilter = withDescription ? "[Name, Description, Id]" : "[Name, Id]";
|
|
570
|
+
async getReleaseBugs({ name, results = 500, withDescription = false }) {
|
|
571
|
+
const includeFilter = withDescription ? "[Name, Description, Id, Creator, Owner, Team]" : "[Name, Id]";
|
|
569
572
|
return this.get({
|
|
570
573
|
pathParam: ["Bugs"],
|
|
571
574
|
param: {
|
|
@@ -818,6 +821,38 @@ export class TpClient {
|
|
|
818
821
|
param: { "format": "json" },
|
|
819
822
|
}, body);
|
|
820
823
|
}
|
|
824
|
+
async assignRole(cardId, userId, roleId) {
|
|
825
|
+
return this.post({
|
|
826
|
+
pathParam: ["Assignments"],
|
|
827
|
+
param: { "format": "json" },
|
|
828
|
+
}, {
|
|
829
|
+
Assignable: { Id: parseInt(cardId) },
|
|
830
|
+
GeneralUser: { Id: parseInt(userId) },
|
|
831
|
+
Role: { Id: parseInt(roleId) },
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
async assignRoleToAllStoriesInFeature(featureId, userId, roleId) {
|
|
835
|
+
const storiesResponse = await this.getFeatureUserStories(featureId);
|
|
836
|
+
const storyItems = storiesResponse?.items?.[0]?.userStories?.items ?? [];
|
|
837
|
+
const succeeded = [];
|
|
838
|
+
const failed = [];
|
|
839
|
+
await Promise.all(storyItems.map(async (story) => {
|
|
840
|
+
const result = await this.assignRole(String(story.id), userId, roleId);
|
|
841
|
+
if (result) {
|
|
842
|
+
succeeded.push(result);
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
failed.push(story.id);
|
|
846
|
+
}
|
|
847
|
+
}));
|
|
848
|
+
return { succeeded, failed };
|
|
849
|
+
}
|
|
850
|
+
async getAssignmentRoles() {
|
|
851
|
+
return this.get({
|
|
852
|
+
pathParam: ["Roles"],
|
|
853
|
+
param: { "format": "json" },
|
|
854
|
+
});
|
|
855
|
+
}
|
|
821
856
|
async getMyTimeLogs(take = 25) {
|
|
822
857
|
return this.get({
|
|
823
858
|
pathParam: ["Times"],
|