@denvermullets/jait 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 +68 -0
- package/dist/api-client.d.ts +7 -0
- package/dist/api-client.js +49 -0
- package/dist/config-store.d.ts +3 -0
- package/dist/config-store.js +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/tools/issue-dependencies.d.ts +2 -0
- package/dist/tools/issue-dependencies.js +42 -0
- package/dist/tools/issues.d.ts +2 -0
- package/dist/tools/issues.js +182 -0
- package/dist/tools/labels.d.ts +2 -0
- package/dist/tools/labels.js +32 -0
- package/dist/tools/lanes.d.ts +2 -0
- package/dist/tools/lanes.js +11 -0
- package/dist/tools/members.d.ts +2 -0
- package/dist/tools/members.js +13 -0
- package/dist/tools/projects.d.ts +2 -0
- package/dist/tools/projects.js +156 -0
- package/dist/tools/teams.d.ts +2 -0
- package/dist/tools/teams.js +10 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 denvermullets
|
|
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,68 @@
|
|
|
1
|
+
```bash
|
|
2
|
+
claude mcp add my-server -- node /absolute/path/to/your/dist/index.js
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
just have to remember to put
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
"mcpServers": {
|
|
9
|
+
"mtasks": {
|
|
10
|
+
"command": "node",
|
|
11
|
+
"args": ["BUILD_FILE_LOCATION"],
|
|
12
|
+
"env": {
|
|
13
|
+
"MTASKS_API_URL": "",
|
|
14
|
+
"MTASKS_API_TOKEN": ""
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
Install the published package from npm — no clone, no manual build.
|
|
23
|
+
|
|
24
|
+
### 1. Save your API token
|
|
25
|
+
|
|
26
|
+
Generate an API token in the JAIT web app, then store it locally:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx -y @denvermullets/jait login <your-api-token>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This writes the token to `~/.config/jait/config.json` (mode `0600`) so it doesn't have to live in any client settings file.
|
|
33
|
+
|
|
34
|
+
### 2. Register the MCP server
|
|
35
|
+
|
|
36
|
+
**Claude Code (recommended):**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
claude mcp add jait -- npx -y @denvermullets/jait
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Claude Desktop / Cursor / other clients:**
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"jait": {
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["-y", "@denvermullets/jait"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No `env` block is needed — the token is read from the config file saved in step 1, and the API URL defaults to `https://justanotherissuetracker.com`.
|
|
56
|
+
|
|
57
|
+
### Logout
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx -y @denvermullets/jait logout
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Overrides (optional)
|
|
64
|
+
|
|
65
|
+
Both defaults can be overridden with environment variables, mostly useful for pointing at staging or localhost during development:
|
|
66
|
+
|
|
67
|
+
- `MTASKS_API_URL` — overrides the default production URL.
|
|
68
|
+
- `MTASKS_API_TOKEN` — overrides the saved token from `jait login`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readToken } from "./config-store.js";
|
|
2
|
+
const DEFAULT_API_URL = "https://justanotherissuetracker.com";
|
|
3
|
+
function getConfig() {
|
|
4
|
+
const apiUrl = process.env.MTASKS_API_URL || DEFAULT_API_URL;
|
|
5
|
+
const apiToken = process.env.MTASKS_API_TOKEN || readToken();
|
|
6
|
+
if (!apiToken) {
|
|
7
|
+
throw new Error("No token found. Run 'npx @denvermullets/jait login <token>' or set MTASKS_API_TOKEN.");
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
baseUrl: apiUrl.replace(/\/$/, ""),
|
|
11
|
+
token: apiToken,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export async function apiRequest(path, options = {}) {
|
|
15
|
+
const { baseUrl, token } = getConfig();
|
|
16
|
+
const { method = "GET", body, params } = options;
|
|
17
|
+
const url = new URL(`${baseUrl}${path}`);
|
|
18
|
+
if (params) {
|
|
19
|
+
for (const [key, value] of Object.entries(params)) {
|
|
20
|
+
if (value !== undefined) {
|
|
21
|
+
url.searchParams.set(key, String(value));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const headers = {
|
|
26
|
+
Authorization: `Bearer ${token}`,
|
|
27
|
+
"Content-Type": "application/json",
|
|
28
|
+
Accept: "application/json",
|
|
29
|
+
};
|
|
30
|
+
const response = await fetch(url.toString(), {
|
|
31
|
+
method,
|
|
32
|
+
headers,
|
|
33
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
34
|
+
});
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
const errorBody = await response.text();
|
|
37
|
+
let message;
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(errorBody);
|
|
40
|
+
message =
|
|
41
|
+
parsed.message || parsed.errors?.join(", ") || parsed.error || errorBody;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
message = errorBody;
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`API error ${response.status}: ${message}`);
|
|
47
|
+
}
|
|
48
|
+
return response.json();
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync, rmSync, existsSync, chmodSync, } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
const configDir = () => join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "jait");
|
|
5
|
+
const configFile = () => join(configDir(), "config.json");
|
|
6
|
+
export function readToken() {
|
|
7
|
+
try {
|
|
8
|
+
const parsed = JSON.parse(readFileSync(configFile(), "utf8"));
|
|
9
|
+
return typeof parsed.token === "string" ? parsed.token : undefined;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function writeToken(token) {
|
|
16
|
+
mkdirSync(configDir(), { recursive: true });
|
|
17
|
+
const path = configFile();
|
|
18
|
+
writeFileSync(path, JSON.stringify({ token }, null, 2));
|
|
19
|
+
chmodSync(path, 0o600);
|
|
20
|
+
return path;
|
|
21
|
+
}
|
|
22
|
+
export function clearToken() {
|
|
23
|
+
const path = configFile();
|
|
24
|
+
if (!existsSync(path))
|
|
25
|
+
return false;
|
|
26
|
+
rmSync(path);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { registerTeamTools } from "./tools/teams.js";
|
|
5
|
+
import { registerIssueTools } from "./tools/issues.js";
|
|
6
|
+
import { registerLaneTools } from "./tools/lanes.js";
|
|
7
|
+
import { registerMemberTools } from "./tools/members.js";
|
|
8
|
+
import { registerLabelTools } from "./tools/labels.js";
|
|
9
|
+
import { registerProjectTools } from "./tools/projects.js";
|
|
10
|
+
import { registerIssueDependencyTools } from "./tools/issue-dependencies.js";
|
|
11
|
+
import { writeToken, clearToken } from "./config-store.js";
|
|
12
|
+
const [, , cmd, arg] = process.argv;
|
|
13
|
+
if (cmd === "login") {
|
|
14
|
+
if (!arg) {
|
|
15
|
+
console.error("Usage: jait login <token>");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const path = writeToken(arg);
|
|
19
|
+
console.log(`Token saved to ${path}`);
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
if (cmd === "logout") {
|
|
23
|
+
const removed = clearToken();
|
|
24
|
+
console.log(removed ? "Token cleared." : "No token found.");
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
const server = new McpServer({
|
|
28
|
+
name: "jait",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
});
|
|
31
|
+
registerTeamTools(server);
|
|
32
|
+
registerIssueTools(server);
|
|
33
|
+
registerIssueDependencyTools(server);
|
|
34
|
+
registerLaneTools(server);
|
|
35
|
+
registerMemberTools(server);
|
|
36
|
+
registerLabelTools(server);
|
|
37
|
+
registerProjectTools(server);
|
|
38
|
+
const transport = new StdioServerTransport();
|
|
39
|
+
await server.connect(transport);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
export function registerIssueDependencyTools(server) {
|
|
4
|
+
server.tool("create_issue_dependency", "Create a blocking relationship between two issues. Use direction 'blocking' to mark the issue as blocking the target, or 'blocked_by' to mark it as blocked by the target.", {
|
|
5
|
+
team_id: z.number().describe("Team ID"),
|
|
6
|
+
issue_id: z.number().describe("The source issue ID"),
|
|
7
|
+
target_issue_id: z
|
|
8
|
+
.number()
|
|
9
|
+
.describe("The target issue ID to create the relationship with"),
|
|
10
|
+
direction: z
|
|
11
|
+
.enum(["blocking", "blocked_by"])
|
|
12
|
+
.describe("'blocking' = this issue blocks the target; 'blocked_by' = this issue is blocked by the target"),
|
|
13
|
+
}, async ({ team_id, issue_id, target_issue_id, direction }) => {
|
|
14
|
+
const dep = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}/issue_dependencies`, {
|
|
15
|
+
method: "POST",
|
|
16
|
+
body: { target_issue_id, direction },
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: `Dependency created:\n ${dep.blocking_issue.identifier} (${dep.blocking_issue.title}) blocks ${dep.blocked_issue.identifier} (${dep.blocked_issue.title})\n Dependency ID: ${dep.id}`,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
server.tool("remove_issue_dependency", "Remove a blocking relationship between issues", {
|
|
28
|
+
team_id: z.number().describe("Team ID"),
|
|
29
|
+
issue_id: z.number().describe("The source issue ID"),
|
|
30
|
+
dependency_id: z.number().describe("The dependency ID to remove"),
|
|
31
|
+
}, async ({ team_id, issue_id, dependency_id }) => {
|
|
32
|
+
await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}/issue_dependencies/${dependency_id}`, { method: "DELETE" });
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: "text",
|
|
37
|
+
text: `Dependency ${dependency_id} removed successfully.`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
const priorityEnum = z
|
|
4
|
+
.enum(["urgent", "high", "medium", "low", "no_priority"])
|
|
5
|
+
.describe("Issue priority");
|
|
6
|
+
function formatIssue(issue, detailed = false) {
|
|
7
|
+
const lines = [
|
|
8
|
+
`**${issue.identifier}**: ${issue.title}`,
|
|
9
|
+
` Status: ${issue.lane.name} | Priority: ${issue.priority} | ID: ${issue.id}`,
|
|
10
|
+
];
|
|
11
|
+
if (issue.assignee)
|
|
12
|
+
lines.push(` Assignee: ${issue.assignee.name}`);
|
|
13
|
+
if (issue.project)
|
|
14
|
+
lines.push(` Project: ${issue.project.name}`);
|
|
15
|
+
if (issue.labels.length > 0)
|
|
16
|
+
lines.push(` Labels: ${issue.labels.map((l) => l.name).join(", ")}`);
|
|
17
|
+
if (issue.due_date)
|
|
18
|
+
lines.push(` Due: ${issue.due_date}`);
|
|
19
|
+
if (issue.estimate !== null)
|
|
20
|
+
lines.push(` Estimate: ${issue.estimate}`);
|
|
21
|
+
if (detailed) {
|
|
22
|
+
if (issue.description)
|
|
23
|
+
lines.push(` Description: ${issue.description}`);
|
|
24
|
+
if (issue.milestone)
|
|
25
|
+
lines.push(` Milestone: ${issue.milestone.name}`);
|
|
26
|
+
if (issue.parent_issue)
|
|
27
|
+
lines.push(` Parent: ${issue.parent_issue.identifier} — ${issue.parent_issue.title}`);
|
|
28
|
+
if (issue.blocking_issues && issue.blocking_issues.length > 0)
|
|
29
|
+
lines.push(` Blocking: ${issue.blocking_issues.map((i) => `${i.identifier} (${i.title})`).join(", ")}`);
|
|
30
|
+
if (issue.blocked_issues && issue.blocked_issues.length > 0)
|
|
31
|
+
lines.push(` Blocked by: ${issue.blocked_issues.map((i) => `${i.identifier} (${i.title})`).join(", ")}`);
|
|
32
|
+
lines.push(` Creator: ${issue.creator.name}`);
|
|
33
|
+
lines.push(` Created: ${issue.created_at}`);
|
|
34
|
+
lines.push(` Updated: ${issue.updated_at}`);
|
|
35
|
+
if (issue.started_at)
|
|
36
|
+
lines.push(` Started: ${issue.started_at}`);
|
|
37
|
+
if (issue.completed_at)
|
|
38
|
+
lines.push(` Completed: ${issue.completed_at}`);
|
|
39
|
+
if (issue.canceled_at)
|
|
40
|
+
lines.push(` Canceled: ${issue.canceled_at}`);
|
|
41
|
+
}
|
|
42
|
+
return lines.join("\n");
|
|
43
|
+
}
|
|
44
|
+
export function registerIssueTools(server) {
|
|
45
|
+
server.tool("list_issues", "List issues for a team, with optional filters", {
|
|
46
|
+
team_id: z.number().describe("Team ID"),
|
|
47
|
+
lane_id: z.number().optional().describe("Filter by status lane ID"),
|
|
48
|
+
assignee_id: z.number().optional().describe("Filter by assignee ID"),
|
|
49
|
+
project_id: z.number().optional().describe("Filter by project ID"),
|
|
50
|
+
priority: priorityEnum.optional(),
|
|
51
|
+
}, async ({ team_id, lane_id, assignee_id, project_id, priority }) => {
|
|
52
|
+
const issues = await apiRequest(`/api/v1/teams/${team_id}/issues`, {
|
|
53
|
+
params: {
|
|
54
|
+
lane_id: lane_id,
|
|
55
|
+
assignee_id: assignee_id,
|
|
56
|
+
project_id: project_id,
|
|
57
|
+
priority,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const text = issues.map((i) => formatIssue(i)).join("\n\n");
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: text || "No issues found." }],
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
server.tool("get_issue", "Get full details of a specific issue", {
|
|
66
|
+
team_id: z.number().describe("Team ID"),
|
|
67
|
+
issue_id: z.number().describe("Issue ID"),
|
|
68
|
+
}, async ({ team_id, issue_id }) => {
|
|
69
|
+
const issue = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}`);
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: "text", text: formatIssue(issue, true) }],
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
server.tool("create_issue", "Create a new issue on a team. If lane_id is omitted, defaults to the Backlog lane.", {
|
|
75
|
+
team_id: z.number().describe("Team ID"),
|
|
76
|
+
title: z.string().describe("Issue title"),
|
|
77
|
+
description: z.string().optional().describe("Issue description"),
|
|
78
|
+
priority: priorityEnum.optional().describe("Defaults to no_priority"),
|
|
79
|
+
lane_id: z
|
|
80
|
+
.number()
|
|
81
|
+
.optional()
|
|
82
|
+
.describe("Status lane ID. Defaults to Backlog if omitted."),
|
|
83
|
+
assignee_id: z.number().optional().describe("Assignee user ID"),
|
|
84
|
+
project_id: z.number().optional().describe("Project ID"),
|
|
85
|
+
label_ids: z.array(z.number()).optional().describe("Label IDs"),
|
|
86
|
+
due_date: z
|
|
87
|
+
.string()
|
|
88
|
+
.optional()
|
|
89
|
+
.describe("Due date in YYYY-MM-DD format"),
|
|
90
|
+
estimate: z.number().optional().describe("Estimate value"),
|
|
91
|
+
milestone_id: z.number().optional().describe("Milestone ID"),
|
|
92
|
+
parent_issue_id: z.number().optional().describe("Parent issue ID"),
|
|
93
|
+
}, async ({ team_id, title, description, priority, lane_id, assignee_id, project_id, label_ids, due_date, estimate, milestone_id, parent_issue_id, }) => {
|
|
94
|
+
let resolvedLaneId = lane_id;
|
|
95
|
+
if (!resolvedLaneId) {
|
|
96
|
+
const lanes = await apiRequest(`/api/v1/teams/${team_id}/lanes`);
|
|
97
|
+
const backlog = lanes.find((l) => l.name.toLowerCase() === "backlog" || l.position === 0);
|
|
98
|
+
if (!backlog) {
|
|
99
|
+
return {
|
|
100
|
+
content: [
|
|
101
|
+
{
|
|
102
|
+
type: "text",
|
|
103
|
+
text: "Error: Could not find a Backlog lane. Please specify a lane_id.",
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
resolvedLaneId = backlog.id;
|
|
109
|
+
}
|
|
110
|
+
const issue = await apiRequest(`/api/v1/teams/${team_id}/issues`, {
|
|
111
|
+
method: "POST",
|
|
112
|
+
body: {
|
|
113
|
+
issue: {
|
|
114
|
+
title,
|
|
115
|
+
description,
|
|
116
|
+
priority: priority || "no_priority",
|
|
117
|
+
lane_id: resolvedLaneId,
|
|
118
|
+
assignee_id,
|
|
119
|
+
project_id,
|
|
120
|
+
label_ids,
|
|
121
|
+
due_date,
|
|
122
|
+
estimate,
|
|
123
|
+
milestone_id,
|
|
124
|
+
parent_issue_id,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: `Issue created successfully:\n\n${formatIssue(issue, true)}`,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
server.tool("update_issue", "Update an existing issue (change priority, reassign, move lane, etc.)", {
|
|
138
|
+
team_id: z.number().describe("Team ID"),
|
|
139
|
+
issue_id: z.number().describe("Issue ID"),
|
|
140
|
+
title: z.string().optional().describe("New title"),
|
|
141
|
+
description: z.string().optional().describe("New description"),
|
|
142
|
+
priority: priorityEnum.optional(),
|
|
143
|
+
lane_id: z.number().optional().describe("Move to lane ID"),
|
|
144
|
+
assignee_id: z.number().optional().describe("Reassign to user ID"),
|
|
145
|
+
project_id: z.number().optional().describe("Move to project ID"),
|
|
146
|
+
label_ids: z.array(z.number()).optional().describe("Set label IDs"),
|
|
147
|
+
due_date: z.string().optional().describe("Due date in YYYY-MM-DD format"),
|
|
148
|
+
estimate: z.number().optional().describe("Estimate value"),
|
|
149
|
+
}, async ({ team_id, issue_id, title, description, priority, lane_id, assignee_id, project_id, label_ids, due_date, estimate, }) => {
|
|
150
|
+
const fields = {};
|
|
151
|
+
if (title !== undefined)
|
|
152
|
+
fields.title = title;
|
|
153
|
+
if (description !== undefined)
|
|
154
|
+
fields.description = description;
|
|
155
|
+
if (priority !== undefined)
|
|
156
|
+
fields.priority = priority;
|
|
157
|
+
if (lane_id !== undefined)
|
|
158
|
+
fields.lane_id = lane_id;
|
|
159
|
+
if (assignee_id !== undefined)
|
|
160
|
+
fields.assignee_id = assignee_id;
|
|
161
|
+
if (project_id !== undefined)
|
|
162
|
+
fields.project_id = project_id;
|
|
163
|
+
if (label_ids !== undefined)
|
|
164
|
+
fields.label_ids = label_ids;
|
|
165
|
+
if (due_date !== undefined)
|
|
166
|
+
fields.due_date = due_date;
|
|
167
|
+
if (estimate !== undefined)
|
|
168
|
+
fields.estimate = estimate;
|
|
169
|
+
const issue = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}`, {
|
|
170
|
+
method: "PATCH",
|
|
171
|
+
body: { issue: fields },
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
content: [
|
|
175
|
+
{
|
|
176
|
+
type: "text",
|
|
177
|
+
text: `Issue updated successfully:\n\n${formatIssue(issue, true)}`,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
export function registerLabelTools(server) {
|
|
4
|
+
server.tool("list_labels", "List available labels for a team", { team_id: z.number().describe("Team ID") }, async ({ team_id }) => {
|
|
5
|
+
const labels = await apiRequest(`/api/v1/teams/${team_id}/labels`);
|
|
6
|
+
const text = labels
|
|
7
|
+
.map((l) => `• ${l.name} (${l.color}) — ID: ${l.id}`)
|
|
8
|
+
.join("\n");
|
|
9
|
+
return { content: [{ type: "text", text: text || "No labels found." }] };
|
|
10
|
+
});
|
|
11
|
+
server.tool("create_label", "Create a new label for a team. Color is auto-assigned if omitted.", {
|
|
12
|
+
team_id: z.number().describe("Team ID"),
|
|
13
|
+
name: z.string().describe("Label name (must be unique within team)"),
|
|
14
|
+
color: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Hex color code (e.g. #ef4444). Auto-assigned if omitted."),
|
|
18
|
+
}, async ({ team_id, name, color }) => {
|
|
19
|
+
const label = await apiRequest(`/api/v1/teams/${team_id}/labels`, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body: { label: { name, color } },
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: `Label created: ${label.name} (${label.color}) — ID: ${label.id}`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
export function registerLaneTools(server) {
|
|
4
|
+
server.tool("list_lanes", "List available status lanes for a team", { team_id: z.number().describe("Team ID") }, async ({ team_id }) => {
|
|
5
|
+
const lanes = await apiRequest(`/api/v1/teams/${team_id}/lanes`);
|
|
6
|
+
const text = lanes
|
|
7
|
+
.map((l) => `• ${l.name} — ID: ${l.id} (position: ${l.position})`)
|
|
8
|
+
.join("\n");
|
|
9
|
+
return { content: [{ type: "text", text: text || "No lanes found." }] };
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
export function registerMemberTools(server) {
|
|
4
|
+
server.tool("list_members", "List team members (for assigning issues)", { team_id: z.number().describe("Team ID") }, async ({ team_id }) => {
|
|
5
|
+
const members = await apiRequest(`/api/v1/teams/${team_id}/members`);
|
|
6
|
+
const text = members
|
|
7
|
+
.map((m) => `• ${m.name} (${m.email}) — ID: ${m.id}`)
|
|
8
|
+
.join("\n");
|
|
9
|
+
return {
|
|
10
|
+
content: [{ type: "text", text: text || "No members found." }],
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
const projectStatusEnum = z
|
|
4
|
+
.enum(["backlog", "started", "paused", "completed", "cancelled"])
|
|
5
|
+
.describe("Project status");
|
|
6
|
+
const priorityEnum = z
|
|
7
|
+
.enum(["urgent", "high", "medium", "low", "no_priority"])
|
|
8
|
+
.describe("Priority level");
|
|
9
|
+
function formatProject(project, detailed = false) {
|
|
10
|
+
const lines = [
|
|
11
|
+
`**${project.name}** — ID: ${project.id}`,
|
|
12
|
+
` Status: ${project.status} | Priority: ${project.priority}`,
|
|
13
|
+
];
|
|
14
|
+
if (project.lead)
|
|
15
|
+
lines.push(` Lead: ${project.lead.name}`);
|
|
16
|
+
if (project.description)
|
|
17
|
+
lines.push(` Description: ${project.description}`);
|
|
18
|
+
if (project.start_date)
|
|
19
|
+
lines.push(` Start: ${project.start_date}`);
|
|
20
|
+
if (project.due_date)
|
|
21
|
+
lines.push(` Due: ${project.due_date}`);
|
|
22
|
+
if (detailed) {
|
|
23
|
+
if (project.milestone)
|
|
24
|
+
lines.push(` Milestone: ${project.milestone.name}`);
|
|
25
|
+
if (project.labels?.length > 0)
|
|
26
|
+
lines.push(` Labels: ${project.labels.map((l) => l.name).join(", ")}`);
|
|
27
|
+
if (project.issues_count !== undefined)
|
|
28
|
+
lines.push(` Issues: ${project.issues_count}`);
|
|
29
|
+
lines.push(` Created: ${project.created_at}`);
|
|
30
|
+
lines.push(` Updated: ${project.updated_at}`);
|
|
31
|
+
}
|
|
32
|
+
return lines.join("\n");
|
|
33
|
+
}
|
|
34
|
+
export function registerProjectTools(server) {
|
|
35
|
+
server.tool("list_projects", "List available projects for a team", { team_id: z.number().describe("Team ID") }, async ({ team_id }) => {
|
|
36
|
+
const projects = await apiRequest(`/api/v1/teams/${team_id}/projects`);
|
|
37
|
+
const text = projects.map((p) => formatProject(p)).join("\n\n");
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: "text", text: text || "No projects found." }],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
server.tool("get_project", "Get full details of a specific project", {
|
|
43
|
+
team_id: z.number().describe("Team ID"),
|
|
44
|
+
project_id: z.number().describe("Project ID"),
|
|
45
|
+
}, async ({ team_id, project_id }) => {
|
|
46
|
+
const project = await apiRequest(`/api/v1/teams/${team_id}/projects/${project_id}`);
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: formatProject(project, true) }],
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
server.tool("create_project", "Create a new project for a team", {
|
|
52
|
+
team_id: z.number().describe("Team ID"),
|
|
53
|
+
name: z.string().describe("Project name"),
|
|
54
|
+
description: z.string().optional().describe("Project description"),
|
|
55
|
+
status: projectStatusEnum.optional().describe("Defaults to backlog"),
|
|
56
|
+
priority: priorityEnum.optional().describe("Defaults to no_priority"),
|
|
57
|
+
lead_id: z.number().optional().describe("Project lead user ID"),
|
|
58
|
+
milestone_id: z.number().optional().describe("Milestone ID"),
|
|
59
|
+
start_date: z
|
|
60
|
+
.string()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Start date in YYYY-MM-DD format"),
|
|
63
|
+
due_date: z
|
|
64
|
+
.string()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("Due date in YYYY-MM-DD format"),
|
|
67
|
+
label_ids: z.array(z.number()).optional().describe("Label IDs"),
|
|
68
|
+
}, async ({ team_id, name, description, status, priority, lead_id, milestone_id, start_date, due_date, label_ids, }) => {
|
|
69
|
+
const project = await apiRequest(`/api/v1/teams/${team_id}/projects`, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: {
|
|
72
|
+
project: {
|
|
73
|
+
name,
|
|
74
|
+
description,
|
|
75
|
+
status: status || "backlog",
|
|
76
|
+
priority: priority || "no_priority",
|
|
77
|
+
lead_id,
|
|
78
|
+
milestone_id,
|
|
79
|
+
start_date,
|
|
80
|
+
due_date,
|
|
81
|
+
label_ids,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: `Project created successfully:\n\n${formatProject(project, true)}`,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
server.tool("update_project", "Update an existing project (change status, priority, lead, dates, etc.)", {
|
|
95
|
+
team_id: z.number().describe("Team ID"),
|
|
96
|
+
project_id: z.number().describe("Project ID"),
|
|
97
|
+
name: z.string().optional().describe("New name"),
|
|
98
|
+
description: z.string().optional().describe("New description"),
|
|
99
|
+
status: projectStatusEnum.optional(),
|
|
100
|
+
priority: priorityEnum.optional(),
|
|
101
|
+
lead_id: z.number().optional().describe("New lead user ID"),
|
|
102
|
+
milestone_id: z.number().optional().describe("Milestone ID"),
|
|
103
|
+
start_date: z
|
|
104
|
+
.string()
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("Start date in YYYY-MM-DD format"),
|
|
107
|
+
due_date: z
|
|
108
|
+
.string()
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("Due date in YYYY-MM-DD format"),
|
|
111
|
+
label_ids: z.array(z.number()).optional().describe("Set label IDs"),
|
|
112
|
+
}, async ({ team_id, project_id, name, description, status, priority, lead_id, milestone_id, start_date, due_date, label_ids, }) => {
|
|
113
|
+
const fields = {};
|
|
114
|
+
if (name !== undefined)
|
|
115
|
+
fields.name = name;
|
|
116
|
+
if (description !== undefined)
|
|
117
|
+
fields.description = description;
|
|
118
|
+
if (status !== undefined)
|
|
119
|
+
fields.status = status;
|
|
120
|
+
if (priority !== undefined)
|
|
121
|
+
fields.priority = priority;
|
|
122
|
+
if (lead_id !== undefined)
|
|
123
|
+
fields.lead_id = lead_id;
|
|
124
|
+
if (milestone_id !== undefined)
|
|
125
|
+
fields.milestone_id = milestone_id;
|
|
126
|
+
if (start_date !== undefined)
|
|
127
|
+
fields.start_date = start_date;
|
|
128
|
+
if (due_date !== undefined)
|
|
129
|
+
fields.due_date = due_date;
|
|
130
|
+
if (label_ids !== undefined)
|
|
131
|
+
fields.label_ids = label_ids;
|
|
132
|
+
const project = await apiRequest(`/api/v1/teams/${team_id}/projects/${project_id}`, {
|
|
133
|
+
method: "PATCH",
|
|
134
|
+
body: { project: fields },
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
content: [
|
|
138
|
+
{
|
|
139
|
+
type: "text",
|
|
140
|
+
text: `Project updated successfully:\n\n${formatProject(project, true)}`,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
server.tool("delete_project", "Delete a project from a team", {
|
|
146
|
+
team_id: z.number().describe("Team ID"),
|
|
147
|
+
project_id: z.number().describe("Project ID"),
|
|
148
|
+
}, async ({ team_id, project_id }) => {
|
|
149
|
+
await apiRequest(`/api/v1/teams/${team_id}/projects/${project_id}`, { method: "DELETE" });
|
|
150
|
+
return {
|
|
151
|
+
content: [
|
|
152
|
+
{ type: "text", text: `Project ${project_id} deleted successfully.` },
|
|
153
|
+
],
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { apiRequest } from "../api-client.js";
|
|
2
|
+
export function registerTeamTools(server) {
|
|
3
|
+
server.tool("list_teams", "List all teams the user has access to", {}, async () => {
|
|
4
|
+
const teams = await apiRequest("/api/v1/teams");
|
|
5
|
+
const text = teams
|
|
6
|
+
.map((t) => `• ${t.name} (${t.identifier}) — ID: ${t.id}`)
|
|
7
|
+
.join("\n");
|
|
8
|
+
return { content: [{ type: "text", text: text || "No teams found." }] };
|
|
9
|
+
});
|
|
10
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@denvermullets/jait",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for Just Another Issue Tracker",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"jait": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
"dev": "tsc --watch",
|
|
16
|
+
"prepack": "yarn build",
|
|
17
|
+
"prepublishOnly": "yarn build"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
21
|
+
"zod": "^4.3.6"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.0.0",
|
|
25
|
+
"typescript": "^5.7.0"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18.0.0"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "denvermullets",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/denvermullets/mtasks-mcp.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/denvermullets/mtasks-mcp#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/denvermullets/mtasks-mcp/issues"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"mcp",
|
|
42
|
+
"mtasks",
|
|
43
|
+
"jait",
|
|
44
|
+
"model-context-protocol",
|
|
45
|
+
"claude"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
}
|
|
50
|
+
}
|