@darbotlabs/darbot-windows-mcp
Version:
🪟 Darbot Windows MCP - Professional Windows desktop automation server for AI agents via Model Context Protocol (MCP). Control Windows like a human with 15 powerful tools. Includes Python dependencies, UV, and VS Code configuration.
49 lines (39 loc) • 1.62 kB
JavaScript
const path = require('path');
// Export the main server path for programmatic use
module.exports = {
serverPath: path.join(__dirname, 'main.py'),
packageDir: __dirname,
// Start the server programmatically
start: function(options = {}) {
const { spawn } = require('child_process');
const mainPyPath = path.join(__dirname, 'main.py');
// Try UV first, fall back to Python
const uvProcess = spawn('uv', ['--version'], { stdio: 'pipe' });
return new Promise((resolve, reject) => {
uvProcess.on('close', (code) => {
let command, args;
if (code === 0) {
command = 'uv';
args = ['--directory', __dirname, 'run', 'python', mainPyPath];
} else {
command = 'python';
args = [mainPyPath];
}
const mcpProcess = spawn(command, args, {
stdio: options.stdio || 'inherit',
cwd: __dirname,
...options
});
resolve(mcpProcess);
});
uvProcess.on('error', () => {
const mcpProcess = spawn('python', [mainPyPath], {
stdio: options.stdio || 'inherit',
cwd: __dirname,
...options
});
resolve(mcpProcess);
});
});
}
};