taskq-mcp-server 1.0.0
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/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/client.d.ts +42 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +166 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/comments.d.ts +5 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +66 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/notifications.d.ts +5 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +64 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/projects.d.ts +5 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +122 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/queue.d.ts +5 -0
- package/dist/tools/queue.d.ts.map +1 -0
- package/dist/tools/queue.js +37 -0
- package/dist/tools/queue.js.map +1 -0
- package/dist/tools/tasks.d.ts +5 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +250 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/users.d.ts +5 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +43 -0
- package/dist/tools/users.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TaskQ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# TaskQ MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for TaskQ task management API. Enables Claude Code and other MCP-compatible tools to manage tasks, projects, queues and notifications in TaskQ.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @taskq_mcp/server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use directly with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @taskq_mcp/server
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Add the MCP server configuration to your `.mcp.json`:
|
|
20
|
+
|
|
21
|
+
### Using npx (recommended)
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"taskq": {
|
|
27
|
+
"type": "stdio",
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["-y", "@taskq_mcp/server"],
|
|
30
|
+
"env": {
|
|
31
|
+
"TASKQ_URL": "https://api.taskq.ru",
|
|
32
|
+
"TASKQ_TOKEN": "tq_your_token"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Using global install
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"taskq": {
|
|
45
|
+
"type": "stdio",
|
|
46
|
+
"command": "taskq-mcp-server",
|
|
47
|
+
"env": {
|
|
48
|
+
"TASKQ_URL": "https://api.taskq.ru",
|
|
49
|
+
"TASKQ_TOKEN": "tq_your_token"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Environment variables
|
|
57
|
+
|
|
58
|
+
| Variable | Description | Default |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `TASKQ_URL` | TaskQ API URL | `http://localhost:8080` |
|
|
61
|
+
| `TASKQ_TOKEN` | API token for authorization | required |
|
|
62
|
+
|
|
63
|
+
## Getting an API token
|
|
64
|
+
|
|
65
|
+
1. Log in to TaskQ web interface
|
|
66
|
+
2. Go to **Profile** -> **API keys**
|
|
67
|
+
3. Click **Create key**, set a name
|
|
68
|
+
4. Copy the generated token (starts with `tq_`)
|
|
69
|
+
|
|
70
|
+
The token is passed in the `Authorization: Bearer tq_...` header.
|
|
71
|
+
|
|
72
|
+
## Available tools
|
|
73
|
+
|
|
74
|
+
### Projects
|
|
75
|
+
|
|
76
|
+
| Tool | Description |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `list_projects` | List user's projects (search, pagination) |
|
|
79
|
+
| `get_project` | Project details |
|
|
80
|
+
| `create_project` | Create a project |
|
|
81
|
+
| `update_project` | Update a project |
|
|
82
|
+
| `get_project_participants` | Project participants with roles |
|
|
83
|
+
| `get_project_stages` | Project kanban board stages |
|
|
84
|
+
| `get_project_analytics` | Project analytics (tasks by status, priority) |
|
|
85
|
+
|
|
86
|
+
### Tasks
|
|
87
|
+
|
|
88
|
+
| Tool | Description |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `list_tasks` | List tasks with filters (project, status, priority, assignee, labels, dates, search) |
|
|
91
|
+
| `get_task` | Full task details |
|
|
92
|
+
| `create_task` | Create a task |
|
|
93
|
+
| `update_task` | Update task fields |
|
|
94
|
+
| `delete_task` | Delete a task |
|
|
95
|
+
| `archive_task` | Archive a task |
|
|
96
|
+
| `unarchive_task` | Unarchive a task |
|
|
97
|
+
| `bulk_task_action` | Bulk actions (status change, assign, priority, delete) |
|
|
98
|
+
| `get_task_activity` | Task change log |
|
|
99
|
+
|
|
100
|
+
### Comments
|
|
101
|
+
|
|
102
|
+
| Tool | Description |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `list_comments` | Task comments |
|
|
105
|
+
| `add_comment` | Add a comment (markdown) |
|
|
106
|
+
| `update_comment` | Edit a comment |
|
|
107
|
+
| `delete_comment` | Delete a comment |
|
|
108
|
+
|
|
109
|
+
### Queue
|
|
110
|
+
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `get_queue` | User's task queue with ETA calculation |
|
|
114
|
+
| `reorder_queue` | Reorder a task in the queue |
|
|
115
|
+
|
|
116
|
+
### Notifications
|
|
117
|
+
|
|
118
|
+
| Tool | Description |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `list_notifications` | List notifications (filter by read status) |
|
|
121
|
+
| `get_unread_count` | Unread notifications count |
|
|
122
|
+
| `mark_notification_read` | Mark notification as read |
|
|
123
|
+
| `mark_all_notifications_read` | Mark all notifications as read |
|
|
124
|
+
|
|
125
|
+
### Users & Search
|
|
126
|
+
|
|
127
|
+
| Tool | Description |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `get_me` | Current user profile |
|
|
130
|
+
| `search` | Global search across tasks, projects and users |
|
|
131
|
+
| `list_labels` | List available labels |
|
|
132
|
+
|
|
133
|
+
## Usage examples
|
|
134
|
+
|
|
135
|
+
After configuring `.mcp.json`, tools are available automatically in Claude Code.
|
|
136
|
+
|
|
137
|
+
**List project tasks:**
|
|
138
|
+
```
|
|
139
|
+
Show all tasks for project with ID 5
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Create a task:**
|
|
143
|
+
```
|
|
144
|
+
Create a bug "Auth error" in project 3 with critical priority assigned to users 10 and 12
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Check queue:**
|
|
148
|
+
```
|
|
149
|
+
What's my task queue and ETA?
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Find a task:**
|
|
153
|
+
```
|
|
154
|
+
Find task PROJ-42
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare class TaskQClient {
|
|
2
|
+
private api;
|
|
3
|
+
constructor(baseUrl: string, token: string);
|
|
4
|
+
listProjects(params?: Record<string, string | number>): Promise<any>;
|
|
5
|
+
getProject(id: number): Promise<any>;
|
|
6
|
+
createProject(body: Record<string, unknown>): Promise<any>;
|
|
7
|
+
updateProject(id: number, body: Record<string, unknown>): Promise<any>;
|
|
8
|
+
deleteProject(id: number): Promise<void>;
|
|
9
|
+
getProjectParticipants(projectId: number): Promise<any>;
|
|
10
|
+
getProjectStages(projectId: number): Promise<any>;
|
|
11
|
+
getProjectAnalytics(projectId: number): Promise<any>;
|
|
12
|
+
listTasks(params?: Record<string, string | number>): Promise<any>;
|
|
13
|
+
getTask(id: number): Promise<any>;
|
|
14
|
+
createTask(body: Record<string, unknown>): Promise<any>;
|
|
15
|
+
updateTask(id: number, body: Record<string, unknown>): Promise<any>;
|
|
16
|
+
deleteTask(id: number): Promise<void>;
|
|
17
|
+
archiveTask(id: number): Promise<any>;
|
|
18
|
+
unarchiveTask(id: number): Promise<any>;
|
|
19
|
+
grabTask(id: number): Promise<any>;
|
|
20
|
+
releaseTask(id: number): Promise<any>;
|
|
21
|
+
bulkTaskAction(body: {
|
|
22
|
+
task_ids: number[];
|
|
23
|
+
action: string;
|
|
24
|
+
value?: unknown;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
listComments(taskId: number): Promise<any>;
|
|
27
|
+
addComment(taskId: number, text: string): Promise<any>;
|
|
28
|
+
updateComment(taskId: number, commentId: number, text: string): Promise<any>;
|
|
29
|
+
deleteComment(taskId: number, commentId: number): Promise<void>;
|
|
30
|
+
getQueue(userId: number): Promise<any>;
|
|
31
|
+
reorderQueue(userId: number, taskId: number, prevTaskId: number): Promise<any>;
|
|
32
|
+
listNotifications(params?: Record<string, string | number>): Promise<any>;
|
|
33
|
+
markNotificationRead(id: number): Promise<any>;
|
|
34
|
+
markAllNotificationsRead(): Promise<any>;
|
|
35
|
+
getUnreadCount(): Promise<any>;
|
|
36
|
+
getMe(): Promise<any>;
|
|
37
|
+
search(q: string, limit?: number): Promise<any>;
|
|
38
|
+
listLabels(): Promise<any>;
|
|
39
|
+
getTaskActivity(taskId: number): Promise<any>;
|
|
40
|
+
static formatError(error: unknown): string;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,qBAAa,WAAW;IACtB,OAAO,CAAC,GAAG,CAAe;gBAEd,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAYpC,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAKrD,UAAU,CAAC,EAAE,EAAE,MAAM;IAKrB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA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iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAK1D,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAK/B,wBAAwB;IAKxB,cAAc;IAMd,KAAK;IAML,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAMhC,UAAU;IAMV,eAAe,CAAC,MAAM,EAAE,MAAM;IAKpC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAW3C"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import axios, { AxiosError } from 'axios';
|
|
2
|
+
export class TaskQClient {
|
|
3
|
+
api;
|
|
4
|
+
constructor(baseUrl, token) {
|
|
5
|
+
this.api = axios.create({
|
|
6
|
+
baseURL: baseUrl,
|
|
7
|
+
headers: {
|
|
8
|
+
'Authorization': `Bearer ${token}`,
|
|
9
|
+
'Content-Type': 'application/json',
|
|
10
|
+
},
|
|
11
|
+
timeout: 30000,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
// Projects
|
|
15
|
+
async listProjects(params) {
|
|
16
|
+
const { data } = await this.api.get('/api/projects/', { params });
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
async getProject(id) {
|
|
20
|
+
const { data } = await this.api.get(`/api/projects/${id}/`);
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
async createProject(body) {
|
|
24
|
+
const { data } = await this.api.post('/api/projects/', body);
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
async updateProject(id, body) {
|
|
28
|
+
const { data } = await this.api.patch(`/api/projects/${id}/`, body);
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
async deleteProject(id) {
|
|
32
|
+
await this.api.delete(`/api/projects/${id}/`);
|
|
33
|
+
}
|
|
34
|
+
async getProjectParticipants(projectId) {
|
|
35
|
+
const { data } = await this.api.get(`/api/projects/${projectId}/participants/`);
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
async getProjectStages(projectId) {
|
|
39
|
+
const { data } = await this.api.get(`/api/projects/${projectId}/stages/`);
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
async getProjectAnalytics(projectId) {
|
|
43
|
+
const { data } = await this.api.get(`/api/projects/${projectId}/analytics/`);
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
// Tasks
|
|
47
|
+
async listTasks(params) {
|
|
48
|
+
const { data } = await this.api.get('/api/tasks/', { params });
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
async getTask(id) {
|
|
52
|
+
const { data } = await this.api.get(`/api/tasks/${id}/`);
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
async createTask(body) {
|
|
56
|
+
const { data } = await this.api.post('/api/tasks/', body);
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
async updateTask(id, body) {
|
|
60
|
+
const { data } = await this.api.patch(`/api/tasks/${id}/`, body);
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
async deleteTask(id) {
|
|
64
|
+
await this.api.delete(`/api/tasks/${id}/`);
|
|
65
|
+
}
|
|
66
|
+
async archiveTask(id) {
|
|
67
|
+
const { data } = await this.api.post(`/api/tasks/${id}/archive/`);
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
async unarchiveTask(id) {
|
|
71
|
+
const { data } = await this.api.post(`/api/tasks/${id}/unarchive/`);
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
async grabTask(id) {
|
|
75
|
+
const { data } = await this.api.post(`/api/tasks/${id}/grab/`);
|
|
76
|
+
return data;
|
|
77
|
+
}
|
|
78
|
+
async releaseTask(id) {
|
|
79
|
+
const { data } = await this.api.post(`/api/tasks/${id}/release/`);
|
|
80
|
+
return data;
|
|
81
|
+
}
|
|
82
|
+
async bulkTaskAction(body) {
|
|
83
|
+
const { data } = await this.api.post('/api/tasks/bulk/', body);
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
// Comments
|
|
87
|
+
async listComments(taskId) {
|
|
88
|
+
const { data } = await this.api.get(`/api/tasks/${taskId}/comments/`);
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
async addComment(taskId, text) {
|
|
92
|
+
const { data } = await this.api.post(`/api/tasks/${taskId}/comments/`, { text });
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
async updateComment(taskId, commentId, text) {
|
|
96
|
+
const { data } = await this.api.patch(`/api/tasks/${taskId}/comments/${commentId}/`, { text });
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
async deleteComment(taskId, commentId) {
|
|
100
|
+
await this.api.delete(`/api/tasks/${taskId}/comments/${commentId}/`);
|
|
101
|
+
}
|
|
102
|
+
// Queue
|
|
103
|
+
async getQueue(userId) {
|
|
104
|
+
const { data } = await this.api.get(`/api/queue/${userId}/`);
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
async reorderQueue(userId, taskId, prevTaskId) {
|
|
108
|
+
const { data } = await this.api.post(`/api/queue/${userId}/reorder/`, {
|
|
109
|
+
task_id: taskId,
|
|
110
|
+
prev_task_id: prevTaskId,
|
|
111
|
+
});
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
114
|
+
// Notifications
|
|
115
|
+
async listNotifications(params) {
|
|
116
|
+
const { data } = await this.api.get('/api/notifications/', { params });
|
|
117
|
+
return data;
|
|
118
|
+
}
|
|
119
|
+
async markNotificationRead(id) {
|
|
120
|
+
const { data } = await this.api.patch(`/api/notifications/${id}/`, { read: true });
|
|
121
|
+
return data;
|
|
122
|
+
}
|
|
123
|
+
async markAllNotificationsRead() {
|
|
124
|
+
const { data } = await this.api.post('/api/notifications/mark_all_read/');
|
|
125
|
+
return data;
|
|
126
|
+
}
|
|
127
|
+
async getUnreadCount() {
|
|
128
|
+
const { data } = await this.api.get('/api/notifications/unread_count/');
|
|
129
|
+
return data;
|
|
130
|
+
}
|
|
131
|
+
// Users
|
|
132
|
+
async getMe() {
|
|
133
|
+
const { data } = await this.api.get('/api/me/');
|
|
134
|
+
return data;
|
|
135
|
+
}
|
|
136
|
+
// Search
|
|
137
|
+
async search(q, limit) {
|
|
138
|
+
const { data } = await this.api.get('/api/search/', { params: { q, limit } });
|
|
139
|
+
return data;
|
|
140
|
+
}
|
|
141
|
+
// Labels
|
|
142
|
+
async listLabels() {
|
|
143
|
+
const { data } = await this.api.get('/api/labels/');
|
|
144
|
+
return data;
|
|
145
|
+
}
|
|
146
|
+
// Activity
|
|
147
|
+
async getTaskActivity(taskId) {
|
|
148
|
+
const { data } = await this.api.get(`/api/tasks/${taskId}/activity/`);
|
|
149
|
+
return data;
|
|
150
|
+
}
|
|
151
|
+
static formatError(error) {
|
|
152
|
+
if (error instanceof AxiosError) {
|
|
153
|
+
const status = error.response?.status;
|
|
154
|
+
const detail = error.response?.data?.detail;
|
|
155
|
+
if (detail)
|
|
156
|
+
return `API error ${status}: ${detail}`;
|
|
157
|
+
if (status)
|
|
158
|
+
return `API error ${status}: ${error.message}`;
|
|
159
|
+
return `Network error: ${error.message}`;
|
|
160
|
+
}
|
|
161
|
+
if (error instanceof Error)
|
|
162
|
+
return error.message;
|
|
163
|
+
return String(error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAA;AAExD,MAAM,OAAO,WAAW;IACd,GAAG,CAAe;IAE1B,YAAY,OAAe,EAAE,KAAa;QACxC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,K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AC/B,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAA;YACrC,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAA;YAC3C,IAAI,MAAM;gBAAE,OAAO,aAAa,MAAM,KAAK,MAAM,EAAE,CAAA;YACnD,IAAI,MAAM;gBAAE,OAAO,aAAa,MAAM,KAAK,KAAK,CAAC,OAAO,EAAE,CAAA;YAC1D,OAAO,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAA;QAC1C,CAAC;QACD,IAAI,KAAK,YAAY,KAAK;YAAE,OAAO,KAAK,CAAC,OAAO,CAAA;QAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { TaskQClient } from './client.js';
|
|
6
|
+
import { projectTools, handleProjectTool } from './tools/projects.js';
|
|
7
|
+
import { taskTools, handleTaskTool } from './tools/tasks.js';
|
|
8
|
+
import { commentTools, handleCommentTool } from './tools/comments.js';
|
|
9
|
+
import { notificationTools, handleNotificationTool } from './tools/notifications.js';
|
|
10
|
+
import { queueTools, handleQueueTool } from './tools/queue.js';
|
|
11
|
+
import { userTools, handleUserTool } from './tools/users.js';
|
|
12
|
+
const TASKQ_URL = process.env.TASKQ_URL || 'http://localhost:8080';
|
|
13
|
+
const TASKQ_TOKEN = process.env.TASKQ_TOKEN;
|
|
14
|
+
if (!TASKQ_TOKEN) {
|
|
15
|
+
console.error('TASKQ_TOKEN environment variable is required');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const client = new TaskQClient(TASKQ_URL, TASKQ_TOKEN);
|
|
19
|
+
const allTools = [
|
|
20
|
+
...projectTools,
|
|
21
|
+
...taskTools,
|
|
22
|
+
...commentTools,
|
|
23
|
+
...notificationTools,
|
|
24
|
+
...queueTools,
|
|
25
|
+
...userTools,
|
|
26
|
+
];
|
|
27
|
+
const projectToolNames = new Set(projectTools.map(t => t.name));
|
|
28
|
+
const taskToolNames = new Set(taskTools.map(t => t.name));
|
|
29
|
+
const commentToolNames = new Set(commentTools.map(t => t.name));
|
|
30
|
+
const notificationToolNames = new Set(notificationTools.map(t => t.name));
|
|
31
|
+
const queueToolNames = new Set(queueTools.map(t => t.name));
|
|
32
|
+
const userToolNames = new Set(userTools.map(t => t.name));
|
|
33
|
+
const server = new Server({
|
|
34
|
+
name: 'taskq',
|
|
35
|
+
version: '1.0.0',
|
|
36
|
+
}, {
|
|
37
|
+
capabilities: {
|
|
38
|
+
tools: {},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
42
|
+
tools: allTools,
|
|
43
|
+
}));
|
|
44
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
45
|
+
const { name, arguments: args = {} } = request.params;
|
|
46
|
+
try {
|
|
47
|
+
let result;
|
|
48
|
+
if (projectToolNames.has(name)) {
|
|
49
|
+
result = await handleProjectTool(client, name, args);
|
|
50
|
+
}
|
|
51
|
+
else if (taskToolNames.has(name)) {
|
|
52
|
+
result = await handleTaskTool(client, name, args);
|
|
53
|
+
}
|
|
54
|
+
else if (commentToolNames.has(name)) {
|
|
55
|
+
result = await handleCommentTool(client, name, args);
|
|
56
|
+
}
|
|
57
|
+
else if (notificationToolNames.has(name)) {
|
|
58
|
+
result = await handleNotificationTool(client, name, args);
|
|
59
|
+
}
|
|
60
|
+
else if (queueToolNames.has(name)) {
|
|
61
|
+
result = await handleQueueTool(client, name, args);
|
|
62
|
+
}
|
|
63
|
+
else if (userToolNames.has(name)) {
|
|
64
|
+
result = await handleUserTool(client, name, args);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return {
|
|
68
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
69
|
+
isError: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return {
|
|
78
|
+
content: [{ type: 'text', text: TaskQClient.formatError(error) }],
|
|
79
|
+
isError: true,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
async function main() {
|
|
84
|
+
const transport = new StdioServerTransport();
|
|
85
|
+
await server.connect(transport);
|
|
86
|
+
}
|
|
87
|
+
main().catch((error) => {
|
|
88
|
+
console.error('Fatal error:', error);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA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K,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TaskQClient } from '../client.js';
|
|
3
|
+
export declare const commentTools: Tool[];
|
|
4
|
+
export declare function handleCommentTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,YAAY,EAAE,IAAI,EAiD9B,CAAA;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkBlB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const commentTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'list_comments',
|
|
4
|
+
description: 'List all comments on a task, ordered by creation time.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
task_id: { type: 'number', description: 'Task ID' },
|
|
9
|
+
},
|
|
10
|
+
required: ['task_id'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'add_comment',
|
|
15
|
+
description: 'Add a comment to a task. Requires project membership.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
task_id: { type: 'number', description: 'Task ID' },
|
|
20
|
+
text: { type: 'string', description: 'Comment text (markdown supported)' },
|
|
21
|
+
},
|
|
22
|
+
required: ['task_id', 'text'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'update_comment',
|
|
27
|
+
description: 'Edit a comment. Only the comment author can edit.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
task_id: { type: 'number', description: 'Task ID' },
|
|
32
|
+
comment_id: { type: 'number', description: 'Comment ID' },
|
|
33
|
+
text: { type: 'string', description: 'Updated comment text' },
|
|
34
|
+
},
|
|
35
|
+
required: ['task_id', 'comment_id', 'text'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'delete_comment',
|
|
40
|
+
description: 'Delete a comment. Only the comment author can delete.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
task_id: { type: 'number', description: 'Task ID' },
|
|
45
|
+
comment_id: { type: 'number', description: 'Comment ID' },
|
|
46
|
+
},
|
|
47
|
+
required: ['task_id', 'comment_id'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
export async function handleCommentTool(client, name, args) {
|
|
52
|
+
switch (name) {
|
|
53
|
+
case 'list_comments':
|
|
54
|
+
return client.listComments(Number(args.task_id));
|
|
55
|
+
case 'add_comment':
|
|
56
|
+
return client.addComment(Number(args.task_id), String(args.text));
|
|
57
|
+
case 'update_comment':
|
|
58
|
+
return client.updateComment(Number(args.task_id), Number(args.comment_id), String(args.text));
|
|
59
|
+
case 'delete_comment':
|
|
60
|
+
await client.deleteComment(Number(args.task_id), Number(args.comment_id));
|
|
61
|
+
return { detail: 'Comment deleted' };
|
|
62
|
+
default:
|
|
63
|
+
throw new Error(`Unknown comment tool: ${name}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,YAAY,GAAW;IAClC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,wDAAwD;QACrE,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;aACpD;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,uDAAuD;QACpE,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;gBACnD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;aAC3E;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;SAC9B;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,mDAAmD;QAChE,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;gBACnD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;gBACzD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;aAC9D;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC;SAC5C;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,W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'../client.js';
|
|
3
|
+
export declare const notificationTools: Tool[];
|
|
4
|
+
export declare function handleNotificationTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,iBAAiB,EAAE,IAAI,EAwCnC,CAAA;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkBlB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const notificationTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'list_notifications',
|
|
4
|
+
description: 'List notifications for the authenticated user. Can filter by read status.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
read: { type: 'string', enum: ['true', 'false'], description: 'Filter: "true" for read, "false" for unread' },
|
|
9
|
+
page: { type: 'number', description: 'Page number' },
|
|
10
|
+
page_size: { type: 'number', description: 'Items per page (max 100)' },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'get_unread_count',
|
|
16
|
+
description: 'Get the count of unread notifications.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'mark_notification_read',
|
|
24
|
+
description: 'Mark a single notification as read.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
id: { type: 'number', description: 'Notification ID' },
|
|
29
|
+
},
|
|
30
|
+
required: ['id'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'mark_all_notifications_read',
|
|
35
|
+
description: 'Mark all unread notifications as read.',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
export async function handleNotificationTool(client, name, args) {
|
|
43
|
+
switch (name) {
|
|
44
|
+
case 'list_notifications': {
|
|
45
|
+
const params = {};
|
|
46
|
+
if (args.read)
|
|
47
|
+
params.read = String(args.read);
|
|
48
|
+
if (args.page)
|
|
49
|
+
params.page = Number(args.page);
|
|
50
|
+
if (args.page_size)
|
|
51
|
+
params.page_size = Number(args.page_size);
|
|
52
|
+
return client.listNotifications(params);
|
|
53
|
+
}
|
|
54
|
+
case 'get_unread_count':
|
|
55
|
+
return client.getUnreadCount();
|
|
56
|
+
case 'mark_notification_read':
|
|
57
|
+
return client.markNotificationRead(Number(args.id));
|
|
58
|
+
case 'mark_all_notifications_read':
|
|
59
|
+
return client.markAllNotificationsRead();
|
|
60
|
+
default:
|
|
61
|
+
throw new Error(`Unknown notification tool: ${name}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAW;IACvC;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,2EAA2E;QACxF,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO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7D,OAAO,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA;QACzC,CAAC;QACD,KAAK,kBAAkB;YACrB,OAAO,MAAM,CAAC,cAAc,EAAE,CAAA;QAChC,KAAK,wBAAwB;YAC3B,OAAO,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;QACrD,KAAK,6BAA6B;YAChC,OAAO,MAAM,CAAC,wBAAwB,EAAE,CAAA;QAC1C;YACE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAA;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TaskQClient } from '../client.js';
|
|
3
|
+
export declare const projectTools: Tool[];
|
|
4
|
+
export declare function handleProjectTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,YAAY,EAAE,IAAI,EAmF9B,CAAA;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAgClB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const projectTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'list_projects',
|
|
4
|
+
description: 'List projects the authenticated user participates in. Returns paginated results with project name, code, description, and participant count.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
search: { type: 'string', description: 'Search projects by name' },
|
|
9
|
+
page: { type: 'number', description: 'Page number for pagination' },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'get_project',
|
|
15
|
+
description: 'Get detailed information about a specific project including stages, participants, and settings.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
id: { type: 'number', description: 'Project ID' },
|
|
20
|
+
},
|
|
21
|
+
required: ['id'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'create_project',
|
|
26
|
+
description: 'Create a new project. The authenticated user becomes the owner.',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
name: { type: 'string', description: 'Project name' },
|
|
31
|
+
description: { type: 'string', description: 'Project description' },
|
|
32
|
+
code_name: { type: 'string', description: 'Short code (used in task IDs like CODE-123)' },
|
|
33
|
+
organization: { type: 'number', description: 'Organization ID' },
|
|
34
|
+
},
|
|
35
|
+
required: ['name', 'code_name'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'update_project',
|
|
40
|
+
description: 'Update project name, description, or other fields.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
id: { type: 'number', description: 'Project ID' },
|
|
45
|
+
name: { type: 'string', description: 'New project name' },
|
|
46
|
+
description: { type: 'string', description: 'New project description' },
|
|
47
|
+
},
|
|
48
|
+
required: ['id'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'get_project_participants',
|
|
53
|
+
description: 'List all participants of a project with their roles (owner, manager, developer, viewer).',
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
project_id: { type: 'number', description: 'Project ID' },
|
|
58
|
+
},
|
|
59
|
+
required: ['project_id'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'get_project_stages',
|
|
64
|
+
description: 'List all workflow stages (columns) of a project kanban board.',
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
properties: {
|
|
68
|
+
project_id: { type: 'number', description: 'Project ID' },
|
|
69
|
+
},
|
|
70
|
+
required: ['project_id'],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'get_project_analytics',
|
|
75
|
+
description: 'Get project analytics: task counts by status, priority distribution, completion trends.',
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
properties: {
|
|
79
|
+
project_id: { type: 'number', description: 'Project ID' },
|
|
80
|
+
},
|
|
81
|
+
required: ['project_id'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
export async function handleProjectTool(client, name, args) {
|
|
86
|
+
switch (name) {
|
|
87
|
+
case 'list_projects': {
|
|
88
|
+
const params = {};
|
|
89
|
+
if (args.search)
|
|
90
|
+
params.search = String(args.search);
|
|
91
|
+
if (args.page)
|
|
92
|
+
params.page = Number(args.page);
|
|
93
|
+
return client.listProjects(params);
|
|
94
|
+
}
|
|
95
|
+
case 'get_project':
|
|
96
|
+
return client.getProject(Number(args.id));
|
|
97
|
+
case 'create_project': {
|
|
98
|
+
const body = {
|
|
99
|
+
name: args.name,
|
|
100
|
+
code_name: args.code_name,
|
|
101
|
+
};
|
|
102
|
+
if (args.description)
|
|
103
|
+
body.description = args.description;
|
|
104
|
+
if (args.organization)
|
|
105
|
+
body.organization = args.organization;
|
|
106
|
+
return client.createProject(body);
|
|
107
|
+
}
|
|
108
|
+
case 'update_project': {
|
|
109
|
+
const { id, ...fields } = args;
|
|
110
|
+
return client.updateProject(Number(id), fields);
|
|
111
|
+
}
|
|
112
|
+
case 'get_project_participants':
|
|
113
|
+
return client.getProjectParticipants(Number(args.project_id));
|
|
114
|
+
case 'get_project_stages':
|
|
115
|
+
return client.getProjectStages(Number(args.project_id));
|
|
116
|
+
case 'get_project_analytics':
|
|
117
|
+
return client.getProjectAnalytics(Number(args.project_id));
|
|
118
|
+
default:
|
|
119
|
+
throw new Error(`Unknown project tool: ${name}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,YAAY,GAAW;IAClC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,8IAA8I;QAC3J,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;gBAClE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;aACpE;SACF;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,iGAAiG;QAC9G,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;aAClD;YACD,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,iEAAiE;QAC9E,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBACrD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;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E,CAAC,EAAE,MAAM,CAAC,CAAA;QACjD,CAAC;QACD,KAAK,0BAA0B;YAC7B,OAAO,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QAC/D,KAAK,oBAAoB;YACvB,OAAO,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QACzD,KAAK,uBAAuB;YAC1B,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QAC5D;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TaskQClient } from '../client.js';
|
|
3
|
+
export declare const queueTools: Tool[];
|
|
4
|
+
export declare function handleQueueTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/tools/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,UAAU,EAAE,IAAI,EAyB5B,CAAA;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAalB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const queueTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_queue',
|
|
4
|
+
description: 'Get the task queue for a user with ETA calculations based on work schedule. Shows tasks in priority order with estimated start/end times.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
user_id: { type: 'number', description: 'User ID (must be the authenticated user)' },
|
|
9
|
+
},
|
|
10
|
+
required: ['user_id'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'reorder_queue',
|
|
15
|
+
description: 'Reorder a task in the user queue. Move a task after another task.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
user_id: { type: 'number', description: 'User ID' },
|
|
20
|
+
task_id: { type: 'number', description: 'Task ID to move' },
|
|
21
|
+
prev_task_id: { type: 'number', description: 'Task ID to place after (0 = move to top)' },
|
|
22
|
+
},
|
|
23
|
+
required: ['user_id', 'task_id', 'prev_task_id'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
export async function handleQueueTool(client, name, args) {
|
|
28
|
+
switch (name) {
|
|
29
|
+
case 'get_queue':
|
|
30
|
+
return client.getQueue(Number(args.user_id));
|
|
31
|
+
case 'reorder_queue':
|
|
32
|
+
return client.reorderQueue(Number(args.user_id), Number(args.task_id), Number(args.prev_task_id));
|
|
33
|
+
default:
|
|
34
|
+
throw new Error(`Unknown queue tool: ${name}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/tools/queue.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAW;IAChC;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2IAA2I;QACxJ,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;aACrF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,mEAAmE;QAChF,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;gBACnD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;gBAC3D,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;aAC1F;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC;SACjD;KACF;CACF,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAmB,EACnB,IAAY,EACZ,IAA6B;IAE7B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW;YACd,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAC9C,KAAK,eAAe;YAClB,OAAO,MAAM,CAAC,YAAY,CACxB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EACpB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EACpB,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAC1B,CAAA;QACH;YACE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAA;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TaskQClient } from '../client.js';
|
|
3
|
+
export declare const taskTools: Tool[];
|
|
4
|
+
export declare function handleTaskTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAe1C,eAAO,MAAM,SAAS,EAAE,IAAI,EAyK3B,CAAA;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAgElB"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
function wrapDescriptionAsTiptap(value) {
|
|
2
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
3
|
+
return {
|
|
4
|
+
type: 'doc',
|
|
5
|
+
content: value.split('\n').map((line) => ({
|
|
6
|
+
type: 'paragraph',
|
|
7
|
+
content: line.length > 0 ? [{ type: 'text', text: line }] : [],
|
|
8
|
+
})),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
export const taskTools = [
|
|
14
|
+
{
|
|
15
|
+
name: 'list_tasks',
|
|
16
|
+
description: 'List tasks with optional filters. Returns paginated results. Supports filtering by project, status, priority, assignee, labels, dates, and text search.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
project: { type: 'number', description: 'Filter by project ID' },
|
|
21
|
+
status: { type: 'number', description: 'Filter by status (0=new, 1=in_progress, 2=estimated, 3=completed)' },
|
|
22
|
+
priority: { type: 'number', description: 'Filter by priority (0=low, 1=normal, 2=high, 3=critical)' },
|
|
23
|
+
assignee: { type: 'number', description: 'Filter by assignee user ID' },
|
|
24
|
+
created_by: { type: 'number', description: 'Filter by creator user ID' },
|
|
25
|
+
task_type: { type: 'string', description: 'Filter by task type (task, bug, feature, improvement)' },
|
|
26
|
+
labels: { type: 'string', description: 'Filter by label IDs (comma-separated)' },
|
|
27
|
+
parent: { type: 'number', description: 'Filter subtasks by parent task ID' },
|
|
28
|
+
stage: { type: 'number', description: 'Filter by stage (kanban column) ID' },
|
|
29
|
+
is_archived: { type: 'boolean', description: 'Filter archived tasks' },
|
|
30
|
+
due_date_after: { type: 'string', description: 'Due date >= (YYYY-MM-DD)' },
|
|
31
|
+
due_date_before: { type: 'string', description: 'Due date <= (YYYY-MM-DD)' },
|
|
32
|
+
search: { type: 'string', description: 'Search by title, description, or human ID (e.g. PROJ-42)' },
|
|
33
|
+
ordering: { type: 'string', description: 'Sort field: created_at, due_date, priority, status, title (prefix with - for desc)' },
|
|
34
|
+
page: { type: 'number', description: 'Page number' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'get_task',
|
|
40
|
+
description: 'Get full task details including description, comments, attachments, subtasks, labels, custom fields, and dependencies.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
id: { type: 'number', description: 'Task ID' },
|
|
45
|
+
},
|
|
46
|
+
required: ['id'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'create_task',
|
|
51
|
+
description: 'Create a new task in a project. Requires project membership.',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
title: { type: 'string', description: 'Task title' },
|
|
56
|
+
description: { type: 'string', description: 'Task description (markdown supported)' },
|
|
57
|
+
project: { type: 'number', description: 'Project ID' },
|
|
58
|
+
priority: { type: 'number', description: 'Priority: 0=low, 1=normal, 2=high, 3=critical' },
|
|
59
|
+
assignees: { type: 'array', items: { type: 'number' }, description: 'Assignee user IDs' },
|
|
60
|
+
due_date: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
|
|
61
|
+
task_type: { type: 'string', description: 'Type: task, bug, feature, improvement' },
|
|
62
|
+
estimated_time: { type: 'number', description: 'Estimated time in minutes' },
|
|
63
|
+
parent: { type: 'number', description: 'Parent task ID (to create subtask)' },
|
|
64
|
+
labels: { type: 'array', items: { type: 'number' }, description: 'Label IDs' },
|
|
65
|
+
stage: { type: 'number', description: 'Stage (kanban column) ID' },
|
|
66
|
+
},
|
|
67
|
+
required: ['title', 'project'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'update_task',
|
|
72
|
+
description: 'Update task fields. Can change title, description, status, priority, assignee, due date, etc.',
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
id: { type: 'number', description: 'Task ID' },
|
|
77
|
+
title: { type: 'string', description: 'New title' },
|
|
78
|
+
description: { type: 'string', description: 'New description' },
|
|
79
|
+
status: { type: 'number', description: 'Status: 0=new, 1=in_progress, 2=estimated, 3=completed' },
|
|
80
|
+
priority: { type: 'number', description: 'Priority: 0=low, 1=normal, 2=high, 3=critical' },
|
|
81
|
+
assignees: { type: 'array', items: { type: 'number' }, description: 'Assignee user IDs (empty array to unassign all)' },
|
|
82
|
+
due_date: { type: 'string', description: 'Due date (YYYY-MM-DD or null)' },
|
|
83
|
+
task_type: { type: 'string', description: 'Type: task, bug, feature, improvement' },
|
|
84
|
+
estimated_time: { type: 'number', description: 'Estimated time in minutes' },
|
|
85
|
+
labels: { type: 'array', items: { type: 'number' }, description: 'Label IDs' },
|
|
86
|
+
stage: { type: 'number', description: 'Stage (kanban column) ID' },
|
|
87
|
+
},
|
|
88
|
+
required: ['id'],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'delete_task',
|
|
93
|
+
description: 'Permanently delete a task. Requires project membership.',
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: {
|
|
97
|
+
id: { type: 'number', description: 'Task ID' },
|
|
98
|
+
},
|
|
99
|
+
required: ['id'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'archive_task',
|
|
104
|
+
description: 'Archive a task. Requires manager/owner role in the project.',
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
id: { type: 'number', description: 'Task ID' },
|
|
109
|
+
},
|
|
110
|
+
required: ['id'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'unarchive_task',
|
|
115
|
+
description: 'Restore an archived task. Requires manager/owner role in the project.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
properties: {
|
|
119
|
+
id: { type: 'number', description: 'Task ID' },
|
|
120
|
+
},
|
|
121
|
+
required: ['id'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'bulk_task_action',
|
|
126
|
+
description: 'Perform bulk action on multiple tasks: change_status, assign, change_priority, or delete.',
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
task_ids: { type: 'array', items: { type: 'number' }, description: 'Task IDs to act on' },
|
|
131
|
+
action: { type: 'string', enum: ['change_status', 'assign', 'change_priority', 'delete'], description: 'Action to perform' },
|
|
132
|
+
value: { description: 'Value for the action (status number, user ID, priority number)' },
|
|
133
|
+
},
|
|
134
|
+
required: ['task_ids', 'action'],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'get_task_activity',
|
|
139
|
+
description: 'Get the activity log / changelog for a task (who changed what and when).',
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: 'object',
|
|
142
|
+
properties: {
|
|
143
|
+
task_id: { type: 'number', description: 'Task ID' },
|
|
144
|
+
},
|
|
145
|
+
required: ['task_id'],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'grab_task',
|
|
150
|
+
description: 'Grab (claim) a task for the authenticated user. Sets grabbed_by to current user.',
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: 'object',
|
|
153
|
+
properties: {
|
|
154
|
+
id: { type: 'number', description: 'Task ID' },
|
|
155
|
+
},
|
|
156
|
+
required: ['id'],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'release_task',
|
|
161
|
+
description: 'Release a previously grabbed task. Clears grabbed_by field.',
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
properties: {
|
|
165
|
+
id: { type: 'number', description: 'Task ID' },
|
|
166
|
+
},
|
|
167
|
+
required: ['id'],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'move_to_stage',
|
|
172
|
+
description: 'Move a task to a different stage (kanban column).',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: {
|
|
176
|
+
id: { type: 'number', description: 'Task ID' },
|
|
177
|
+
stage: { type: 'number', description: 'Target stage (kanban column) ID' },
|
|
178
|
+
},
|
|
179
|
+
required: ['id', 'stage'],
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
];
|
|
183
|
+
export async function handleTaskTool(client, name, args) {
|
|
184
|
+
switch (name) {
|
|
185
|
+
case 'list_tasks': {
|
|
186
|
+
const params = {};
|
|
187
|
+
const filterFields = [
|
|
188
|
+
'project', 'status', 'priority', 'assignee',
|
|
189
|
+
'created_by', 'task_type', 'labels', 'parent', 'stage', 'is_archived',
|
|
190
|
+
'due_date_after', 'due_date_before', 'ordering', 'page',
|
|
191
|
+
];
|
|
192
|
+
for (const key of filterFields) {
|
|
193
|
+
if (args[key] !== undefined && args[key] !== null) {
|
|
194
|
+
params[key] = args[key];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (args.search)
|
|
198
|
+
params.search = String(args.search);
|
|
199
|
+
return client.listTasks(params);
|
|
200
|
+
}
|
|
201
|
+
case 'get_task':
|
|
202
|
+
return client.getTask(Number(args.id));
|
|
203
|
+
case 'create_task': {
|
|
204
|
+
const body = { title: args.title, project_id: args.project };
|
|
205
|
+
const fields = [
|
|
206
|
+
'description', 'priority', 'assignees',
|
|
207
|
+
'due_date', 'task_type', 'estimated_time', 'parent', 'labels', 'stage',
|
|
208
|
+
];
|
|
209
|
+
for (const key of fields) {
|
|
210
|
+
if (args[key] !== undefined)
|
|
211
|
+
body[key] = args[key];
|
|
212
|
+
}
|
|
213
|
+
if (body.description !== undefined) {
|
|
214
|
+
body.description = wrapDescriptionAsTiptap(body.description);
|
|
215
|
+
}
|
|
216
|
+
return client.createTask(body);
|
|
217
|
+
}
|
|
218
|
+
case 'update_task': {
|
|
219
|
+
const { id, ...fields } = args;
|
|
220
|
+
if (fields.description !== undefined) {
|
|
221
|
+
fields.description = wrapDescriptionAsTiptap(fields.description);
|
|
222
|
+
}
|
|
223
|
+
return client.updateTask(Number(id), fields);
|
|
224
|
+
}
|
|
225
|
+
case 'delete_task':
|
|
226
|
+
await client.deleteTask(Number(args.id));
|
|
227
|
+
return { detail: 'Task deleted' };
|
|
228
|
+
case 'archive_task':
|
|
229
|
+
return client.archiveTask(Number(args.id));
|
|
230
|
+
case 'unarchive_task':
|
|
231
|
+
return client.unarchiveTask(Number(args.id));
|
|
232
|
+
case 'bulk_task_action':
|
|
233
|
+
return client.bulkTaskAction({
|
|
234
|
+
task_ids: args.task_ids,
|
|
235
|
+
action: String(args.action),
|
|
236
|
+
value: args.value,
|
|
237
|
+
});
|
|
238
|
+
case 'get_task_activity':
|
|
239
|
+
return client.getTaskActivity(Number(args.task_id));
|
|
240
|
+
case 'grab_task':
|
|
241
|
+
return client.grabTask(Number(args.id));
|
|
242
|
+
case 'release_task':
|
|
243
|
+
return client.releaseTask(Number(args.id));
|
|
244
|
+
case 'move_to_stage':
|
|
245
|
+
return client.updateTask(Number(args.id), { stage: args.stage });
|
|
246
|
+
default:
|
|
247
|
+
throw new Error(`Unknown task tool: ${name}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AAGA,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,OAAO;YACL,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACxC,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;aAC/D,CAAC,CAAC;SACJ,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,yJAAyJ;QACtK,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;gBAChE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mEAAmE,EAAE;gBAC5G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0DAA0D,EAAE;gBACrG,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;gBACvE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ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,EAAE,CAAC,CAAA;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TaskQClient } from '../client.js';
|
|
3
|
+
export declare const userTools: Tool[];
|
|
4
|
+
export declare function handleUserTool(client: TaskQClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,SAAS,EAAE,IAAI,EA6B3B,CAAA;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const userTools = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_me',
|
|
4
|
+
description: 'Get the authenticated user profile: ID, username, name, email, organizations, and settings.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {},
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'search',
|
|
12
|
+
description: 'Global search across tasks, projects, and users. Searches by title, description, human ID, project code, and username.',
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
q: { type: 'string', description: 'Search query (min 2 characters)' },
|
|
17
|
+
limit: { type: 'number', description: 'Max results per category (default 20, max 50)' },
|
|
18
|
+
},
|
|
19
|
+
required: ['q'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'list_labels',
|
|
24
|
+
description: 'List all available labels for categorizing tasks.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
export async function handleUserTool(client, name, args) {
|
|
32
|
+
switch (name) {
|
|
33
|
+
case 'get_me':
|
|
34
|
+
return client.getMe();
|
|
35
|
+
case 'search':
|
|
36
|
+
return client.search(String(args.q), args.limit ? Number(args.limit) : undefined);
|
|
37
|
+
case 'list_labels':
|
|
38
|
+
return client.listLabels();
|
|
39
|
+
default:
|
|
40
|
+
throw new Error(`Unknown user tool: ${name}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6FAA6F;QAC1G,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE,EAAE;SACf;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wHAAwH;QACrI,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;gBACrE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;aACxF;YACD,QAAQ,EAAE,CAAC,GAAG,CAAC;SAChB;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,mDAAmD;QAChE,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE,EAAE;SACf;KACF;CACF,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAmB,EACnB,IAAY,EACZ,IAA6B;IAE7B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,KAAK,EAAE,CAAA;QACvB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QACnF,KAAK,aAAa;YAChB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAA;QAC5B;YACE,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "taskq-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for TaskQ task management API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"taskq-mcp-server": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"start": "node dist/index.js",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"mcp",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"taskq",
|
|
25
|
+
"task-management",
|
|
26
|
+
"ai-agent",
|
|
27
|
+
"claude"
|
|
28
|
+
],
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/egormikov/taskq-mcp"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://taskq.ru",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
40
|
+
"axios": "^1.7.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"typescript": "^5.7.0"
|
|
45
|
+
}
|
|
46
|
+
}
|