ctxfw — Claude Code MCP server: what it does, how to install
ctxfw strips peripheral code down to typed stubs before it reaches the agent's context, and screens incoming prompts for injection attempts.
Apache-2.0 ★ 8 updated 2026-10-29
claude mcp add ctxfw -- uvx ctxfwWhat ctxfw does
ctxfw sits between a codebase and a coding agent as an MCP layer. It parses dependency files with an AST engine and swaps out the implementation of neighboring modules for interface signatures and type stubs, keeping full code only for the file being worked on. The point is to stop the agent from loading code it never fully reads anyway.
A second layer checks architecture briefs before execution: the server rejects specs that skip invariants, variable bounds, or error handling. A separate filter called SARA screens incoming text for prompt injection. The server runs over stdio with no network telemetry in its standard mode.
Installing it means running uvx ctxfw, which requires uv on the machine.
What it helps with
- cut the context an agent pulls in from dependency files
- hand the agent interface stubs instead of full module code
- block architecture briefs missing invariants or error handling
- catch prompt injection in incoming files before processing
- keep code processing local without network telemetry
Example prompts for the agent
- Wire up ctxfw and prune the context before refactoring
cli.py - Run this architecture brief through ctxfw to check for missing invariants
- Scan this incoming file with SARA for prompt injection
How to install ctxfw
Platform CLI
claude mcp add ctxfw -- uvx ctxfwuvx runs the command named after the package; if the README names another one, use uvx --from ctxfw <command>
Platform CLI
codex mcp add ctxfw -- uvx ctxfwuvx runs the command named after the package; if the README names another one, use uvx --from ctxfw <command>
Config file
{
"mcpServers": {
"ctxfw": {
"command": "uvx",
"args": [
"ctxfw"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from ctxfw <command>
Config file
{
"servers": {
"ctxfw": {
"type": "stdio",
"command": "uvx",
"args": [
"ctxfw"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from ctxfw <command>
Platform CLI
gemini mcp add ctxfw uvx ctxfwuvx runs the command named after the package; if the README names another one, use uvx --from ctxfw <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 ctxfw
How do I install ctxfw in Claude Code?
Run claude mcp add ctxfw -- uvx ctxfw.
What does ctxfw do?
It's an MCP server that trims dependency context using AST parsing, rejects architecture briefs lacking required invariants, and filters incoming prompts for injection via SARA.
What do I need to run ctxfw?
It launches via uvx ctxfw, so uv needs to be installed on the machine. It runs locally over stdio with no network telemetry in standard mode.