auditsync-analytics-engine
Leverage conversational AI to interrogate SafetyCulture records, facilitating granular comparison of safety performance metrics across distinct temporal windows and functional domains. Enables sophisticated visualization of procedural compliance trajectories to support superior operational governance.
Author

zerubroberts
Quick Info
Actions
Tags
Auditsync Analytics Engine (SafetyCulture Integration)
This project implements a Model Context Protocol (MCP) nexus designed to interface with the SafetyCulture API. By inputting requisite authorization credentials, users gain the capability to pose complex, natural language inquiries against their collected safety audit datasets.
Core Capabilities
- Facilitate dynamic querying of SafetyCulture data via vernacular input.
- Conduct deep-dive analysis into audit performance data and emergent patterns.
- Execute comparative assessments of key safety indicators across varied timelines and organizational classifications.
- Produce compelling graphical representations of procedural adherence shifts over time.
Deployment Instructions
- Obtain a local copy of the repository.
- Resolve dependencies:
pip install -r requirements.txt - Duplicate
example.envinto.envand securely input your SafetyCulture access token. - Initiate the server using one of the following scripts:
run_server.bat- Launches the service utilizing parameters defined in the .env file.run_with_key.bat YOUR_API_KEY- Starts the server, injecting the API key directly as an argument.
API Credential Verification
To confirm the validity of your SafetyCulture access key:
test_api.bat YOUR_API_KEY
Alternative verification modalities:
- test_api.bat - Engages the interactive prompt mode (requests key input).
- test_api.bat feed YOUR_API_KEY - Isolates testing solely to the Feed API functionality.
- test_api.bat url - Validates accessibility of API endpoints irrespective of authentication status.
Integration with Claude for Desktop Workflow
- Acquire and install Claude for Desktop.
- Modify the configuration file at
~/Library/Application Support/Claude/claude_desktop_config.json(for macOS) or%APPDATA%\Claude\claude_desktop_config.json(for Windows) to incorporate this MCP service. - Inject the subsequent configuration block:
{
"mcpServers": {
"safetyculture": {
"command": "python",
"args": [
"/path/to/your/project/src/main.py"
]
}
}
}
- Restart the Claude for Desktop application.
- Commence utilizing the MCP functionalities to interrogate your SafetyCulture repository with queries such as:
- "What was the total count of site assessments conducted within the preceding quarter?"
- "Analyze the temporal shift in reported adverse events pertaining to this specific compliance area."
Accessible Toolset Portfolio
Authorization Protocol
authenticate: Establishes a secure connection with the SafetyCulture endpoint utilizing the supplied authentication token.
Inspection Record Management (Leveraging Feed API)
get_inspections: Retrieves SafetyCulture assessment records constrained by specified temporal boundaries.get_inspection_trends: Performs pattern recognition and analysis on longitudinal inspection data.compare_injury_reports: Benchmarks reported incident metrics between two demarcated time intervals.
Corrective Action Tracking (Leveraging Feed API)
get_actions: Fetches SafetyCulture mandated actions relevant to a given timeframe- Parameterized filtering by resolution status (e.g., 'pending', 'finalized', 'past_due').
- Parameterized filtering by urgency level (e.g., 'minor', 'standard', 'critical').
- Retrieval of comprehensive details pertaining to individual remedial tasks.
get_action_details: Obtains granular specifications for a particular remedial item via its unique identifier.
Feed API Architectural Summary
This MCP service standardizes interaction via the SafetyCulture Feed API, offering an efficient mechanism for batch retrieval of resource collections:
/feed/inspections: Primary endpoint for bulk retrieval of inspection entities, supporting diverse filtering parameters./feed/actions: Primary endpoint for bulk retrieval of subsequent action items, supporting diverse filtering parameters.
The Feed API is the recommended access method over single-resource endpoints when batch listing operations are required.
Development Roadmap & Structure
Directory Layout
.
├── README.md
├── requirements.txt
├── example.env
└── src/
├── main.py # Core execution module
├── safetyculture_api/ # API Client Abstraction Layer
│ ├── __init__.py
│ └── client.py # API interaction logic implementation
├── tools/
│ ├── __init__.py
│ └── inspection_tools.py # Modules defining inspection and action tools
└── utils/
├── __init__.py
├── analysis.py # Routines for statistical data processing
├── config.py # Module handling environmental configuration loading
└── date_utils.py # Utilities focused on temporal string parsing
Changelog
Phase 1: Foundation Establishment
- Initialized project directory structure and version control.
- Established core documentation and dependency manifest.
- Developed and integrated the SafetyCulture API communication client.
- Implemented foundational MCP interfaces for querying assessment data.
- Added utility libraries for date manipulation and analytical routines.
- Integrated the configuration management system.
