Skip to main content

Proof of Concept: AI-Powered Predictive Maintenance & Fault Diagnosis MCP Server - Industrial machinery condition monitoring, vibration analysis, bearing diagnostics, and ML-based anomaly detection through Model Context Protocol

Project description

๐Ÿญ Predictive Maintenance MCP Server

Python 3.11+ DOI Tests codecov FastMCP License: MIT LinkedIn

Transform raw vibration data into actionable maintenance insights through natural conversation with AI.

A Model Context Protocol server that brings industrial machinery diagnostics directly to LLMs like Claude, enabling AI-powered vibration analysis, bearing fault detection, and predictive maintenance workflows โ€” all through natural language.

Predictive Maintenance MCP Server Cover


๐ŸŽฏ Our Mission

Predictive maintenance is critical for Industry 4.0, yet expert-level machinery diagnostics remains inaccessible to most engineers. Complex diagnostic workflows โ€” FFT spectrum analysis, envelope demodulation, ISO severity assessment โ€” require years of specialized training.

We believe that AI can democratize this expertise.

By combining the reasoning capabilities of Large Language Models with specialized diagnostic tools through the Model Context Protocol (MCP), we create a bridge: engineers can describe a problem in plain language and receive professional-grade analysis. No signal processing PhD required.

This project is an open-source framework that proves this vision works. It's a foundation โ€” a set of building blocks โ€” that the community can extend, customize, and deploy for any industrial diagnostics scenario.

๐Ÿ“– Read the full story: Building an AI-Powered Predictive Maintenance System with MCP and Claude


๐Ÿ—๏ธ Ecosystem Architecture

This project is built around the Model Context Protocol (MCP) โ€” an open standard that lets you package any software tool and make it instantly queryable by an LLM. Think of it as a USB port for AI: plug in a tool, and the LLM immediately knows how to use it.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   YOU (Natural Language)                                     โ”‚
โ”‚   "Is this bearing failing? Show me the envelope analysis."  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   LLM (Claude, GPT, local models...)                         โ”‚
โ”‚   Understands your question, selects the right tools         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚  Model Context Protocol (MCP)
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   PREDICTIVE MAINTENANCE MCP SERVER                          โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚   โ”‚ FFT Analysis   โ”‚  โ”‚ Envelope      โ”‚  โ”‚ ISO 20816-3   โ”‚  โ”‚
โ”‚   โ”‚ & Reporting    โ”‚  โ”‚ Demodulation  โ”‚  โ”‚ Compliance    โ”‚  โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚   โ”‚ ML Anomaly     โ”‚  โ”‚ Manual/PDF    โ”‚  โ”‚ Bearing       โ”‚  โ”‚
โ”‚   โ”‚ Detection      โ”‚  โ”‚ Reader        โ”‚  โ”‚ Catalog       โ”‚  โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   YOUR DATA (stays on your machine โ€” privacy-first)          โ”‚
โ”‚   Vibration signals ยท Equipment manuals ยท Trained models     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key insight: The LLM doesn't know signal processing. It knows how to call tools that do signal processing. MCP is the standard that makes this plug-and-play โ€” you can add new diagnostic tools without changing the LLM.

What This Means For You

  • ๐Ÿ”Œ Plug-and-play โ€” Add new analysis tools (thermography, oil analysis, acoustics) as simple Python functions โ€” the LLM discovers them automatically
  • ๐Ÿ”’ Privacy-first โ€” All data stays on your machine; only tool calls and results flow through the LLM
  • ๐Ÿค– LLM-agnostic โ€” Works with Claude, ChatGPT, or any MCP-compatible client
  • ๐Ÿงฑ Modular โ€” Use only the tools you need, extend with your own

๐Ÿ“‘ Table of Contents


๐Ÿšช Choose Your Path

This project serves two audiences. Pick the door that fits you:

๐Ÿ”ง I'm a Maintenance / Reliability Engineer

"I want to use AI for my vibration analysis and diagnostics."

You don't need to write code. This tool turns your vibration data into professional reports through simple conversation.

What you'll get:

  • ISO 20816-3 compliance reports in one sentence
  • Bearing fault detection from your real data
  • Interactive HTML reports you can share with your team
  • ML anomaly detection trained on your healthy baselines

โžก๏ธ Start here: Quickstart for Engineers

๐Ÿ’ป I'm an AI / Software Developer

"I want to understand MCP, extend this server, or build my own."

The code is your playground. Learn how MCP works, add new diagnostic tools, or use this as a template for your own domain-specific server.

What you'll learn:

  • How MCP bridges LLMs and specialized tools
  • How to create new tools as Python functions
  • How to design resource/tool hybrid architectures
  • How to contribute to an industrial open-source project

โžก๏ธ Start here: Quickstart for Developers

๐Ÿ’ก Don't fit either profile? That's fine โ€” read on for the full documentation, or jump to Quick Examples to see the server in action.


โœจ What Makes This Special

  • ๐ŸŽฏ Real Bearing Fault Data Included โ€” 20 production-quality vibration signals from real machinery tests (3 healthy, 17 faulty)

  • ๐Ÿ“Š Professional HTML Reports โ€” Interactive Plotly visualizations with automatic peak detection and frequency markers

  • ๐Ÿค– ML Anomaly Detection โ€” Train unsupervised/semi-supervised models (OneClassSVM/LOF) on healthy baselines with optional hyperparameter tuning

  • ๐Ÿ“ ISO 20816-3 Compliance โ€” Industry-standard vibration severity assessment built-in ISO Compliance

  • ๐Ÿ” Advanced Diagnostics โ€” FFT spectrum analysis, envelope analysis for bearing faults, time-domain feature extraction

    Example analysis

    Envelope analysis 1 Envelope analysis 2 Envelope analysis 3

  • ๐Ÿš€ Zero Configuration โ€” Works out of the box with sample data, auto-detects sampling rates from metadata


๐ŸŽฌ Quick Examples

Example 1: Bearing Fault Detection

Generate envelope report for real_train/OuterRaceFault_1.csv

Result: AI automatically:

  1. Detects sampling rate from metadata (97,656 Hz)
  2. Applies bandpass filter (500-5000 Hz)
  3. Generates interactive HTML report with bearing fault frequencies marked
  4. Identifies outer race fault at ~81 Hz with harmonics
  5. Saves report to reports/envelope_OuterRaceFault_1_*.html

Example 2: ISO 20816-3 Vibration Assessment

Evaluate real_train/OuterRaceFault_1.csv against ISO 20816-3 standard

Result:

  • RMS velocity: 4.5 mm/s โ†’ Zone B (Acceptable for long-term operation)
  • Interactive HTML report with zone visualization
  • Compliance assessment and recommendations

Example 3: Machine Manual Integration + Diagnosis

1. Extract specifications from test_pump_manual.pdf
2. Calculate bearing frequencies for SKF 6205-2RS at 1475 RPM
3. Diagnose bearing fault in signal_from_pump.csv using calculated frequencies

Result: Complete zero-knowledge diagnosis:

  • Extracts: Drive end bearing SKF 6205-2RS, operating speed 1475 RPM
  • Calculates: BPFO=85.20 Hz, BPFI=136.05 Hz, BSF=101.32 Hz
  • Diagnoses: Outer race fault detected with 3 harmonics

๐Ÿ“š More examples: See Usage Examples section below or EXAMPLES.md for complete workflows


๐Ÿš€ Installation

Quick Start (Python Package)

# 1. Clone repository
git clone https://github.com/LGDiMaggio/predictive-maintenance-mcp.git
cd predictive-maintenance-mcp

# 2. Run automated setup
python setup_venv.py

# 3. Activate environment
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Linux/macOS

# 4. Verify installation
python validate_server.py

๐Ÿ“– Detailed Installation Guide: See INSTALL.md for troubleshooting, Claude Desktop setup, and developer instructions.

From Source (Advanced)

git clone https://github.com/LGDiMaggio/predictive-maintenance-mcp.git
cd predictive-maintenance-mcp
pip install -e .

โš™๏ธ Configuration

Claude Desktop

Add to your Claude Desktop config:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

๐Ÿ“‹ Example config: See claude_desktop_config_PYTHON_VENV.json for a complete example

{
  "mcpServers": {
    "predictive-maintenance": {
      "command": "C:/path/to/predictive-maintenance-mcp/.venv/Scripts/python.exe",
      "args": ["C:/path/to/predictive-maintenance-mcp/src/machinery_diagnostics_server.py"]
    }
  }
}

Important Notes:

  • Replace C:/path/to/predictive-maintenance-mcp with your actual project path
  • Use absolute paths for both command and args
  • On macOS/Linux, use .venv/bin/python instead of .venv/Scripts/python.exe
  • Forward slashes (/) work on all platforms, including Windows

After configuration, restart Claude Desktop completely.

VS Code

Add to your MCP configuration (.vscode/mcp.json or user settings):

{
  "servers": {
    "predictive-maintenance": {
      "command": "/path/to/predictive-maintenance-mcp/.venv/bin/python",
      "args": ["/path/to/predictive-maintenance-mcp/src/machinery_diagnostics_server.py"]
    }
  }
}

Adjust paths according to your system (use .venv/Scripts/python.exe on Windows)


๐Ÿ”ง Available Tools & Resources

MCP Resources (Direct Data Access)

Resources provide direct read access for Claude to examine data:

๐Ÿ“Š Vibration Signals
  • signal://list โ€” Browse all available signal files with metadata
  • signal://read/{filename} โ€” Read signal data directly (first 1000 samples preview)

Usage: Claude can directly read signals without calling tools first.

๐Ÿ“– Machine Manuals
  • manual://list โ€” Browse available equipment manuals (PDF/TXT)
  • manual://read/{filename} โ€” Read manual text (first 20 pages)

Usage: Claude can answer ANY question about manual content by reading directly.


MCP Tools (Analysis & Processing)

Tools perform computations and generate outputs:

๐Ÿ“Š Analysis & Diagnostics
  • analyze_fft โ€” FFT spectrum analysis with automatic peak detection
  • analyze_envelope โ€” Envelope analysis for bearing fault detection
  • analyze_statistics โ€” Time-domain statistical indicators (RMS, Crest Factor, Kurtosis, etc.)
  • evaluate_iso_20816 โ€” ISO 20816-3 vibration severity assessment
  • diagnose_bearing โ€” Guided 6-step bearing diagnostic workflow
  • diagnose_gear โ€” Evidence-based gear fault diagnostic workflow
๐Ÿค– Machine Learning
  • extract_features_from_signal โ€” Extract 17+ statistical features from vibration data
  • train_anomaly_model โ€” Train novelty detection models (OneClassSVM/LOF) on healthy data only, with optional semi-supervised hyperparameter tuning
  • predict_anomalies โ€” Detect anomalies in new signals with confidence scores
๐Ÿ“„ Professional Report Generation
  • generate_fft_report โ€” Interactive FFT spectrum HTML report with peak table
  • generate_envelope_report โ€” Envelope analysis report with bearing fault markers
  • generate_iso_report โ€” ISO 20816-3 evaluation with zone visualization
  • list_html_reports โ€” List all generated reports with metadata
  • get_report_info โ€” Get report details without loading full HTML

๐Ÿ’ก All reports are interactive Plotly visualizations saved to reports/ directory

๐Ÿ“– Machine Documentation Reader
  • list_machine_manuals โ€” List available equipment manuals (PDF/TXT)
  • extract_manual_specs โ€” Extract bearings, RPM, power from manual (with caching)
  • calculate_bearing_characteristic_frequencies โ€” Calculate BPFO/BPFI/BSF/FTF from geometry
  • read_manual_excerpt โ€” Read manual text excerpt (configurable page limit)
  • search_bearing_catalog โ€” Search bearing geometry in local catalog (20+ common bearings)

MCP Resources:

  • manual://list โ€” Browse available manuals
  • manual://read/{filename} โ€” Read manual for LLM context

๐ŸŽฏ Upload pump manual โ†’ Extract bearing specs โ†’ Auto-calculate frequencies โ†’ Diagnose signal

๐Ÿ” Data Management
  • list_signals โ€” Browse available signal files with metadata
  • generate_test_signal โ€” Create synthetic signals for testing

๐Ÿ“ Detailed Architecture

The system follows a hybrid MCP architecture combining Resources (direct data access) and Tools (computational processing):

MCP Server Architecture

Detailed Structure
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    CLAUDE / LLM CLIENT                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
                     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   MCP SERVER (FastMCP)                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  RESOURCES (Direct Data Access)                      โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  Vibration Signals                             โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ€ข signal://list                               โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ€ข signal://read/{filename}                    โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  Machine Manuals                               โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ€ข manual://list                               โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ”‚  โ€ข manual://read/{filename}                    โ”‚  โ”‚  โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  TOOLS (Analysis & Processing)                       โ”‚  โ”‚
โ”‚  โ”‚  โ€ข FFT, Envelope, ISO 20816-3                        โ”‚  โ”‚
โ”‚  โ”‚  โ€ข ML Anomaly Detection                              โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Report Generation (HTML)                          โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Manual Spec Extraction                            โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Bearing Frequency Calculation                     โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Bearing Catalog Search                            โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  SIGNAL ANALYSIS โ”‚   โ”‚  DOCUMENT READER MODULE          โ”‚
โ”‚  MODULE          โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ€ข FFT Engine    โ”‚   โ”‚  โ”‚ PDF Extractโ”‚  โ”‚ ISO Formulasโ”‚  โ”‚
โ”‚  โ€ข Envelope      โ”‚   โ”‚  โ”‚ (PyPDF2)   โ”‚  โ”‚ BPFO/BPFI   โ”‚  โ”‚
โ”‚  โ€ข Filters       โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ€ข Statistics    โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ€ข ML Models     โ”‚   โ”‚  โ”‚  Bearing Catalog DB         โ”‚  โ”‚
โ”‚  โ€ข Plotly Charts โ”‚   โ”‚  โ”‚  โ€ข 20+ ISO bearings         โ”‚  โ”‚
โ”‚                  โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                      โ”‚
         โ–ผ                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   LOCAL FILE SYSTEM                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  data/signals/       โ”‚   โ”‚  resources/              โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ real_train/     โ”‚   โ”‚  โ”œโ”€โ”€ machine_manuals/    โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ real_test/      โ”‚   โ”‚  โ”œโ”€โ”€ bearing_catalogs/   โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€โ”€ samples/        โ”‚   โ”‚  โ”œโ”€โ”€ datasheets/         โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ””โ”€โ”€ cache/ (auto)       โ”‚   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚  โ”‚  reports/            โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  โ€ข FFT reports       โ”‚   โ”‚  models/                 โ”‚   โ”‚
โ”‚  โ”‚  โ€ข Envelope reports  โ”‚   โ”‚  โ€ข Trained ML models     โ”‚   โ”‚
โ”‚  โ”‚  โ€ข ISO reports       โ”‚   โ”‚  โ€ข Scalers, PCA          โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Features:

  • โœ… 4 MCP Resources โ€” Direct read access to signals and manuals
  • โœ… 25+ MCP Tools โ€” Complete diagnostic workflow
  • โœ… Hybrid Architecture โ€” Resources for reading, Tools for processing
  • โœ… Local-First โ€” All data stays on your machine (privacy-preserving)

๐Ÿ“Š Sample Dataset

The server includes 20 real bearing vibration signals from production machinery:

Training Set (14 signals):

  • โœ… 2 Healthy Baselines โ€” Normal operation data
  • ๐Ÿ”ด 7 Inner Race Faults โ€” Variable load conditions
  • โš ๏ธ 5 Outer Race Faults โ€” Various severity levels

Test Set (6 signals):

  • โœ… 1 Healthy Baseline โ€” Validation data
  • ๐Ÿ”ด 2 Inner Race Faults โ€” Test conditions
  • โš ๏ธ 3 Outer Race Faults โ€” Test conditions

Note: Sampling rates and durations vary by signal (48.8-97.7 kHz, 3-6 seconds). All parameters auto-detected from metadata files.

๐Ÿ“– Full dataset documentation: data/README.md


๐Ÿ’ก Usage Examples

Quick Fault Detection

Diagnose bearing fault in real_train/OuterRaceFault_1.csv
BPFO=81.13 Hz, BPFI=118.88 Hz, BSF=63.91 Hz, FTF=14.84 Hz

Result: โœ… Outer race fault detected at ~81 Hz with harmonics

Generate Professional Report

Generate envelope report for real_train/OuterRaceFault_1.csv

Result: Interactive HTML saved to reports/ with bearing fault markers

Train ML Anomaly Detector

Train anomaly model on baseline_1.csv and baseline_2.csv
Validate on OuterRaceFault_1.csv

Result: Model detects fault with 95%+ confidence

๐Ÿ“š More examples: EXAMPLES.md for complete diagnostic workflows


๐Ÿ“Š Professional Reports

All analysis tools generate interactive HTML reports with Plotly visualizations:

Why HTML Reports?

โœ… Universal โ€” Works with any LLM (Claude, ChatGPT, local models)
โœ… Zero tokens โ€” Files saved locally, not in chat
โœ… Interactive โ€” Pan, zoom, hover for details
โœ… Professional โ€” Publication-ready visualizations
โœ… Persistent โ€” Save for documentation and sharing

Report Types

Report Tool Contents
๐Ÿ”Š FFT Spectrum generate_fft_report() Frequency analysis, peak detection, harmonic markers
๐ŸŽฏ Envelope Analysis generate_envelope_report() Bearing fault frequencies, modulation detection
๐Ÿ“ ISO 20816-3 generate_iso_report() Vibration severity zones, compliance assessment

All reports include:

  • Interactive Plotly charts (pan/zoom/hover)
  • Automatic peak detection with frequency tables
  • Metadata (signal info, analysis parameters)
  • Timestamp and file references

Usage:

Generate FFT report for baseline_1.csv

โ†’ Opens reports/fft_spectrum_baseline_1_20251111_143022.html in browser


๐Ÿ“– Documentation

Document Audience Description
Quickstart for Engineers ๐Ÿ”ง Engineers Get results fast, no coding required
Quickstart for Developers ๐Ÿ’ป Developers Understand MCP, extend the server
EXAMPLES.md Everyone Complete diagnostic workflows with step-by-step tutorials
INSTALL.md Everyone Detailed installation and troubleshooting guide
CONTRIBUTING.md Contributors How to contribute (for every skill level)
CHANGELOG.md Everyone Version history
data/README.md Everyone Dataset documentation

๐Ÿงช Testing

This project includes a comprehensive test suite covering all analysis tools:

# Run all tests
pytest

# Run with coverage report
pytest --cov=src --cov-report=html

# Run specific test file
pytest tests/test_fft_analysis.py

# Run with verbose output
pytest -v

Test coverage includes:

  • โœ… FFT analysis and peak detection
  • โœ… Envelope analysis and bearing fault detection
  • โœ… ISO 20816-3 evaluation and zone classification
  • โœ… ML tools (feature extraction, training, prediction)
  • โœ… Report generation system (HTML outputs)
  • โœ… Real bearing fault data validation

See tests/README.md for detailed testing documentation.


๐Ÿ› ๏ธ Development

Install Development Dependencies

pip install -e ".[dev]"

Code Quality

# Format code
black src/

# Type checking
mypy src/

# Linting
flake8 src/

Debugging

Use MCP Inspector for interactive testing:

npx @modelcontextprotocol/inspector npx predictive-maintenance-mcp

Or from source:

uv run mcp dev src/machinery_diagnostics_server.py

๐Ÿš€ Roadmap

โœจ Recent: v0.2.1 โ€” Machine Documentation Reader

AI-powered extraction of machine specifications from equipment manuals:

  • ๐Ÿ“„ Direct PDF Access via MCP Resources
  • ๐Ÿ” Smart Extraction โ€” Regex patterns for bearings, RPM, power ratings
  • ๐Ÿงฎ Auto-Calculation โ€” Bearing fault frequencies from geometry (ISO 15243:2017)
  • ๐Ÿ’พ Caching System โ€” Fast repeated queries with JSON caching

๐Ÿ”ฎ Planned Enhancements

Each item below links to an open issue where you can discuss, contribute, or claim the task:

Priority Enhancement Status Get Involved
๐Ÿ”ด High Parquet/HDF5 data format support Open Good First Issue
๐Ÿ”ด High Customizable ISO report thresholds Open Good First Issue
๐Ÿ”ด High Docker image for zero-install setup Open Help Wanted
๐ŸŸก Medium Vector search for large documents (ChromaDB/FAISS) Planned Discuss
๐ŸŸก Medium OCR for scanned PDF manuals (Tesseract) Planned Discuss
๐ŸŸก Medium Multi-signal trending โ€” Compare historical data Planned Discuss
๐ŸŸข Future Real-time streaming โ€” Live vibration monitoring Concept โ€”
๐ŸŸข Future Dashboard โ€” Multi-asset fleet monitoring Concept โ€”
๐ŸŸข Future Online bearing catalog โ€” Web search for unknown bearings Concept โ€”
๐ŸŸข Future Multimodal fusion โ€” Vibration + temperature + acoustic Concept โ€”

๐Ÿ’ก Have ideas? Open a discussion or create an issue!


๐Ÿค Contributing

We welcome contributions from everyone โ€” not just programmers. See our full CONTRIBUTING.md guide, which includes specific paths for:

  • ๐Ÿ”ง Domain experts โ€” Validate signals, add datasets, review diagnostic logic
  • ๐Ÿ’ป Developers โ€” Add tools, fix bugs, improve architecture
  • ๐Ÿ“– Technical writers โ€” Improve docs, add tutorials, translate content
  • ๐Ÿงช Testers โ€” Edge cases, validation with ground truth data

Quick Start for Contributors

  1. Browse Issues โ€” look for good first issue or help wanted labels
  2. Comment on the issue to claim it
  3. Fork โ†’ Branch โ†’ Code โ†’ Test โ†’ PR

See CONTRIBUTING.md for detailed setup and guidelines.


๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

Note: Sample data is licensed CC BY-NC-SA 4.0 (non-commercial). For commercial use, replace with your own machinery data.


๐Ÿ“š Citation

If you use this server in your research or projects, please cite:

@software{dimaggio_predictive_maintenance_mcp_2025,
  title = {Predictive Maintenance MCP Server: An open-source framework for integrating Large Language Models with predictive maintenance and fault diagnosis workflows},
  author = {Di Maggio, Luigi Gianpio},
  year = {2025},
  version = {0.4.0},
  url = {https://github.com/LGDiMaggio/predictive-maintenance-mcp},
  doi = {10.5281/zenodo.17611542}
}

DOI


๐Ÿ™ Acknowledgments

  • FastMCP framework by @jlowin
  • Model Context Protocol by Anthropic
  • Sample Data from MathWorks
  • Development Assistance: Core codebase and demonstration examples were developed with assistance from Claude by Anthropic to rapidly prototype and demonstrate the Model Context Protocol (MCP) concept for predictive maintenance applications.

โš ๏ธ Development Notice: This codebase was generated using Claude AI under human supervision to explore and validate MCP-based approaches for industrial diagnostics and predictive maintenance workflows. While the implementation demonstrates the potential of AI-assisted development for specialized engineering domains, thorough testing and validation are required before any production or safety-critical use.


๐Ÿ“ฌ Support


Built with โค๏ธ for condition monitoring professionals and the open-source community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

predictive_maintenance_mcp-0.4.0.tar.gz (24.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

predictive_maintenance_mcp-0.4.0-py3-none-any.whl (77.0 kB view details)

Uploaded Python 3

File details

Details for the file predictive_maintenance_mcp-0.4.0.tar.gz.

File metadata

File hashes

Hashes for predictive_maintenance_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 280df4abb5965873d5ee6708d6fc7aadec791107a72141d3513bc8eb98f2cc0e
MD5 5ac93cf28c764210df16fec7c5237740
BLAKE2b-256 6acaef272b8e96695958dbdefcf15108e6e1f0e280e0761385ee49a788a6a5f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for predictive_maintenance_mcp-0.4.0.tar.gz:

Publisher: publish.yml on LGDiMaggio/predictive-maintenance-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file predictive_maintenance_mcp-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for predictive_maintenance_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ea90d493ed0fac7bb5a2a5280269db88fbd678666aeff25dc432dd659280023
MD5 d05ce88728117825d7e96983797453b6
BLAKE2b-256 df05551c52285c11745c483ddf605226b0613b910bbe1bb00e2b2cbf35219baf

See more details on using hashes here.

Provenance

The following attestation bundles were made for predictive_maintenance_mcp-0.4.0-py3-none-any.whl:

Publisher: publish.yml on LGDiMaggio/predictive-maintenance-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page