Repository navigation
Home
Documentation is not a feature switch: Sidebar entries are reference pages, not enabled capabilities. A feature may require a compatible release, optional dependency, client configuration, credentials, or a separately hosted service. Verify availability in the linked source and current setup before assuming it is active.
A practical engineering handbook for T-Zero Algorithm Start with the quickstart, find the interface you need, then follow links to implementation details and source documents.
Project stack
Choose your path
API Reference · GitHub Repository · Releases · Issues · Security Reporting
T-Zero Algorithm is an open-source developer toolset for preparing code context for AI coding assistants. The repository combines a Python package and CLI, an MCP server, AST and source-analysis utilities, editor integrations, Rust crates, a hosted Gradio demonstration, and project automation.
The central workflow is to inspect code structure and produce a smaller, task-relevant representation instead of blindly sending whole files. The repository documents AST-based handling for Python and heuristic or schema-oriented extraction for several other languages. Results depend on the language, parser path, project shape, selected tool, and task.
| Item | Repository value |
|---|---|
| Package | tzero-mcp |
Version in pyproject.toml and server.json
|
12.3.4 |
| Python requirement | >=3.11 |
| MCP transport in registry manifest | stdio |
| License identifier | AGPL-3.0-only |
| Main public API documentation | tzero-docs.octri.dev |
These are source metadata values. The package installed on a machine or the hosted demo may be on a different revision.
| Your goal | Start here |
|---|---|
| Install and configure an editor | Start-Here |
| Understand the components and boundaries | Repository-Map · Architecture |
| Follow actual source execution paths | Codebase-Internals |
| Browse Python classes, functions, and docstrings | Python-Core-Symbol-Reference |
| Inspect the actual MCP handler signatures | MCP-Tool-Reference |
| Browse Rust declarations and docs | Rust-Source-Reference |
| Find tests by source declaration | Tests-Source-Reference |
| Understand extension and package boundaries | Extension-and-Packaging-Internals |
| Review safe scope of Anti-REA features | Anti-REA-Safe-Overview |
| Connect an MCP client | MCP-and-OpenAPI |
| Read the API routes for the hosted demo | Octri API Reference |
| Review privacy and network behavior | Privacy-and-Network-Behavior |
| Check security-reporting guidance | Security-Reporting |
| Explore benchmarks and their limitations | Local-Benchmark-Report · Evidence-Boundaries |
| Work on the repository | Contributing-Guidelines · Developer-Walkthrough |
| Find a specific source document or agent skill | Source-Index |
| Interface | How it runs | Useful for | Important boundary |
|---|---|---|---|
| Local MCP server | MCP over stdio
|
Giving an AI editor access to T-Zero Algorithm tools | The editor starts the configured local process. The editor may send returned tool output to its configured model provider. |
| CLI | Local command-line process | Setup, context tasks, scans, reports, and scripts | File or system changes depend on the exact command and options. Read help and use preview modes where available. |
| VS Code extension | Commands and views inside VS Code | Editor workflows, status information, and direct commands | Extension behavior and available commands can differ by published version. |
| Hosted Gradio Space | Public web app with an HTTP API | Trying selected features without a local install | Submitted source code is sent to the hosted service. Do not send private code or credentials. |
| Octri documentation | Hosted API reference site | Browsing the OpenAPI contract | It documents the hosted Gradio API, not the local stdio MCP server. |
Do not treat the hosted HTTP API and local MCP server as the same service. See MCP-and-OpenAPI for the distinction and request flow.
pip install --upgrade tzero-mcpThe repository documents an auto-detection command:
tzero initIt also documents explicit client selectors:
tzero init --cursor
tzero init --claude
tzero init --antigravity
tzero init --windsurf
tzero init --cline
tzero init --vscode
tzero init --zedCheck tzero init --help on your installed version before using a selector.
tzero-mcp --version
tzero-mcp --helpRestart or reload the editor after changing its MCP configuration. Confirm that T-Zero Algorithm appears in the editor's MCP/tool panel and inspect the editor's server logs if it does not.
Use the launcher installed on your machine. The Python module example is:
{
"mcpServers": {
"tzero": {
"command": "python",
"args": ["-m", "tzero_mcp"]
}
}
}The uvx example is:
{
"mcpServers": {
"tzero": {
"command": "uvx",
"args": ["tzero-mcp"]
}
}
}Do not add both alternatives under the same server name. Pick one launch method and adapt the JSON location to the client you use.
flowchart TD
User["Developer"] --> Client["Editor, script, or CLI"]
Client -->|MCP stdio| Server["Local T-Zero Algorithm MCP server"]
Client -->|command| CLI["Local T-Zero CLI"]
Server --> Tools["Tool catalog"]
CLI --> Tools
Tools --> Analysis["AST, context, search, policy, and workflow services"]
Analysis --> Result["Context, findings, or generated report"]
Result --> Client
Public["Hosted Gradio Space"] --> HTTP["Separate public HTTP API"]
At a high level:
- A developer invokes a command or an MCP tool.
- The selected operation reads the inputs it needs.
- Analysis tools inspect syntax, symbols, dependencies, text, or configured rules.
- T-Zero returns a context representation, result, or diagnostic.
- The calling client decides how to present or use the result.
This diagram is an orientation aid, not a promise that every command traverses the same modules.
The current Python implementation registers two mutually exclusive decorator groups. The default mode is canonical; setting TZERO_MCP_TOOL_MODE to all, legacy, or 47 selects the alternate group. An AST scan of tzero/tzero_mcp.py finds 14 canonical registrations and 51 alternate registrations, with four names shared between those groups. A nearby source comment still says 47 for the alternate group, and the README advertises a different count. This is a source/documentation discrepancy, not a promise that every installed server exposes all names.
| Canonical tool | Handler purpose at a glance |
|---|---|
build_project_context |
Build project context. |
prune_code_snippet |
Prune a supplied code snippet. |
manage_architecture_rules |
Read or manage architecture rules. |
enforce_architecture_rules |
Check configured architecture boundaries. |
generate_architecture_blueprint |
Generate an architecture blueprint. |
analyze_code_dependencies |
Inspect dependency relationships. |
analyze_change_impact |
Analyze impact for a requested change. |
search_codebase |
Search the codebase. |
audit_code_quality |
Run code-quality analysis. |
verify_security_guard |
Run the security-guard check. |
estimate_token_cost |
Estimate token-related cost. |
query_memory_store |
Query stored memory. |
manage_memory_store |
Manage memory entries. |
orchestrate_agent_swarm |
Route a goal through the agent orchestration path. |
This short list is not the complete API contract. Read MCP-Tool-Reference for all 65 source registrations, signatures, handler names, and source links. For a live client, the server's tools/list result is authoritative.
The repository README distinguishes parser techniques rather than claiming that every language has identical AST fidelity:
| Language family documented | Technique described | Practical note |
|---|---|---|
| Python | Native Python ast module |
The README describes preservation of imports, classes, methods, signatures, decorators, and docstrings while pruning function bodies. |
| TypeScript / JavaScript | Heuristic grammar and regular expressions | Treat extraction as heuristic; verify edge cases in the current implementation and tests. |
| Go | Heuristic grammar and regular expressions | Treat extraction as heuristic; confirm the target construct is recognized. |
| Rust | Heuristic grammar and regular expressions | Treat extraction as heuristic; confirm visibility and signature handling. |
| SQL, Prisma, GraphQL | Declarative schema reducer | Schema-oriented extraction is different from general-purpose language parsing. |
For exact supported constructs and limitations, consult Project-Overview, Codebase-Internals, the symbol references, and tests for the language being used.
The OpenAPI document in the repository describes named routes exposed by the public Gradio Space. Its request flow is asynchronous:
-
POST /gradio_api/call/{api_name}with an ordereddataarray. - Read the returned
event_id. -
GET /gradio_api/call/{api_name}/{event_id}to read the Server-Sent Events stream.
The curated spec lists:
process_code_compressionrun_hallucination_guard_controllerrun_impact_analysis_controllerrun_auto_vault_controllerrun_code_healer_controllercalculate_roi_controllergenerate_mcp_config_controller_run_anti_rea_audit_controller
The hosted Space can change independently of the repository. Check the live API reference and version note before integrating it. Never send secrets or confidential source code to a public demo.
| Activity | What to keep in mind |
|---|---|
| Local AST analysis and lexical search | The repository privacy document says these process workspace data on the machine running T-Zero. |
| MCP tool output | Returned source excerpts, paths, or findings go to the connected client. The client/model provider's settings determine subsequent processing. |
| Optional AI-assisted generation | Prompts, paths, relationships, and excerpts may be sent to the provider explicitly selected by the user. Review provider and client policies. |
| Hosted Gradio API | Submitted code leaves the local machine and reaches the public Space. Do not send confidential code, tokens, or real credentials. |
| Package installation and metrics | Package managers, public registry lookups, tokenizer downloads, and optional project metrics can use the network. |
| Repair and setup commands | Some commands may modify files, configuration, PATH, or system state. Read command help and review effects before execution. |
The repository contains secret-scanning and other security-related features, but no project page, test result, or tool can guarantee that software is "100% secure." Choose a workflow that matches your threat model and review Privacy-and-Network-Behavior.
Benchmark results depend on the repository, language, selection strategy, tokenizer, model, hardware, runtime version, and baseline. A percentage reported for one workload is not a universal guarantee.
Before using a benchmark to make a product or cost decision:
- Open the linked report.
- Record the revision, environment, input set, and command.
- Re-run it on representative data.
- Compare the same baseline and tokenizer.
- Separate measured results from projections and marketing language.
Start with Local-Benchmark-Report, Hallucination-Guard-Report, and Evidence-Boundaries.
The repository includes Python tests, Rust workspace crates, CI workflows, package publishing workflows, and security workflows.
python -m pytest
cargo test
cargo clippyThe exact commands and gates are defined by the current CI workflows and repository instructions. A local command passing does not prove that every OS-specific, packaging, or hosted deployment path works.
For contribution requirements, use Contributing-Guidelines. For the current source layout, use Repository-Map.
- Start-Here
- Project-Overview
- Turkish-Guide · Japanese-Guide · Chinese-Guide
- VSCode-Extension-Guide
- NPM-Installer-Guide
- Hugging-Face-Deployment
- MCP-and-OpenAPI
- Codebase-Internals
- Python-Core-Symbol-Reference
- Python-Core-Engine-Reference
- Python-Core-Analysis-Reference
- Python-Core-Workflow-Reference
- Python-Fixer-Symbol-Reference
- Python-Jarvis-Symbol-Reference
- Rust-Source-Reference
- MCP-Tool-Reference
- Tests-Source-Reference
- Extension-and-Packaging-Internals
- Architecture
- Repository-Map
- Developer-Walkthrough
- Workspace-Orchestration
- GitHub-Actions-and-Precommit
- Contributing-Guidelines
- AI-Agent-Inspection
- Anti-REA-Safe-Overview
- Privacy-and-Network-Behavior
- Security-Review
- Security-Reporting
- Guarded-Self-Healing
- Hallucination-Guard-Report
- Local-Benchmark-Report
- Evidence-Boundaries
The registry manifest in the repository declares stdio transport. The OpenAPI file is a separate description of the hosted Gradio application.
No. Local analysis is one path, but client/model settings, explicitly selected remote providers, public hosted demos, package downloads, metrics, and optional search can involve network requests. Read Privacy-and-Network-Behavior.
Not necessarily. Check the installed version, current tool catalog, package metadata, release notes, and tests for that version.
No. Roadmap documents include planned work. Use release notes, source code, and tests to confirm shipped behavior.
No. Results depend on workload and measurement method. Reproduce the benchmark using your own inputs.
Follow the repository's Security Reporting policy. Do not post exploit details publicly before coordinating with the maintainers.
This Wiki is organized around the repository's tracked documentation and metadata. Source-linked pages point back to the repository so readers can compare this snapshot with the latest revision.
- Source-Index lists the imported Markdown documents and their source paths.
- Changelog and the version-specific release pages are historical records.
-
server.json,pyproject.toml,openapi.yaml, source modules, and tests are the best references for machine-readable contracts and implementation details. - The hosted OpenAPI spec and the source package may describe different deployment versions.
License: T-Zero Algorithm declares AGPL-3.0-only; see the repository's LICENSE and NOTICE.