@lionad/port-key-mcp 0.3.0 → 0.4.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 (46) hide show
  1. package/README.md +81 -29
  2. package/dist/config/index.d.ts +26 -0
  3. package/dist/config/index.js +24 -0
  4. package/dist/config/index.js.map +1 -0
  5. package/dist/logger.d.ts +7 -0
  6. package/dist/logger.js +48 -0
  7. package/dist/logger.js.map +1 -0
  8. package/dist/mcp-cli.js +84 -12
  9. package/dist/mcp-cli.js.map +1 -1
  10. package/dist/mcp-server.d.ts +16 -2
  11. package/dist/mcp-server.js +250 -92
  12. package/dist/mcp-server.js.map +1 -1
  13. package/dist/resources/index.d.ts +13 -0
  14. package/dist/resources/index.js +5 -0
  15. package/dist/resources/index.js.map +1 -0
  16. package/dist/resources/port-mapping-config.d.ts +13 -0
  17. package/dist/resources/port-mapping-config.js +22 -0
  18. package/dist/resources/port-mapping-config.js.map +1 -0
  19. package/dist/resources/project-port-history.d.ts +15 -0
  20. package/dist/resources/project-port-history.js +30 -0
  21. package/dist/resources/project-port-history.js.map +1 -0
  22. package/dist/session-manager.d.ts +35 -0
  23. package/dist/session-manager.js +66 -0
  24. package/dist/session-manager.js.map +1 -0
  25. package/dist/tools/check-port-availability.d.ts +25 -0
  26. package/dist/tools/check-port-availability.js +65 -0
  27. package/dist/tools/check-port-availability.js.map +1 -0
  28. package/dist/tools/get-design-philosophy.d.ts +24 -0
  29. package/dist/tools/get-design-philosophy.js +52 -0
  30. package/dist/tools/get-design-philosophy.js.map +1 -0
  31. package/dist/tools/get-port-occupancy.d.ts +25 -0
  32. package/dist/tools/get-port-occupancy.js +69 -0
  33. package/dist/tools/get-port-occupancy.js.map +1 -0
  34. package/dist/tools/index.d.ts +94 -0
  35. package/dist/tools/index.js +11 -0
  36. package/dist/tools/index.js.map +1 -0
  37. package/dist/tools/map-project-name-to-port.d.ts +27 -0
  38. package/dist/tools/map-project-name-to-port.js +51 -0
  39. package/dist/tools/map-project-name-to-port.js.map +1 -0
  40. package/dist/utils/logger.d.ts +7 -0
  41. package/dist/utils/logger.js +55 -0
  42. package/dist/utils/logger.js.map +1 -0
  43. package/dist/utils/session-manager.d.ts +35 -0
  44. package/dist/utils/session-manager.js +66 -0
  45. package/dist/utils/session-manager.js.map +1 -0
  46. package/package.json +11 -5
@@ -0,0 +1,65 @@
1
+ import { z } from "zod";
2
+ import { exec } from "child_process";
3
+ import { promisify } from "util";
4
+ const execAsync = promisify(exec);
5
+ export const checkPortAvailabilityTool = {
6
+ name: "check-port-availability",
7
+ title: "Check Port Availability",
8
+ isLocal: true,
9
+ description: "Check if a specific port is available or occupied on the local machine. This tool executes local system commands (lsof) and will not work in cloud/serverless environments.",
10
+ inputSchema: {
11
+ port: z.number().int().min(0).max(65535),
12
+ },
13
+ execute: async ({ port }) => {
14
+ try {
15
+ // Use lsof to check port usage (works on macOS/Linux)
16
+ // For Windows, netstat might be needed, but assuming macOS environment as per context
17
+ try {
18
+ await execAsync(`lsof -i :${port}`);
19
+ // If lsof returns success (exit code 0), the port is occupied
20
+ return {
21
+ content: [
22
+ {
23
+ type: "text",
24
+ text: JSON.stringify({
25
+ port,
26
+ available: false,
27
+ status: "occupied",
28
+ message: `Port ${port} is currently in use.`,
29
+ }, null, 2),
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ catch (error) {
35
+ // If lsof returns error (exit code 1), the port is likely free
36
+ return {
37
+ content: [
38
+ {
39
+ type: "text",
40
+ text: JSON.stringify({
41
+ port,
42
+ available: true,
43
+ status: "available",
44
+ message: `Port ${port} appears to be available.`,
45
+ }, null, 2),
46
+ },
47
+ ],
48
+ };
49
+ }
50
+ }
51
+ catch (error) {
52
+ const errorMessage = error instanceof Error ? error.message : String(error);
53
+ return {
54
+ content: [
55
+ {
56
+ type: "text",
57
+ text: JSON.stringify({ error: errorMessage }),
58
+ },
59
+ ],
60
+ isError: true,
61
+ };
62
+ }
63
+ }
64
+ };
65
+ //# sourceMappingURL=check-port-availability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-port-availability.js","sourceRoot":"","sources":["../../src/tools/check-port-availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,yBAAyB;IAChC,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,6KAA6K;IAC1L,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;KACzC;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAoB,EAAE,EAAE;QAC5C,IAAI,CAAC;YACH,sDAAsD;YACtD,sFAAsF;YACtF,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;gBACpC,8DAA8D;gBAC9D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gCACnB,IAAI;gCACJ,SAAS,EAAE,KAAK;gCAChB,MAAM,EAAE,UAAU;gCAClB,OAAO,EAAE,QAAQ,IAAI,uBAAuB;6BAC7C,EAAE,IAAI,EAAE,CAAC,CAAC;yBACZ;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,+DAA+D;gBAC/D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gCACnB,IAAI;gCACJ,SAAS,EAAE,IAAI;gCACf,MAAM,EAAE,WAAW;gCACnB,OAAO,EAAE,QAAQ,IAAI,2BAA2B;6BACjD,EAAE,IAAI,EAAE,CAAC,CAAC;yBACZ;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;qBAC9C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ export declare const getDesignPhilosophyTool: {
3
+ name: string;
4
+ title: string;
5
+ description: string;
6
+ inputSchema: {
7
+ lang: z.ZodDefault<z.ZodEnum<{
8
+ [x: string]: string;
9
+ }>>;
10
+ };
11
+ execute: ({ lang }: any) => Promise<{
12
+ content: {
13
+ type: string;
14
+ text: string;
15
+ }[];
16
+ isError?: undefined;
17
+ } | {
18
+ content: {
19
+ type: string;
20
+ text: string;
21
+ }[];
22
+ isError: boolean;
23
+ }>;
24
+ };
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { readFile } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ const SUPPORTED_LANGUAGES = ["cn", "es", "fr", "de", "ja", "ko", "ru", "ar", "pt", "it"];
8
+ async function loadLocale(lang) {
9
+ const localePath = join(__dirname, "..", "..", "locales", `${lang}.json`);
10
+ try {
11
+ const content = await readFile(localePath, "utf-8");
12
+ const locale = JSON.parse(content);
13
+ return locale.designPhilosophy || "";
14
+ }
15
+ catch {
16
+ return "";
17
+ }
18
+ }
19
+ export const getDesignPhilosophyTool = {
20
+ name: "get-design-philosophy",
21
+ title: "Get PortKey Design Philosophy",
22
+ description: "Get design philosophy and background of PortKey",
23
+ inputSchema: {
24
+ lang: z.enum([...SUPPORTED_LANGUAGES]).default("cn"),
25
+ },
26
+ execute: async ({ lang = "cn" }) => {
27
+ try {
28
+ const philosophy = await loadLocale(lang);
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text",
33
+ text: philosophy,
34
+ },
35
+ ],
36
+ };
37
+ }
38
+ catch (error) {
39
+ const errorMessage = error && typeof error === "object" && "message" in error ? String(error.message) : String(error);
40
+ return {
41
+ content: [
42
+ {
43
+ type: "text",
44
+ text: JSON.stringify({ error: errorMessage }),
45
+ },
46
+ ],
47
+ isError: true,
48
+ };
49
+ }
50
+ }
51
+ };
52
+ //# sourceMappingURL=get-design-philosophy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-design-philosophy.js","sourceRoot":"","sources":["../../src/tools/get-design-philosophy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC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;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;qBAC9C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ export declare const getPortOccupancyTool: {
3
+ name: string;
4
+ title: string;
5
+ isLocal: boolean;
6
+ description: string;
7
+ inputSchema: {
8
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
9
+ };
10
+ execute: ({ ports }: {
11
+ ports?: number[];
12
+ }) => Promise<{
13
+ content: {
14
+ type: string;
15
+ text: string;
16
+ }[];
17
+ isError?: undefined;
18
+ } | {
19
+ content: {
20
+ type: string;
21
+ text: string;
22
+ }[];
23
+ isError: boolean;
24
+ }>;
25
+ };
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ import { exec } from "child_process";
3
+ import { promisify } from "util";
4
+ const execAsync = promisify(exec);
5
+ export const getPortOccupancyTool = {
6
+ name: "get-port-occupancy",
7
+ title: "Get Port Occupancy",
8
+ isLocal: true,
9
+ description: "Get information about processes occupying specific ports on the local machine. This tool executes local system commands (lsof) and will not work in cloud/serverless environments.",
10
+ inputSchema: {
11
+ ports: z.array(z.number().int().min(0).max(65535)).optional(),
12
+ },
13
+ execute: async ({ ports }) => {
14
+ try {
15
+ let command = "lsof -i -P -n";
16
+ if (ports && ports.length > 0) {
17
+ // Filter for specific ports if provided
18
+ // lsof doesn't support multiple ports easily in one go for -i without complex syntax
19
+ // So we'll fetch all and filter in JS, or construct a grep chain
20
+ // Fetching all listening ports is usually fast enough
21
+ }
22
+ const { stdout } = await execAsync(command);
23
+ const lines = stdout.split('\n').filter(line => line.trim() !== '');
24
+ const processes = [];
25
+ // Parse lsof output
26
+ // COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
27
+ for (let i = 1; i < lines.length; i++) {
28
+ const parts = lines[i].replace(/\s+/g, ' ').split(' ');
29
+ if (parts.length >= 9) {
30
+ const namePart = parts.slice(8).join(' ');
31
+ const portMatch = namePart.match(/:(\d+)/);
32
+ if (portMatch) {
33
+ const port = parseInt(portMatch[1], 10);
34
+ if (!ports || ports.includes(port)) {
35
+ processes.push({
36
+ command: parts[0],
37
+ pid: parts[1],
38
+ user: parts[2],
39
+ port,
40
+ details: namePart
41
+ });
42
+ }
43
+ }
44
+ }
45
+ }
46
+ return {
47
+ content: [
48
+ {
49
+ type: "text",
50
+ text: JSON.stringify(processes, null, 2),
51
+ },
52
+ ],
53
+ };
54
+ }
55
+ catch (error) {
56
+ const errorMessage = error instanceof Error ? error.message : String(error);
57
+ return {
58
+ content: [
59
+ {
60
+ type: "text",
61
+ text: JSON.stringify({ error: errorMessage }),
62
+ },
63
+ ],
64
+ isError: true,
65
+ };
66
+ }
67
+ }
68
+ };
69
+ //# sourceMappingURL=get-port-occupancy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-port-occupancy.js","sourceRoot":"","sources":["../../src/tools/get-port-occupancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,oLAAoL;IACjM,WAAW,EAAE;QACX,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC9D;IACD,OAAO,EAAE,KAA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,CAAC,CAAC,CAAC;gCACjB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;gCACb,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gCACd,IAAI;gCACJ,OAAO,EAAE,QAAQ;6BAClB,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;qBACzC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;qBAC9C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,94 @@
1
+ export declare const tools: ({
2
+ name: string;
3
+ title: string;
4
+ description: string;
5
+ inputSchema: {
6
+ projectName: import("zod").ZodString;
7
+ map: import("zod").ZodOptional<import("zod").ZodString>;
8
+ preferDigitCount: import("zod").ZodOptional<import("zod").ZodNumber>;
9
+ minPort: import("zod").ZodOptional<import("zod").ZodNumber>;
10
+ maxPort: import("zod").ZodOptional<import("zod").ZodNumber>;
11
+ blockedPorts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodNumber>>;
12
+ };
13
+ execute: ({ projectName, map, preferDigitCount, minPort, maxPort, blockedPorts }: any) => Promise<{
14
+ content: {
15
+ type: string;
16
+ text: string;
17
+ }[];
18
+ isError?: undefined;
19
+ } | {
20
+ content: {
21
+ type: string;
22
+ text: string;
23
+ }[];
24
+ isError: boolean;
25
+ }>;
26
+ } | {
27
+ name: string;
28
+ title: string;
29
+ description: string;
30
+ inputSchema: {
31
+ lang: import("zod").ZodDefault<import("zod").ZodEnum<{
32
+ [x: string]: string;
33
+ }>>;
34
+ };
35
+ execute: ({ lang }: any) => Promise<{
36
+ content: {
37
+ type: string;
38
+ text: string;
39
+ }[];
40
+ isError?: undefined;
41
+ } | {
42
+ content: {
43
+ type: string;
44
+ text: string;
45
+ }[];
46
+ isError: boolean;
47
+ }>;
48
+ } | {
49
+ name: string;
50
+ title: string;
51
+ isLocal: boolean;
52
+ description: string;
53
+ inputSchema: {
54
+ port: import("zod").ZodNumber;
55
+ };
56
+ execute: ({ port }: {
57
+ port: number;
58
+ }) => Promise<{
59
+ content: {
60
+ type: string;
61
+ text: string;
62
+ }[];
63
+ isError?: undefined;
64
+ } | {
65
+ content: {
66
+ type: string;
67
+ text: string;
68
+ }[];
69
+ isError: boolean;
70
+ }>;
71
+ } | {
72
+ name: string;
73
+ title: string;
74
+ isLocal: boolean;
75
+ description: string;
76
+ inputSchema: {
77
+ ports: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodNumber>>;
78
+ };
79
+ execute: ({ ports }: {
80
+ ports?: number[];
81
+ }) => Promise<{
82
+ content: {
83
+ type: string;
84
+ text: string;
85
+ }[];
86
+ isError?: undefined;
87
+ } | {
88
+ content: {
89
+ type: string;
90
+ text: string;
91
+ }[];
92
+ isError: boolean;
93
+ }>;
94
+ })[];
@@ -0,0 +1,11 @@
1
+ import { mapProjectNameToPortTool } from './map-project-name-to-port.js';
2
+ import { getDesignPhilosophyTool } from './get-design-philosophy.js';
3
+ import { checkPortAvailabilityTool } from './check-port-availability.js';
4
+ import { getPortOccupancyTool } from './get-port-occupancy.js';
5
+ export const tools = [
6
+ mapProjectNameToPortTool,
7
+ getDesignPhilosophyTool,
8
+ checkPortAvailabilityTool,
9
+ getPortOccupancyTool,
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,wBAAwB;IACxB,uBAAuB;IACvB,yBAAyB;IACzB,oBAAoB;CACrB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ export declare const mapProjectNameToPortTool: {
3
+ name: string;
4
+ title: string;
5
+ description: string;
6
+ inputSchema: {
7
+ projectName: z.ZodString;
8
+ map: z.ZodOptional<z.ZodString>;
9
+ preferDigitCount: z.ZodOptional<z.ZodNumber>;
10
+ minPort: z.ZodOptional<z.ZodNumber>;
11
+ maxPort: z.ZodOptional<z.ZodNumber>;
12
+ blockedPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
13
+ };
14
+ execute: ({ projectName, map, preferDigitCount, minPort, maxPort, blockedPorts }: any) => Promise<{
15
+ content: {
16
+ type: string;
17
+ text: string;
18
+ }[];
19
+ isError?: undefined;
20
+ } | {
21
+ content: {
22
+ type: string;
23
+ text: string;
24
+ }[];
25
+ isError: boolean;
26
+ }>;
27
+ };
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import { mapToPort } from "@lionad/port-key";
3
+ export const mapProjectNameToPortTool = {
4
+ name: "map-project-name-to-port",
5
+ title: "Map Project Name to Port",
6
+ description: "Map a project name to a port number using keyboard-based letter-to-number mapping",
7
+ inputSchema: {
8
+ projectName: z.string().min(1),
9
+ map: z.string().optional(),
10
+ preferDigitCount: z.number().int().min(2).max(5).optional(),
11
+ minPort: z.number().int().min(0).max(65535).optional(),
12
+ maxPort: z.number().int().min(0).max(65535).optional(),
13
+ blockedPorts: z.array(z.number().int().min(0).max(65535)).optional(),
14
+ },
15
+ execute: async ({ projectName, map, preferDigitCount, minPort, maxPort, blockedPorts }) => {
16
+ try {
17
+ let customMap = undefined;
18
+ if (map && map !== "") {
19
+ customMap = JSON.parse(map);
20
+ }
21
+ const options = {
22
+ preferDigitCount,
23
+ minPort,
24
+ maxPort,
25
+ blockedPorts: blockedPorts ? new Set(blockedPorts) : undefined,
26
+ };
27
+ const result = mapToPort(projectName, customMap, options);
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: JSON.stringify(result, null, 2),
33
+ },
34
+ ],
35
+ };
36
+ }
37
+ catch (error) {
38
+ const errorMessage = error && typeof error === "object" && "message" in error ? String(error.message) : String(error);
39
+ return {
40
+ content: [
41
+ {
42
+ type: "text",
43
+ text: JSON.stringify({ error: errorMessage }),
44
+ },
45
+ ],
46
+ isError: true,
47
+ };
48
+ }
49
+ }
50
+ };
51
+ //# sourceMappingURL=map-project-name-to-port.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-project-name-to-port.js","sourceRoot":"","sources":["../../src/tools/map-project-name-to-port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,mFAAmF;IAChG,WAAW,EAAE;QACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC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;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;qBAC9C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import winston from 'winston';
2
+ interface CustomLogger extends winston.Logger {
3
+ getLevel(): string;
4
+ setLevel(level: string): void;
5
+ }
6
+ declare const logger: CustomLogger;
7
+ export default logger;
@@ -0,0 +1,55 @@
1
+ import winston from 'winston';
2
+ import DailyRotateFile from 'winston-daily-rotate-file';
3
+ import config from '../config/index.js';
4
+ import { homedir } from 'os';
5
+ import { existsSync, mkdirSync } from 'fs';
6
+ import { join } from 'path';
7
+ const LOG_DIR = join(homedir(), '.port-key', 'logs');
8
+ if (!existsSync(LOG_DIR)) {
9
+ mkdirSync(LOG_DIR, { recursive: true });
10
+ }
11
+ const logger = winston.createLogger({
12
+ level: config.logging.level,
13
+ format: winston.format.combine(winston.format.timestamp(), winston.format.errors({ stack: true }), winston.format.json()),
14
+ transports: [
15
+ new DailyRotateFile({
16
+ filename: join(LOG_DIR, 'error-%DATE%.log'),
17
+ datePattern: 'YYYY-MM-DD',
18
+ zippedArchive: true,
19
+ maxSize: '10m',
20
+ maxFiles: '14d',
21
+ level: 'error',
22
+ }),
23
+ new DailyRotateFile({
24
+ filename: join(LOG_DIR, 'combined-%DATE%.log'),
25
+ datePattern: 'YYYY-MM-DD',
26
+ zippedArchive: true,
27
+ maxSize: '1',
28
+ maxFiles: '14d',
29
+ }),
30
+ ],
31
+ });
32
+ if (process.env.NODE_ENV !== 'production') {
33
+ logger.add(new winston.transports.Console({
34
+ format: winston.format.combine(winston.format.colorize(), winston.format.printf(({ timestamp, level, message, ...rest }) => {
35
+ let args = '';
36
+ if (typeof message === 'object') {
37
+ args = JSON.stringify(message, null, 2);
38
+ message = '';
39
+ }
40
+ const extraArgs = Object.keys(rest).length
41
+ ? JSON.stringify(rest, null, 2)
42
+ : '';
43
+ return `${timestamp} ${level}: ${message} ${args} ${extraArgs}`.trim();
44
+ })),
45
+ }));
46
+ }
47
+ logger.getLevel = () => logger.level;
48
+ logger.setLevel = (level) => {
49
+ logger.level = level;
50
+ logger.transports.forEach((transport) => {
51
+ transport.level = level;
52
+ });
53
+ };
54
+ export default logger;
55
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AAErD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAOD,MAAM,MAAM,GAAiB,OAAO,CAAC,YAAY,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;IAC3B,MAAM,EAAE,OAAO,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M,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;gBACxC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/B,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,GAAG,SAAS,IAAI,KAAK,KAAK,OAAO,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC;QACzE,CAAC,CAAC,CACH;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,QAAQ,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,KAAe,CAAC;AACvD,MAAM,CAAC,QAAQ,GAAG,CAAC,KAAa,EAAQ,EAAE;IACxC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QACtC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,35 @@
1
+ interface SessionOptions {
2
+ ttl: number;
3
+ timeout: number;
4
+ }
5
+ export declare class SessionManager<T> {
6
+ private sessions;
7
+ private options;
8
+ private cleanupInterval;
9
+ constructor(options?: SessionOptions);
10
+ /**
11
+ * Set a session with the given ID and data
12
+ */
13
+ set(id: string, data: T): void;
14
+ /**
15
+ * Get a session by ID. Updates the expiration time (sliding window).
16
+ */
17
+ get(id: string): T | undefined;
18
+ /**
19
+ * Remove a session by ID
20
+ */
21
+ remove(id: string): void;
22
+ /**
23
+ * Get the number of active sessions
24
+ */
25
+ get size(): number;
26
+ /**
27
+ * Cleanup expired sessions
28
+ */
29
+ private cleanup;
30
+ /**
31
+ * Stop the cleanup interval and clear all sessions
32
+ */
33
+ destroy(): void;
34
+ }
35
+ export {};
@@ -0,0 +1,66 @@
1
+ import config from '../config/index.js';
2
+ export class SessionManager {
3
+ sessions;
4
+ options;
5
+ cleanupInterval;
6
+ constructor(options = config.session) {
7
+ this.sessions = new Map();
8
+ this.options = options;
9
+ // Cleanup every minute to remove expired sessions
10
+ this.cleanupInterval = setInterval(() => this.cleanup(), 60000);
11
+ }
12
+ /**
13
+ * Set a session with the given ID and data
14
+ */
15
+ set(id, data) {
16
+ const expiresAt = Date.now() + this.options.ttl * 1000;
17
+ this.sessions.set(id, { data, expiresAt });
18
+ }
19
+ /**
20
+ * Get a session by ID. Updates the expiration time (sliding window).
21
+ */
22
+ get(id) {
23
+ const session = this.sessions.get(id);
24
+ if (!session)
25
+ return undefined;
26
+ // Check if expired
27
+ if (Date.now() > session.expiresAt) {
28
+ this.sessions.delete(id);
29
+ return undefined;
30
+ }
31
+ // Refresh expiration
32
+ session.expiresAt = Date.now() + this.options.ttl * 1000;
33
+ return session.data;
34
+ }
35
+ /**
36
+ * Remove a session by ID
37
+ */
38
+ remove(id) {
39
+ this.sessions.delete(id);
40
+ }
41
+ /**
42
+ * Get the number of active sessions
43
+ */
44
+ get size() {
45
+ return this.sessions.size;
46
+ }
47
+ /**
48
+ * Cleanup expired sessions
49
+ */
50
+ cleanup() {
51
+ const now = Date.now();
52
+ for (const [id, session] of this.sessions.entries()) {
53
+ if (now > session.expiresAt) {
54
+ this.sessions.delete(id);
55
+ }
56
+ }
57
+ }
58
+ /**
59
+ * Stop the cleanup interval and clear all sessions
60
+ */
61
+ destroy() {
62
+ clearInterval(this.cleanupInterval);
63
+ this.sessions.clear();
64
+ }
65
+ }
66
+ //# sourceMappingURL=session-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-manager.js","sourceRoot":"","sources":["../../src/utils/session-manager.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAYxC,MAAM,OAAO,cAAc;IACjB,QAAQ,CAAiC;IACzC,OAAO,CAAiB;IACxB,eAAe,CAAiB;IAExC,YAAY,UAA0B,MAAM,CAAC,OAAO;QAClD,IAAI,CAAC,QAA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,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACpD,IAAI,GAAG,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;gBAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,OAAO;QACL,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionad/port-key-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.4.2",
4
4
  "description": "MCP Server for PortKey",
5
5
  "bin": "./bin/port-key-mcp.js",
6
6
  "type": "module",
@@ -46,14 +46,20 @@
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
48
  "dependencies": {
49
- "@lionad/port-key": "^0.1.5",
50
- "@modelcontextprotocol/sdk": "^1.24.1",
51
- "zod": "^4.1.13"
49
+ "@fastify/cors": "^11.2.0",
50
+ "@lionad/port-key": "^0.3.0",
51
+ "@modelcontextprotocol/sdk": "^1.25.2",
52
+ "dotenv": "^17.2.3",
53
+ "fastify": "^5.6.2",
54
+ "winston": "^3.19.0",
55
+ "winston-daily-rotate-file": "^5.0.0",
56
+ "zod": "^4.3.5"
52
57
  },
53
58
  "devDependencies": {
54
59
  "@cfworker/json-schema": "^4.1.1",
60
+ "@types/dotenv": "^8.2.3",
55
61
  "@types/express": "^5.0.6",
56
- "@types/node": "^24.7.2",
62
+ "@types/node": "^24.10.7",
57
63
  "vitest": "4.0.16"
58
64
  },
59
65
  "scripts": {