Skip to main content
Glama
ateeqdesktop-dot

SentinelMCP

SentinelMCP

CI License: MIT Python 3.11+ Code Style: Ruff

Model Context Protocol (MCP) のための決定論的ポリシーファイアウォール&ランタイムガバナンスエンジン


概要

SentinelMCP は、Model Context Protocol (MCP) サーバーとマルチエージェント AI スウォーム向けに設計された、本番環境対応のセキュリティゲートウェイおよびランタイムガバナンスフレームワークです。AI エージェントが MCP を介してエンタープライズのファイルシステム、データベース、API への自律的なアクセスをますます拡大する中、プロンプトインジェクション、不正なツール呼び出し、データ流出などのセキュリティリスクが急増しています。

SentinelMCP はインラインポリシーファイアウォールとして機能し、JSON-RPC MCP ツール呼び出しをインターセプトし、宣言型 AST ベースのルールに対して引数を検査し、セキュリティ制限を適用し、不変かつ暗号学的に検証可能な監査証跡を記録します。


Related MCP server: AgentGuard MCP Server

主なアーキテクチャと機能

  • Policy-as-Code エンジン: ツール名のグロブパターンマッチング、引数値の正規表現検査、厳格な引数スキーマ検証をサポートする宣言型 JSON/YAML ポリシー定義。

  • 暗号学的証明台帳: 各実行レコードが SHA-256 ハッシュでチェーンされた追記専用の監査ログ。コンプライアンスとトレーサビリティのための改ざん防止を保証。

  • 高性能プロキシゲートウェイ: FastAPI と Pydantic v2 上に構築され、非同期リクエスト処理によるサブミリ秒のインターセプトレイテンシを実現。

  • CLI&テストツールチェーン: ポリシーに対するツール呼び出しの評価、ゲートウェイサーバーの起動、台帳の整合性検証を行うための組み込み CLI。

  • エンタープライズグレードの CI/CD: pytest による完全なテスト、Python 3.11 および 3.12 でのマトリックステスト、GitHub Actions ワークフローとの統合。


インストール

リポジトリをクローンし、開発依存関係を含めて編集可能モードでインストールします:

git clone https://github.com/ateeqdesktop-dot/sentinel-mcp.git
cd sentinel-mcp
pip install -e .[dev]

使用方法

1. CLI によるツール呼び出しの評価

セキュリティポリシーに対して任意の MCP ツール呼び出しがどのように評価されるかをテストできます:

sentinel-mcp evaluate --tool fs_delete --args '{"path": "/home/user/document.txt"}' --policy policy.json

2. ゲートウェイサーバーの起動

SentinelMCP プロキシサーバーをローカルで起動します:

sentinel-mcp serve --host 127.0.0.1 --port 8000 --policy policy.json

3. 監査台帳の整合性検証

追記専用の監査証跡が改ざんされていないことを検証します:

sentinel-mcp verify --ledger sentinel_audit.jsonl

ポリシー設定例 (policy.json)

{
  "version": "1.0",
  "default_action": "allow",
  "rules": [
    {
      "id": "block-destructive-fs",
      "tool_pattern": "fs_*",
      "action": "deny",
      "forbidden_arguments": [
        "rm\\s+-rf",
        "/etc/passwd",
        "drop\\s+database"
      ]
    },
    {
      "id": "limit-sql-queries",
      "tool_pattern": "db_*",
      "action": "allow",
      "max_string_length": 500
    }
  ]
}

テスト

pytest とコードカバレッジを使用してテストスイートを実行します:

pytest --cov=sentinel tests/ -v

ライセンス

MIT ライセンスの下で配布されています。詳細は LICENSE を参照してください。


参考文献

  1. Anthropic Model Context Protocol (MCP) 仕様。オンラインで入手可能。

  2. Open Policy Agent (OPA) のクラウドネイティブセキュリティの原則。オンラインで入手可能。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides policy-driven runtime authorization and security evaluation for MCP-based agents, including MCP streaming HTTP gateway, mock MCP servers, deterministic agent demos, and audited tool invocation with redacted PostgreSQL audit chains.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enforces fine-grained, context-aware access control on MCP tool calls, with a tamper-evident, replayable audit log that records denials and verifies every decision.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enforces allow/deny/ask policies on MCP tool calls before they reach downstream servers, with tamper-evident audit logging.
    MIT