Skip to content

Commit 9448679

Browse files
committed
Support --debug flag via commander in GitHub Workflow MCP Server #7803
1 parent a0d5a42 commit 9448679

5 files changed

Lines changed: 65 additions & 12 deletions

File tree

.github/.sync-metadata.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"lastSync": "2025-11-19T10:16:11.495Z",
3-
"releasesLastFetched": "2025-11-19T10:16:11.498Z",
2+
"lastSync": "2025-11-19T11:05:13.874Z",
3+
"releasesLastFetched": "2025-11-19T11:05:13.877Z",
44
"pushFailures": [],
55
"issues": {
66
"3789": {
@@ -6535,11 +6535,18 @@
65356535
"contentHash": "84eec3a5182f07ef575857227e50b0d799a28a354e9ff34798f64263a30532b8"
65366536
},
65376537
"7802": {
6538-
"state": "OPEN",
6538+
"state": "CLOSED",
65396539
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-7802.md",
6540+
"closedAt": "2025-11-19T10:59:33Z",
6541+
"updatedAt": "2025-11-19T10:59:33Z",
6542+
"contentHash": "356e92ddd1e6b1a8041263e7d001daed837eaa4d4b1883e4b8769e128f8bc176"
6543+
},
6544+
"7803": {
6545+
"state": "OPEN",
6546+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-7803.md",
65406547
"closedAt": null,
6541-
"updatedAt": "2025-11-19T10:16:03Z",
6542-
"contentHash": "7de415eb54929a19ca7844abb24d2e836a404fa2bace3eb450772bf89bd21952"
6548+
"updatedAt": "2025-11-19T11:02:34Z",
6549+
"contentHash": "2b47d959bdc0d570dbb40998d9b7e05fbc11e96c6984ef4f48a12491043a7d7f"
65436550
}
65446551
},
65456552
"releases": {

.github/ISSUE/issue-7802.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
id: 7802
33
title: Add CLI argument parsing to GitHub Workflow MCP Server
4-
state: OPEN
4+
state: CLOSED
55
labels:
66
- enhancement
77
- ai
8-
assignees: []
8+
assignees:
9+
- tobiu
910
createdAt: '2025-11-19T10:16:03Z'
10-
updatedAt: '2025-11-19T10:16:03Z'
11+
updatedAt: '2025-11-19T10:59:33Z'
1112
githubUrl: 'https://github.com/neomjs/neo/issues/7802'
1213
author: tobiu
1314
commentsCount: 0
@@ -17,6 +18,7 @@ subIssuesCompleted: 0
1718
subIssuesTotal: 0
1819
blockedBy: []
1920
blocking: []
21+
closedAt: '2025-11-19T10:59:33Z'
2022
---
2123
# Add CLI argument parsing to GitHub Workflow MCP Server
2224

@@ -37,4 +39,7 @@ The `ai/mcp/server/github-workflow/mcp-stdio.mjs` entry point should use `comman
3739

3840
- 2025-11-19 @tobiu added the `enhancement` label
3941
- 2025-11-19 @tobiu added the `ai` label
42+
- 2025-11-19 @tobiu assigned to @tobiu
43+
- 2025-11-19 @tobiu referenced in commit `a0d5a42` - "Add CLI argument parsing to GitHub Workflow MCP Server #7802"
44+
- 2025-11-19 @tobiu closed this issue
4045

.github/ISSUE/issue-7803.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: 7803
3+
title: Support --debug flag via commander in GitHub Workflow MCP Server
4+
state: OPEN
5+
labels:
6+
- enhancement
7+
- ai
8+
- refactoring
9+
assignees: []
10+
createdAt: '2025-11-19T11:02:34Z'
11+
updatedAt: '2025-11-19T11:02:34Z'
12+
githubUrl: 'https://github.com/neomjs/neo/issues/7803'
13+
author: tobiu
14+
commentsCount: 0
15+
parentIssue: null
16+
subIssues: []
17+
subIssuesCompleted: 0
18+
subIssuesTotal: 0
19+
blockedBy: []
20+
blocking: []
21+
---
22+
# Support --debug flag via commander in GitHub Workflow MCP Server
23+
24+
The current debugging implementation relies on manually parsing `process.argv` inside `ai/mcp/server/github-workflow/logger.mjs`. Since we are now using `commander`, we should standardize this behavior.
25+
26+
**Tasks:**
27+
1. Update `ai/mcp/server/github-workflow/mcp-stdio.mjs` to support a `--debug` (and `-d`) option using `commander`.
28+
2. If the debug flag is present, update `aiConfig.debug` to `true`.
29+
3. Refactor `ai/mcp/server/github-workflow/logger.mjs` to rely solely on `aiConfig.debug` (via `aiConfig.data.debug` or the proxy access), removing the manual `process.argv` check.
30+
31+
This consolidation ensures a single source of truth for the debug state and leverages the CLI parsing library correctly.
32+
33+
## Activity Log
34+
35+
- 2025-11-19 @tobiu added the `enhancement` label
36+
- 2025-11-19 @tobiu added the `ai` label
37+
- 2025-11-19 @tobiu added the `refactoring` label
38+

ai/mcp/server/github-workflow/logger.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ import aiConfig from './config.mjs';
66
*/
77
const logger = {};
88

9-
// Check for --debug flag in command line arguments
10-
const isDebugFlagSet = process.argv.includes('--debug');
11-
129
const createLogMethod = (level) => {
1310
return (...args) => {
14-
if (aiConfig.debug || isDebugFlagSet) {
11+
if (aiConfig.debug) {
1512
console.error(`[${level.toUpperCase()}]`, ...args);
1613
}
1714
};

ai/mcp/server/github-workflow/mcp-stdio.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ program
1717
.name('neo-github-workflow-mcp')
1818
.description('Neo.mjs GitHub Workflow MCP Server')
1919
.option('-c, --config <path>', 'Path to the configuration file')
20+
.option('-d, --debug', 'Enable debug logging')
2021
.parse(process.argv);
2122

2223
const options = program.opts();
2324

25+
// Apply debug flag
26+
if (options.debug) {
27+
aiConfig.data.debug = true;
28+
}
29+
2430
// Load custom configuration if provided
2531
if (options.config) {
2632
try {

0 commit comments

Comments
 (0)