by paiml
Provides deterministic code generation with agents, offering zero‑configuration AI context generation, technical debt grading, quality enforcement, and MCP integration.
PmAT is an MCP server and CLI toolkit that creates deterministic AI‑generated context for codebases. It combines a powerful static‑analysis engine (Technical Debt Grading, real‑time quality monitoring, WASM verification) with agent‑centric workflows (AGENTS.md integration, Claude Code agent mode) and delivers results through CLI, HTTP and MCP interfaces.
cargo install pmat
npm install -g pmat-agent
docker run --rm -v $(pwd):/workspace paiml/pmat:latest pmat …
pmat mcp
(or via npm with npx -y pmat-agent mcp
).pmat context # generate AI context for current repo
pmat tdg . --include-components # technical debt grading
pmat analyze wasm module.wasm # WASM quality checks
pmat quality-gate --strict # enforce all quality gates
Q: Do I need to install Rust to run PmAT? A: Only the Rust binary requires a Rust toolchain for building from source. Pre‑built packages (cargo, npm, Docker, Homebrew, etc.) run out‑of‑the‑box.
Q: Can I run PmAT on Windows?
A: Yes. Install via Chocolatey (choco install pmat
) or use the Docker image.
Q: How does the MCP server start?
A: Execute pmat mcp
(or npx -y pmat-agent mcp
). The server listens on the default port and exposes REST endpoints and SSE streams.
Q: What storage back‑ends are supported for TDG scores? A: Pluggable back‑ends include Sled, RocksDB, and an in‑memory option, automatically tiered into hot, warm and cold caches.
Q: Is there a way to integrate pre‑commit hooks?
A: Yes. Run pmat tdg hooks install --backup
to generate hooks from a single pmat.toml
configuration.
Q: How can I limit analysis time?
A: Most analyze commands accept a --timeout <seconds>
flag to abort long‑running scans.
Q: Does PmAT support custom agent commands? A: Through AGENTS.md you can define custom markdown directives; the parser extracts and sandbox‑executes them respecting the quality gates.
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.
Two groundbreaking systems that redefine code quality and AI collaboration!
Complete quality automation from monitoring to enforcement! Revolutionary dual-track quality system with immediate production value:
Bridge AI agents with your codebase through standardized markdown! Complete integration of the AGENTS.md standard:
Comprehensive WASM module analysis and verification! Analyze WebAssembly binaries for quality, security, and performance:
Persistent file score storage for continuous quality improvement! PMAT now tracks its own quality metrics:
pmat tdg storage stats
for monitoring and diagnosticsSingle source of truth configuration for quality gate enforcement! Eliminate configuration duplication with PMAT-managed pre-commit hooks:
pmat.toml
configurationpmat tdg hooks install --backup
to get started🚀 v2.77.0 Release: WebAssembly Quality Assurance & Sprint 89 Technical Debt Elimination!
- 🔬 WASM Module: Complete WebAssembly analysis, verification, and security scanning
- 🔒 Formal Verification: Incremental verification with shadow stack analysis for WASM binaries
- 🛡️ Security Scanning: Pattern-based vulnerability detection for common WASM exploits
- 📊 Performance Profiling: Instruction mix analysis and hot function identification
- 🔧 Sprint 89 Complete: Eliminated 62% of complexity in WASM handler (26→10 cyclomatic)
- 📈 Quality Baselines: Multi-anchor baseline system for regression detection
🔧 v2.70.0 Clippy Automation: Intelligent Automatic Clippy Fixes
- 🎯 Confidence-Based: Only applies fixes above configurable thresholds (0.5-1.0)
- 🔄 Transactional Safety: Atomic changes with automatic rollback on failure
- ⚡ Performance: Cached AST analysis, parallel processing, <20s for 100K LOC
- 📊 CI/CD Ready: GitHub Actions, pre-commit hooks, MCP tool integration
- 🛡️ Risk Assessment: Identifies unsafe code, macros, lifetime changes before fixing
- 📊 Entropy Analysis: Actionable AST pattern-based entropy with fix suggestions and LOC reduction estimates
- 🧮 Advanced Algorithms: Winnowing, TF-IDF, Cosine Similarity, Jaccard Index, Levenshtein Distance
- 📄 Multi-Format Output: JSON, Markdown, CSV, SARIF, and Summary formats
- 🚀 Performance: Optimized for 100K+ LOC with parallel processing
- 🔧 Full Integration: CLI commands, MCP tools, and comprehensive examples
🚀 v2.39.0 Release: TDG System with MCP Integration & Advanced Monitoring! Production-ready technical debt analysis:
- 🌐 Web Dashboard: Real-time monitoring with Axum-based interface and Server-Sent Events
- 🛠️ 6 MCP Tools: Enterprise-grade external integration (tdg_analyze_with_storage, tdg_system_diagnostics, etc.)
- 📊 Advanced Analytics: Metrics aggregation, performance profiling, bottleneck detection
- 🚨 Alert System: Configurable thresholds with multi-channel notifications
- 📤 Multi-format Export: JSON, CSV, SARIF, HTML, Markdown, XML, Prometheus support
- 💾 Storage Flexibility: Pluggable backends (Sled, RocksDB, InMemory) with trait abstraction
🔧 v2.14.0 Release: Technical Debt Elimination via TDD! Major fixes using Test-Driven Development:
- ✅ Language Detection Fixed: Functions now properly detected (was 0, now detects all)
- 🚫 Zero Stub Implementations: All stub code eliminated with real implementations
- 📉 Complexity Reduced: Ruchy parser from 89 to ≤4 cyclomatic complexity (95% reduction)
- 🧪 TDD Coverage: 80%+ test coverage on critical language detection paths
- 🏭 Toyota Way Applied: ONE implementation principle, zero defect tolerance
🎯 v2.13.0: 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 tdg
command 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
Choose your preferred installation method - PMAT is available across all major package ecosystems:
cargo install pmat
# macOS/Linux - Homebrew
brew install pmat
# Windows - Chocolatey
choco install pmat
# Ubuntu/Debian - APT
sudo apt install pmat # (via PPA - coming soon)
# Arch Linux - AUR
yay -S pmat
# Node.js - npm (global)
npm install -g pmat-agent
# Latest version
docker run --rm -v $(pwd):/workspace paiml/pmat:latest pmat --version
# Interactive analysis
docker run --rm -v $(pwd):/workspace -w /workspace paiml/pmat:latest pmat context
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit
make build
# Linux/macOS Quick Install
curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
# Windows PowerShell
# Download from: https://github.com/paiml/paiml-mcp-agent-toolkit/releases
# Analyze current directory
pmat context
# Technical Debt Grading (TDG) - v2.39.0!
pmat tdg . --include-components
# Start TDG web dashboard
pmat tdg dashboard --port 8081 --open
# TDG analysis with automatic persistent storage (NEW - v2.68.0!)
pmat tdg server/src/tdg/analyzer_ast.rs
# Scores automatically stored in ~/.pmat/tdg-warm and ~/.pmat/tdg-cold
# View storage statistics and dogfooding progress
pmat tdg storage stats
# Get complexity metrics
pmat analyze complexity --top-files 10
# Find technical debt
pmat analyze satd
# Code similarity detection - v2.63.0! 🔍
pmat analyze duplicates --detection-type all # Find all types of duplicates
pmat analyze duplicates --format sarif # Export to SARIF format
pmat analyze duplicates --detection-type semantic --threshold 0.7
# Analysis with timeout control - NEW! 🔧
pmat analyze complexity --timeout 30 # 30-second timeout
pmat analyze dead-code --timeout 60 # 60-second timeout
pmat analyze satd --timeout 45 # 45-second timeout
# Run quality gates
pmat quality-gate --strict
# WebAssembly Analysis - NEW in v2.77.0! 🔬
pmat analyze wasm module.wasm # Basic analysis
pmat analyze wasm module.wasm --verify # With formal verification
pmat analyze wasm module.wasm --security # Security vulnerability scan
pmat analyze wasm module.wasm --profile # Performance profiling
pmat analyze wasm module.wasm --baseline ref.wasm # Quality comparison
pmat analyze wasm module.wasm --format sarif # CI/CD integration
# 📖 See full documentation: docs/wasm-features.md
# Start MCP server
pmat mcp
# Analyze any GitHub repository with AI recommendations
cargo run --example analyze_github_repo -- --url https://github.com/rust-lang/rust-clippy
# Compare multiple repositories across languages
cargo run --example compare_repos
# Run quality gates on GitHub repositories
cargo run --example quality_gate_github -- https://github.com/owner/repo
# Start interactive web demo
pmat demo --serve
# Then visit http://localhost:8080 for:
# • AI-powered repository recommendations
# • Multi-language project intelligence
# • Repository showcase gallery
# • Interactive analysis visualizations
# Setup quality enforcement (one-time)
make setup-quality
# Start development with quality checks
make dev
# Create quality-enforced commit
make commit
# Verify sprint quality
make sprint-close
PMAT implements Toyota Production System principles through rigorous static analysis:
// Unified service layer with dependency injection
pub trait Service: Send + Sync {
type Input: Serialize + DeserializeOwned;
type Output: Serialize + DeserializeOwned;
async fn process(&self, input: Self::Input) -> Result<Self::Output, Self::Error>;
}
// All protocols use unified request/response
#[derive(Serialize, Deserialize)]
pub struct UnifiedRequest {
pub operation: Operation,
pub params: Value,
pub context: RequestContext,
}
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit
# Setup Toyota Way quality enforcement
make setup-quality
# Build and test
make build
make validate
# Run examples
make examples
[dependencies]
pmat = "2.39.0"
use pmat::services::code_analysis::CodeAnalysisService;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let service = CodeAnalysisService::new();
// Generate AI-optimized context
let context = service.generate_context(".", None).await?;
// Analyze complexity with Toyota Way standards
let complexity = service.analyze_complexity(".", Some(10)).await?;
Ok(())
}
PMAT provides 18 MCP tools via unified pmcp SDK server:
# Start MCP server (auto-detects transport)
pmat mcp
# Test with Claude Code
cargo run --example mcp_server_pmcp
cargo run --example test_pmcp_server
analyze_tdg
- Technical Debt Grading with 6-metric scoringanalyze_tdg_compare
- Compare TDG scores between files/projectstdg_analyze_with_storage
- NEW v2.39.0! TDG analysis with configurable storage backendstdg_system_diagnostics
- NEW v2.39.0! Comprehensive system health monitoringtdg_storage_management
- NEW v2.39.0! Storage operations and managementtdg_performance_profiling
- NEW v2.39.0! Performance analysis with flame graphstdg_alert_management
- NEW v2.39.0! Alert configuration and monitoringtdg_export_data
- NEW v2.39.0! Multi-format data export (8 formats)analyze_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 issuesTransform PMAT into a persistent background quality agent that continuously monitors your codebase:
# Start agent as MCP server for Claude Code
pmat agent mcp-server
# Configure in Claude Code settings.json:
{
"mcpServers": {
"pmat": {
"command": "pmat",
"args": ["agent", "mcp-server"],
"env": {}
}
}
}
# Start monitoring a project
pmat agent start --project-path /path/to/project
# Check monitoring status
pmat agent status
# Stop monitoring
pmat agent stop
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 statusSee Claude Code Agent Guide for detailed setup and deployment instructions.
# Real-time TDG metrics
GET /api/metrics
# System health status
GET /api/health
# Storage statistics
GET /api/storage/stats
# Run TDG analysis
GET /api/analysis?path=src/main.rs
# System diagnostics
GET /api/diagnostics
# Real-time metrics stream (SSE)
GET /api/events
# Storage operations
POST /api/storage/operation
# AI-powered repository recommendations
GET /api/recommendations
# Multi-language project intelligence
GET /api/polyglot
# Repository showcase gallery
GET /api/showcase
# Core analysis APIs
GET /api/summary
GET /api/metrics
GET /api/hotspots
GET /api/dag
PMAT enforces extreme quality standards:
# Run comprehensive quality analysis
pmat quality-gate --strict
# CI/CD integration
pmat analyze complexity --fail-on-violation
pmat analyze satd --fail-on-violation
pmat quality-gate --strict --fail-on-violation
PMAT follows Toyota Way development principles:
make setup-quality
make dev
make commit
make sprint-close
All contributions must meet:
See CONTRIBUTING.md for detailed guidelines.
Licensed under the MIT License. See LICENSE for details.
Built with ❤️ by Pragmatic AI Labs
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "pmat": { "command": "npx", "args": [ "-y", "pmat-agent", "mcp" ], "env": { "API_KEY": "<YOUR_API_KEY>" } } } }
Discover more MCP servers with similar functionality and use cases
by zed-industries
Provides real-time collaborative editing powered by Rust, enabling developers to edit code instantly across machines with a responsive, GPU-accelerated UI.
by cline
Provides autonomous coding assistance directly in the IDE, enabling file creation, editing, terminal command execution, browser interactions, and tool extension with user approval at each step.
by continuedev
Provides continuous AI assistance across IDEs, terminals, and CI pipelines, offering agents, chat, inline editing, and autocomplete to accelerate software development.
by github
Enables AI agents, assistants, and chatbots to interact with GitHub via natural‑language commands, providing read‑write access to repositories, issues, pull requests, workflows, security data and team activity.
by block
Automates engineering tasks by installing, executing, editing, and testing code using any large language model, providing end‑to‑end project building, debugging, workflow orchestration, and external API interaction.
by RooCodeInc
An autonomous coding agent that lives inside VS Code, capable of generating, refactoring, debugging code, managing files, running terminal commands, controlling a browser, and adapting its behavior through custom modes and instructions.
by lastmile-ai
A lightweight, composable framework for building AI agents using Model Context Protocol and simple workflow patterns.
by firebase
Provides a command‑line interface to manage, test, and deploy Firebase projects, covering hosting, databases, authentication, cloud functions, extensions, and CI/CD workflows.
by gptme
Empowers large language models to act as personal AI assistants directly inside the terminal, providing capabilities such as code execution, file manipulation, web browsing, vision, and interactive tool usage.