workfullcircle-mcp-local 1.4.2 → 1.4.4

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 (2) hide show
  1. package/index.js +24 -8
  2. package/package.json +4 -3
package/index.js CHANGED
@@ -14,7 +14,8 @@ function printUsage() {
14
14
  function parseArgs(argv) {
15
15
  const parsed = {
16
16
  token: null,
17
- url: process.env.WFC_API_URL || 'https://workfullcircle.com'
17
+ url: process.env.WFC_API_URL || 'https://workfullcircle.com',
18
+ project: null
18
19
  };
19
20
 
20
21
  for (let i = 0; i < argv.length; i++) {
@@ -24,6 +25,9 @@ function parseArgs(argv) {
24
25
  } else if (argv[i] === '--url') {
25
26
  parsed.url = argv[i + 1];
26
27
  i++;
28
+ } else if (argv[i] === '--project') {
29
+ parsed.project = argv[i + 1];
30
+ i++;
27
31
  }
28
32
  }
29
33
 
@@ -32,6 +36,11 @@ function parseArgs(argv) {
32
36
  parsed.token = process.env.WFC_TOKEN;
33
37
  }
34
38
 
39
+ // Fallback to environment variable for project
40
+ if (!parsed.project) {
41
+ parsed.project = process.env.WFC_PROJECT;
42
+ }
43
+
35
44
  if (!parsed.token) {
36
45
  printUsage();
37
46
  }
@@ -39,7 +48,7 @@ function parseArgs(argv) {
39
48
  return parsed;
40
49
  }
41
50
 
42
- const { token: API_TOKEN, url: API_URL } = parseArgs(args);
51
+ const { token: API_TOKEN, url: API_URL, project: PROJECT_ID } = parseArgs(args);
43
52
 
44
53
  // Create HTTPS agent with keepAlive disabled to prevent stale connections
45
54
  const httpsAgent = new https.Agent({
@@ -53,15 +62,22 @@ async function makeRequest(url, payload, retryCount = 0) {
53
62
  const timeout = setTimeout(() => controller.abort(), 15000); // 15s timeout
54
63
 
55
64
  try {
65
+ const requestHeaders = {
66
+ 'Content-Type': 'application/json',
67
+ 'Authorization': `Bearer ${API_TOKEN}`,
68
+ 'Connection': 'close' // Explicitly request connection close
69
+ };
70
+
71
+ // Add project ID header if available
72
+ if (PROJECT_ID) {
73
+ requestHeaders['X-Project-ID'] = PROJECT_ID;
74
+ }
75
+
56
76
  const response = await fetch(url, {
57
77
  method: 'POST',
58
- headers: {
59
- 'Content-Type': 'application/json',
60
- 'Authorization': `Bearer ${API_TOKEN}`,
61
- 'Connection': 'close' // Explicitly request connection close
62
- },
78
+ headers: requestHeaders,
63
79
  body: JSON.stringify(payload),
64
- agent: httpsAgent,
80
+ agent: url.startsWith('https:') ? httpsAgent : undefined,
65
81
  signal: controller.signal
66
82
  });
67
83
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "workfullcircle-mcp-local",
4
- "version": "1.4.2",
5
- "description": "Local STDIO MCP server for WorkFullCircle API with connection leak fixes",
4
+ "version": "1.4.4",
5
+ "description": "Local STDIO MCP server for WorkFullCircle API with project ID support and connection leak fixes",
6
6
  "main": "index.js",
7
7
  "bin": {
8
8
  "workfullcircle-mcp-local": "index.js"
@@ -20,7 +20,8 @@
20
20
  "windsurf",
21
21
  "antigravity",
22
22
  "path-fix",
23
- "plug-and-play"
23
+ "plug-and-play",
24
+ "project-id"
24
25
  ],
25
26
  "author": "Afreensiyad",
26
27
  "license": "MIT",