Skip to main content
Glama

🩺 T-Zero PC-Fixer & Codebase Doctor

Autonomous Self-Healing Operating System & Codebase Doctor (12,650+ Lines Master Edition)

CI Status Python Support License: MIT Codebase Volume Zero-Leak Rating Zero Cost MCP Protocol Docker Ready Smithery Glama M8ven Score T-Zero Live Demo


🌟 Executive Overview

T-Zero PC-Fixer & Codebase Doctor is an encyclopedic, industrial-grade autonomous self-healing engine and Model Context Protocol (MCP) server. It diagnoses and fixes computer environments, developer toolchains, virtual environments, Git version control issues, AST syntax errors, PEP 517 packaging conflicts, and OWASP/CWE security vulnerabilities with zero external dependencies and $0.00 cloud cost.

Available as both a single-file monolithic executable (tzero_pc_fixer.py, 12,657 lines) and a modular Python package (tzero_fixer/), it delivers surgical repair recipes with full transactional rollback safety.


Related MCP server: aiganak-aiops-mcp

🏗 System Architecture

flowchart TD
    subgraph Presentation ["Presentation & Interfaces"]
        CLI["CLI: pc-fixer / tzero-doctor"]
        MCP["MCP Server: pc-fixer-mcp (Claude / Cursor / Windsurf)"]
        TUI["Interactive ANSI Cockpit TUI"]
    end

    subgraph Orchestrator ["Sovereign Orchestration Core"]
        ORCH["FixerOrchestrator"]
        TX["Transactional Backup & Rollback (.tzero/fixer_backups)"]
        CONV["Multi-Pass Convergence Engine"]
    end

    subgraph Specialists ["Surgical Healers & Diagnostics"]
        OS["OS & Hardware Doctor\n(RAM, Registry, S.M.A.R.T., WSL2, Dev Ports)"]
        VENV["Virtualenv & ABI Surgeon\n(pyvenv.cfg, PEP 517, dist-info)"]
        GIT["Git Advanced Surgeon\n(index.lock, detached HEAD, submodules)"]
        AST["AST Syntax Healer\n(Colons, delimiters, indents, docstrings)"]
        SEC["100% Zero-Leak Security Guard\n(CWE-78, CWE-89, CWE-798, .env migrator)"]
        POLY["Polyglot Build Healer\n(Dockerfiles, Makefiles, Nginx confs)"]
    end

    CLI --> ORCH
    MCP --> ORCH
    TUI --> ORCH
    ORCH --> TX
    ORCH --> CONV
    CONV --> OS
    CONV --> VENV
    CONV --> GIT
    CONV --> AST
    CONV --> SEC
    CONV --> POLY

🚀 Key Capabilities

  1. AST Syntax & Delimiter Surgical Healer: Automatically detects and repairs missing colons, unbalanced brackets/parentheses, indentation errors, and unclosed quotes.

  2. Virtual Environment & ABI Doctor: Detects corrupted pyvenv.cfg, resolves conflicting or duplicate .dist-info directories in site-packages, and handles PEP 517/621 build-backend injection.

  3. Git VCS Advanced Surgeon: Cleans stale .git/index.lock and .git/HEAD.lock after crashes, rescues detached HEAD states into safe branches, and generates .gitattributes for universal cross-platform line ending normalization.

  4. Dev Port & Hardware Doctor: Identifies and terminates rogue processes locking developer ports (3000, 5000, 8000, 8080), monitors physical disk partition space, and detects WSL2 .vhdx storage expansion.

  5. 100% Zero-Leak Security Guard: Scans AST code for 60+ high-entropy API key patterns (AWS, OpenAI, Anthropic, Gemini, GitHub, Stripe, DB URIs) and migrates them safely into .env with automatic os.environ.get() replacement.

  6. Polyglot Build & Container Healer: Repairs Makefile space-to-tab indentation traps, generates high-efficiency .dockerignore files, and audits Nginx reverse proxy configurations for missing semicolons.

  7. Transactional Atomic Rollback: Backs up all modified files into .tzero/fixer_backups/<tx_id>/ before touching disk, enabling 1-second atomic rollbacks via --rollback <tx_id>.


📦 Installation

Linux & macOS:

curl -fsSL https://raw.githubusercontent.com/toprakahmetaydogmus/tzero-pc-fixer/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/toprakahmetaydogmus/tzero-pc-fixer/main/install.ps1 | iex

Option 2: Install via Pip

pip install tzero-pc-fixer

Option 3: Single-File Zero-Dependency Standalone

Download the single-file masterpiece tzero_pc_fixer.py directly without installing any packages:

curl -O https://raw.githubusercontent.com/toprakahmetaydogmus/tzero-pc-fixer/main/tzero_pc_fixer.py
python tzero_pc_fixer.py --help

Option 4: From Source

git clone https://github.com/toprakahmetaydogmus/tzero-pc-fixer.git
cd tzero-pc-fixer
pip install -e .

💻 Command-Line Interface (CLI)

# 1. Run complete workspace diagnostic check
pc-fixer .

# 2. Autonomously heal all detected defects with atomic backup
pc-fixer --heal

# 3. Simulate self-healing without touching files on disk
pc-fixer --heal --dry-run

# 4. Roll back any previously executed healing transaction
pc-fixer --rollback tx_1793900379_d7337d

# 5. Output reports in SARIF v2.1.0 (for GitHub Security tab) or JUnit XML
pc-fixer --format sarif --out results.sarif
pc-fixer --format junit --out results.xml

# 6. Install Git pre-commit zero-leak & syntax quality gate
pc-fixer --install-hook

# 7. Generate GitHub Actions CI quality workflow
pc-fixer --generate-ci

# 8. Run synthetic stress benchmarks
pc-fixer --benchmark

🔌 Model Context Protocol (MCP) Server Setup

T-Zero PC-Fixer exposes a fully compliant JSON-RPC 2.0 stdio MCP server for AI IDEs and assistants:

1-Click Install via Smithery

To automatically install T-Zero PC-Fixer for Claude Desktop:

npx -y @smithery/cli install tzero-pc-fixer --client claude

Glama MCP Registry

Access or configure through Glama.ai. Both stdio and HTTP/SSE transports are pre-configured.

Docker Container

Run the official container directly:

docker build -t tzero-pc-fixer .
docker run -i tzero-pc-fixer

Claude Desktop (Manual Config)

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "pc-fixer": {
      "command": "python",
      "args": ["-m", "tzero_fixer.mcp_server"]
    }
  }
}

Cursor & Windsurf

Add to your workspace .cursor/mcp.json or Windsurf global config:

{
  "mcpServers": {
    "pc-fixer": {
      "command": "pc-fixer-mcp"
    }
  }
}

Available MCP Tools

  • pc_fixer_diagnose: Deep multi-tier workspace and OS diagnostics.

  • pc_fixer_auto_heal: Autonomous surgical self-healing with rollback manifest.

  • pc_fixer_rollback: Transactional atomic rollback using transaction UUID.

  • pc_fixer_check_system: Hardware health, disk partition space, and dev port conflicts.

  • pc_fixer_cwe_audit: Static AST CWE-78/89/22/798 vulnerability scanner.

  • pc_fixer_kill_port_process: Terminate processes locking dev ports (3000, 5000, etc.).

  • pc_fixer_clean_git_locks: Detect and safely delete stale Git lock files.


📊 Comprehensive Capability Matrix

Feature

T-Zero PC-Fixer

Ruff

Black

Bandit

Snyk

Dependencies Required

0 (Zero)

1+

5+

8+

Node/Cloud

Cloud Cost / Subscriptions

$0.00 Free

Free

Free

Free

Paid

AST Syntax Error Repair

Yes

No

No

No

No

Virtualenv & pyvenv.cfg Repair

Yes

No

No

No

No

Git Stale Lock Removal

Yes

No

No

No

No

Dev Port Conflict Termination

Yes

No

No

No

No

CWE / OWASP Vulnerability Check

Yes

Partial

No

Yes

Yes

Zero-Leak Secret Migration to .env

Yes

No

No

No

No

Transactional Atomic Rollback

Yes

No

No

No

No

Native MCP Server Support

Yes

No

No

No

No


🔒 100% Zero-Leak Security & Privacy Policy

  1. Zero External Data Transmission: 100% of all diagnostics, AST parsing, and code repairs run locally offline on your device.

  2. Zero Paid Cloud API Calls: No external LLM credits, subscriptions, or API tokens are required.

  3. No Secret Telemetry: No user analytics, metrics, or logs are transmitted to any external server.


🧪 Running Tests

# Run all unit and integration tests
python -m unittest discover -s tests -p "test_*.py" -v

📄 License

Distributed under the MIT License. See LICENSE for details. Crafted with passion by Toprak Ahmet Aydogmus & Siber Akademi T-Zero R&D Team.

Available Tools

7 tools
pc_fixer_auto_healA

Autonomously heal detected codebase and environment defects with automatic backup and atomic rollback manifest. Safe with dry-run verification mode.

Inputs: path, dry_run, category.

pc_fixer_check_systemC

Check physical hardware health, disk partitions space, WSL2 vhdx growth, high-memory consumer processes, and active developer port conflicts (3000, 5000, 8000, etc.).

Inputs: ports.

pc_fixer_clean_git_locksA

Find and remove stale Git lock files (.git/index.lock, .git/HEAD.lock, refs locks) that block git operations after crashes or aborted commands.

Inputs: path.

pc_fixer_cwe_auditB

Execute local AST static security vulnerability scan against OWASP Top 10 and CWE catalog (CWE-78 Command Injection, CWE-89 SQL Injection, CWE-22 Path Traversal, CWE-798 Hardcoded Secrets).

Inputs: path.

pc_fixer_diagnoseC

Run deep multi-tier diagnostics across workspace code, operating system environment, virtual environments, Git repository locks, PEP 517 build configs, AST syntax, and CWE vulnerabilities.

Inputs: path, categories.

pc_fixer_kill_port_processB

Find and terminate the process locking a specific developer port (e.g. 3000, 5000, 8000, 8080) to unblock dev servers without rebooting.

Inputs: port (required).

pc_fixer_rollbackA

Roll back a previously executed healing transaction using its unique transaction ID, restoring modified files to their exact pre-fix state.

Inputs: transaction_id (required), path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 7 tools

    Disambiguation3/5

    Most tools are distinct, but pc_fixer_diagnose explicitly claims to cover 'Git repository locks' and 'CWE vulnerabilities,' directly overlapping with the dedicated pc_fixer_cwe_audit and pc_fixer_clean_git_locks tools. An agent wanting a security scan or git-lock cleanup could reasonably misselect between the broad diagnose tool and the specialized ones, though descriptions do help differentiate.

    Naming Consistency4/5

    All tools share a consistent pc_fixer_ prefix and snake_case convention, which is a strong unifying pattern. However, action ordering is mixed (check_system and kill_port_process are verb_noun, while cwe_audit is noun_verb and rollback/diagnose are bare verbs), a minor deviation from a uniform verb_noun scheme.

    Tool Count5/5

    Seven tools is well within the ideal 3-15 range for a PC/codebase fixing server. Each tool maps to a distinct concern (diagnose, heal, rollback, system health, security audit, port kill, git locks) and earns its place without bloat.

    Completeness4/5

    The lifecycle of diagnose -> heal -> rollback is covered, along with system checks and targeted fixes, giving strong overall coverage. The one gap is discoverability of transaction IDs: pc_fixer_rollback requires a transaction ID but there is no tool to list prior healing transactions, forcing reliance on manifests returned by heal.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables LLM-driven agents to autonomously detect, diagnose, repair, verify, and prevent software and hardware failures on local and remote systems. Includes built-in safety checks and automatic rollbacks.
      15
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables autonomous infrastructure diagnostics, log root-cause analysis, and safe code patching via tools for querying logs, inspecting Python AST, and applying git-safe patches.
      3
      Apache 2.0
    • A
      license
      B
      quality
      B
      maintenance
      Provides a universal developer operations and diagnostics toolkit with sandboxed code execution, algorithm stress testing, security secret scanning, AST-based code fixes, and a visual dashboard for ERD, port/process inspection, and differential testing.
      28
      36 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to securely inspect, modify, and manage local projects with trusted filesystem access, safe Git operations, controlled task execution, and developer runtime process management over stdio or HTTP.
      4
      Apache 2.0