zerubroberts safetyculture mcp server

zerubroberts safetyculture mcp server avatar

by zerubroberts

What is zerubroberts safetyculture mcp server

SafetyCulture MCP Server

A Model Context Protocol (MCP) server for the SafetyCulture API. This project allows users to ask natural language questions about their SafetyCulture data after providing an API key.

Features

  • Query SafetyCulture data using natural language
  • Analyze inspection data and trends
  • Compare safety metrics across time periods and categories
  • Visualize inspection trends over time

Setup

  1. Clone this repository
  2. Install dependencies: pip install -r requirements.txt
  3. Copy example.env to .env and configure your SafetyCulture API key
  4. Run the server using one of these methods:
    • run_server.bat - Run the server with configuration from .env file
    • run_with_key.bat YOUR_API_KEY - Run the server with the provided API key

Testing the API

To test if your SafetyCulture API key works properly:

test_api.bat YOUR_API_KEY

Additional testing options:

  • test_api.bat - Run tests in interactive mode (prompts for API key)
  • test_api.bat feed YOUR_API_KEY - Test just the Feed API
  • test_api.bat url - Check which API URLs are accessible without authentication

Usage with Claude for Desktop

  1. Install Claude for Desktop
  2. Configure Claude for Desktop to use this MCP server by editing the configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  3. Add the following configuration:
{
    "mcpServers": {
        "safetyculture": {
            "command": "python",
            "args": [
                "/path/to/your/project/src/main.py"
            ]
        }
    }
}
  1. Restart Claude for Desktop
  2. Use the MCP tools to query your SafetyCulture data with questions like:
    • "How many inspections were done in this site over the last 3 months?"
    • "Compare any trends in rise of injuries report for this category"

Available Tools

Authentication

  • authenticate: Authenticate with the SafetyCulture API using your API key

Inspection Data (Using Feed API)

  • get_inspections: Get SafetyCulture inspections for a specific time period
  • get_inspection_trends: Analyze trends in SafetyCulture inspections over time
  • compare_injury_reports: Compare injury reports between two time periods

Action Data (Using Feed API)

  • get_actions: Get SafetyCulture actions for a specific time period
    • Filter by status (e.g., 'in_progress', 'completed', 'overdue')
    • Filter by priority (e.g., 'low', 'medium', 'high')
    • View detailed information about each action
  • get_action_details: Get detailed information about a specific action by ID

About the Feed API

This MCP server uses the SafetyCulture Feed API, which provides a simple way to access collections of resources:

  • /feed/inspections: For listing inspections with various filter parameters
  • /feed/actions: For listing actions with various filter parameters

The Feed API is preferred over the individual resource endpoints when you need to list multiple items.

Development

Project Structure

.
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ example.env
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ main.py                      # Main entry point
    โ”œโ”€โ”€ safetyculture_api/           # SafetyCulture API client
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ””โ”€โ”€ client.py                # API client implementation
    โ”œโ”€โ”€ tools/                       # MCP tools
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ””โ”€โ”€ inspection_tools.py      # Inspection and action tools
    โ””โ”€โ”€ utils/                       # Utility modules
        โ”œโ”€โ”€ __init__.py
        โ”œโ”€โ”€ analysis.py              # Data analysis utilities
        โ”œโ”€โ”€ config.py                # Configuration management
        โ””โ”€โ”€ date_utils.py            # Date parsing utilities

Development Log

Initial Setup

  • Created project structure
  • Set up git repository
  • Added README and requirements
  • Implemented SafetyCulture API client
  • Added MCP tools for querying inspection data
  • Added utility modules for date parsing and data analysis
  • Added configuration management

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP ๆœๅŠกๅ™จ๏ผŒ็”จไบŽ็ฎก็†ๆกŒ้ขๅ›พ็‰‡ใ€ๆŸฅ็œ‹่ฏฆๆƒ…ใ€ๅŽ‹็ผฉใ€็งปๅŠจ็ญ‰๏ผˆๅฎŒๅ…จ่ฎฉTraeๅฎž็Žฐ๏ผ‰

mcp
zhixiaoqiang antd components mcp avatar

zhixiaoqiang antd components mcp

An MCP service for Ant Design components query | ไธ€ไธชๅ‡ๅฐ‘ Ant Design ็ป„ไปถไปฃ็ ็”Ÿๆˆๅนป่ง‰็š„ MCP ๆœๅŠก๏ผŒๅŒ…ๅซ็ณป็ปŸๆ็คบ่ฏใ€็ป„ไปถๆ–‡ๆกฃใ€API ๆ–‡ๆกฃใ€ไปฃ็ ็คบไพ‹ๅ’Œๆ›ดๆ–ฐๆ—ฅๅฟ—ๆŸฅ่ฏข

designantdapi

Submit Your MCP Server

Share your MCP server with the community

Submit Now