aux4/mcp

MCP (Model Context Protocol) server that exposes aux4 commands as tools for AI assistants.

Install

aux4 aux4 pkger install aux4/mcp

How it works

  1. Discovers aux4 commands from .aux4 files in your project and installed packages
  2. Maps each command to an MCP tool with typed parameters
  3. Connects to the aux4 daemon for fast command execution
  4. Falls back to subprocess execution if the daemon is not running

Usage

Run aux4 mcp to see the configuration for your MCP client:

aux4 mcp

Claude Desktop

{
  "mcpServers": {
    "aux4": {
      "command": "aux4",
      "args": ["mcp"]
    }
  }
}

Claude Code

claude mcp add aux4 -- aux4 mcp

Tool mapping

aux4 commands are mapped to MCP tools as follows:

| aux4 command | MCP tool name | Parameters | |-------------|---------------|------------| | aux4 build | build | (from help variables) | | aux4 config get | config_get | path | | aux4 test run | test_run | file |

  • Command hierarchy is flattened with underscores: config get becomes config_get
  • Variable definitions become typed JSON Schema properties
  • Positional (arg: true) variables are passed as positional arguments
  • Named variables are passed as --flag value pairs
  • Private commands and aux4 system commands are excluded

Architecture

AI Client <-- stdio (JSON-RPC) --> MCP Server <-- unix socket --> aux4 daemon
                                       |
                                       +-- fallback --> aux4 subprocess

The MCP server auto-starts the daemon if it's not running.