Skip to content

kernel_graph MCP tool

Query the tree-sitter code graph of a pinned Linux kernel tree (symbols, definitions, references, includes, call edges, Kconfig and Kbuild links) with file:line answers. Build it first with fw kernel graph build on a host that has the tree.

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "kernel_graph",
"arguments": {
"query": "stats"
}
}
}
Name Type Required Description
query string: stats, def, refs, callers, callees, includes, included-by, file, config, search, path yes
operands array no Symbol, file path or CONFIG_ name (two symbols for path).
tree string no Pinned tree id: stable (default), mainline, cachyos.
limit integer no
{
"type": "object",
"properties": {
"query": {
"type": "string",
"enum": [
"stats",
"def",
"refs",
"callers",
"callees",
"includes",
"included-by",
"file",
"config",
"search",
"path"
]
},
"operands": {
"type": "array",
"items": {
"type": "string"
},
"description": "Symbol, file path or CONFIG_ name (two symbols for `path`)."
},
"tree": {
"type": "string",
"description": "Pinned tree id: stable (default), mainline, cachyos."
},
"limit": {
"type": "integer"
}
},
"required": [
"query"
]
}

Part of the fw MCP server. See the tool list and the agents guide.