@vitalyostanin/youtrack-mcp 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +32 -3
  3. package/dist/package.json +80 -79
  4. package/dist/src/tools/issue-activity-tools.d.ts +4 -4
  5. package/dist/src/tools/issue-activity-tools.js +4 -4
  6. package/dist/src/tools/users-activity-tools.d.ts +4 -4
  7. package/dist/src/tools/users-activity-tools.js +4 -4
  8. package/dist/src/tools/workitem-report-tools.js +1 -1
  9. package/dist/src/tools/workitem-tools.d.ts +6 -6
  10. package/dist/src/tools/workitem-tools.js +1 -1
  11. package/package.json +15 -14
  12. package/dist/src/__tests__/config.test.d.ts +0 -2
  13. package/dist/src/__tests__/config.test.js +0 -47
  14. package/dist/src/__tests__/setup.d.ts +0 -2
  15. package/dist/src/__tests__/setup.js +0 -12
  16. package/dist/src/__tests__/smoke.test.d.ts +0 -2
  17. package/dist/src/__tests__/smoke.test.js +0 -7
  18. package/dist/src/__tests__/youtrack-client.delete-link.test.d.ts +0 -2
  19. package/dist/src/__tests__/youtrack-client.delete-link.test.js +0 -93
  20. package/dist/src/__tests__/youtrack-client.normalize-error.test.d.ts +0 -2
  21. package/dist/src/__tests__/youtrack-client.normalize-error.test.js +0 -71
  22. package/dist/src/__tests__/youtrack-client.process-batch.test.d.ts +0 -2
  23. package/dist/src/__tests__/youtrack-client.process-batch.test.js +0 -63
  24. package/dist/src/__tests__/youtrack-client.read-pagination.test.d.ts +0 -2
  25. package/dist/src/__tests__/youtrack-client.read-pagination.test.js +0 -75
  26. package/dist/src/__tests__/youtrack-client.resolve-id.test.d.ts +0 -2
  27. package/dist/src/__tests__/youtrack-client.resolve-id.test.js +0 -77
  28. package/dist/src/__tests__/youtrack-client.single-flight.test.d.ts +0 -2
  29. package/dist/src/__tests__/youtrack-client.single-flight.test.js +0 -82
  30. package/dist/src/__tests__/youtrack-client.timeouts.test.d.ts +0 -2
  31. package/dist/src/__tests__/youtrack-client.timeouts.test.js +0 -27
  32. package/dist/src/__tests__/youtrack-client.url-encoding.test.d.ts +0 -2
  33. package/dist/src/__tests__/youtrack-client.url-encoding.test.js +0 -60
  34. package/dist/src/tools/__tests__/article-search-tools.test.d.ts +0 -2
  35. package/dist/src/tools/__tests__/article-search-tools.test.js +0 -31
  36. package/dist/src/tools/__tests__/attachment-tools.test.d.ts +0 -2
  37. package/dist/src/tools/__tests__/attachment-tools.test.js +0 -94
  38. package/dist/src/tools/__tests__/destructive-confirmation.test.d.ts +0 -2
  39. package/dist/src/tools/__tests__/destructive-confirmation.test.js +0 -38
  40. package/dist/src/tools/__tests__/issue-activity-tools.test.d.ts +0 -2
  41. package/dist/src/tools/__tests__/issue-activity-tools.test.js +0 -69
  42. package/dist/src/tools/__tests__/issue-search-tools.test.d.ts +0 -2
  43. package/dist/src/tools/__tests__/issue-search-tools.test.js +0 -25
  44. package/dist/src/tools/__tests__/issue-status-tools.test.d.ts +0 -2
  45. package/dist/src/tools/__tests__/issue-status-tools.test.js +0 -98
  46. package/dist/src/tools/__tests__/workitem-tools.test.d.ts +0 -2
  47. package/dist/src/tools/__tests__/workitem-tools.test.js +0 -72
  48. package/dist/src/utils/__tests__/file-download.test.d.ts +0 -2
  49. package/dist/src/utils/__tests__/file-download.test.js +0 -77
  50. package/dist/src/utils/__tests__/file-storage.test.d.ts +0 -2
  51. package/dist/src/utils/__tests__/file-storage.test.js +0 -61
  52. package/dist/src/utils/__tests__/path-safety.test.d.ts +0 -2
  53. package/dist/src/utils/__tests__/path-safety.test.js +0 -49
  54. package/dist/src/utils/__tests__/streaming-client.test.d.ts +0 -2
  55. package/dist/src/utils/__tests__/streaming-client.test.js +0 -90
  56. package/dist/src/utils/__tests__/validators.test.d.ts +0 -2
  57. package/dist/src/utils/__tests__/validators.test.js +0 -65
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Vitaly Ostanin
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/dist/index.js CHANGED
@@ -1,13 +1,42 @@
1
1
  #!/usr/bin/env node
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import { YoutrackServer } from "./src/server.js";
2
+ import { readFileSync } from 'node:fs';
3
+ import { dirname, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
+ import { YoutrackServer } from './src/server.js';
7
+ function readManifest() {
8
+ const here = dirname(fileURLToPath(import.meta.url));
9
+ const candidates = [
10
+ resolve(here, 'package.json'),
11
+ resolve(here, '..', 'package.json'),
12
+ ];
13
+ for (const path of candidates) {
14
+ try {
15
+ const raw = readFileSync(path, 'utf8');
16
+ return JSON.parse(raw);
17
+ }
18
+ catch {
19
+ // try next candidate
20
+ }
21
+ }
22
+ return { name: '@vitalyostanin/youtrack-mcp', version: 'unknown' };
23
+ }
24
+ function maybePrintVersionAndExit() {
25
+ const argv = process.argv.slice(2);
26
+ if (argv.includes('--version') || argv.includes('-v')) {
27
+ const manifest = readManifest();
28
+ console.log(`${manifest.name} ${manifest.version}`);
29
+ process.exit(0);
30
+ }
31
+ }
4
32
  async function main() {
33
+ maybePrintVersionAndExit();
5
34
  const transport = new StdioServerTransport();
6
35
  const server = new YoutrackServer();
7
36
  await server.connect(transport);
8
37
  }
9
38
  main().catch((error) => {
10
- console.error("YouTrack MCP server crashed", error);
39
+ console.error('YouTrack MCP server crashed', error);
11
40
  process.exit(1);
12
41
  });
13
42
  //# sourceMappingURL=index.js.map
package/dist/package.json CHANGED
@@ -1,81 +1,82 @@
1
1
  {
2
- "name": "@vitalyostanin/youtrack-mcp",
3
- "version": "0.13.0",
4
- "scripts": {
5
- "build": "tsc -p tsconfig.json",
6
- "postbuild": "chmod +x dist/index.js",
7
- "dev": "tsc -p tsconfig.json --watch",
8
- "start": "node dist/index.js",
9
- "dev:watch": "tsc -p tsconfig.json --watch",
10
- "lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",
11
- "lint:fix": "eslint . --fix --cache --cache-location node_modules/.cache/eslint/",
12
- "format": "eslint . --fix --cache --cache-location node_modules/.cache/eslint/",
13
- "typecheck": "tsc -p tsconfig.json --noEmit",
14
- "test": "vitest run",
15
- "test:watch": "vitest",
16
- "test:coverage": "vitest run --coverage",
17
- "prepublishOnly": "npm run lint && npm test && npm run build"
18
- },
19
- "keywords": [
20
- "mcp",
21
- "model-context-protocol",
22
- "youtrack",
23
- "jetbrains",
24
- "issue-tracking",
25
- "work-items",
26
- "time-tracking",
27
- "claude"
28
- ],
29
- "author": "Vitaly Ostanin <vitaly.ostanin@mail.ru>",
30
- "license": "MIT",
31
- "description": "MCP server for comprehensive YouTrack integration: issues, work items with reports, user activity search, knowledge base, projects and users",
32
- "type": "module",
33
- "engines": {
34
- "node": ">=22.13.0"
35
- },
36
- "bin": {
37
- "youtrack-mcp": "dist/index.js"
38
- },
39
- "homepage": "https://github.com/VitalyOstanin/youtrack-mcp#readme",
40
- "repository": {
41
- "type": "git",
42
- "url": "git+https://github.com/VitalyOstanin/youtrack-mcp.git"
43
- },
44
- "bugs": {
45
- "url": "https://github.com/VitalyOstanin/youtrack-mcp/issues"
46
- },
47
- "files": [
48
- "dist/**/*.js",
49
- "dist/**/*.d.ts",
50
- "dist/**/*.json",
51
- "README.md",
52
- "README-ru.md"
53
- ],
54
- "publishConfig": {
55
- "access": "public"
56
- },
57
- "overrides": {
58
- "ip-address": "^10.2.0"
59
- },
60
- "dependencies": {
61
- "@modelcontextprotocol/sdk": "^1.29.0",
62
- "@vitalyostanin/mutex-pool": "^0.0.3",
63
- "axios": "^1.16.0",
64
- "form-data": "^4.0.1",
65
- "luxon": "^3.5.0",
66
- "stream-json": "^2.1.0",
67
- "zod": "^4.4.3"
68
- },
69
- "devDependencies": {
70
- "@eslint/js": "^10.0.1",
71
- "@types/luxon": "^3.7.1",
72
- "@types/node": "^25.6.0",
73
- "@vitest/coverage-v8": "^4.1.5",
74
- "eslint": "^10.3.0",
75
- "nock": "^14.0.14",
76
- "typescript": "^6.0.3",
77
- "typescript-eslint": "^8.59.2",
78
- "vitest": "^4.1.5",
79
- "zod-to-json-schema": "^3.25.2"
80
- }
2
+ "name": "@vitalyostanin/youtrack-mcp",
3
+ "version": "0.13.2",
4
+ "scripts": {
5
+ "build": "tsc -p tsconfig.build.json",
6
+ "postbuild": "chmod +x dist/index.js && cp package.json dist/package.json",
7
+ "dev": "tsc -p tsconfig.build.json --watch",
8
+ "start": "node dist/index.js",
9
+ "typecheck": "tsc -p tsconfig.json",
10
+ "lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",
11
+ "lint:fix": "eslint . --fix --cache --cache-location node_modules/.cache/eslint/",
12
+ "format": "npm run --silent lint:fix",
13
+ "test": "timeout 600 vitest run",
14
+ "test:watch": "vitest",
15
+ "test:coverage": "timeout 600 vitest run --coverage",
16
+ "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm audit --omit=dev --audit-level=high && npm run build"
17
+ },
18
+ "keywords": [
19
+ "mcp",
20
+ "model-context-protocol",
21
+ "youtrack",
22
+ "jetbrains",
23
+ "issue-tracking",
24
+ "work-items",
25
+ "time-tracking",
26
+ "claude"
27
+ ],
28
+ "author": "Vitaly Ostanin <vitaly.ostanin@mail.ru>",
29
+ "license": "MIT",
30
+ "description": "MCP server for comprehensive YouTrack integration: issues, work items with reports, user activity search, knowledge base, projects and users",
31
+ "type": "module",
32
+ "engines": {
33
+ "node": ">=22.13.0",
34
+ "npm": ">=10.0.0"
35
+ },
36
+ "packageManager": "npm@11.12.1",
37
+ "bin": {
38
+ "youtrack-mcp": "dist/index.js"
39
+ },
40
+ "homepage": "https://github.com/VitalyOstanin/youtrack-mcp#readme",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/VitalyOstanin/youtrack-mcp.git"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/VitalyOstanin/youtrack-mcp/issues"
47
+ },
48
+ "files": [
49
+ "dist/**/*.js",
50
+ "dist/**/*.d.ts",
51
+ "dist/**/*.json",
52
+ "README.md",
53
+ "README-ru.md",
54
+ "LICENSE"
55
+ ],
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "overrides": {
60
+ "ip-address": "^10.2.0"
61
+ },
62
+ "dependencies": {
63
+ "@modelcontextprotocol/sdk": "^1.29.0",
64
+ "@vitalyostanin/mutex-pool": "^0.0.3",
65
+ "axios": "^1.16.0",
66
+ "form-data": "^4.0.1",
67
+ "luxon": "^3.5.0",
68
+ "stream-json": "^2.1.0",
69
+ "zod": "^4.4.3"
70
+ },
71
+ "devDependencies": {
72
+ "@eslint/js": "^10.0.1",
73
+ "@types/luxon": "^3.7.1",
74
+ "@types/node": "^25.6.0",
75
+ "@vitest/coverage-v8": "^4.1.5",
76
+ "eslint": "^10.3.0",
77
+ "nock": "^14.0.14",
78
+ "typescript": "^6.0.3",
79
+ "typescript-eslint": "^8.59.2",
80
+ "vitest": "^4.1.5"
81
+ }
81
82
  }
@@ -27,8 +27,8 @@ export declare const issueActivitiesArgs: {
27
27
  overwrite: z.ZodOptional<z.ZodBoolean>;
28
28
  issueId: z.ZodString;
29
29
  author: z.ZodOptional<z.ZodString>;
30
- startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
31
- endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
30
+ startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
31
+ endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
32
32
  categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
33
33
  CustomFieldCategory: "CustomFieldCategory";
34
34
  CommentsCategory: "CommentsCategory";
@@ -58,8 +58,8 @@ export declare const issueActivitiesSchema: z.ZodObject<{
58
58
  overwrite: z.ZodOptional<z.ZodBoolean>;
59
59
  issueId: z.ZodString;
60
60
  author: z.ZodOptional<z.ZodString>;
61
- startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
62
- endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
61
+ startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
62
+ endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
63
63
  categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
64
64
  CustomFieldCategory: "CustomFieldCategory";
65
65
  CommentsCategory: "CommentsCategory";
@@ -27,13 +27,13 @@ export const issueActivitiesArgs = {
27
27
  issueId: issueIdSchema.describe("Issue code (e.g., PROJ-123)"),
28
28
  author: z.string().optional().describe("Filter by author login (e.g., 'john.doe')"),
29
29
  startDate: z
30
- .union([z.string(), z.number(), z.date()])
30
+ .union([z.string(), z.number()])
31
31
  .optional()
32
- .describe("Start date for filtering (format: YYYY-MM-DD, timestamp, or Date object)"),
32
+ .describe("Start date for filtering (format: YYYY-MM-DD or unix ms timestamp)"),
33
33
  endDate: z
34
- .union([z.string(), z.number(), z.date()])
34
+ .union([z.string(), z.number()])
35
35
  .optional()
36
- .describe("End date for filtering (format: YYYY-MM-DD, timestamp, or Date object)"),
36
+ .describe("End date for filtering (format: YYYY-MM-DD or unix ms timestamp)"),
37
37
  categories: z
38
38
  .array(activityCategoryEnum)
39
39
  .optional()
@@ -9,8 +9,8 @@ export declare const usersActivityArgs: {
9
9
  }>>;
10
10
  overwrite: z.ZodOptional<z.ZodBoolean>;
11
11
  author: z.ZodString;
12
- start: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
13
- end: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
12
+ start: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
13
+ end: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
14
14
  categories: z.ZodString;
15
15
  reverse: z.ZodOptional<z.ZodBoolean>;
16
16
  limit: z.ZodDefault<z.ZodNumber>;
@@ -26,8 +26,8 @@ export declare const usersActivitySchema: z.ZodObject<{
26
26
  }>>;
27
27
  overwrite: z.ZodOptional<z.ZodBoolean>;
28
28
  author: z.ZodString;
29
- start: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
30
- end: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
29
+ start: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
30
+ end: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
31
31
  categories: z.ZodString;
32
32
  reverse: z.ZodOptional<z.ZodBoolean>;
33
33
  limit: z.ZodDefault<z.ZodNumber>;
@@ -9,13 +9,13 @@ import { createToolHandler } from "../utils/tool-handler.js";
9
9
  export const usersActivityArgs = {
10
10
  author: userLoginSchema.describe("Filter by author login (required, e.g., 'vyt'). Matches activities created by this user."),
11
11
  start: z
12
- .union([z.string(), z.number(), z.date()])
12
+ .union([z.string(), z.number()])
13
13
  .optional()
14
- .describe("Inclusive start of the interval. Accepts ISO string, unix timestamp (ms), or Date object. Converted to unix ms for /api/activities (default: 30 days before end). Avoid omitting on instances with multi-year history -- /api/activities scans the full date window before applying $top."),
14
+ .describe("Inclusive start of the interval. Accepts ISO string or unix timestamp (ms). Converted to unix ms for /api/activities (default: 30 days before end). Avoid omitting on instances with multi-year history -- /api/activities scans the full date window before applying $top."),
15
15
  end: z
16
- .union([z.string(), z.number(), z.date()])
16
+ .union([z.string(), z.number()])
17
17
  .optional()
18
- .describe("Inclusive end of the interval. Accepts ISO string, unix timestamp (ms), or Date object. Converted to unix ms for /api/activities (default: now)."),
18
+ .describe("Inclusive end of the interval. Accepts ISO string or unix timestamp (ms). Converted to unix ms for /api/activities (default: now)."),
19
19
  categories: z
20
20
  .string()
21
21
  .describe("Comma-separated list of activity categories. Supported values: 'CustomFieldCategory', 'CommentsCategory', 'AttachmentsCategory', 'LinksCategory', 'VcsChangeActivityCategory', 'WorkItemsActivityCategory'."),
@@ -4,7 +4,7 @@ import { processWithFileStorage } from "../utils/file-storage.js";
4
4
  import { DEFAULT_FILE_STORAGE_FORMAT, fileStorageArgs } from "../utils/tool-args.js";
5
5
  import { createToolHandler } from "../utils/tool-handler.js";
6
6
  import { READ_ONLY_ANNOTATIONS } from "../utils/tool-annotations.js";
7
- const sharedDate = z.union([z.string().regex(/^\d{4}-\d{2}-\d{2}$/), z.number(), z.date()]);
7
+ const sharedDate = z.union([z.string().regex(/^\d{4}-\d{2}-\d{2}$/), z.number()]);
8
8
  const reportBaseArgs = {
9
9
  author: z.string().optional().describe("Work item author login"),
10
10
  issueId: z.string().optional().describe("Issue code"),
@@ -11,8 +11,8 @@ declare const baseFilterArgs: {
11
11
  overwrite: z.ZodOptional<z.ZodBoolean>;
12
12
  issueId: z.ZodOptional<z.ZodString>;
13
13
  author: z.ZodOptional<z.ZodString>;
14
- startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
15
- endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
14
+ startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
15
+ endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
16
16
  allUsers: z.ZodOptional<z.ZodBoolean>;
17
17
  limit: z.ZodDefault<z.ZodNumber>;
18
18
  skip: z.ZodDefault<z.ZodNumber>;
@@ -28,8 +28,8 @@ export declare const workItemsListSchema: z.ZodObject<{
28
28
  overwrite: z.ZodOptional<z.ZodBoolean>;
29
29
  issueId: z.ZodOptional<z.ZodString>;
30
30
  author: z.ZodOptional<z.ZodString>;
31
- startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
32
- endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
31
+ startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
32
+ endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
33
33
  allUsers: z.ZodOptional<z.ZodBoolean>;
34
34
  limit: z.ZodDefault<z.ZodNumber>;
35
35
  skip: z.ZodDefault<z.ZodNumber>;
@@ -45,8 +45,8 @@ declare const workItemsForUsersArgs: {
45
45
  overwrite: z.ZodOptional<z.ZodBoolean>;
46
46
  issueId: z.ZodOptional<z.ZodString>;
47
47
  author: z.ZodOptional<z.ZodString>;
48
- startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
49
- endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodDate]>>;
48
+ startDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
49
+ endDate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
50
50
  allUsers: z.ZodOptional<z.ZodBoolean>;
51
51
  limit: z.ZodDefault<z.ZodNumber>;
52
52
  skip: z.ZodDefault<z.ZodNumber>;
@@ -10,7 +10,7 @@ const isoDate = z
10
10
  .string()
11
11
  .regex(/^\d{4}-\d{2}-\d{2}$/)
12
12
  .describe("Date in YYYY-MM-DD format");
13
- const dateInput = z.union([isoDate, z.number(), z.date()]);
13
+ const dateInput = z.union([isoDate, z.number()]);
14
14
  const baseFilterArgs = {
15
15
  issueId: issueIdSchema.optional().describe("Issue code (e.g., PROJ-123)"),
16
16
  author: userLoginSchema.optional().describe("Work item author login"),
package/package.json CHANGED
@@ -1,20 +1,19 @@
1
1
  {
2
2
  "name": "@vitalyostanin/youtrack-mcp",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "scripts": {
5
- "build": "tsc -p tsconfig.json",
6
- "postbuild": "chmod +x dist/index.js",
7
- "dev": "tsc -p tsconfig.json --watch",
5
+ "build": "tsc -p tsconfig.build.json",
6
+ "postbuild": "chmod +x dist/index.js && cp package.json dist/package.json",
7
+ "dev": "tsc -p tsconfig.build.json --watch",
8
8
  "start": "node dist/index.js",
9
- "dev:watch": "tsc -p tsconfig.json --watch",
9
+ "typecheck": "tsc -p tsconfig.json",
10
10
  "lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",
11
11
  "lint:fix": "eslint . --fix --cache --cache-location node_modules/.cache/eslint/",
12
- "format": "eslint . --fix --cache --cache-location node_modules/.cache/eslint/",
13
- "typecheck": "tsc -p tsconfig.json --noEmit",
14
- "test": "vitest run",
12
+ "format": "npm run --silent lint:fix",
13
+ "test": "timeout 600 vitest run",
15
14
  "test:watch": "vitest",
16
- "test:coverage": "vitest run --coverage",
17
- "prepublishOnly": "npm run lint && npm test && npm run build"
15
+ "test:coverage": "timeout 600 vitest run --coverage",
16
+ "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm audit --omit=dev --audit-level=high && npm run build"
18
17
  },
19
18
  "keywords": [
20
19
  "mcp",
@@ -31,8 +30,10 @@
31
30
  "description": "MCP server for comprehensive YouTrack integration: issues, work items with reports, user activity search, knowledge base, projects and users",
32
31
  "type": "module",
33
32
  "engines": {
34
- "node": ">=22.13.0"
33
+ "node": ">=22.13.0",
34
+ "npm": ">=10.0.0"
35
35
  },
36
+ "packageManager": "npm@11.12.1",
36
37
  "bin": {
37
38
  "youtrack-mcp": "dist/index.js"
38
39
  },
@@ -49,7 +50,8 @@
49
50
  "dist/**/*.d.ts",
50
51
  "dist/**/*.json",
51
52
  "README.md",
52
- "README-ru.md"
53
+ "README-ru.md",
54
+ "LICENSE"
53
55
  ],
54
56
  "publishConfig": {
55
57
  "access": "public"
@@ -75,7 +77,6 @@
75
77
  "nock": "^14.0.14",
76
78
  "typescript": "^6.0.3",
77
79
  "typescript-eslint": "^8.59.2",
78
- "vitest": "^4.1.5",
79
- "zod-to-json-schema": "^3.25.2"
80
+ "vitest": "^4.1.5"
80
81
  }
81
82
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=config.test.d.ts.map
@@ -1,47 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach } from "vitest";
2
- import { mkdtempSync, rmSync, existsSync } from "node:fs";
3
- import { tmpdir } from "node:os";
4
- import { join, resolve } from "node:path";
5
- import { loadConfig, enrichConfigWithRedaction } from "../config.js";
6
- describe("loadConfig", () => {
7
- let tmp;
8
- const oldEnv = { ...process.env };
9
- beforeEach(() => {
10
- tmp = mkdtempSync(join(tmpdir(), "yt-cfg-"));
11
- process.env = {
12
- YOUTRACK_URL: "https://yt.example.com",
13
- YOUTRACK_TOKEN: "perm:test-token",
14
- };
15
- });
16
- afterEach(() => {
17
- rmSync(tmp, { recursive: true, force: true });
18
- process.env = { ...oldEnv };
19
- });
20
- it("uses cwd by default for outputDir", () => {
21
- const cfg = loadConfig();
22
- expect(cfg.outputDir).toBe(resolve(process.cwd()));
23
- });
24
- it("honors YOUTRACK_OUTPUT_DIR", () => {
25
- process.env.YOUTRACK_OUTPUT_DIR = tmp;
26
- const cfg = loadConfig();
27
- expect(cfg.outputDir).toBe(resolve(tmp));
28
- });
29
- it("creates outputDir if missing", () => {
30
- const sub = join(tmp, "missing-subdir");
31
- process.env.YOUTRACK_OUTPUT_DIR = sub;
32
- loadConfig();
33
- expect(existsSync(sub)).toBe(true);
34
- });
35
- it("throws when YOUTRACK_TOKEN is missing", () => {
36
- delete process.env.YOUTRACK_TOKEN;
37
- expect(() => loadConfig()).toThrow();
38
- });
39
- it("redacts token via enrichConfigWithRedaction", () => {
40
- const cfg = loadConfig();
41
- const redacted = enrichConfigWithRedaction(cfg);
42
- expect(redacted.hasToken).toBe(true);
43
- expect(redacted.token).toBeUndefined();
44
- expect(redacted.outputDir).toBe(cfg.outputDir);
45
- });
46
- });
47
- //# sourceMappingURL=config.test.js.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=setup.d.ts.map
@@ -1,12 +0,0 @@
1
- import { afterAll, afterEach, beforeAll } from "vitest";
2
- import nock from "nock";
3
- beforeAll(() => {
4
- nock.disableNetConnect();
5
- });
6
- afterEach(() => {
7
- nock.cleanAll();
8
- });
9
- afterAll(() => {
10
- nock.enableNetConnect();
11
- });
12
- //# sourceMappingURL=setup.js.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=smoke.test.d.ts.map
@@ -1,7 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- describe("smoke", () => {
3
- it("vitest is wired", () => {
4
- expect(1 + 1).toBe(2);
5
- });
6
- });
7
- //# sourceMappingURL=smoke.test.js.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=youtrack-client.delete-link.test.d.ts.map
@@ -1,93 +0,0 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import { YoutrackClient } from "../youtrack-client.js";
3
- const config = {
4
- baseUrl: "https://yt.test",
5
- token: "perm:test",
6
- defaultProject: "BC",
7
- outputDir: "/tmp",
8
- timezone: "UTC",
9
- };
10
- function getHttp(client) {
11
- return client.http;
12
- }
13
- function methodNotAllowed() {
14
- return {
15
- isAxiosError: true,
16
- message: "Request failed with status code 405",
17
- response: { status: 405, data: { error: "method_not_allowed" } },
18
- };
19
- }
20
- describe("deleteIssueLink subtask fallback", () => {
21
- it("uses linkToDelete.issue.idReadable when targetId is missing", async () => {
22
- const client = new YoutrackClient(config);
23
- const http = getHttp(client);
24
- vi.spyOn(http, "delete").mockRejectedValue(methodNotAllowed());
25
- vi.spyOn(client, "getIssueLinks").mockResolvedValue({
26
- issueId: "BC-1",
27
- links: [
28
- {
29
- id: "L1",
30
- direction: "OUTWARD",
31
- linkType: { name: "Subtask", id: "lt-sub" },
32
- issue: { idReadable: "BC-99", id: "1-99", summary: "s" },
33
- },
34
- ],
35
- });
36
- let captured;
37
- vi.spyOn(http, "post").mockImplementation((...args) => {
38
- captured = { url: String(args[0]), body: args[1] };
39
- return Promise.resolve({ data: {} });
40
- });
41
- await client.deleteIssueLink({ issueId: "BC-1", linkId: "L1" });
42
- expect(captured?.url).toBe("/api/commands");
43
- expect(captured?.body.query).toBe("remove subtask of BC-99");
44
- const issues = captured?.body.issues;
45
- expect(issues[0].idReadable).toBe("BC-1");
46
- });
47
- it("uses provided targetId when given (regular link)", async () => {
48
- const client = new YoutrackClient(config);
49
- const http = getHttp(client);
50
- vi.spyOn(http, "delete").mockRejectedValue(methodNotAllowed());
51
- vi.spyOn(client, "getIssueLinks").mockResolvedValue({
52
- issueId: "BC-1",
53
- links: [
54
- {
55
- id: "L1",
56
- direction: "OUTWARD",
57
- linkType: {
58
- name: "Relates",
59
- id: "lt-rel",
60
- outwardName: "relates to",
61
- inwardName: "relates to",
62
- },
63
- issue: { idReadable: "BC-99", id: "1-99", summary: "s" },
64
- },
65
- ],
66
- });
67
- let captured;
68
- vi.spyOn(http, "post").mockImplementation((...args) => {
69
- captured = { body: args[1] };
70
- return Promise.resolve({ data: {} });
71
- });
72
- await client.deleteIssueLink({ issueId: "BC-1", linkId: "L1", targetId: "BC-7" });
73
- expect(String(captured?.body.query)).toContain("BC-7");
74
- });
75
- it("throws when neither input.targetId nor link payload provide a target", async () => {
76
- const client = new YoutrackClient(config);
77
- const http = getHttp(client);
78
- vi.spyOn(http, "delete").mockRejectedValue(methodNotAllowed());
79
- vi.spyOn(client, "getIssueLinks").mockResolvedValue({
80
- issueId: "BC-1",
81
- links: [
82
- {
83
- id: "L1",
84
- direction: "OUTWARD",
85
- linkType: { name: "Subtask", id: "lt-sub" },
86
- issue: { idReadable: "", id: "1-99", summary: "s" },
87
- },
88
- ],
89
- });
90
- await expect(client.deleteIssueLink({ issueId: "BC-1", linkId: "L1" })).rejects.toThrow(/Cannot determine target issue id/);
91
- });
92
- });
93
- //# sourceMappingURL=youtrack-client.delete-link.test.js.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=youtrack-client.normalize-error.test.d.ts.map