agent-desk-mcp 0.1.0
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/README.md +48 -0
- package/bin/agent-desk-mcp +107 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# agent-desk-mcp
|
|
2
|
+
|
|
3
|
+
npx wrapper for Agent Desk MCP Server - enables multi-agent blocking question capability with message queue management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# No installation needed - use npx directly
|
|
9
|
+
npx agent-desk-mcp --api-url http://localhost:8080
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### Basic Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Run MCP server connecting to API server
|
|
18
|
+
npx agent-desk-mcp --api-url http://localhost:8080
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### With Custom Database
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Use custom database path
|
|
25
|
+
npx agent-desk-mcp --api-url http://localhost:8080 --db-path /path/to/data.db
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Environment Variables
|
|
29
|
+
|
|
30
|
+
- `AGENT_DESK_SOURCE`: Path to agent-desk source directory (if not using installed package)
|
|
31
|
+
|
|
32
|
+
## Requirements
|
|
33
|
+
|
|
34
|
+
- Node.js >= 18.0.0
|
|
35
|
+
- Python >= 3.10
|
|
36
|
+
- agent-desk package installed (or source available)
|
|
37
|
+
|
|
38
|
+
## For Development
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Clone and link
|
|
42
|
+
git clone https://github.com/weidwonder/agent-desk.git
|
|
43
|
+
cd agent-desk/mcp-wrapper
|
|
44
|
+
npm link
|
|
45
|
+
|
|
46
|
+
# Now you can run directly
|
|
47
|
+
agent-desk-mcp --api-url http://localhost:8080
|
|
48
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agent-desk-mcp
|
|
4
|
+
*
|
|
5
|
+
* npx wrapper for Agent Desk MCP Server
|
|
6
|
+
* Usage: npx agent-desk-mcp --api-url http://localhost:8080
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn } = require('child_process');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
|
|
13
|
+
// Find Python interpreter
|
|
14
|
+
function findPython() {
|
|
15
|
+
// Check for python3 first, then python
|
|
16
|
+
const candidates = ['python3', 'python'];
|
|
17
|
+
|
|
18
|
+
for (const candidate of candidates) {
|
|
19
|
+
try {
|
|
20
|
+
const result = require('child_process').execSync(`which ${candidate}`, { encoding: 'utf8' }).trim();
|
|
21
|
+
if (result) return candidate;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
// Continue to next candidate
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Try common paths
|
|
28
|
+
const commonPaths = [
|
|
29
|
+
'/usr/bin/python3',
|
|
30
|
+
'/usr/local/bin/python3',
|
|
31
|
+
'/opt/homebrew/bin/python3',
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
for (const p of commonPaths) {
|
|
35
|
+
if (fs.existsSync(p)) return p;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return 'python3';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Find agent-desk source directory
|
|
42
|
+
function findAgentDeskSource() {
|
|
43
|
+
// First check AGENT_DESK_SOURCE env variable
|
|
44
|
+
if (process.env.AGENT_DESK_SOURCE) {
|
|
45
|
+
return process.env.AGENT_DESK_SOURCE;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Look for src/cli.py relative to this script
|
|
49
|
+
const scriptDir = path.dirname(__filename);
|
|
50
|
+
const wrapperDir = path.dirname(scriptDir);
|
|
51
|
+
const projectDir = path.dirname(wrapperDir);
|
|
52
|
+
const cliPath = path.join(projectDir, 'src', 'cli.py');
|
|
53
|
+
|
|
54
|
+
if (fs.existsSync(cliPath)) {
|
|
55
|
+
return projectDir;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Check current working directory
|
|
59
|
+
const cwdCliPath = path.join(process.cwd(), 'src', 'cli.py');
|
|
60
|
+
if (fs.existsSync(cwdCliPath)) {
|
|
61
|
+
return process.cwd();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Return default (assumes agent-desk is installed as a package)
|
|
65
|
+
return process.cwd();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function main() {
|
|
69
|
+
const args = process.argv.slice(2);
|
|
70
|
+
const python = findPython();
|
|
71
|
+
const sourceDir = findAgentDeskSource();
|
|
72
|
+
|
|
73
|
+
// Build command arguments
|
|
74
|
+
const cliPath = path.join(sourceDir, 'src', 'cli.py');
|
|
75
|
+
const commandArgs = ['-m', 'src.cli', 'mcp', ...args];
|
|
76
|
+
|
|
77
|
+
console.log(`Agent Desk MCP Server`);
|
|
78
|
+
console.log(`Python: ${python}`);
|
|
79
|
+
console.log(`Source: ${sourceDir}`);
|
|
80
|
+
console.log(`Command: ${python} ${commandArgs.join(' ')}`);
|
|
81
|
+
console.log('');
|
|
82
|
+
|
|
83
|
+
// Spawn MCP server
|
|
84
|
+
const proc = spawn(python, commandArgs, {
|
|
85
|
+
cwd: sourceDir,
|
|
86
|
+
stdio: 'inherit',
|
|
87
|
+
env: {
|
|
88
|
+
...process.env,
|
|
89
|
+
PYTHONPATH: sourceDir,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
proc.on('error', (err) => {
|
|
94
|
+
console.error('Failed to start MCP server:', err.message);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
proc.on('exit', (code) => {
|
|
99
|
+
process.exit(code || 0);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Handle signals
|
|
103
|
+
process.on('SIGINT', () => proc.kill('SIGINT'));
|
|
104
|
+
process.on('SIGTERM', () => proc.kill('SIGTERM'));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-desk-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for multi-agent interaction with users - npx wrapper",
|
|
5
|
+
"main": "bin/agent-desk-mcp.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-desk-mcp": "bin/agent-desk-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"mcp",
|
|
11
|
+
"agent",
|
|
12
|
+
"multi-agent",
|
|
13
|
+
"claude"
|
|
14
|
+
],
|
|
15
|
+
"author": "weidwonder",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/weidwonder/agent-desk"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|