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.
@@ -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 default (assumes agent-desk is installed as a package)
65
- return process.cwd();
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
- const cliPath = path.join(sourceDir, 'src', 'cli.py');
75
- const commandArgs = ['-m', 'src.cli', 'mcp', ...args];
76
-
77
- console.error(`Agent Desk MCP Server`);
78
- console.error(`Python: ${python}`);
79
- console.error(`Source: ${sourceDir}`);
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 proc = spawn(python, commandArgs, {
84
- cwd: sourceDir,
90
+ const spawnOptions = {
85
91
  stdio: 'inherit',
86
- env: {
87
- ...process.env,
88
- PYTHONPATH: sourceDir,
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-desk-mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "MCP server for multi-agent interaction with users - npx wrapper",
5
5
  "main": "bin/agent-desk-mcp.js",
6
6
  "bin": {