This example shows how to connect pyqual to a Dockerized llx MCP service.
llxruns as an MCP SSE service in Docker.pyqualusespyqual mcp-refactoras a pipeline stage.- The helper first runs
llx_analyze, then calls theaiderMCP tool with a refactor prompt. - The run result is saved to
.pyqual/llx_mcp.json, which is also visible inpyqual status.
Dockerfile- builds an image containing bothllxandpyqualdocker-compose.yml- starts the MCP service onhttp://localhost:8000/ssepyqual.yaml- pipeline config that uses the MCP refactor stage
- Build and start the MCP service:
docker compose -f examples/llm_fix/docker-compose.yml up --build -d- Run the refactor workflow from your project directory:
pyqual mcp-refactor --workdir . --project-path /workspace/projectOr run the full pipeline with the refactor stage enabled:
export PYQUAL_LLX_MCP_URL=http://localhost:8000/sse
export PYQUAL_LLX_PROJECT_PATH=/workspace/project
pyqual run -c pyqual.yaml- Inspect the latest refactor run:
cat .pyqual/llx_mcp.json
pyqual status- Use
PYQUAL_LLX_PROJECT_PATH=/workspace/projectso the host project maps to the same path inside the MCP container. - Keep
PYQUAL_LLX_USE_DOCKER=falseunless you want theaidertool to spawn its own nested Docker container. - If your llx routing relies on Ollama or another backend, expose that backend to the container as well.
- For local development, you can also start the persistent service with
pyqual mcp-service --host 0.0.0.0 --port 8000.
You can register the plugin with:
pyqual plugin add llx-mcp-fixerThat will append a ready-to-customize llx-mcp-fixer snippet to pyqual.yaml.