SafetyCulture MCP Server

Integrations

  • Enables configuration management through .env files, allowing users to securely store their SafetyCulture API keys and other configuration parameters.

  • Provides version control integration through Git, allowing users to clone the repository as part of the setup process.

  • Uses Python as the runtime environment for the MCP server, with the server being executed through Python commands in the Claude Desktop configuration.

SafetyCulture MCP サーバー

SafetyCulture API用のモデルコンテキストプロトコル(MCP)サーバー。このプロジェクトでは、ユーザーはAPIキーを入力することで、SafetyCultureデータに関する自然言語の質問をすることができます。

特徴

  • 自然言語を使用して SafetyCulture データをクエリする
  • 検査データと傾向を分析する
  • 期間とカテゴリ間で安全性指標を比較する
  • 検査の傾向を時間経過とともに視覚化する

設定

  1. このリポジトリをクローンする
  2. 依存関係をインストールします: pip install -r requirements.txt
  3. example.env.envにコピーし、SafetyCulture API キーを設定します。
  4. 次のいずれかの方法でサーバーを実行します。
    • run_server.bat - .env ファイルの設定でサーバーを実行します
    • run_with_key.bat YOUR_API_KEY - 提供されたAPIキーでサーバーを実行します

APIのテスト

SafetyCulture API キーが正しく機能するかどうかをテストするには:

test_api.bat YOUR_API_KEY

追加のテスト オプション:

  • test_api.bat - 対話モードでテストを実行します(API キーの入力を求めます)
  • test_api.bat feed YOUR_API_KEY - Feed API のみをテストします
  • test_api.bat url - 認証なしでアクセスできる API URL を確認する

Claude for Desktop での使用

  1. デスクトップ版Claudeをインストールする
  2. ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) または%APPDATA%\Claude\claude_desktop_config.json (Windows) にある設定ファイルを編集して、この MCP サーバーを使用するように Claude for Desktop を設定します。
  3. 次の構成を追加します。
{ "mcpServers": { "safetyculture": { "command": "python", "args": [ "/path/to/your/project/src/main.py" ] } } }
  1. デスクトップ版のClaudeを再起動
  2. MCP ツールを使用して、次のような質問で SafetyCulture データを照会します。
    • 「過去 3 か月間にこのサイトで何回の検査が行われましたか?」
    • 「このカテゴリーの負傷増加報告の傾向を比較する」

利用可能なツール

認証

  • authenticate : APIキーを使用してSafetyCulture APIで認証する

検査データ(フィードAPIを使用)

  • get_inspections : 特定の期間の SafetyCulture 検査を取得する
  • get_inspection_trends : SafetyCulture 検査の傾向を時系列で分析する
  • compare_injury_reports : 2つの期間の傷害報告を比較する

アクションデータ(フィードAPIを使用)

  • get_actions : 特定の期間の SafetyCulture アクションを取得します
    • ステータスでフィルタリング(例:「進行中」、「完了」、「期限超過」)
    • 優先度でフィルタリングする(例:「低」、「中」、「高」)
    • 各アクションの詳細情報を表示する
  • get_action_details : IDで特定のアクションの詳細情報を取得する

フィードAPIについて

この MCP サーバーは、リソースのコレクションに簡単にアクセスできる SafetyCulture Feed API を使用します。

  • /feed/inspections : さまざまなフィルターパラメータを使用して検査を一覧表示します
  • /feed/actions : さまざまなフィルターパラメータを持つアクションを一覧表示します

複数のアイテムをリストする必要がある場合は、個々のリソース エンドポイントよりも Feed API が優先されます。

発達

プロジェクト構造

. ├── 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

開発ログ

初期設定

  • プロジェクト構造の作成
  • Gitリポジトリを設定する
  • READMEと要件を追加しました
  • SafetyCulture APIクライアントを実装しました
  • 検査データのクエリ用のMCPツールを追加しました
  • 日付解析とデータ分析用のユーティリティモジュールを追加しました
  • 構成管理の追加
-
security - not tested
F
license - not found
-
quality - not tested

API キーを提供した後、ユーザーが自然言語を使用して SafetyCulture 検査データを照会および分析できるようにするモデル コンテキスト プロトコル サーバー。

  1. Features
    1. Setup
      1. Testing the API
        1. Usage with Claude for Desktop
          1. Available Tools
            1. Authentication
            2. Inspection Data (Using Feed API)
            3. Action Data (Using Feed API)
          2. About the Feed API
            1. Development
              1. Project Structure
              2. Development Log
            ID: ia1bbslu1r