AST Codebase Context Engine & 20-Tool MCP Server for AI Coding Agents — Up to 95% Token Reduction &
AST Codebase Context Engine & 20-Tool MCP Server for AI Coding Agents — Up to 95% Token Reduction & Zero-Leak Security Architecture
·
T-Zero
High-performance AST context pruner & MCP server for AI coding assistants.
Reduces codebase prompt tokens by up to 94.9% while preserving complete class contracts, typed signatures, and cross-file dependencies.
When an AI coding assistant (Cursor, Claude Code, Antigravity IDE, Windsurf, Cline) reads your codebase, feeding full source files wastes 80% to 95% of your context window on internal loop bodies, routine calculations, and local variables. The model needs to know what your modules expose and call, not 100 lines of boilerplate implementation inside each method.
T-Zero acts like an on-the-fly .pyi / .d.ts declaration generator for your AI context window:
def process_charge(self, user_id: str, amount_cents: int, currency: str = "USD") -> TransactionResult: """Charges a customer card with automated retry and idempotency.""" ...
The AI assistant retains full access to class names, typed parameters, docstrings, and return types — with zero semantic loss, at a fraction of the token cost, and with drastically faster Time-To-First-Token (TTFT).
Quickstart
1. ⚡ One-Click Auto-Install (Zero Configuration)
Automatically detect and configure Cursor, Claude Desktop, Antigravity IDE, Windsurf, Cline, and VS Code in 5 seconds with zero manual JSON editing:
uvx tzero-mcp --add-mcp # or using pipx pipx run tzero-mcp --add-mcp
2. Instant Run via uvx or pipx (Zero Installation)
# Launch MCP server stdio transport instantly: uvx tzero-mcp # or: pipx run tzero-mcp
3. Install via pip
pip install tzero-mcp
4. Manual Configuration for Cursor / Claude Desktop / Antigravity / Windsurf
Add the following to your claude_desktop_config.json or Cursor Settings (Features → MCP):
9. 🏅 Badge of Honor: Show Your Repo is Context-Optimized
If your repository, library, or framework is optimized for AI coding assistants using T-Zero, embed our official badge in your README.md. This signals to developers and AI coding agents that your repository can be ingested with 90%+ less token overhead:
[-blue?style=flat-square&logo=python)](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
Live Preview:
Dark Mode / Slate variant:
[-38bdf8?style=flat-square&logo=python&labelColor=0f172a)](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
Reproducible Benchmarks
⚡ Head-to-Head Comparison: Raw Code vs. T-Zero AST Engine
Dimension
Raw Codebase Ingestion
T-Zero AST Context Architecture
Impact / Developer Advantage
Context Window Consumption
166,996 tokens (90%+ routine bodies)
8,465 tokens (pure typed signatures)
🔥 94.9% Token Reduction
API Cost per Pass (Claude 3.7 / GPT-4o)
$0.501 per query
$0.025 per query
💰 20x Cost Savings
Response Latency (TTFT)
18.4s slow time-to-first-token
2.1s instant response
⚡ 8.7x Faster Generation
Hallucination Risk (Ghost Imports/Params)
High (phantom packages & invented args)
0% (Blocked by 5-Tier AST Guard)
🛡️ 100% Deterministic
Helper Function Reusability
Poor (AI constantly reinvents wheels)
Auto-Surfaced (suggest_reusable_helpers)
♻️ Zero Logic Duplication
Security Leak Vulnerability
High (.env secrets & tokens leaked to API)
0 Leaks (100% Offline Zero-Leak AST)
🔒 100% Zero-Leak Certified
Tool Definition Quality (TDQS)
Untested / Ad-hoc
Anchor-5 Certified (Grade A 5.0/5.0)
⭐ 0 Notes / 0 Warnings
Analysis Target
Raw Codebase Tokens
T-Zero AST Payload
Token Savings
Cost per Query (Claude 3.7 / GPT-4o)
Latency (TTFT)
Full Repository Scan (38K LOC)
166,996 tokens
8,465 tokens
-94.9%
$0.501 → $0.025
18.4s → 2.1s
Large Backend Service
42,180 tokens
2,410 tokens
-94.3%
$0.126 → $0.007
6.2s → 0.9s
Git PR Diff Stream
18,450 tokens
1,120 tokens
-93.9%
$0.055 → $0.003
2.8s → 0.4s
Verify locally on your machine with zero cloud cost:
python tzero.py --savings
Core Capabilities
1. AST Skeleton Pruning
Strips internal routine execution bodies while preserving every class definition, typed signature, docstring, and return type. Zero heuristic line cutting — 100% deterministic language parsing.
2. Polyglot Language Support
Zero external compiler dependencies. Supports:
Python (via native ast parser)
TypeScript & JavaScript (interfaces, exports, type annotations)
Before refactoring a class or function, T-Zero calculates its exact downstream dependency impact (0–100 score), identifying every file, import, and symbol that could break.
4. Zero-Leak Security Guard
Guaranteed 100% offline execution. Includes pre-commit hooks and real-time scanners that block .env secrets, private tokens, and credentials from ever being sent to LLM APIs.
5. Embedded Superdesign Engine
Natively integrates the Superdesign UI methodology into Claude Code and Cursor with 5 tools to generate design systems, component specifications, and interactive browser preview galleries.
6. 5-Tier Zero-Hallucination Guard
Eliminates AI coding hallucinations before changes touch files. Statically intercepts ghost dependencies, validates workspace symbol tables and keyword arguments, enforces class schema fields, and checks return type contracts, backed by an automated self-healing AST transformer (repair_code) and immutable grounding contract generation.
7. Anti-Reinvention Engine
Automatically surfaces reusable existing utility helpers across the repository AST (suggest_reusable_helpers / --helpers), injecting ready-to-use imports into focus skeletons so AI models never duplicate code already written in your project.
MCP Tools Reference
🚀 Flagship Omni-Tool: execute_codebase_workflow
Execute any codebase workflow, multi-stage audit, or specific T-Zero engine in a single unified MCP command:
"action": "search" — Local BM25 hybrid semantic search
Tool Architecture: By default, T-Zero exposes the 15 TDQS-certified Canonical & Omni Tools to prevent context bloat and ensure 5/5 tool coherence. The full 49-tool suite is available on-demand via tzero-mcp --all or TZERO_MCP_TOOL_MODE=all (and all 49 tools remain dynamically callable via call_tool() in both modes).
T-Zero tools grouped by functional category:
1. Context & AST Pruning (7 tools)
get_project_context_tree: Multi-tier hierarchical AST context tree (T-1 to T-4).
prune_code_snippet: Strips implementation bodies from in-memory snippets or diff streams.
prune_schema_definition: Compresses database schemas, OpenAPI specs, and protobuf definitions.
get_smart_skeleton_context: Focus-file implementation with 1st-degree caller/callee skeletons.
get_incremental_diff_context: Git diff context pruned with AST signatures.
generate_zero_waste_prompt_context: Token-optimized prompt preamble for coding agents.
suggest_reusable_helpers: Discovers and surfaces existing reusable helpers across AST to prevent reinventing wheels.
2. Dependency & Impact Analysis (6 tools)
query_module_dependencies: Analyzes import/export graphs across 10+ programming languages.
analyze_code_dependencies: Deep dependency mapping, call chains, PageRank, and dead code.
analyze_change_impact: Calculates change blast radius (0-100) and downstream dependents.
rank_repository_pagerank: Identifies architectural backbone files by network centrality.
trace_symbol_call_chain: Traces cross-file execution flow from caller to callee.
find_dead_code: Detects unreferenced, unreachable, or orphaned functions.
3. Security & Code Quality (6 tools)
verify_security_guard: 100% Zero-Leak scan for hardcoded credentials and secrets.
verify_zero_leak_security: Validates that files adhere to the Zero-Leak security policy.
estimate_token_cost: Real-time cost comparisons across OpenAI, Anthropic, Gemini, and DeepSeek.
get_token_savings_metrics: Quantitative token compression metrics and monthly ROI savings.
compress_stream_tokens: Compresses live text streams using localized codebooks.
search_codebase: Local BM25 hybrid semantic and lexical code search.
search_codebase_semantic: 100% private semantic search without cloud embedding APIs.
Architecture
flowchart TD
subgraph Input ["Input Layer"]
REPO["Source Code Repository"]
end
subgraph Parser ["AST Engine"]
AST["Language AST Visitor"]
SIG["Signature & Type Extractor"]
DEP["Import & Call Graph Analyzer"]
end
subgraph Core ["T-Zero Engine"]
PRUNER["AST Skeleton Pruner (-94.9% Tokens)"]
GUARD["100% Zero-Leak Security Guard"]
SUPER["Superdesign UI Engine"]
end
subgraph Delivery ["MCP Delivery"]
MCP["tzero_mcp.py (Stdio Server)"]
DASH["tzero --dashboard (localhost:8421)"]
end
subgraph Clients ["AI Clients"]
CURSOR["Cursor IDE"]
CLAUDE["Claude Code / Desktop"]
AGY["Antigravity IDE"]
WINDSURF["Windsurf / Cline"]
end
REPO --> AST
AST --> SIG
AST --> DEP
SIG --> PRUNER
DEP --> PRUNER
PRUNER --> GUARD
GUARD --> MCP
SUPER --> MCP
PRUNER --> DASH
MCP --> CURSOR
MCP --> CLAUDE
MCP --> AGY
MCP --> WINDSURF
Security Architecture
100% Zero-Leak Guarantee: T-Zero contains ZERO hardcoded, personal, or public API keys. All AST parsing, BM25 indexing, and blast radius calculations run 100% locally on your machine with zero external network telemetry.
🇹🇷 Türkçe Dokümantasyon
T-Zero, yapay zeka kodlama ajanları (Cursor, Claude Code, Antigravity IDE, Windsurf, Cline) için geliştirilmiş, kod tabanı bağlamını yapısal olarak koruyarak token tüketimini %94.9'a kadar azaltan açık kaynaklı bir bağlam motoru ve Model Context Protocol (MCP) sunucusudur.
Neden T-Zero?
Bir AI asistanına binlerce satırlık ham kod dosyaları verildiğinde, fonksiyonların içindeki döngüler ve rutin işlemler bağlam penceresini gereksiz yere doldurur. T-Zero, kod tabanını derleyici seviyesinde AST ile ayrıştırarak fonksiyon gövdelerini çıkarır; yalnızca sınıf yapılarını, tip imzalarını, docstring'leri ve bağımlılıkları korur.
Hızlı Kurulum
# Kurulum yapmadan doğrudan çalıştırmak için (uvx): uvx tzero-mcp
Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Install with your agent
Paste this prompt into your agent. It reads this page and does the setup for you.
prompt
Read https://aiagentslisting.com/mcp/t-zero-algorithm to learn what the "T Zero Algorithm" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.
Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
From the project README
bashbash
uvx tzero-mcp --add-mcp uvx tzero-mcp
claude mcp add --scope user tzero uvx tzero-mcp
This server runs locally, so we can't read its tool list over the web yet.
We could not run this server: it ships no npx package for our sandbox and no public endpoint. The four checks that need a live server are left out, and the grade tops out at B until one exists.
What's missing
Claimed by ownerThe maintainer proved ownership of this listing.
0/4
All 5 checks (4 passed)
Installation methodRequiredThe README documents at least one way to install or connect.
15/15
Has a READMERequiredThe repository ships documentation we could read.
10/10
Easy installA paste-ready client config (an mcpServers block) is documented.
12/12
Has a licenseThe repository declares a license.
8/8
Claimed by ownerThe maintainer proved ownership of this listing.
0/4
Verified liveNot checkableWe connected to the server and it answered a real MCP handshake.
—
Exposes toolsNot checkableThe server reports at least one tool, from its manifest or a live read.
—
Ships promptsNot checkableThe server exposes at least one prompt template.
—
Ships resourcesNot checkableThe server exposes at least one resource.
—
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Paste this line near the top of your repository's README. The badge always renders the current score.
markdown
[](https://aiagentslisting.com/mcp/t-zero-algorithm)
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "t-zero-algorithm" with a rating from 1 to 5 and a short note on what worked and what did not.
No reviews yet
Be the first to share your experience with this tool.
Subscribe to our newsletter
One email a week. New agents, MCP servers and skills, and what is actually getting traction.