
Kconfig Mcp
io.github.0xmortuexPublished by GitHub account 0xmortuexv0.1.0Updated Oct 24, 2026
Why can't I enable CONFIG_X? Explains Kconfig dependencies and finds a verified fix.
Overview
Explains why a Kconfig symbol (e.g. CONFIG_X) can't be enabled, with file:line dependency chains and a verified minimal fix.
- What you can do
- Load and manage Kconfig source trees, optionally with an existing .config, into named sessions
- Explain why a bool or tristate symbol is not y/m/n, recursively with file:line, plus a verified minimal fix and its side effects
- Inspect a symbol's type, prompt, value, assignable values, dependencies, defaults, select/imply links and help text
- Find every symbol that selects or implies a given one, and regex-search names, prompts and help
- Assign values as menuconfig would, reporting every other symbol that changed, and diff against another config, defconfig or fragment
- Write a .config or a minimal defconfig
- When to use it
- Useful when configuring the Linux kernel, Zephyr, U-Boot or Buildroot and an option is missing or greyed out in menuconfig, or when you need to know what a change will switch on or off before editing a config.
- Requirements
- Local Python 3.10+ process installed from PyPI (kconfig-mcp). A source tree containing the Kconfig files is needed, even a sparse checkout; no kernel build environment is required. For Linux, pass arch variables such as SRCARCH and ARCH when loading, and optionally shell="dry" when no compiler is available.
Installation
In SourceWeft
- Open Kconfig Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
kconfig-mcp
"Why can't I enable CONFIG_X?", answered with file:line and a fix that's been checked.
kconfig-mcp is an MCP server that lets an AI agent reason about Kconfig, the configuration system used by the Linux kernel, Zephyr, U-Boot, Buildroot and others.
Everyone who has configured a kernel has hit this: the option you want isn't in
menuconfig, or it's there but greyed out, and the reason is five depends on hops
away in a different directory. kconfig-mcp walks that chain for you. Then it searches
for the smallest set of changes that would unlock the option, and applies them to
the real tree to verify they work before it shows them to you.
What it looks like
This is real output on the current Linux tree (18,913 symbols) for x86:
The same question on a 32-bit build (ARCH=i386) ends somewhere no symbol change can
reach, and the tool says so instead of inventing a fix:
Why it's built this way
- Fixes are verified, not guessed. Kconfig is full of edge cases: tristate
mneedsMODULES, bools promotemtoy, choices deselect their other members,selectoverridesdepends on, anddefault yturns things on silently. So every candidate plan is applied to the loaded tree and checked. Only plans that really reach the goal are shown as fixes, together with their side effects (what elseselect/imply/defaults switch on or off). - It parses current Linux. It's built on Kconfiglib, which hasn't had a release
since 2020 and can't parse Linux's newer
modules,transitionalanddepends on X if Ysyntax. kconfig-mcp rewrites those lines as files are read, keeping every line number exact.depends on X if Yis lowered with a line-by-line port ofexpr_trans_comparefromscripts/kconfig/expr.c, so it behaves exactly as kconfig does, including how kconfig treats!Swhen S ism. - Environment problems are named. Linux sources
arch/$(SRCARCH)/Kconfig, and an unset variable silently becomes"". kconfig-mcp tracks undefined variables and names them in the error (undefined variable(s): SRCARCH (the arch/ directory to use, ...)) instead of leaving you witharch//Kconfig not found.
Install
Python 3.10+. You don't need a kernel build environment. A source tree with its Kconfig files is enough, even a sparse checkout:
Loading trees
shell controls the tree's $(shell,...) calls, which is how Linux probes the
compiler:
"run"(default) runs them with a POSIXsh, asmake menuconfigwould. Compiler-dependent symbols then reflect your real toolchain."dry"runs nothing. Linux's probe idioms get fixed answers: feature probes read as absent, and the toolchain reports as GCC 13.2.$(error-if)checks become warnings. Results then carry a note that compiler-dependent symbols such asCC_HAS_*read as absent.
Tools
Symbol names work with or without CONFIG_. A misspelt name gets "Did you mean: ...".
Limitations
transitionalsymbols are alwaysn. Real kconfig reads them from an old.configto migrate a value during a rename. Kconfiglib has no equivalent.- The fix search is bounded. Selects and defaults are only explored when a symbol can't be reached through its own prompt, and the search has an expansion budget. If no verified fix is found, the result says whether the budget ran out or every route is genuinely blocked.
why_notcovers bool and tristate symbols. For int/hex/string symbols, usekconfig_symbolandkconfig_set.- Dry mode answers compiler probes generically (see above), so trust
CC_HAS_*-style symbols only withshell="run"on a real toolchain. - It depends on Kconfiglib 14.1.0, pinned because
compat.pyhooks two of its internal methods. CI parses the latest Linux tree every week, so the next new keyword shows up as a failing build rather than a silent wrong answer.
Tests
The fixture tree in tests/fixtures/tree exercises every construct the explainer
handles: depends on, select, imply, choice, visible if, menuconfig/if blocks,
defaults, tristate and modules, and an arch directory chosen by $(SRCARCH). The
Linux tests assert real facts, such as x2APIC's dependencies, the i386 dead end, and
the x86_64 defconfig already enabling it. CI runs them against a sparse checkout of
the current tree.
License
MIT. Kconfiglib is ISC-licensed.
Source: README.md at commit 6a23bfb
Tools
0Version history
1- v0.1.0LatestOct 11, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts