@mondaydotcomorg/monday-api-mcp 1.0.0 → 1.0.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.
package/dist/index.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
8
|
+
const mcp_1 = require("@mondaydotcomorg/agent-toolkit/mcp");
|
|
9
|
+
const args_service_js_1 = require("./utils/args/args.service.js");
|
|
10
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
11
|
+
dotenv_1.default.config();
|
|
7
12
|
/**
|
|
8
13
|
* Initializes and starts the MCP server with the Monday Agent Toolkit
|
|
9
14
|
* Uses stdio for transport
|
|
10
15
|
*/
|
|
11
16
|
async function runServer() {
|
|
12
17
|
const args = process.argv.slice(2);
|
|
13
|
-
const parsedArgs = parseArgs(args);
|
|
14
|
-
const validatedArgs = validateArgs(parsedArgs);
|
|
15
|
-
const toolkit = new MondayAgentToolkit({
|
|
18
|
+
const parsedArgs = (0, args_service_js_1.parseArgs)(args);
|
|
19
|
+
const validatedArgs = (0, args_service_js_1.validateArgs)(parsedArgs);
|
|
20
|
+
const toolkit = new mcp_1.MondayAgentToolkit({
|
|
16
21
|
mondayApiToken: validatedArgs.token,
|
|
17
22
|
mondayApiVersion: validatedArgs.version,
|
|
18
23
|
mondayApiRequestConfig: {},
|
|
@@ -21,7 +26,7 @@ async function runServer() {
|
|
|
21
26
|
enableDynamicApiTools: validatedArgs.enableDynamicApiTools,
|
|
22
27
|
},
|
|
23
28
|
});
|
|
24
|
-
const transport = new StdioServerTransport();
|
|
29
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
25
30
|
await toolkit.connect(transport);
|
|
26
31
|
}
|
|
27
32
|
runServer().catch((error) => {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseArgs = parseArgs;
|
|
4
|
+
exports.validateArgs = validateArgs;
|
|
5
|
+
const args_config_js_1 = require("./args.config.js");
|
|
2
6
|
/**
|
|
3
7
|
* Parse command line arguments based on the defined configurations
|
|
4
8
|
* Also checks environment variables if command line args are not provided
|
|
5
9
|
* @param args Command line arguments (process.argv.slice(2))
|
|
6
10
|
* @returns Object with parsed arguments
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
function parseArgs(args) {
|
|
9
13
|
const result = {};
|
|
10
|
-
ARG_CONFIGS.forEach((config) => {
|
|
14
|
+
args_config_js_1.ARG_CONFIGS.forEach((config) => {
|
|
11
15
|
let argValue;
|
|
12
16
|
// Try to get value from command line arguments
|
|
13
17
|
for (const flag of config.flags) {
|
|
@@ -37,8 +41,8 @@ export function parseArgs(args) {
|
|
|
37
41
|
* @param parsedArgs The parsed arguments to validate
|
|
38
42
|
* @returns Strongly typed validated arguments
|
|
39
43
|
*/
|
|
40
|
-
|
|
41
|
-
const missingArgs = ARG_CONFIGS.filter((config) => config.required && !parsedArgs[config.name]);
|
|
44
|
+
function validateArgs(parsedArgs) {
|
|
45
|
+
const missingArgs = args_config_js_1.ARG_CONFIGS.filter((config) => config.required && !parsedArgs[config.name]);
|
|
42
46
|
if (missingArgs.length > 0) {
|
|
43
47
|
console.error('Error: The following required arguments are missing:');
|
|
44
48
|
missingArgs.forEach((config) => {
|
|
@@ -50,7 +54,7 @@ export function validateArgs(parsedArgs) {
|
|
|
50
54
|
process.exit(1);
|
|
51
55
|
}
|
|
52
56
|
const typedArgs = { ...parsedArgs };
|
|
53
|
-
ARG_CONFIGS.forEach((config) => {
|
|
57
|
+
args_config_js_1.ARG_CONFIGS.forEach((config) => {
|
|
54
58
|
if (typeof config.defaultValue === 'boolean' && parsedArgs[config.name] !== undefined) {
|
|
55
59
|
const stringValue = parsedArgs[config.name];
|
|
56
60
|
typedArgs[config.name] = stringValue.toLowerCase() === 'true';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED