make
Execute make commands in isolated build environments to compile code, run tests, and manage software builds without local dependency installation.
Instructions
Run make command with specified arguments. Executes make in the root of the specified repository. If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments to pass to make (e.g., 'clean', 'all', 'test') | |
| repo | Yes | Repository name (required) | |
| branch | No | Git branch name (optional). If provided, uses isolated worktree. |
Implementation Reference
- src/server.py:484-501 (handler)Executes the 'make' tool: extracts repo, branch, args from input; validates args; builds ['make', ...args]; runs in repo worktree via execute_in_worktree; returns formatted output.async def handle_make(self, args: Dict[str, Any]) -> List[TextContent]: """Handle make command""" repo = args.get("repo") branch = args.get("branch") make_args = args.get("args", "") # Validate arguments validate_make_args(make_args) # Build command cmd = ["make"] if make_args: cmd.extend(shlex.split(make_args)) # Execute in appropriate worktree with locking result = await self.execute_in_worktree(repo, branch, cmd) return [TextContent(type="text", text=result)]
- src/server.py:325-347 (schema)Defines the input schema for the 'make' tool, specifying required 'repo' and optional 'args', 'branch'.name="make", description="Run make command with specified arguments. " "Executes make in the root of the specified repository. " "If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.", inputSchema={ "type": "object", "properties": { "args": { "type": "string", "description": "Arguments to pass to make (e.g., 'clean', 'all', 'test')" }, "repo": { "type": "string", "description": "Repository name (required)" }, "branch": { "type": "string", "description": "Git branch name (optional). If provided, uses isolated worktree." } }, "required": ["repo"] } ),
- src/server.py:165-169 (registration)Registers the list_tools handler which returns the list of tools including 'make' via get_tools_list().@self.server.list_tools() async def handle_list_tools() -> List[Tool]: """List available MCP tools""" return await self.get_tools_list()
- src/validators.py:118-140 (helper)Validates make arguments: checks for dangerous patterns like ; | & etc., and ensures only safe characters.def validate_make_args(args: str) -> None: """ Validate make command arguments Args: args: Make command arguments Raises: ValueError: If arguments contain dangerous patterns """ if not args: return # Empty args is fine (will run default target) # Check for dangerous patterns if contains_dangerous_pattern(args): raise ValueError(f"Make arguments contain dangerous patterns: {args}") # Make arguments should be targets or variable assignments # Allow: alphanumeric, underscore, hyphen, equals, space, slash (for paths), quotes (for values with spaces) if not re.match(r'^[\*a-zA-Z0-9_\-=\s/\.\'"]+$', args): raise ValueError(f"Make arguments contain invalid characters: {args}")
- src/server.py:456-456 (helper)Dispatch in execute_tool that routes 'make' tool calls to handle_make.return await self.handle_make(arguments)