MCP server that wraps lavacli (Linaro LAVA CLI)
Project description
mcp-lava
mcp-lava is an MCP (Model Context Protocol) server that lets an LLM interact with a
Linaro LAVA by wrapping the official
lavacli command-line tool.
Instead of re-implementing LAVA's XML-RPC API, this server executes lavacli locally and returns
results to the LLM in a tool-friendly way.
Why an MCP server for LAVA?
LAVA is powerful, but day-to-day workflows often involve many repetitive CLI steps:
- checking device availability and health
- locating the right job definition
- submitting jobs and monitoring states
- pulling logs and artifacts for failed jobs
- correlating failures across multiple runs
- re-running jobs to reproduce or to confirm a fix
An LLM can help with these workflows if it can reliably call the right commands and parse the
outputs. mcp-lava provides that bridge:
- Reuses
lavaclisubcommands and output formats (many support--json/--yaml). - Keeps server logic minimal (no duplicated API client).
- Makes automation conversational: "find the last failed run for this device type and summarize the failure", "show me the first kernel panic in the logs", etc.
Example scenarios
A few practical things you can do with an LLM + mcp-lava:
-
Triage a failure quickly
- List recent jobs for a project
- Detect failures, fetch logs, and summarize the suspected root cause
- Extract the first occurrence of an error pattern (e.g. kernel panic, timeout, SSH failed)
-
Lab status overview
- List devices and filter to offline/retired/busy
- Show which workers are overloaded
- Identify the most flaky device type based on recent job outcomes
-
Job submission assistance
- Validate that a device type exists
- Submit a job definition
- Track the job until completion and then download artifacts
-
Re-run / reproduce / confirm a fix ("rerun" workflow)
- Re-run the same job definition to reproduce a failure on demand
- Re-run on a different device (or a different device type) to separate lab flakiness from real regressions
- Re-run after changing one variable (new kernel, new rootfs, different test plan) and compare outcomes
- Compare logs/artifacts between the original run and the rerun to spot what changed
-
Routine reporting
- "Summarize all failed jobs in the last 24h, grouped by device type"
- "Show the top 3 failure signatures and link to the relevant logs"
Installation
Create/activate a virtual environment, then install:
python -m venv .venv
# Activate the venv (command depends on your shell)
python -m pip install -U pip
pip install mcp-lava
Alternatively, you can also use uvx mcp-lava to run it directly without installing to your system Python.
Configuration (required)
mcp-lava authenticates to LAVA by creating/refreshing a lavacli identity at startup and then
running all subsequent commands using that identity.
Set these environment variables:
LAVA_URL- Base URL or RPC endpoint. If it doesn't end with/RPC2, the server appends it.LAVA_USERNAME- LAVA username.LAVA_AUTHENTICATION_TOKEN- LAVA token.
Optional:
LAVA_IDENTITY- Identity name to use (default:mcp).LAVA_SSL_VERIFY-true/false(default:true).
A minimal way to represent variables (set them using your preferred method):
LAVA_URL=https://lava.example.com
LAVA_USERNAME=your.user
LAVA_AUTHENTICATION_TOKEN=<your-token>
Running the MCP server
This server uses the stdio transport (typical for MCP servers).
mcp-lava
Equivalent:
python -m mcp_lava.server
Tools
lava_run
Run any lavacli command.
argsmust be an argv token list (a list of strings): exactly what you would type afterlavacli.
Examples:
lavacli devices list->args=["devices", "list"]lavacli devices show qemu0->args=["devices", "show", "qemu0"]lavacli devices list --json->args=["devices", "list", "--json"]
Do not pass a single space-separated string like args=["devices list"].
lava_help
Get lavacli --help, or help for a specific command group.
lava_command_tree
Introspect the installed lavacli Python package and return its command/subcommand tree.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_lava-0.1.1.tar.gz.
File metadata
- Download URL: mcp_lava-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0309960abbdfaadb946ee33a3af3449c1b68c35825af5dcba7c1584f80a4704d
|
|
| MD5 |
9006990e07554b88bbe5b093f662f9e9
|
|
| BLAKE2b-256 |
f38ba1abe5e3690a95e9413b5f753bc2ab8f0d12b1fccfbd18b62bc18dbb847b
|
File details
Details for the file mcp_lava-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_lava-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
707d07264d6f8472e0bcdba529041fc14195ef15b87119dd1c81c48db5b0ad78
|
|
| MD5 |
2249e16afda13142a2fa4a96df25a02a
|
|
| BLAKE2b-256 |
948eaad9f7fa0bbfde8232685e27d6fc9439850db004659aa628ceb10de53717
|