# Ctxfw

> Updated 2026-09-25 · type: tool · category: ai-infrastructure · status: active · rev 1

Ctxfw is an in-memory Tree-Sitter AST 'context firewall' MCP server that prunes the code a coding agent sends to the model.

- Open source: yes (Apache-2.0)
- Self-hostable: yes
- Pricing model: free
- Best for: A team running coding agents at volume that wants to cut token spend by pruning the code context an agent ships to the model — installing an AST-aware MCP server between the agent and the LLM — and is comfortable measuring the actual savings on its own codebase.
- Last verified: 2026-09-25

- **Canonical:** https://gtmstacker.com/registry/tool/ctxfw/
- **Source:** [heuristicolab · GitHub](https://github.com/heuristicolab/ctxfw)
- **Tags:** ai-infrastructure, self-hostable, mcp, tree-sitter, token-pruning, cost-control
- **Repository:** https://github.com/heuristicolab/ctxfw

## Is Ctxfw open source?

Yes, Ctxfw is open source under the Apache-2.0 license.

## How much does Ctxfw cost?

Ctxfw is free to use.

## Can I self-host Ctxfw?

Yes, Ctxfw can be self-hosted (the source is available under the Apache-2.0 license).


---

Ctxfw is an Apache-2.0, in-memory Tree-Sitter AST "context firewall" — an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline "-72.4% token mass" figure is a self-reported, unbenchmarked project claim, not a measured result.

## Provenance

- Apache-2.0 (OSI-open); 2 stars, created 2026-09-11, last push 2026-09-25; on PyPI; an in-memory Tree-Sitter AST "context firewall" / pruning MCP server that trims what a coding agent sends to the model; self-hostable (WebFetch 2026-09-25).
- Surfaced via studio discovery in the 2026-09-25 pass.
- Anti-hype note: the "-72.4% token mass" figure is a self-reported, unbenchmarked project claim — tagged as a claim, never stated as measured. Nascent at 2 stars.
- Curated from the GTM Stacker signal registry (2026-09-25 pass); license/facts independently verified 2026-09-25.

## Why it matters for a GTM stack

The cost of running coding agents at volume is dominated by how much context each call ships to the model. Ctxfw sits in that path as an MCP server that parses code with Tree-Sitter and prunes the AST before it is sent — a "context firewall" whose whole job is to reduce what the model has to read. For a team building agent-driven tooling where LLM spend is a line item, that cost-control layer is the interesting angle: you own it, run it in-memory, and pip-install it from PyPI. The honest read: the project's "-72.4% token mass" number is self-reported and unbenchmarked, so do not price a business case on it — and at 2 stars it is early. Adopt it as a candidate cost-control layer, but measure the real reduction, and any answer-quality loss from pruning, on your own codebase.
