fw-context-mcp — Claude Code MCP server
Builds a compiler-aware index for embedded C/C++ firmware and lets coding agents query symbols, call paths, callbacks, and active code.
claude mcp add fw-context-mcp -- uvx fw-context-mcpWhat fw-context-mcp does
fw-context-mcp creates a persistent project index from compile_commands.json and the libclang AST, then serves that information over MCP. An agent can inspect the implementation selected by a build, trace direct or indirect callers, locate callback registration, follow function-pointer paths, and filter out code removed by preprocessing.
The index stores symbols, source bodies, references, call edges, inheritance data, macros, and build metadata. FTS5 provides full-text search, while changed translation units can be processed incrementally after the first run. Project setup uses fw-context init, followed by fw-context index --build.
The project needs Python 3.11 or newer, libclang, and a build that can produce compile_commands.json. Ollama supplies embeddings and LLM-generated symbol descriptions; without it, those features fall back to full-text search or expose raw prompts.
What it helps with
- identify the implementation selected by a firmware build
- trace execution from an ISR into application code
- list direct and indirect callers of an API
- locate callback registrations and function-pointer paths
Example prompts for the agent
- Index this firmware from
compile_commands.jsonand show which driver implementation is active. - Trace every direct and indirect caller of this function, including callbacks.
- Assess which code paths are affected if this API changes, using the active preprocessor configuration.
How to install fw-context-mcp
Platform CLI
claude mcp add fw-context-mcp -- uvx fw-context-mcpuvx runs the command named after the package; if the README names another one, use uvx --from fw-context-mcp <command>
Platform CLI
codex mcp add fw-context-mcp -- uvx fw-context-mcpuvx runs the command named after the package; if the README names another one, use uvx --from fw-context-mcp <command>
Config file
{
"mcpServers": {
"fw-context-mcp": {
"command": "uvx",
"args": [
"fw-context-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from fw-context-mcp <command>
Config file
{
"servers": {
"fw-context-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"fw-context-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from fw-context-mcp <command>
Platform CLI
gemini mcp add fw-context-mcp uvx fw-context-mcpuvx runs the command named after the package; if the README names another one, use uvx --from fw-context-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about fw-context-mcp
How do I install fw-context-mcp in Claude Code?
Run claude mcp add fw-context-mcp -- uvx fw-context-mcp, then restart Claude Code.
What does fw-context-mcp do?
It builds a build-aware firmware index from the compilation database and libclang, giving an agent targeted queries for symbols, calls, macros, callbacks, and active source.
What does fw-context-mcp require?
It requires Python 3.11 or newer, libclang, and a project that can generate compile_commands.json. Ollama is needed for embeddings and LLM-based symbol descriptions.