A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/paiml/paiml-mcp-agent-toolkit below:

GitHub - paiml/paiml-mcp-agent-toolkit: Pragmatic AI Labs MCP Agent Toolkit

PAIML MCP Agent Toolkit (pmat)

Zero-configuration AI context generation system that analyzes any codebase instantly through CLI, MCP, or HTTP interfaces. Built by Pragmatic AI Labs with extreme quality standards and zero tolerance for technical debt.

πŸŽ‰ v2.3.1 Release: Dependency Updates & PDMT Integration! All MCP implementations consolidated into ONE high-performance pmcp SDK-based server. Features include:

Install pmat using one of the following methods:

# Analyze current directory
pmat context

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

# Analyze specific files with include patterns
pmat analyze complexity --include "src/*.rs" --format json

# Test with validated examples (try these!)
cargo run --example complexity_demo
pmat analyze complexity --include "server/examples/complexity_*.rs"

# Find technical debt
pmat analyze satd

# Run comprehensive quality checks
pmat quality-gate --strict

# NEW: Quality Proxy - Enforce quality standards on AI-generated code
cargo run --example quality_proxy_demo

# NEW: PDMT Integration - Generate deterministic todos with quality enforcement
cargo run --example pmcp_analyze_workflow  # Full PDMT workflow demo
pmat mcp-call pdmt_deterministic_todos --requirements '["implement auth", "add logging"]'

# NEW: GitHub Issues Integration - Create quality-enforced GitHub issues
pmat github create-issue --title "Implement Authentication System" --type feature --requirements '["OAuth integration", "JWT tokens"]'
pmat github list-issues --state open --labels "enhancement,quality-gate"

# Test MCP server and tools
cargo run --example mcp_server_pmcp      # Start MCP server
cargo run --example test_pmcp_server     # Test MCP tools
cargo run --example unified_mcp_demo     # Complete MCP demonstration

Add to your Cargo.toml:

[dependencies]
pmat = "2.3"

Basic usage:

use pmat::{
    services::code_analysis::CodeAnalysisService,
    types::ProjectPath,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let service = CodeAnalysisService::new();
    let path = ProjectPath::new(".");
    
    // Generate context
    let context = service.generate_context(path, None).await?;
    println!("Project context: {}", context);
    
    // Analyze complexity
    let complexity = service.analyze_complexity(path, Some(10)).await?;
    println!("Complexity results: {:?}", complexity);
    
    Ok(())
}
πŸ› οΈ Refactoring & Quality Tools πŸ“Š Quality Gates & CI/CD Integration πŸ€– Agent Scaffolding (NEW)
# Zero-configuration context generation
pmat context                                    # Auto-detects language
pmat context --format json                     # JSON output
pmat context -t rust                           # Force toolchain
pmat context --skip-expensive-metrics          # Fast mode

# Code analysis
pmat analyze complexity --top-files 5         # Complexity analysis
pmat analyze complexity --fail-on-violation   # CI/CD mode - exit(1) if violations
pmat analyze churn --days 30                  # Git history analysis  
pmat analyze dag --target-nodes 25            # Dependency graph
pmat analyze dead-code --format json          # Dead code detection
pmat analyze dead-code --fail-on-violation --max-percentage 10  # CI/CD mode
pmat analyze satd --top-files 10              # Technical debt
pmat analyze satd --strict --fail-on-violation  # Zero tolerance for debt
pmat analyze deep-context --format json       # Comprehensive analysis
pmat analyze deep-context --full               # Full detailed report
pmat analyze deep-context --include-pattern "*.rs" # Filter by file pattern
pmat analyze big-o                            # Big-O complexity analysis
pmat analyze makefile-lint                    # Makefile quality linting
pmat analyze proof-annotations                # Provability analysis

# Analysis commands
pmat analyze graph-metrics                    # Graph centrality metrics (PageRank, betweenness, closeness)
pmat analyze name-similarity "function_name"  # Fuzzy name matching with phonetic support
pmat analyze symbol-table                     # Symbol extraction with cross-references
pmat analyze duplicates --min-lines 10        # Code duplication detection
pmat quality-gate --fail-on-violation         # Comprehensive quality enforcement
pmat diagnose --verbose                       # Self-diagnostics and health checks

# WebAssembly Support
pmat analyze assemblyscript --wasm-complexity  # AssemblyScript analysis with WASM metrics
pmat analyze webassembly --include-binary      # WebAssembly binary and text format analysis

# Project scaffolding
pmat scaffold project rust --templates makefile,readme,gitignore  # Scaffold a Rust project
pmat scaffold agent --name my_agent --template mcp-server         # Create MCP agent
pmat scaffold agent --interactive                                 # Interactive agent creation
pmat list                                      # Available templates
pmat list-agents                                # Available agent templates

# Refactoring engine
pmat refactor interactive                      # Interactive refactoring
pmat refactor serve --config refactor.json     # Batch refactoring
pmat refactor status                          # Check refactor progress
pmat refactor resume                          # Resume from checkpoint
pmat refactor auto                            # AI-powered automatic refactoring
pmat refactor docs --dry-run                  # Clean up documentation

# Demo and visualization
pmat demo --format table                      # CLI demo
pmat demo --web --port 8080                   # Web interface
pmat demo --repo https://github.com/user/repo # Analyze GitHub repo

# Quality enforcement
pmat quality-gate --fail-on-violation         # CI/CD quality gate
pmat quality-gate --checks complexity,satd,security  # Specific checks
pmat quality-gate --format human              # Human-readable output
pmat enforce extreme                          # Enforce extreme quality standards
πŸ’« See CLI usage in action
Context and code analysis:

Running demos/visualization:

PMAT provides comprehensive MCP (Model Context Protocol) integration for seamless AI-assisted development.

πŸ“š Complete MCP Documentation:

# Quick setup for Claude Code (see full guide above)
# Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
# or ~/.config/Claude/claude_desktop_config.json (Linux)
{
  "mcpServers": {
    "pmat": {
      "command": "pmat",
      "args": [],
      "env": {"RUST_LOG": "info"}
    }
  }
}
πŸ’« See Claude Code usage in action
Enhanced MCP Server Performance (v2.0+)

New in v2.0: pmat now uses the pmcp 1.2.0 Rust MCP SDK for dramatically improved performance:

The unified MCP server uses the high-performance pmcp Rust SDK exclusively:

# Run the unified MCP server (auto-detected)
pmat

# With debug logging
pmat --debug

Supported transports:

All MCP operations now flow through a single, unified server implementation:

// The unified server provides all tools in one place
use pmat::mcp_pmcp::UnifiedServer;

let server = UnifiedServer::new()?;
server.run().await?;

// Includes 17 core tools:
// - Analysis: complexity, SATD, dead code, DAG, deep context, Big-O
// - Refactoring: start, nextIteration, getState, stop
// - Quality: quality_gate, quality_proxy
// - Context: git_operation, generate_context, scaffold_project

The unified architecture provides:

Available MCP tools:

πŸ”— MCP Tool Composition (NEW)

AI agents can now chain analysis tools using the --files parameter:

# Step 1: Find complexity hotspots
pmat analyze complexity --top-files 5 --format json

# Step 2: Deep analyze those specific files (MCP composition)
pmat analyze comprehensive --files src/complex.rs,src/legacy.rs

# Step 3: Target refactoring on problematic files
pmat refactor auto --files src/complex.rs

MCP Agent Workflow Example:

// AI agent discovers hotspots
const hotspots = await callTool("pmat_analyze_complexity", {
  top_files: 5, 
  format: "json"
});

// Agent extracts file paths and performs deep analysis
const detailed = await callTool("pmat_analyze_comprehensive", {
  files: hotspots.files.map(f => f.path)
});

// Agent generates targeted refactoring plan
const refactor = await callTool("pmat_refactor_auto", {
  files: detailed.high_risk_files
});
# Start server
pmat serve --port 8080 --cors

# API endpoints
curl "http://localhost:8080/health"
curl "http://localhost:8080/api/v1/analyze/complexity?top_files=5"
curl "http://localhost:8080/api/v1/templates"

# POST analysis
curl -X POST "http://localhost:8080/api/v1/analyze/deep-context" \
  -H "Content-Type: application/json" \
  -d '{"project_path":"./","include":["ast","complexity","churn"]}'

All analyze commands now support --fail-on-violation for seamless CI/CD integration:

name: Code Quality
on: [push, pull_request]

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      
      - name: Install pmat
        run: cargo install pmat
        
      - name: Check Complexity
        run: |
          pmat analyze complexity \
            --max-cyclomatic 15 \
            --max-cognitive 10 \
            --fail-on-violation
            
      - name: Check Technical Debt
        run: pmat analyze satd --strict --fail-on-violation
        
      - name: Check Dead Code
        run: |
          pmat analyze dead-code \
            --max-percentage 10.0 \
            --fail-on-violation
            
      - name: Run Quality Gate
        run: pmat quality-gate --fail-on-violation

See examples/ci_integration.rs for more CI/CD patterns including GitLab CI, Jenkins, and pre-commit hooks.

πŸ› v0.29.6 - Critical Bug Fixes πŸ† v0.28.14 - Toyota Way Kaizen Success 🚦 v0.28.9 - CI/CD Integration & Exit Codes πŸ” v0.28.3 - Enhanced Single-File Analysis 🚦 v0.28.2 - Quality Gate Improvements πŸ† v0.26.3 - Quality Uplift 🧹 v0.26.1 - Documentation Cleanup (pmat refactor docs) πŸ”₯ v0.26.0 - New Analysis Commands Toyota Way Quality Standards

This project exemplifies the Toyota Way philosophy through disciplined quality practices:

Kaizen (ζ”Ήε–„) - Continuous Improvement Genchi Genbutsu (ηΎεœ°ηΎη‰©) - Go and See Jidoka (θ‡ͺεƒεŒ–) - Quality at Source Poka-Yoke (ポカヨケ) - Error Prevention GitHub Actions Integration
# .github/workflows/quality.yml
- name: Run Quality Gate
  run: |
    pmat quality-gate \
      --checks complexity,satd,security,dead-code \
      --max-complexity-p99 20 \
      --fail-on-violation

Explore our comprehensive documentation to get the most out of pmat.

For systems with low swap space, we provide a configuration tool:

make config-swap      # Configure 8GB swap (requires sudo)
make clear-swap       # Clear swap memory between heavy operations

The project uses a distributed test architecture for fast feedback:

# Run specific test suites
make test-unit        # <10s - Core logic tests
make test-services    # <30s - Service integration
make test-protocols   # <45s - Protocol validation
make test-e2e         # <120s - Full system tests
make test-performance # Performance regression

# Run all tests in parallel
make test-all

# Coverage analysis
make coverage-stratified

We welcome contributions! Please see our Contributing Guide for details.

Quick Start for Contributors
# Clone and setup
git clone https://github.com/paiml/paiml-mcp-agent-toolkit
cd paiml-mcp-agent-toolkit

# Install dependencies
make install-deps

# Run tests
make test-fast      # Quick validation
make test-all       # Complete test suite

# Check code quality
make lint           # Run extreme quality lints
make coverage       # Generate coverage report
  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following our Zero Tolerance Quality Standards
  4. Run quality checks before committing:
    make lint  # Check code quality
    make test  # Run all tests (fast, doctests, property tests, examples)
  5. Submit a pull request with a clear description of changes

Note: The make test command runs comprehensive testing including:

See CONTRIBUTING.md for detailed guidelines.

Licensed under either of:

at your option.

Built with ❀️ by Pragmatic AI Labs


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4