agent-desk-mcp 0.1.4 → 0.1.5
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/bin/agent-desk-mcp.js +24 -16
- package/package.json +1 -1
package/bin/agent-desk-mcp.js
CHANGED
|
@@ -45,7 +45,7 @@ function findAgentDeskSource() {
|
|
|
45
45
|
return process.env.AGENT_DESK_SOURCE;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
// Look for src/cli.py relative to this script
|
|
48
|
+
// Look for src/cli.py relative to this script (for local dev)
|
|
49
49
|
const scriptDir = path.dirname(__filename);
|
|
50
50
|
const wrapperDir = path.dirname(scriptDir);
|
|
51
51
|
const projectDir = path.dirname(wrapperDir);
|
|
@@ -61,8 +61,8 @@ function findAgentDeskSource() {
|
|
|
61
61
|
return process.cwd();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// Return
|
|
65
|
-
return
|
|
64
|
+
// Return empty string - will use pip installed package instead
|
|
65
|
+
return '';
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function main() {
|
|
@@ -71,23 +71,31 @@ function main() {
|
|
|
71
71
|
const sourceDir = findAgentDeskSource();
|
|
72
72
|
|
|
73
73
|
// Build command arguments
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
let commandArgs;
|
|
75
|
+
if (sourceDir && fs.existsSync(path.join(sourceDir, 'src', 'cli.py'))) {
|
|
76
|
+
// Use source directory if found
|
|
77
|
+
commandArgs = ['-m', 'src.cli', 'mcp', ...args];
|
|
78
|
+
console.error(`Agent Desk MCP Server (using source)`);
|
|
79
|
+
console.error(`Python: ${python}`);
|
|
80
|
+
console.error(`Source: ${sourceDir}`);
|
|
81
|
+
} else {
|
|
82
|
+
// Use pip installed package (agent-desk)
|
|
83
|
+
commandArgs = ['-m', 'agent_desk.cli', 'mcp', ...args];
|
|
84
|
+
console.error(`Agent Desk MCP Server (using pip package)`);
|
|
85
|
+
console.error(`Python: ${python}`);
|
|
86
|
+
}
|
|
80
87
|
console.error(`Command: ${python} ${commandArgs.join(' ')}`);
|
|
81
88
|
|
|
82
89
|
// Spawn MCP server
|
|
83
|
-
const
|
|
84
|
-
cwd: sourceDir,
|
|
90
|
+
const spawnOptions = {
|
|
85
91
|
stdio: 'inherit',
|
|
86
|
-
env: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
env: { ...process.env },
|
|
93
|
+
};
|
|
94
|
+
if (sourceDir) {
|
|
95
|
+
spawnOptions.cwd = sourceDir;
|
|
96
|
+
spawnOptions.env.PYTHONPATH = sourceDir;
|
|
97
|
+
}
|
|
98
|
+
const proc = spawn(python, commandArgs, spawnOptions);
|
|
91
99
|
|
|
92
100
|
proc.on('error', (err) => {
|
|
93
101
|
console.error('Failed to start MCP server:', err.message);
|