v0.20.0 — read_file tool for ifdef-filtered file content
Overview
Adds read_file, a new MCP tool that returns the complete ifdef-filtered content of a C/C++ source file. Only code that actually compiles for the current build configuration is returned — inactive #ifdef branches are replaced with blank lines (preserving original line numbers).
This bridges a gap in the API: get_source reads one symbol body, search_content returns snippets around matches, but there was no way to read a complete file without leaving the fw-context ecosystem. LLMs were already attempting to call read_file even though it did not exist.
Changes
Features
read_filetool — read complete C/C++ source files with ifdef-filtered, build-accurate content. Falls back to raw disk content for legacy indexes.
| File | Change |
|---|---|
src/fw_context_mcp/mcp/handlers/source.py |
read_file implementation |
src/fw_context_mcp/mcp/server.py |
tool registration, instructions update, tool count fix |
docs/tools.md |
read_file documentation |
pyproject.toml |
version 0.19.2 → 0.20.0 |
server.json |
version + description tool count |
glama.json |
version + description tool count |
CLAUDE.md |
tool count fix |
AGENTS.md |
tool count fix |
README-MCP.md |
tool count fix, read_file in Understanding row |
Breaking changes
None.