Zentao MCP Server
by dyno-nexsoft
README.md
# Zentao MCP Server
[](https://github.com/dyno-nexsoft/zentao_mcp/pkgs/npm/zentao_mcp)
[](https://github.com/dyno-nexsoft/zentao_mcp/releases)
[](https://github.com/dyno-nexsoft/zentao_mcp/blob/master/LICENSE)
[](https://nodejs.org)
[](https://www.typescriptlang.org)
[](https://modelcontextprotocol.io)
[](https://github.com/dyno-nexsoft/zentao_mcp/tree/master/tests)
A **Model Context Protocol (MCP)** server for integrating AI assistants (Claude, Cursor, etc.) with the [ZenTao](https://www.zentao.net) project management API.
Fetch task details, bug reports, and attachments โ all directly inside your AI chat.
---
## โจ Features
| Tool | Description |
|---|---|
| `zentao_get_details` | Fetch full details of a task or bug by ID |
| `zentao_get_comments` | Fetch only the history and comments timeline of a task or bug (with comment IDs) |
| `zentao_add_comment` | Add a comment/remark to a task or bug |
| `zentao_edit_comment` | Edit an existing comment by its action ID |
| `zentao_delete_comment` | Delete (soft-hide) a comment by its action ID |
| `zentao_update_task_status` | Update task status (start, finish, close, pause, cancel, restart) and add optional comments/hours |
| `zentao_update_bug_status` | Update bug status (resolve, close, activate) and add optional comments/resolutions |
| `zentao_create_task` | Create a new task under an execution |
| `zentao_edit_task` | Edit an existing task's fields |
| `zentao_get_assigned_to_me` | Get tasks and bugs currently assigned to you (configured via `ZENTAO_ACCOUNT`) |
| `zentao_get_my_tasks` | Get only the tasks currently assigned to you |
| `zentao_get_my_bugs` | Get only the bugs currently assigned to you |
| `zentao_create_bug` | Create a new bug under a product |
| `zentao_edit_bug` | Edit an existing bug's fields |
| `zentao_list_tasks` | List tasks in an execution (optionally filtered by keyword) |
| `zentao_list_bugs` | List bugs in a product (optionally filtered by keyword) |
| `zentao_search` | Search tasks or bugs within an execution/product scope, filtering by keyword, status, priority, severity, assignee, and/or opened-date range |
**Under the hood:**
- ๐ Auto login & token refresh โ no manual auth needed
- ๐ฆ In-memory cache (2 min TTL) + in-flight request dedup โ avoids redundant API calls
- ๐ Classic JSON API fallback โ seamlessly retries via the web API when the REST endpoint returns empty or errors
- ๐ผ๏ธ Inline HTML images are automatically downloaded and served as local `file://` links
- ๐ Attachments are downloaded and embedded as clickable local links
- ๐ก๏ธ Corrupt partial downloads are auto-cleaned on error
- โก Non-blocking async image I/O โ base64 encoding uses `fs.promises` + `Promise.all`
---
## ๐ฆ Installation
Published on **GitHub Packages** โ add this to `~/.npmrc` first (needs a GitHub token with `read:packages`):
```ini
@dyno-nexsoft:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
```
```bash
npx @dyno-nexsoft/zentao_mcp # run directly
npm install -g @dyno-nexsoft/zentao_mcp # or install globally
```
### Or clone & build
```bash
git clone https://github.com/dyno-nexsoft/zentao_mcp.git
cd zentao_mcp
npm install
npm run build
```
---
## โ๏ธ Configuration
Create a `.env` file in the project root (or pass via MCP client `env` block):
```env
ZENTAO_BASE_URL=https://your-zentao-url.com/zentao/api.php/v1
ZENTAO_ACCOUNT=your_username
ZENTAO_PASSWORD=your_password
# Optional: bypass SSL certificate errors (self-signed/invalid cert).
# Set to 'true' only if your ZenTao server has a broken/untrusted certificate.
ZENTAO_ALLOW_INSECURE_SSL=false
```
---
## ๐ MCP Client Integration
This server communicates via **stdio transport** โ compatible with any MCP client.
### Claude Desktop / Cursor / Windsurf
Add to your MCP client config (e.g. `claude_desktop_config.json`):
```json
{
"mcpServers": {
"zentao": {
"command": "npx",
"args": ["-y", "@dyno-nexsoft/zentao_mcp"],
"env": {
"ZENTAO_BASE_URL": "https://your-zentao-url.com/zentao/api.php/v1",
"ZENTAO_ACCOUNT": "your_username",
"ZENTAO_PASSWORD": "your_password",
"ZENTAO_ALLOW_INSECURE_SSL": "false"
}
}
}
}
```
---
## ๐งโ๐ป Development
```bash
npm run build # Compile TypeScript
npm run dev # Watch mode
npm test # Unit tests (Jest)
npm run test:api # Live API integration test
```
### Project structure
```
src/
โโโ index.ts # MCP server entry point
โโโ zentaoClient.ts # Axios client: auth, cache, dedup, fallback, stream helpers
โโโ tools.ts # Thin orchestrator + backward-compat exports
โโโ utils/
โ โโโ fileUtils.ts # toFileUrl ยท getMimeType ยท formatSize
โ โโโ markdownUtils.ts # htmlToMarkdown ยท parseFiles ยท formatUser
โ โโโ mcpResponse.ts # mcpText ยท buildMcpResponse (async)
โโโ formatters/
โ โโโ imageLocalizer.ts # Inline <img> โ local file:// link (deduped, concurrent)
โ โโโ attachmentRenderer.ts # Attachments โ Markdown ## Files section
โ โโโ actionFormatter.ts # renderHistoryAndComments
โ โโโ taskFormatter.ts # taskToMarkdown (includes comments)
โ โโโ bugFormatter.ts # bugToMarkdown (includes comments)
โ โโโ myWorkFormatter.ts # myWorkToMarkdown ยท myTasksToMarkdown ยท myBugsToMarkdown
โโโ tools/
โโโ detailTool.ts # zentao_get_details
โโโ commentTool.ts # zentao_get_comments ยท zentao_add_comment ยท zentao_edit_comment ยท zentao_delete_comment
โโโ statusTool.ts # zentao_update_task_status ยท zentao_update_bug_status
โโโ taskTool.ts # zentao_create_task ยท zentao_edit_task
โโโ myWorkTool.ts # zentao_get_assigned_to_me ยท zentao_get_my_tasks ยท zentao_get_my_bugs
```
### Running tests
```bash
npm test # Unit tests โ 19 tests across ZentaoClient
npm run test:api # Live API integration test (requires .env)
```
---
## ๐ License
[MIT](./LICENSE) ยฉ [dyno-nexsoft](https://github.com/dyno-nexsoft)
This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues