Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
PAIML MCP Agent Toolkit (pmat)
Zero-configuration AI context generation system with extreme quality enforcement and Toyota Way standards. Analyze any codebase instantly through CLI, MCP, or HTTP interfaces. Built by Pragmatic AI Labs.
𧬠v2.174.0 Release: Mutation Testing CLI (Sprint 61)! AST-based test quality measurement:
- π§ͺ
pmat mutateCommand: Test your tests with AST-based mutation testing (no source recompilation)- β‘ Parallel Execution: Configurable worker threads (default: CPU core count) with real-time progress bars
- π Three Output Formats: Text (terminal), JSON (CI/CD), Markdown (PR comments with "Survived Mutants" section)
- π― Threshold Enforcement: Fail builds if mutation score below threshold (
--threshold 80.0)- π Test Gap Detection: Markdown reports highlight survived mutants for test improvement
- π¦ Rust Support: Fully functional for Rust (Python, TypeScript, Go, C++ planned for v2.175.0+)
- β±οΈ Smart Timeouts: Per-mutant timeout control (default: 30s, configurable via
--timeout)- β Production Ready: Tested on real files (239+ mutants), progress indicators, execution timing
π§ v2.158.0 Release: Semantic Code Search System! AI-powered code discovery with natural language:
- π Hybrid Search: Combines keyword matching (ripgrep) + vector similarity with RRF algorithm
- 𧬠AST-Aware Chunking: Semantic code extraction for 5 languages (Rust, TypeScript, Python, C/C++, Go)
- π OpenAI Embeddings: 1536-dimensional vectors with incremental updates (optional, for
pmat semantic search)- π Code Analytics: K-means, DBSCAN, hierarchical clustering + LDA topics via aprender (no API keys!)
- π€ MCP Integration: 4 new tools -
semantic_search,find_similar_code,cluster_code,analyze_topics- β‘ Production Ready: 149 tests, <150ms search, pure Rust ML for clustering/topics
- π» CLI Commands:
pmat embed sync,pmat semantic search,pmat analyze cluster/topics
π― v2.88.0 Release: Technical Debt Grading (TDG) System! Complete code quality scoring with 6 orthogonal metrics:
- π Comprehensive Scoring: Structural complexity, semantic complexity, code duplication, coupling analysis
- π Documentation Coverage: Language-specific documentation pattern detection and scoring
- π¨ Consistency Analysis: Naming conventions, indentation patterns, and code style consistency
- π Grade Classification: A+ through F grading system with detailed component breakdowns
- π Multi-Language Support: 10+ languages including Rust, Python, JavaScript, TypeScript, Go, Java, C/C++
- π οΈ CLI & MCP Integration:
pmat analyze tdgcommand and MCP tools for programmatic access- π Project Analysis: Directory-level analysis with language distribution and aggregated scoring
π v2.10.0: Claude Code Agent Mode - "Always Working" Achievement! Transform PMAT into a persistent background quality agent:
- π€ Claude Code Integration: Native MCP server for seamless Claude Code integration
- πΎ Persistent State: Monitoring state maintained across restarts with auto-save
- βοΈ Production Ready: Environment-specific configs for dev, prod, and CI/CD
- π Real-time Monitoring: Continuous quality tracking with file system watching
- ποΈ Service Architecture: Systemd deployment with health checks and auto-restart
π― v2.9.0: Universal Demo "Just Works" Achievement! Complete AI-powered repository intelligence with multi-language analysis:
- π€ AI-Powered Recommendations: Framework-aware repository recommendations with complexity-based learning tiers
- π Multi-Language Intelligence: Advanced polyglot analysis with cross-language dependency detection
- ποΈ Architecture Pattern Recognition: Microservices, Layered, Event-driven pattern detection with confidence scoring
- π Repository Showcase Gallery: Curated collection of 8+ repositories across languages and complexity levels
- β‘ Universal Demo: Any GitHub repository URL β Complete analysis with AI recommendations
- π Enhanced Web Demo: Interactive visualizations with 3 new API endpoints (/api/recommendations, /api/polyglot, /api/showcase)
- Toyota Way Excellence: Zero compilation defects maintained throughout development
π Quick Start
Installation
Choose your preferred installation method - PMAT is available across all major package ecosystems:
π¦ Rust (Recommended)
π¦ Package Managers
# macOS/Linux - Homebrew
# Windows - Chocolatey
# Ubuntu/Debian - APT
# Arch Linux - AUR
# Node.js - npm (global)
π³ Docker
# Latest version
# Interactive analysis
π§ From Source
π₯ Direct Download
# Linux/macOS Quick Install
|
# Windows PowerShell
# Download from: https://github.com/paiml/paiml-mcp-agent-toolkit/releases
Basic Usage
# Analyze current directory
# Semantic Code Search - NEW!
# Technical Debt Grading (TDG)
# Get complexity metrics
# Find technical debt
# Mutation Testing - NEW! (v2.174.0 - Sprint 61)
# Validate documentation links
# Validate README for hallucinations - NEW! (Sprint 38)
# Run quality gates
# Start MCP server
Universal Demo - "Just Works" Analysis
# Analyze any GitHub repository with AI recommendations
# Compare multiple repositories across languages
# Run quality gates on GitHub repositories
# Start interactive web demo
# Then visit http://localhost:8080 for:
# β’ AI-powered repository recommendations
# β’ Multi-language project intelligence
# β’ Repository showcase gallery
# β’ Interactive analysis visualizations
Toyota Way Development (NEW)
# Setup quality enforcement (one-time)
# Start development with quality checks
# Create quality-enforced commit
# Verify sprint quality
π― Core Capabilities
π§ Semantic Search Engine (NEW!)
- Hybrid Search: Combines keyword (ripgrep) + vector similarity with Reciprocal Rank Fusion (RRF)
- AST-Aware Chunking: Semantic code extraction for 5 languages using tree-sitter
- OpenAI Embeddings: 1536-dimensional vectors with incremental SHA256-based updates (optional, for
pmat semantic search) - Vector Database: Local SQLite storage with cosine similarity search (<100ms)
- Code Analytics: K-means, hierarchical, DBSCAN clustering + LDA topic modeling via aprender (pure Rust, no API keys required)
- Natural Language Queries: Find "error handling patterns" across different terminology
- Similarity Detection: Discover code duplicates and refactoring opportunities
- Architecture Insights: Cluster-based pattern discovery and topic extraction
Analysis Engine
- Documentation Link Validator: Validate markdown links (internal & external) with HTTP retry logic
- Technical Debt Grading (TDG): 6-metric orthogonal code quality scoring with A+ through F grading
- Complexity Analysis: McCabe cyclomatic & cognitive complexity with AST precision
- Dead Code Detection: Graph-based reachability analysis across 30+ languages
- SATD Detection: Self-admitted technical debt with severity classification
- Documentation Coverage: Language-specific pattern detection with scoring algorithms
- Consistency Analysis: Naming conventions and code style consistency measurement
- Deep Context Generation: Multi-dimensional analysis optimized for AI agents
π€ AI-Powered Intelligence (NEW)
- Smart Recommendations: Framework-aware repository suggestions with complexity matching
- Polyglot Analysis: Cross-language dependency detection and architecture pattern recognition
- Repository Showcase: Curated gallery with learning pathways from beginner to expert
- Integration Points: Risk assessment of multi-language project coupling with mitigation strategies
Quality Systems
- Quality Gates: Zero-tolerance enforcement (complexity β€20, SATD=0, coverage >80%)
- Quality Proxy: AI code interceptor with 7-stage validation pipeline
- PDMT Integration: Deterministic todo generation with embedded quality requirements
- Refactoring Engine: State machine-based code transformation with ACID snapshots
ποΈ Agent System (Enterprise)
- Distributed Architecture: Actix actor system with zero-copy messaging and Raft consensus
- Sub-Agent Types: AnalyzerActor, TransformerActor, ValidatorActor, OrchestratorActor
- Workflow Engine: DSL-based automation with step dependencies and parallel execution
- Resource Management: CPU/Memory/GPU/Network/IO control with enterprise-grade fault tolerance
- MCP Integration: Full Model Context Protocol server with multiple transport modes
Integration Protocols
- MCP Protocol: 22 tools via unified pmcp SDK 1.2.0 server (includes TDG + 4 semantic search tools)
- New:
semantic_search,find_similar_code,cluster_code,analyze_topics
- New:
- HTTP API: RESTful with Server-Sent Events streaming
- CLI Interface: 50+ commands with POSIX-compliant exit semantics
π Documentation
Core Documentation
- Complete Specification - Unified source of truth (36 sections)
- TDG Guide - NEW! Technical Debt Grading system documentation
- Agent Architecture - NEW! Sub-agent system and distributed computing capabilities
- API Reference - Service APIs and integration patterns
- CLI Reference - Complete command documentation
Quality & Development
- Toyota Way Guide - Development workflow and standards
- Sprint Management - Task tracking and execution DAG
- Quality Gates - Enforcement mechanisms
Language Support
- Cross-Language Analysis - NEW! Polyglot codebase analysis
- Polyglot AST Feature Flags - NEW! Language feature configuration
- Language Support Details - Supported language capabilities
Integration Guides
- MCP Integration - Model Context Protocol setup
- PDMT Guide - Deterministic todo generation
- CI/CD Integration - Pipeline integration
ποΈ Architecture
PMAT implements Toyota Production System principles through rigorous static analysis:
- Kaizen (ζΉε): Iterative file-by-file improvement with measurable ΞQ metrics
- Genchi Genbutsu (ηΎε°ηΎη©): Direct AST traversal, no heuristics
- Jidoka (θͺεε): Automated quality gates with fail-fast semantics
- Zero SATD Policy: Compile-time enforcement of zero technical debt
Service Architecture
// Unified service layer with dependency injection
// All protocols use unified request/response
Performance Characteristics
- Startup: 4ms hot, 127ms cold (mmap'd grammar cache)
- Analysis: 487K LOC/s single-thread, 3.9M LOC/s multi-core
- Memory: 47MB base + 312KB per KLOC
- SIMD: 43% vectorized paths, 2.7x AVX2 speedup
π οΈ Development
Requirements
- Rust 1.80.0+
- Git (for repository analysis)
Build from Source
# Setup Toyota Way quality enforcement
# Build and test
# Run examples
Library Usage
[]
= "2.88.0"
use CodeAnalysisService;
async
Feature Flag Options
PMAT uses Rust's feature flag system for customizing language support:
# Default configuration (all features enabled)
= "2.158.0"
# Custom configuration with specific language support
= { = "2.158.0", = false, = ["polyglot-java", "polyglot-typescript"] }
# Available language-specific features:
# - polyglot-java
# - polyglot-kotlin
# - polyglot-scala
# - polyglot-typescript
# - polyglot-javascript
# - polyglot-csharp
# - polyglot-ruby
See Polyglot AST Feature Flags for detailed documentation.
## π Language Support
- **Rust**: Full cargo integration with syn AST
- **TypeScript/JavaScript**: SWC-based parsing
- **Python**: RustPython AST analysis
- **C/C++**: Tree-sitter with goto tracking
- **Ruchy**: v1.5.0 support with advanced analysis
- Full AST parsing with 35+ token types
- Halstead metrics (volume, difficulty, effort, time, bugs)
- Dead code detection (unused functions/variables)
- Type inference for literals and binary operations
- Actor message flow analysis with deadlock detection
- Enhanced pattern matching complexity scoring
- Import/export dependency tracking
- **Kotlin**: Tree-sitter based analysis
- **30+ Languages**: Via tree-sitter grammar support
### Cross-Language Analysis
PMAT provides a unified cross-language AST framework that enables analysis across language boundaries:
- **Polyglot AST**: Common node representation across all languages
- **Cross-Language Dependencies**: Track relationships between nodes in different languages
- **Language Mappers**: Translate language-specific ASTs to unified nodes
- **Configurable Support**: Build with only the language support you need ([Feature Flags](../docs/polyglot-ast-feature-flags.md))
## π€ MCP Integration
PMAT provides 18 MCP tools via unified pmcp SDK server:
```bash
# Start MCP server (auto-detects transport)
pmat mcp
# Test with Claude Code
cargo run --example mcp_server_pmcp
cargo run --example test_pmcp_server
Available Tools
analyze_tdg- NEW! Technical Debt Grading with 6-metric scoringanalyze_tdg_compare- NEW! Compare TDG scores between files/projectsanalyze_complexity- Complexity metricsanalyze_satd- Technical debt detectionanalyze_dead_code- Unused code analysisquality_gate- Comprehensive quality validationrefactor_start- Begin refactoring workflowpdmt_deterministic_todos- Generate quality todosgithub_create_issue- Create GitHub issues- NEW: AI recommendation tools for intelligent repository analysis
- And 9 more...
π€ Claude Code Agent Mode (NEW v2.10.0)
Transform PMAT into a persistent background quality agent that continuously monitors your codebase:
Quick Start with Claude Code
# Start agent as MCP server for Claude Code
# Configure in Claude Code settings.json:
{
}
Background Daemon Mode
# Start monitoring a project
# Check monitoring status
# Stop monitoring
Key Features
- Real-time Monitoring: File system watching with instant quality feedback
- Persistent State: Maintains metrics across restarts with auto-save
- Toyota Way Compliance: Enforces β€20 complexity with zero SATD tolerance
- Production Ready: Systemd service with health checks and auto-restart
- MCP Native: Seamless Claude Code integration via stdio transport
Available Agent Tools
start_quality_monitoring- Begin monitoring a projectstop_quality_monitoring- Stop monitoringget_quality_status- Current quality metricsrun_quality_gates- Execute quality checksanalyze_complexity- Complexity analysishealth_check- Agent health status
See Claude Code Agent Guide for detailed setup and deployment instructions.
π Web Demo API Endpoints (NEW)
# AI-powered repository recommendations
# Multi-language project intelligence
# Repository showcase gallery
# Core analysis APIs
π Quality Standards
PMAT enforces extreme quality standards:
- Complexity: β€20 cyclomatic, β€15 cognitive
- Technical Debt: 0 SATD comments allowed
- Test Coverage: >80% with property-based testing
- Code Quality: 0 lint warnings, 0 dead code
- Documentation: Synchronized with every commit
Quality Gates
# Run comprehensive quality analysis
# CI/CD integration
π Contributing
PMAT follows Toyota Way development principles:
- Setup quality enforcement:
make setup-quality - Start development:
make dev - Make changes with documentation updates
- Quality-enforced commit:
make commit - Sprint verification:
make sprint-close
All contributions must meet:
- Zero SATD comments
- Complexity β€20 per function
- Full test coverage
- Documentation updates
Contribution guidelines coming soon.
π License
Licensed under the MIT License.
Built with β€οΈ by Pragmatic AI Labs