Skip to content

Pragmatic AI Labs MCP Agent Toolkit - An MCP Server designed to make code with agents more deterministic

Notifications You must be signed in to change notification settings

paiml/paiml-mcp-agent-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PAIML MCP Agent Toolkit (pmat)

Crates.io Documentation CI/CD Quality Gate MCP Compatible License: MIT Downloads Rust 1.80+

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.5.0 Release: Toyota Way Quality Integration! Unified project management with ruchy-inspired documentation synchronization:

  • Quality Gates: Pre-commit hooks enforce documentation updates with every code change
  • Sprint Management: Task tracking with PMAT-XXXX IDs and velocity metrics
  • Toyota Way Standards: Kaizen workflow, MCP-first dogfooding, zero-tolerance quality
  • 18 MCP Tools: High-performance pmcp SDK with unified protocol design
  • PDMT Integration: Deterministic todo generation with quality requirements
  • Zero Technical Debt: 0 SATD comments, complexity ≀20, comprehensive testing

πŸš€ Quick Start

Installation

# From Crates.io (Recommended)
cargo install pmat

# Linux Quick Install
curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh

# From Source
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit
make build

Basic Usage

# Analyze current directory
pmat context

# Get complexity metrics
pmat analyze complexity --top-files 10

# Find technical debt
pmat analyze satd

# Run quality gates
pmat quality-gate --strict

# Start MCP server
pmat mcp

Toyota Way Development (NEW)

# 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

🎯 Core Capabilities

Analysis Engine

  • 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
  • Technical Debt Gradient: Multi-factor composite scoring with time-decay modeling
  • Deep Context Generation: Multi-dimensional analysis optimized for AI agents

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

Integration Protocols

  • MCP Protocol: 18 tools via unified pmcp SDK 1.2.0 server
  • HTTP API: RESTful with Server-Sent Events streaming
  • CLI Interface: 47 commands with POSIX-compliant exit semantics

πŸ“– Documentation

Core Documentation

Quality & Development

Integration Guides

πŸ—οΈ 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
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,
}

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

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

Library Usage

[dependencies]
pmat = "2.5"
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(())
}

πŸ” 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
  • 30+ Languages: Via tree-sitter grammar support

πŸ€– MCP Integration

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

Available Tools

  • analyze_complexity - Complexity metrics
  • analyze_satd - Technical debt detection
  • analyze_dead_code - Unused code analysis
  • quality_gate - Comprehensive quality validation
  • refactor_start - Begin refactoring workflow
  • pdmt_deterministic_todos - Generate quality todos
  • github_create_issue - Create GitHub issues
  • And 11 more...

πŸ“Š 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
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

πŸš€ Contributing

PMAT follows Toyota Way development principles:

  1. Setup quality enforcement: make setup-quality
  2. Start development: make dev
  3. Make changes with documentation updates
  4. Quality-enforced commit: make commit
  5. Sprint verification: make sprint-close

All contributions must meet:

  • Zero SATD comments
  • Complexity ≀20 per function
  • Full test coverage
  • Documentation updates

See CONTRIBUTING.md for detailed guidelines.

πŸ“‹ License

Licensed under the MIT License. See LICENSE for details.

Built with ❀️ by Pragmatic AI Labs

About

Pragmatic AI Labs MCP Agent Toolkit - An MCP Server designed to make code with agents more deterministic

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published