Summary
Create MCP tool handlers for CLI command execution.
Acceptance Criteria
Tool Definitions
\\js
// run_command
{
name: 'run_command',
description: 'Execute a CLI command. Returns processId for polling. Use background=true for long-running commands.',
inputSchema: {
type: 'object',
properties: {
command: { type: 'string', description: 'Command to execute' },
args: { type: 'array', items: { type: 'string' }, description: 'Command arguments' },
cwd: { type: 'string', description: 'Working directory (within project root)' },
timeout: { type: 'number', description: 'Timeout in ms (default: 30000)' },
background: { type: 'boolean', description: 'Run in background (default: false)' }
},
required: ['command']
}
}
// get_command_output
{
name: 'get_command_output',
description: 'Get output from a running or completed command.',
inputSchema: {
type: 'object',
properties: {
processId: { type: 'string', description: 'Process ID from run_command' },
offset: { type: 'number', description: 'Output offset for large outputs' }
},
required: ['processId']
}
}
// list_processes
{
name: 'list_processes',
description: 'List all tracked CLI processes.',
inputSchema: {
type: 'object',
properties: {
status: { type: 'string', enum: ['running', 'completed', 'killed'] }
}
}
}
// kill_process
{
name: 'kill_process',
description: 'Kill a running process.',
inputSchema: {
type: 'object',
properties: {
processId: { type: 'string', description: 'Process ID to kill' },
signal: { type: 'string', enum: ['SIGTERM', 'SIGKILL'], description: 'Signal (default: SIGTERM)' }
},
required: ['processId']
}
}
\\
Related
Summary
Create MCP tool handlers for CLI command execution.
Acceptance Criteria
un_command\ handler
Tool Definitions
\\js
// run_command
{
name: 'run_command',
description: 'Execute a CLI command. Returns processId for polling. Use background=true for long-running commands.',
inputSchema: {
type: 'object',
properties: {
command: { type: 'string', description: 'Command to execute' },
args: { type: 'array', items: { type: 'string' }, description: 'Command arguments' },
cwd: { type: 'string', description: 'Working directory (within project root)' },
timeout: { type: 'number', description: 'Timeout in ms (default: 30000)' },
background: { type: 'boolean', description: 'Run in background (default: false)' }
},
required: ['command']
}
}
// get_command_output
{
name: 'get_command_output',
description: 'Get output from a running or completed command.',
inputSchema: {
type: 'object',
properties: {
processId: { type: 'string', description: 'Process ID from run_command' },
offset: { type: 'number', description: 'Output offset for large outputs' }
},
required: ['processId']
}
}
// list_processes
{
name: 'list_processes',
description: 'List all tracked CLI processes.',
inputSchema: {
type: 'object',
properties: {
status: { type: 'string', enum: ['running', 'completed', 'killed'] }
}
}
}
// kill_process
{
name: 'kill_process',
description: 'Kill a running process.',
inputSchema: {
type: 'object',
properties: {
processId: { type: 'string', description: 'Process ID to kill' },
signal: { type: 'string', enum: ['SIGTERM', 'SIGKILL'], description: 'Signal (default: SIGTERM)' }
},
required: ['processId']
}
}
\\
Related