skills / kerneldev-lms-mcp.md
This guide teaches an LLM how to use the kerneldev-lms-mcp tools. These tools manage Linux kernel configuration and builds. They come from the original kerneldev-mcp project and are exposed here through an LM Studio plugin.
skills / kerneldev-lms-mcp.md
This guide teaches an LLM how to use the kerneldev-lms-mcp tools. These tools manage Linux kernel configuration and builds. They come from the original kerneldev-mcp project and are exposed here through an LM Studio plugin.
kerneldev-mcpEvery tool has a name, a description, and an input schema (its arguments). The LLM must pass arguments that match the schema.
| Argument | Type | Meaning |
|---|---|---|
kernel_path | string | Path to the Linux kernel source tree on disk (e.g. /home/user/linux). |
config_path | string | Path to a kernel .config file. |
target | string | Build target: all, vmlinux, modules, bzImage, Image, dtbs. |
cross_compile_arch | string | Architecture for cross-compilation: x86_64, x86, arm64, arm, riscv, powerpc, mips. |
cross_compile_prefix | string | Cross-compiler prefix (e.g. aarch64-linux-gnu-). |
use_llvm | boolean | Use LLVM/Clang instead of GCC. |
timeout | integer | Maximum seconds to wait for the tool to finish. |
clean_type | string | Cleanup level: clean, mrproper, distclean. |
A. Configuration tools (8)
list_config_presets, get_config_template, create_config_fragment,
merge_configs, apply_config, validate_config, modify_kernel_config,
search_config_options
B. Build tools (4)
generate_build_config, build_kernel, check_build_requirements,
clean_kernel_build
C. VM boot & test tools (3)
boot_kernel_test, check_virtme_ng, kill_hanging_vms
D. fstests tools (13)
fstests_setup_check, fstests_check_environment, fstests_setup_install,
fstests_setup_devices, fstests_setup_configure, fstests_vm_boot_and_run,
fstests_vm_boot_custom, fstests_groups_list, fstests_baseline_get,
fstests_baseline_compare, fstests_baseline_list, fstests_baseline_save,
fstests_git_load, fstests_git_list, fstests_git_delete
E. mmtests tools (2)
mmtests_vm_boot_and_run, mmtests_host_build_and_run
F. Device pool tools (7)
device_pool_setup, device_pool_status, device_pool_teardown,
device_pool_resize, device_pool_snapshot, device_pool_list,
device_pool_cleanup
kernel_path points to a real kernel tree. Use check_build_requirements
first to verify it.required: [...]). Do not omit required arguments.timeout
values (60–600 seconds). Short tools need small values.cross_compile_arch and
cross_compile_prefix together when cross-compiling.kill_hanging_vms afterward.fstests_setup_check → fstests_setup_install →
fstests_setup_devices → fstests_setup_configure → run tests.
Or use the all-in-one fstests_vm_boot_and_run instead.fstests_baseline_save, then compare with
fstests_baseline_compare.kernel_path,
config_path, and file arguments.Tool: list_config_presets Arguments: { "category": "target" }
Returns a list of preset configurations (e.g. boot, btrfs, filesystem)
with descriptions.
Tool: get_config_template Arguments: { "target": "boot", "debug_level": "basic", "architecture": "x86_64" }
Returns a complete .config text for a minimal boot kernel.
Tool: create_config_fragment Arguments: { "name": "my-debug-fragment", "description": "Enable KASAN for memory error detection", "options": { "CONFIG_KASAN": "y", "CONFIG_KASAN_INLINE": "n" } }
Returns a fragment file content that can be merged into a base config.
Tool: merge_configs Arguments: { "base": "/home/user/.config/linux/.config", "fragments": ["my-debug-fragment.conf", "kasan.conf"], "output": "/home/user/.config/linux/my-config" }
Tool: validate_config Arguments: { "config_path": "/home/user/.config/linux/my-config", "kernel_path": "/home/user/linux" }
Tool: apply_config Arguments: { "kernel_path": "/home/user/linux", "config_source": "/home/user/.config/linux/my-config", "merge_with_existing": true, "cross_compile_arch": "arm64", "cross_compile_prefix": "aarch64-linux-gnu-", "use_llvm": false, "enable_virtme": true }
Tool: search_config_options Arguments: { "query": "KASAN", "category": "debugging" }
Tool: check_build_requirements Arguments: { "kernel_path": "/home/user/linux" }
Tool: build_kernel Arguments: { "kernel_path": "/home/user/linux", "target": "all", "jobs": 8, "verbose": false, "keep_going": true, "timeout": 600, "clean_first": false }
Tool: generate_build_config Arguments: { "target": "bzImage", "optimization": "speed", "ccache": true, "out_of_tree": true, "kernel_path": "/home/user/linux" }
Tool: boot_kernel_test Arguments: { "kernel_path": "/home/user/linux", "command": "dmesg | tail -n 20", "timeout": 120, "memory": "4G", "cpus": 4 }
Tool: fstests_vm_boot_and_run Arguments: { "kernel_path": "/home/user/linux", "fstests_path": "/home/user/fstests", "tests": ["-g", "quick"], "fstype": "ext4", "timeout": 300, "memory": "4G", "cpus": 4 }
# Step 1: save current results as a baseline Tool: fstests_baseline_save Arguments: { "results_dir": "/home/user/.kerneldev-mcp/fstests-results/run-1234/", "save_baseline": true, "baseline_name": "mainline-v6.1" } # Step 2: after a new kernel run, compare against the baseline Tool: fstests_baseline_compare Arguments: { "baseline_name": "mainline-v6.1", "kernel_path": "/home/user/linux", "branch_name": "my-fix-branch" }
Goal: Configure a kernel, build it, and report the result.
Steps for the LLM:
get_config_template with that target and architecture.validate_config to confirm the generated config is valid.apply_config to apply it to the kernel source tree.check_build_requirements to confirm the tree is ready.generate_build_config for an optimized build plan.build_kernel with a generous timeout.Goal: Keep multiple kernel configs organized and track which one is active.
Steps for the LLM:
list_config_presets to show available presets.create_config_fragment to build custom fragments.merge_configs to combine a base preset with custom fragments.validate_config after each merge.modify_kernel_config to toggle individual CONFIG_* options.Goal: Test a filesystem fix across multiple kernel versions.
Steps for the LLM:
fstests_vm_boot_and_run with the same
test group (e.g. ["-g", "auto"]).fstests_baseline_save to record the result.fstests_baseline_compare between versions to find
regressions (new failures) and improvements.Goal: Find out why a kernel build failed and fix it.
Steps for the LLM:
check_build_requirements to verify the kernel tree and tools.build_kernel with verbose: true and keep_going: false.cross_compile_arch/cross_compile_prefix mismatch → correct both.validate_config and fix the .config.Goal: Produce a human-readable report.
Steps for the LLM:
list_config_presets (category=target) to list available presets.get_config_template for the chosen target to show the resulting
configuration summary.generate_build_config to show the optimized build plan.check_build_requirements to confirm readiness.Goal: Prepare LVM device pools for RAID/filesystem tests.
Steps for the LLM:
device_pool_setup with a disk path to create a PV + VG.device_pool_status to verify health.fstests_setup_devices (mode=existing) pointing at the pool.device_pool_teardown to clean up.device_pool_list to confirm cleanup.| Tool name | Best used for |
|---|---|
list_config_presets | Discovering config options. |
get_config_template | Generating a full .config from a preset. |
create_config_fragment | Building small, reusable config snippets. |
merge_configs | Combining a base config with fragments. |
apply_config | Writing a config into a kernel tree. |
validate_config | Checking a .config before building. |
modify_kernel_config | Toggling individual CONFIG options. |
search_config_options | Finding what a CONFIG option does. |
generate_build_config | Planning an optimized build. |
build_kernel | Compiling the kernel. |
check_build_requirements | Verifying the tree is build-ready. |
clean_kernel_build | Removing build artifacts. |
boot_kernel_test | Quick VM boot validation. |
check_virtme_ng | Verifying virtme-ng availability. |
kill_hanging_vms | Recovering from a hung VM. |
fstests_* | End-to-end filesystem testing workflow. |
fstests_vm_boot_and_run | Fastest way to run fstests in a VM. |
fstests_baseline_* | Saving and comparing test results across versions. |
mmtests_* | Running memory-management selftests. |
device_pool_* | Managing LVM device pools for fstests. |
/home/user/linux, not
relative ones.timeout: 300 or higher for them.kill_hanging_vms if a test does not finish.kerneldev-mcp/ source is a git
clone. Update it with git pull — do not edit it directly.kerneldev-mcpEvery tool has a name, a description, and an input schema (its arguments). The LLM must pass arguments that match the schema.
| Argument | Type | Meaning |
|---|---|---|
kernel_path | string | Path to the Linux kernel source tree on disk (e.g. /home/user/linux). |
config_path | string | Path to a kernel .config file. |
target | string | Build target: all, vmlinux, modules, bzImage, Image, dtbs. |
cross_compile_arch | string | Architecture for cross-compilation: x86_64, x86, arm64, arm, riscv, powerpc, mips. |
cross_compile_prefix | string | Cross-compiler prefix (e.g. aarch64-linux-gnu-). |
use_llvm | boolean | Use LLVM/Clang instead of GCC. |
timeout | integer | Maximum seconds to wait for the tool to finish. |
clean_type | string | Cleanup level: clean, mrproper, distclean. |
A. Configuration tools (8)
list_config_presets, get_config_template, create_config_fragment,
merge_configs, apply_config, validate_config, modify_kernel_config,
search_config_options
B. Build tools (4)
generate_build_config, build_kernel, check_build_requirements,
clean_kernel_build
C. VM boot & test tools (3)
boot_kernel_test, check_virtme_ng, kill_hanging_vms
D. fstests tools (13)
fstests_setup_check, fstests_check_environment, fstests_setup_install,
fstests_setup_devices, fstests_setup_configure, fstests_vm_boot_and_run,
fstests_vm_boot_custom, fstests_groups_list, fstests_baseline_get,
fstests_baseline_compare, fstests_baseline_list, fstests_baseline_save,
fstests_git_load, fstests_git_list, fstests_git_delete
E. mmtests tools (2)
mmtests_vm_boot_and_run, mmtests_host_build_and_run
F. Device pool tools (7)
device_pool_setup, device_pool_status, device_pool_teardown,
device_pool_resize, device_pool_snapshot, device_pool_list,
device_pool_cleanup
kernel_path points to a real kernel tree. Use check_build_requirements
first to verify it.required: [...]). Do not omit required arguments.timeout
values (60–600 seconds). Short tools need small values.cross_compile_arch and
cross_compile_prefix together when cross-compiling.kill_hanging_vms afterward.fstests_setup_check → fstests_setup_install →
fstests_setup_devices → fstests_setup_configure → run tests.
Or use the all-in-one fstests_vm_boot_and_run instead.fstests_baseline_save, then compare with
fstests_baseline_compare.kernel_path,
config_path, and file arguments.Tool: list_config_presets Arguments: { "category": "target" }
Returns a list of preset configurations (e.g. boot, btrfs, filesystem)
with descriptions.
Tool: get_config_template Arguments: { "target": "boot", "debug_level": "basic", "architecture": "x86_64" }
Returns a complete .config text for a minimal boot kernel.
Tool: create_config_fragment Arguments: { "name": "my-debug-fragment", "description": "Enable KASAN for memory error detection", "options": { "CONFIG_KASAN": "y", "CONFIG_KASAN_INLINE": "n" } }
Returns a fragment file content that can be merged into a base config.
Tool: merge_configs Arguments: { "base": "/home/user/.config/linux/.config", "fragments": ["my-debug-fragment.conf", "kasan.conf"], "output": "/home/user/.config/linux/my-config" }
Tool: validate_config Arguments: { "config_path": "/home/user/.config/linux/my-config", "kernel_path": "/home/user/linux" }
Tool: apply_config Arguments: { "kernel_path": "/home/user/linux", "config_source": "/home/user/.config/linux/my-config", "merge_with_existing": true, "cross_compile_arch": "arm64", "cross_compile_prefix": "aarch64-linux-gnu-", "use_llvm": false, "enable_virtme": true }
Tool: search_config_options Arguments: { "query": "KASAN", "category": "debugging" }
Tool: check_build_requirements Arguments: { "kernel_path": "/home/user/linux" }
Tool: build_kernel Arguments: { "kernel_path": "/home/user/linux", "target": "all", "jobs": 8, "verbose": false, "keep_going": true, "timeout": 600, "clean_first": false }
Tool: generate_build_config Arguments: { "target": "bzImage", "optimization": "speed", "ccache": true, "out_of_tree": true, "kernel_path": "/home/user/linux" }
Tool: boot_kernel_test Arguments: { "kernel_path": "/home/user/linux", "command": "dmesg | tail -n 20", "timeout": 120, "memory": "4G", "cpus": 4 }
Tool: fstests_vm_boot_and_run Arguments: { "kernel_path": "/home/user/linux", "fstests_path": "/home/user/fstests", "tests": ["-g", "quick"], "fstype": "ext4", "timeout": 300, "memory": "4G", "cpus": 4 }
# Step 1: save current results as a baseline Tool: fstests_baseline_save Arguments: { "results_dir": "/home/user/.kerneldev-mcp/fstests-results/run-1234/", "save_baseline": true, "baseline_name": "mainline-v6.1" } # Step 2: after a new kernel run, compare against the baseline Tool: fstests_baseline_compare Arguments: { "baseline_name": "mainline-v6.1", "kernel_path": "/home/user/linux", "branch_name": "my-fix-branch" }
Goal: Configure a kernel, build it, and report the result.
Steps for the LLM:
get_config_template with that target and architecture.validate_config to confirm the generated config is valid.apply_config to apply it to the kernel source tree.check_build_requirements to confirm the tree is ready.generate_build_config for an optimized build plan.build_kernel with a generous timeout.Goal: Keep multiple kernel configs organized and track which one is active.
Steps for the LLM:
list_config_presets to show available presets.create_config_fragment to build custom fragments.merge_configs to combine a base preset with custom fragments.validate_config after each merge.modify_kernel_config to toggle individual CONFIG_* options.Goal: Test a filesystem fix across multiple kernel versions.
Steps for the LLM:
fstests_vm_boot_and_run with the same
test group (e.g. ["-g", "auto"]).fstests_baseline_save to record the result.fstests_baseline_compare between versions to find
regressions (new failures) and improvements.Goal: Find out why a kernel build failed and fix it.
Steps for the LLM:
check_build_requirements to verify the kernel tree and tools.build_kernel with verbose: true and keep_going: false.cross_compile_arch/cross_compile_prefix mismatch → correct both.validate_config and fix the .config.Goal: Produce a human-readable report.
Steps for the LLM:
list_config_presets (category=target) to list available presets.get_config_template for the chosen target to show the resulting
configuration summary.generate_build_config to show the optimized build plan.check_build_requirements to confirm readiness.Goal: Prepare LVM device pools for RAID/filesystem tests.
Steps for the LLM:
device_pool_setup with a disk path to create a PV + VG.device_pool_status to verify health.fstests_setup_devices (mode=existing) pointing at the pool.device_pool_teardown to clean up.device_pool_list to confirm cleanup.| Tool name | Best used for |
|---|---|
list_config_presets | Discovering config options. |
get_config_template | Generating a full .config from a preset. |
create_config_fragment | Building small, reusable config snippets. |
merge_configs | Combining a base config with fragments. |
apply_config | Writing a config into a kernel tree. |
validate_config | Checking a .config before building. |
modify_kernel_config | Toggling individual CONFIG options. |
search_config_options | Finding what a CONFIG option does. |
generate_build_config | Planning an optimized build. |
build_kernel | Compiling the kernel. |
check_build_requirements | Verifying the tree is build-ready. |
clean_kernel_build | Removing build artifacts. |
boot_kernel_test | Quick VM boot validation. |
check_virtme_ng | Verifying virtme-ng availability. |
kill_hanging_vms | Recovering from a hung VM. |
fstests_* | End-to-end filesystem testing workflow. |
fstests_vm_boot_and_run | Fastest way to run fstests in a VM. |
fstests_baseline_* | Saving and comparing test results across versions. |
mmtests_* | Running memory-management selftests. |
device_pool_* | Managing LVM device pools for fstests. |
/home/user/linux, not
relative ones.timeout: 300 or higher for them.kill_hanging_vms if a test does not finish.kerneldev-mcp/ source is a git
clone. Update it with git pull — do not edit it directly.