@dyno181cm.nexsoft/zentao_mcp 1.2.5 → 1.2.7

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/build/index.js CHANGED
@@ -3,12 +3,15 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { registerTools } from "./tools.js";
5
5
  import * as dotenv from "dotenv";
6
+ import { readFileSync } from "fs";
6
7
  // Initialize environment variables from .env file
7
8
  dotenv.config();
9
+ // Read package.json to get the version dynamically
10
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
8
11
  // Create the MCP server instance
9
12
  const server = new McpServer({
10
13
  name: "Zentao MCP Server",
11
- version: "1.2.5"
14
+ version: pkg.version
12
15
  });
13
16
  // Register all Zentao-specific tools onto the server
14
17
  registerTools(server);
package/build/tools.js CHANGED
@@ -3,8 +3,10 @@ import * as os from "os";
3
3
  import * as path from "path";
4
4
  import fs from "fs";
5
5
  import { ZentaoClient } from "./zentaoClient.js";
6
+ import TurndownService from "turndown";
6
7
  const client = new ZentaoClient();
7
8
  const activeDownloads = new Map();
9
+ const turndownService = new TurndownService();
8
10
  /**
9
11
  * Registers Zentao-specific tools to the Model Context Protocol (MCP) server.
10
12
  *
@@ -32,7 +34,15 @@ function parseFiles(files) {
32
34
  }
33
35
  return [];
34
36
  }
35
- function cleanTask(task) {
37
+ /**
38
+ * Simple utility to convert basic HTML to Markdown for better readability by the AI.
39
+ */
40
+ function htmlToMarkdown(html) {
41
+ if (!html)
42
+ return '';
43
+ return turndownService.turndown(html);
44
+ }
45
+ export function cleanTask(task) {
36
46
  if (!task)
37
47
  return null;
38
48
  return {
@@ -40,7 +50,7 @@ function cleanTask(task) {
40
50
  name: task.name,
41
51
  status: task.status,
42
52
  pri: task.pri,
43
- desc: task.desc,
53
+ desc: htmlToMarkdown(task.desc),
44
54
  estimate: task.estimate,
45
55
  consumed: task.consumed,
46
56
  left: task.left,
@@ -65,7 +75,7 @@ function cleanTask(task) {
65
75
  files: parseFiles(task.files)
66
76
  };
67
77
  }
68
- function cleanBug(bug) {
78
+ export function cleanBug(bug) {
69
79
  if (!bug)
70
80
  return null;
71
81
  return {
@@ -75,7 +85,7 @@ function cleanBug(bug) {
75
85
  severity: bug.severity,
76
86
  pri: bug.pri,
77
87
  type: bug.type,
78
- steps: bug.steps,
88
+ steps: htmlToMarkdown(bug.steps),
79
89
  openedBy: bug.openedBy ? {
80
90
  account: bug.openedBy.account,
81
91
  realname: bug.openedBy.realname
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyno181cm.nexsoft/zentao_mcp",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "Zentao MCP Server",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,8 @@
28
28
  "dependencies": {
29
29
  "@modelcontextprotocol/sdk": "^1.1.0",
30
30
  "axios": "^1.7.9",
31
- "dotenv": "^16.4.7"
31
+ "dotenv": "^16.4.7",
32
+ "turndown": "^7.2.4"
32
33
  },
33
34
  "engines": {
34
35
  "node": ">=18.0.0",
@@ -37,6 +38,7 @@
37
38
  "devDependencies": {
38
39
  "@types/jest": "^30.0.0",
39
40
  "@types/node": "^22.10.2",
41
+ "@types/turndown": "^5.0.6",
40
42
  "jest": "^30.4.2",
41
43
  "ts-jest": "^29.4.11",
42
44
  "tsx": "^4.23.0",