Complete AI Training

MCP server · Coding

fw-context MCP server

by turbyho

Lets your AI read your firmware the way the compiler sees it, so it can trace calls, callbacks and dead code.

Flow diagram: you ask your AI “Which sensor driver is compiled for this board?”, on your own computer the fw-context MCP server works with your firmware project, and you get back plain answers about your code.

fw-context is a helper for people who work on embedded firmware in C and C++. It builds a map of your actual compiled program, then lets your AI assistant ask questions about that map instead of guessing from raw files. It is handy if you use an AI coding agent on firmware and keep getting answers about the wrong driver or a branch that never gets compiled.

What is an MCP server? The 30-second version

On its own, your AI can only chat with you and read text you paste in. An MCP server is a small helper program that gives your AI a new skill or a connection to something else. This one connects your AI to your firmware project's build, so it can look up functions, callers and callbacks in the real compiled program. You install it once, point it at your project, and then your AI can ask it questions while you work.

What this MCP server does

You install fw-context and run it once on your firmware project, and it reads the same build instructions your compiler uses. From those it builds a lasting index of your symbols, calls, callbacks, macros and which files are actually compiled. When you ask your AI something about the code, the AI asks this helper instead of reading every file. The helper answers with small, exact pieces of the real program, and your AI explains them back to you. After the first run it only re-reads files that changed, so later questions are quick.

Flow diagram: you ask your AI “Which sensor driver is compiled for this board?”, on your own computer the fw-context MCP server works with your firmware project, and you get back plain answers about your code. Click to zoom

What you can do with it

  • Find which implementation of a function is actually active in your current build
  • List everyone who calls a function, directly or through other functions
  • Trace how a callback or interrupt handler reaches your application code
  • Check what would break if you change a function signature or data type
  • Spot dead code and symbols nothing references
  • See which code is removed by the preprocessor for your target
  • Separate your own project code from vendor and SDK code

Try asking your AI

  • “Which implementation of the sensor driver is compiled for this board?”
  • “Show me every place that calls spi_transfer, including indirect calls.”
  • “What registers this callback, and where does it get invoked from?”
  • “If I change the signature of this API, what else is affected?”

What it gives back to you

You get short, focused answers in the chat: lists of functions, caller chains, callback relationships, macro values and file paths from the real build. Your AI turns those into plain explanations, summaries or a review of a change. It does not dump whole files on you unless you ask for a specific function body. Everything stays on your machine.

Before you start

What you need

  • Python 3.11 or newer
  • libclang installed on your computer
  • A firmware project that can produce a compile_commands.json file
  • An AI coding agent that supports MCP, such as Claude Code or OpenCode

Good to know

It reads your project's source and build files to build its index, so keep that in mind if your code is private, though everything stays on your machine unless you turn on optional external services.

Install it with your AI

Add fw-context MCP server to your AI, no technical skills needed

You don't install anything by hand. You copy one prompt, paste it into an AI that can work on your computer, and it checks, installs and connects the server for you, asking you when it needs something.

Sign in to get the install prompt

Members get a ready-made prompt that lets the Claude desktop app check fw-context MCP server, install it and connect it for them, step by step. You don't need any technical skills: you copy, paste and answer a few questions. Your connected AI can also find and install any of the 4,066 MCP servers here for you.

Sign in Become a member

Who it's for

Embedded firmware developers and reviewers who use an AI coding agent on C or C++ projects and want answers about the real compiled program.