@leeguoo/zentao-mcp 0.2.1 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +115 -11
  2. package/package.json +4 -1
  3. package/src/index.js +5 -5
package/README.md CHANGED
@@ -2,9 +2,38 @@
2
2
 
3
3
  MCP server for ZenTao RESTful APIs (products + bugs).
4
4
 
5
- ## Quick Start (npx)
5
+ ## Quick Start
6
6
 
7
- Use this MCP server config in your client:
7
+ ### Cursor IDE
8
+
9
+ 1. Open Cursor Settings (⌘, on Mac or Ctrl+, on Windows/Linux)
10
+ 2. Navigate to **Features** → **Model Context Protocol**
11
+ 3. Click **Edit Config** to open `~/.cursor/mcp.json` (or create it)
12
+ 4. Add the following configuration:
13
+
14
+ ```json
15
+ {
16
+ "mcpServers": {
17
+ "zentao-mcp": {
18
+ "command": "npx",
19
+ "args": [
20
+ "-y",
21
+ "@leeguoo/zentao-mcp",
22
+ "--stdio",
23
+ "--zentao-url=https://zentao.example.com/zentao",
24
+ "--zentao-account=leo",
25
+ "--zentao-password=***"
26
+ ]
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ 5. Restart Cursor IDE
33
+
34
+ ### Other MCP Clients (Claude Desktop, etc.)
35
+
36
+ For clients using TOML configuration (e.g., Claude Desktop), add to your MCP config file:
8
37
 
9
38
  ```toml
10
39
  [mcp_servers."zentao-mcp"]
@@ -19,23 +48,90 @@ args = [
19
48
  ]
20
49
  ```
21
50
 
51
+ **Config file locations:**
52
+ - Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.toml` (Mac) or `%APPDATA%\Claude\claude_desktop_config.toml` (Windows)
53
+ - Cursor: `~/.cursor/mcp.json` (JSON format)
54
+
22
55
  ## Configuration
23
56
 
24
- Required:
25
- - `--zentao-url` / `ZENTAO_URL` (e.g. `https://zentao.example.com/zentao`)
26
- - `--zentao-account` / `ZENTAO_ACCOUNT`
27
- - `--zentao-password` / `ZENTAO_PASSWORD`
57
+ ### Required Parameters
28
58
 
29
- Tip: `ZENTAO_URL` should include the ZenTao base path (often `/zentao`).
59
+ You can configure the server using CLI arguments or environment variables:
60
+
61
+ **CLI Arguments:**
62
+ - `--zentao-url` (e.g. `https://zentao.example.com/zentao`)
63
+ - `--zentao-account`
64
+ - `--zentao-password`
65
+
66
+ **Environment Variables:**
67
+ - `ZENTAO_URL` (e.g. `https://zentao.example.com/zentao`)
68
+ - `ZENTAO_ACCOUNT`
69
+ - `ZENTAO_PASSWORD`
70
+
71
+ ### Using Environment Variables in Cursor
72
+
73
+ If you prefer to use environment variables instead of CLI args, you can configure them in Cursor:
74
+
75
+ ```json
76
+ {
77
+ "mcpServers": {
78
+ "zentao-mcp": {
79
+ "command": "npx",
80
+ "args": ["-y", "@leeguoo/zentao-mcp", "--stdio"],
81
+ "env": {
82
+ "ZENTAO_URL": "https://zentao.example.com/zentao",
83
+ "ZENTAO_ACCOUNT": "leo",
84
+ "ZENTAO_PASSWORD": "***"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ **Tip:** `ZENTAO_URL` should include the ZenTao base path (often `/zentao`).
30
92
 
31
93
  ## Tools
32
94
 
33
- - `zentao_products_list` (page, limit)
34
- - `zentao_bugs_list` (product, page, limit)
35
- - `zentao_bugs_stats` (includeZero, limit)
95
+ The MCP server provides three tools that can be triggered by natural language in Cursor:
96
+
97
+ - **`zentao_products_list`** - List all products
98
+ - **`zentao_bugs_list`** - List bugs for a specific product
99
+ - **`zentao_bugs_stats`** - Get bug statistics across products
100
+
101
+ ### Usage Examples
102
+
103
+ After configuring the MCP server in Cursor, you can use natural language to interact with ZenTao:
104
+
105
+ **English:**
106
+ - "Show me all products"
107
+ - "List bugs for product 1"
108
+ - "Show me bugs"
109
+ - "What's the bug statistics?"
110
+ - "View bugs in product 2"
36
111
 
37
- Example tool input:
112
+ **Chinese (中文):**
113
+ - "看bug" / "查看bug" / "显示bug"
114
+ - "产品1的bug列表"
115
+ - "bug统计"
116
+ - "显示所有产品"
117
+ - "查看产品2的问题"
118
+
119
+ The AI will automatically:
120
+ 1. Use `zentao_products_list` to get product IDs when needed
121
+ 2. Use `zentao_bugs_list` when you ask to see bugs
122
+ 3. Use `zentao_bugs_stats` when you ask for statistics or overview
123
+
124
+ ### Tool Parameters
125
+
126
+ **zentao_products_list:**
127
+ ```json
128
+ {
129
+ "page": 1,
130
+ "limit": 1000
131
+ }
132
+ ```
38
133
 
134
+ **zentao_bugs_list:**
39
135
  ```json
40
136
  {
41
137
  "product": 1,
@@ -44,6 +140,14 @@ Example tool input:
44
140
  }
45
141
  ```
46
142
 
143
+ **zentao_bugs_stats:**
144
+ ```json
145
+ {
146
+ "includeZero": false,
147
+ "limit": 1000
148
+ }
149
+ ```
150
+
47
151
  ## Local Development
48
152
 
49
153
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leeguoo/zentao-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for ZenTao RESTful APIs",
5
5
  "keywords": [
6
6
  "zentao",
@@ -26,6 +26,9 @@
26
26
  "src",
27
27
  "README.md"
28
28
  ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
29
32
  "scripts": {
30
33
  "start": "node src/index.js",
31
34
  "release": "./scripts/release.sh",
package/src/index.js CHANGED
@@ -218,7 +218,7 @@ const server = new Server(
218
218
  const tools = [
219
219
  {
220
220
  name: "zentao_products_list",
221
- description: "List products (RESTful API).",
221
+ description: "List all products from ZenTao. Use this to get product IDs before querying bugs. Returns product information including ID, name, and bug counts.",
222
222
  inputSchema: {
223
223
  type: "object",
224
224
  properties: {
@@ -230,11 +230,11 @@ const tools = [
230
230
  },
231
231
  {
232
232
  name: "zentao_bugs_list",
233
- description: "List bugs for a product (RESTful API).",
233
+ description: "List bugs (缺陷/问题) for a specific product in ZenTao. Use this when user asks to 'see bugs', 'view bugs', 'show bugs', '看bug', '查看bug', '显示bug', or wants to check issues for a product. Requires product ID which can be obtained from zentao_products_list.",
234
234
  inputSchema: {
235
235
  type: "object",
236
236
  properties: {
237
- product: { type: "integer", description: "Product ID." },
237
+ product: { type: "integer", description: "Product ID (required). Get this from zentao_products_list first." },
238
238
  page: { type: "integer", description: "Page number (default 1)." },
239
239
  limit: { type: "integer", description: "Page size (default 20)." },
240
240
  },
@@ -244,11 +244,11 @@ const tools = [
244
244
  },
245
245
  {
246
246
  name: "zentao_bugs_stats",
247
- description: "Aggregate bug totals across products.",
247
+ description: "Get bug statistics (bug统计) across all products. Shows total bugs, unresolved bugs, closed bugs, and fixed bugs per product. Use when user asks for bug summary, statistics, overview, or 'bug统计'.",
248
248
  inputSchema: {
249
249
  type: "object",
250
250
  properties: {
251
- includeZero: { type: "boolean", description: "Include products with zero bugs." },
251
+ includeZero: { type: "boolean", description: "Include products with zero bugs (default false)." },
252
252
  limit: { type: "integer", description: "Max products to fetch (default 1000)." },
253
253
  },
254
254
  additionalProperties: false,