targetprocess-mcp-server 1.0.9 → 1.0.12

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
@@ -33,6 +33,28 @@ It acts as a **bridge between LLM agents and the Targetprocess API**, providing:
33
33
 
34
34
  - search for a card with 'Text Element' title
35
35
 
36
+ ---
37
+ ## Available tools:
38
+ Releases
39
+ - `get_current_releases` — List all current releases (no params needed)
40
+ - `get_release_bugs` — Get bugs for a release (name, optional results)
41
+ - `get_release_features` — Get features for a release (name, optional results)
42
+ - `get_release_user_stories` — Get user stories for a release (name, optional results)
43
+ - `get_release_user_stories_with_description` — Same as above but includes full descriptions (name, withDescription)
44
+ - `get_release_open_bugs` — Get only active/open bugs for a release (name, withDescription, optional results)
45
+ - `get_release_open_user_stories` — Get only active/open user stories for a release (name, withDescription, optional results)
46
+
47
+ Cards — Read
48
+ - `get_bug_content` — Fetch full content of a bug by ID (id)
49
+ - `get_user_story_content` — Fetch full content of a user story by ID (id)
50
+ - `get_bug_comments` — Get comments on a bug (id, optional results)
51
+ - `get_user_story_comments` — Get comments on a user story (id, optional results)
52
+ - `search_all_cards_by_keyword` — Search bugs, stories, and features by keyword (keyword)
53
+
54
+ Cards — Write
55
+ - `add_comment` — Post a comment to any card (id, comment)
56
+ - `create_bug` — Create a new bug linked to a card (card object with id+type, title, bugContent)
57
+ - `create_test_plan` — Create a test plan linked to a user story (title, userStoryId)
36
58
  ---
37
59
 
38
60
  ## Installation
@@ -87,9 +109,7 @@ It acts as a **bridge between LLM agents and the Targetprocess API**, providing:
87
109
  ### Claude Code
88
110
  ```bash
89
111
  claude mcp add tarteprocess -s user \
90
- -- env TP_TOKEN=<your-tp-token> \
91
- -- env TP_BASE_URL=<tp-api-endpoint> \
92
- npx -y targetprocess-mcp-server
112
+ -e TP_TOKEN=<your-tp-token> -e TP_BASE_URL=<tp-api-endpoint> -- npx -y targetprocess-mcp-server
93
113
  ```
94
114
 
95
115
  ## Local Development
package/build/config.js CHANGED
@@ -3,7 +3,7 @@ export const config = {
3
3
  tp: {
4
4
  url: process.env.TP_BASE_URL || "",
5
5
  token: process.env.TP_TOKEN || "",
6
- ownerId: process.env.TP_OWNER_ID || "",
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
9
  }
package/build/index.js CHANGED
@@ -50,12 +50,28 @@ server.registerTool('get_user_story_content', {
50
50
  }],
51
51
  };
52
52
  }
53
- const dom = new JSDOM(`<html><body><div id="content">${description}</div></body></html>`);
54
- const descriptionText = dom.window.document.getElementById('content')?.textContent;
53
+ let userStoryResults = {
54
+ name: userStory.Name,
55
+ id: userStory.Id,
56
+ description: '',
57
+ feature: userStory.Feature?.Name,
58
+ featureId: userStory.Feature?.Id,
59
+ };
60
+ try {
61
+ const dom = new JSDOM(`<html><body><div id="content">${description}</div></body></html>`);
62
+ const descriptionText = dom.window.document.getElementById('content')?.textContent;
63
+ if (descriptionText) {
64
+ userStoryResults.description = descriptionText;
65
+ }
66
+ }
67
+ catch (error) {
68
+ console.error("Error parsing user story description:", error);
69
+ console.error("Returning user story without description");
70
+ }
55
71
  return {
56
72
  content: [{
57
73
  type: 'text',
58
- text: JSON.stringify(descriptionText)
74
+ text: JSON.stringify(userStoryResults)
59
75
  }],
60
76
  };
61
77
  });
@@ -632,6 +648,35 @@ server.registerTool('create_test_plan', {
632
648
  }],
633
649
  };
634
650
  });
651
+ server.registerTool('get_logged_in_user', {
652
+ title: 'Get logged in user',
653
+ description: 'Get logged in user',
654
+ }, async () => {
655
+ const ctx = await tp.getContext();
656
+ if (!ctx) {
657
+ return {
658
+ content: [{
659
+ type: 'text',
660
+ text: `Failed to get context, JSON: ${JSON.stringify(ctx, null, 2)}`
661
+ }],
662
+ };
663
+ }
664
+ const loggedInUser = ctx.LoggedUser;
665
+ if (!loggedInUser) {
666
+ return {
667
+ content: [{
668
+ type: 'text',
669
+ text: `Failed to get logged in user in this context, JSON: ${JSON.stringify(ctx, null, 2)}`
670
+ }],
671
+ };
672
+ }
673
+ return {
674
+ content: [{
675
+ type: 'text',
676
+ text: JSON.stringify(loggedInUser)
677
+ }],
678
+ };
679
+ });
635
680
  async function main() {
636
681
  const transport = new StdioServerTransport();
637
682
  await server.connect(transport);
package/build/tp.js CHANGED
@@ -98,7 +98,7 @@ export class TpClient {
98
98
  const bug = {
99
99
  "Name": title,
100
100
  "Project": {
101
- "Id": 59901
101
+ "Id": config.tp.projectId
102
102
  },
103
103
  "customFields": [{
104
104
  "name": "Origin",
@@ -107,7 +107,7 @@ export class TpClient {
107
107
  }],
108
108
  "assignedTeams": [{
109
109
  "team": {
110
- "id": 127065
110
+ "id": config.tp.teamId
111
111
  }
112
112
  }],
113
113
  "Description": bugContent,
@@ -126,7 +126,7 @@ export class TpClient {
126
126
  const bug = {
127
127
  "Name": title,
128
128
  "Project": {
129
- "Id": 59901
129
+ "Id": config.tp.projectId
130
130
  },
131
131
  "UserStory": {
132
132
  "Id": userStoryId
@@ -138,7 +138,7 @@ export class TpClient {
138
138
  }],
139
139
  "assignedTeams": [{
140
140
  "team": {
141
- "id": 127065
141
+ "id": config.tp.teamId
142
142
  }
143
143
  }],
144
144
  "Description": bugContent,
@@ -152,7 +152,7 @@ export class TpClient {
152
152
  const testPlan = {
153
153
  "Name": title,
154
154
  "Project": {
155
- "Id": 59901
155
+ "Id": config.tp.projectId
156
156
  },
157
157
  "LinkedGeneral": {
158
158
  "ResourceType": "General",
@@ -179,7 +179,7 @@ export class TpClient {
179
179
  const commentData = {
180
180
  description: comment,
181
181
  owner: {
182
- id: "1504",
182
+ id: config.tp.ownerId
183
183
  },
184
184
  general: {
185
185
  id: userStoryId,
@@ -296,4 +296,10 @@ export class TpClient {
296
296
  }
297
297
  });
298
298
  }
299
+ async getContext() {
300
+ return this.get({
301
+ pathParam: { "Context": '' },
302
+ param: { "format": "json", }
303
+ });
304
+ }
299
305
  }
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "engines": {
26
26
  "node": ">=20.x"
27
27
  },
28
- "version": "1.0.9",
28
+ "version": "1.0.12",
29
29
  "description": "MCP server for Tartget Process",
30
30
  "main": "build/index.js",
31
31
  "keywords": [