# kconfig-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/0xmortuex/kconfig-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/kconfig-mcp

## Description
Why can't I enable CONFIG_X? Explains Kconfig dependencies and finds a verified fix.

## Tools
Capabilities this server exposes over MCP:

- **kconfig_load** — Parse a tree (plus optional `.config`) into a named session. Reports undefined variables and warnings.
- **kconfig_why_not** — The unmet conditions behind `symbol` not being `y`/`m`/`n`, recursively with file:line, plus a verified minimal fix and its side effects.
- **kconfig_symbol** — Type, prompt, value and *why* it has that value, assignable values, dependencies, defaults, select/imply in both directions, help text.
- **kconfig_what_selects** — Every symbol that selects or implies this one, with current values and which are active.
- **kconfig_search** — Regex search over names, prompts and help, with name matches first.
- **kconfig_set** — Assign a value as menuconfig would, and report every other symbol that changed. A refused assignment says so.
- **kconfig_diff** — Compare with another `.config`, or with a defconfig or fragment using `fragment=True`.
- **kconfig_save** — Write `.config`, or a minimal defconfig with `minimal=True`.
- **kconfig_sessions** — Manage loaded trees.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "kconfig-mcp": {
    "command": "uvx",
    "args": ["kconfig-mcp"]
  }
}
```

## Documentation

## What kconfig-mcp MCP server does

The kconfig-mcp MCP server gives an AI agent structured access to Kconfig configuration logic. It can parse a top-level Kconfig file and an optional existing `.config`, then explain how symbols derive their current values. The server is intended for Kconfig-based projects including the Linux kernel, Zephyr, U-Boot, and Buildroot, but it can load other trees when their expanded variables are supplied.

Its main diagnostic use is answering why a boolean or tristate option cannot reach `y`, `m`, or `n`. The explanation follows dependency chains recursively, identifies relevant `select`, `imply`, defaults, prompts, and choices, and includes source file and line locations. When possible, it searches for a small change set, applies that plan to the loaded tree, and reports only fixes that pass verification. Resulting side effects are included.

## How it works

A loaded tree is kept in a named session. During parsing, kconfig-mcp tracks warnings and variables that were referenced but not defined, which helps distinguish a configuration problem from an incomplete load environment. Symbol names may be provided with or without the `CONFIG_` prefix, and misspellings produce a suggested name.

The parser is based on Kconfiglib 14.1.0 and includes compatibility handling for newer Linux Kconfig constructs. Files are rewritten while preserving source line locations, allowing diagnostics to point back to the original tree. The server also models tristate behavior, module requirements, choices, defaults, and the effects of selecting or implying other symbols.

For Linux trees, loading may require values such as `SRCARCH` and `ARCH`. Shell expressions can either run through a POSIX shell or use dry mode. Dry mode avoids compiler probes and gives generic results for those checks, while run mode reflects the available toolchain. This makes the kconfig-mcp MCP server useful without a complete kernel build environment, provided the Kconfig files are available.

## Setup and configuration

Install it with Python 3.10 or newer:

```bash
pip install kconfig-mcp
```

The server is started as a standard stdio MCP process. For example, Claude Desktop can register it with:

```bash
claude mcp add kconfig -- kconfig-mcp
```

Call `kconfig_load` with the path to the top-level Kconfig file, an optional `.config`, and any environment mappings needed by the tree. A Linux load commonly points to `linux/Kconfig` and supplies architecture values. Use `shell="dry"` when compiler or shell probing should not run, such as on Windows or where no compiler is installed.

## Tools and capabilities

- `kconfig_load` parses a tree and optionally an existing configuration.
- `kconfig_why_not` traces unmet conditions and searches for a verified fix.
- `kconfig_symbol` reports a symbol’s type, value, prompt, dependencies, defaults, help, and assignment options.
- `kconfig_what_selects` lists symbols that select or imply a target and identifies active ones.
- `kconfig_search` searches names, prompts, and help text with regular expressions.
- `kconfig_set` assigns values using menuconfig-like behavior and reports cascading changes.
- `kconfig_diff` compares configurations, defconfigs, or fragments.
- `kconfig_save` writes a `.config` or minimal defconfig.
- `kconfig_sessions` and `kconfig_unload` manage loaded trees.

## Limitations and notes

The fix search has an expansion limit, so a missing fix may reflect either a genuinely unreachable condition or an exhausted search budget. Transitional symbols are always treated as `n`, because the underlying library does not reproduce their migration behavior. `kconfig_why_not` is for bool and tristate symbols; use `kconfig_symbol` and `kconfig_set` for integer, hexadecimal, or string values.

Dry mode is not equivalent to a real compiler environment: compiler feature symbols such as `CC_HAS_*` are treated as absent. Use `shell="run"` with the intended toolchain when those results matter. The kconfig-mcp MCP server also depends on a pinned Kconfiglib version because it hooks internal methods for compatibility.

_Full upstream README: https://allmcps.com/mcp/kconfig-mcp/readme_

