---
title: "MCP サーバー"
description: "Model Context Protocol で、claude.ai、Claude Desktop、ChatGPT、Claude Code、Codex、Cursor を Vigiora サーバーに接続します。Vigiora アカウントでサインインするか、スコープ付きの API キーを使います。"
url: https://vigiora.com/ja/docs/developers/mcp
updated: 2026-11-25T11:49:35.000Z
---

# MCP サーバー

> Model Context Protocol で、claude.ai、Claude Desktop、ChatGPT、Claude Code、Codex、Cursor を Vigiora サーバーに接続します。Vigiora アカウントでサインインするか、スコープ付きの API キーを使います。

すべての Vigiora サーバーには **MCP サーバー**が組み込まれています。AI アシスタントはここに接続して、カメラ、アラート、録画、クリップを**ツール**として使えます。たとえば、昨夜のアラートを要約したり、カメラのライブスナップショットを確認したり、録画から赤いシャツの人を探したり、クリップを書き出したりできます。

## MCP とは

Model Context Protocol（MCP）は、AI アシスタントがほかのシステムのツールを呼び出せるようにするオープンな標準です。claude.ai、Claude Desktop、ChatGPT、Claude Code、Codex、Cursor など、多くのアプリが対応しています。

Vigiora のツールは [API v1](https://vigiora.com/docs/developers/api-v1) そのものです。各ツールは 1 つの API 操作で、ツールを呼び出すと、サインインしたユーザー（または API キーのユーザー）としてその操作が実行されます。スコープ、ロール、カメラごとの権限、レート制限、認証情報の秘匿は、REST とまったく同じように機能します。サーバーに新しい API 操作が追加されると、新しいツールとして自動的に表示されます。

## MCP サーバーの URL

```
https://<your-site>.vigiora.com/api/v1/mcp
```

Web アプリを開くときと同じアドレスを使います。たとえば `https://yourname.vigiora.com/api/v1/mcp`、ローカルネットワークでは `http://192.0.2.10:8080/api/v1/mcp` です。Web アプリの「**API keys → Connect an AI agent**」に、コピーしてすぐ使える設定例とともに表示されます。

- **トランスポート：** Streamable HTTP、セッションなし（MCP プロトコルのリビジョン 2024-11-05 から 2026-07-28）。すべてのメッセージは `POST` で、サーバーは JSON で応答します。
- **サーバー名：** `vigiora`。クライアントの接続時に、短い使い方の説明も送ります。

## claude.ai または Claude Desktop に追加する

claude.ai と Claude Desktop に必要なのは URL だけです。Vigiora サーバー自体が OAuth のサインインサーバーなので、コピーするキーはありません。

1. **カスタムコネクタを追加します**

   claude.ai または Claude Desktop で「**Settings → Connectors**」を開き、「**Add custom connector**」をクリックします。

2. **名前と URL を入力します**

   名前（たとえば *Vigiora*）を付けて、`https://<your-site>.vigiora.com/api/v1/mcp` を貼り付けます。OAuth の client ID と secret は空のままにします。「**Add**」をクリックします。

3. **サインインします**

   「**Connect**」をクリックすると、Vigiora のページが開きます。まだサインインしていない場合は、Vigiora サーバーのアカウントでサインインします。ページには、アクセスを求めているアプリと戻り先（`claude.ai`）が表示されます。

4. **アクセスを選びます**

   「**Read only**」（既定）または「**Read and control**」を選び、「**Approve**」をクリックします。Claude に戻ると、コネクタに Vigiora のツールが表示されます。

| アクセス | アプリができること |
| --- | --- |
| **Read only** | カメラ、ライブスナップショット、アラート、顔、録画、クリップ、イベントログ、Analytics のカウント、フロアプラン、Vigiora と共有された Home Assistant のデバイスを見ることができます。 |
| **Read and control** | さらに、カメラ設定の変更、カメラと AI のオン・オフ、PTZ カメラの操作、アラートの確認済み処理、録画の保護、クリップの作成、ローカルネットワークのスキャンとカメラのアドレスの修正、Analytics のライン・ゾーン・エリアの設定、フロアプランの編集、共有された Home Assistant デバイスの制御ができます。viewer にはカメラの変更、PTZ、ネットワークツール、Analytics とフロアプランの変更、Home Assistant のデバイスは許可されません。 |

アプリは、選んだアクセス範囲で、あなたとして動作します。見られるのは、あなたが見られるカメラだけです。ユーザー、設定、API キー、Webhook の管理、設定の書き出し、公開共有リンクの作成は決してできません。あとであなたのロールが変わると、アプリのアクセスもそれに合わせて変わります。

アクセスの選択の下にある「**Ask me before actions**」で、カメラを動かす、ネットワークをスキャンするなどのリスクのある操作の前に、アプリがあなたの承認を得る必要があるかどうかを決めます。初期値はサーバーの [Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) 設定（既定でオン）と同じです。その設定がオンの間は、管理者だけがチェックを外せます。

> **Note**
>
> claude.ai と ChatGPT はインターネットから接続するため、サインインはサイトのインターネットアドレス（`https://<your-site>.vigiora.com`）で動作します。まだの場合は、先にリモートアクセスをオンにしてください。ローカルネットワークでは、Claude Code か API キーを使います。

## ChatGPT に追加する

1. **開発者モードをオンにします**

   ChatGPT で「**Settings → Apps & Connectors**」を開き、「**Advanced**」で開発者モードをオンにします。

2. **コネクタを作成します**

   「**Create**」をクリックし、名前を付けて `https://<your-site>.vigiora.com/api/v1/mcp` を貼り付け、認証に「**OAuth**」を選びます。

3. **サインインして承認します**

   開いた Vigiora のページでサインインし（アクセスを求めるアプリとして `chatgpt.com` が表示されます）、「**Read only**」または「**Read and control**」を選んで「**Approve**」をクリックします。

## Claude Code、Codex、Cursor

これらのクライアントは、同じ方法でサインインすることも、[API キー](https://vigiora.com/docs/developers/api-keys)を使うこともできます。以下の API キーの設定はすべて、環境変数 `VIGIORA_API_KEY` からキーを読み込むので、キーが設定ファイルに書き込まれることはありません。

```bash
export VIGIORA_API_KEY=vgk_...
```

> **Warning**
>
> エージェントは、そのキーの権限で動作します。必要なスコープだけを持つキーを作成してください。閲覧やレポートには `cameras:read`、`alerts:read`、`recordings:read`、`events:read` を使います。エージェントを特定のカメラに限定するには、viewer ロールで、そのカメラにだけアクセスできる専用ユーザーを作成します。

### Claude Code

API キーを使う場合：

```bash
claude mcp add --transport http vigiora https://<your-server>/api/v1/mcp \
  --header "Authorization: Bearer $VIGIORA_API_KEY"
```

代わりにサインインする場合は `--header` を外し、Claude Code で `/mcp` を実行して `vigiora` を選び、「**Authenticate**」を選びます。

```bash
claude mcp add --transport http vigiora https://<your-site>.vigiora.com/api/v1/mcp
```

Claude Code は `localhost` に戻るため、同意ページには、アプリがお使いのコンピューターで動作しているという警告が表示されます。自分でサインインを開始した直後の場合にだけ承認してください。`/mcp` を実行して、`vigiora` が接続されていることを確認します。

### Codex

`~/.codex/config.toml` に次を追加します。

```toml
[mcp_servers.vigiora]
url = "https://<your-server>/api/v1/mcp"
bearer_token_env_var = "VIGIORA_API_KEY"
```

### Cursor

`~/.cursor/mcp.json`、またはプロジェクトの `.cursor/mcp.json` に次を追加します。

```json
{
  "mcpServers": {
    "vigiora": {
      "url": "https://<your-server>/api/v1/mcp",
      "headers": { "Authorization": "Bearer ${env:VIGIORA_API_KEY}" }
    }
  }
}
```

### API キーで Claude Desktop を使う

サインイン付きのカスタムコネクタ（上記）をおすすめします。API キーを使いたい場合は、Claude Desktop のローカル設定から [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) でリモートサーバーに接続できます（Node.js が必要です）。`claude_desktop_config.json` に次を追加します。このファイルにはキーが含まれるので、外部に公開しないでください。

```json
{
  "mcpServers": {
    "vigiora": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://<your-server>/api/v1/mcp",
               "--header", "Authorization:${AUTH_HEADER}"],
      "env": { "AUTH_HEADER": "Bearer vgk_..." }
    }
  }
}
```

### その他のクライアント

Streamable HTTP とカスタムヘッダーに対応した MCP クライアントなら、どれでも使えます。キーは `Authorization: Bearer vgk_…`（または `X-API-Key: vgk_…`）として送ります。有効な認証情報がないと、エンドポイントは `401` と、サインイン用メタデータを指す `WWW-Authenticate: Bearer` チャレンジを返します。Web アプリのセッショントークンは拒否されます。ターミナルからサーバーを試すには、MCP Inspector を使います。

```bash
npx @modelcontextprotocol/inspector --cli https://<your-server>/api/v1/mcp \
  --transport http --header "Authorization: Bearer $VIGIORA_API_KEY" --method tools/list
```

## ツール

バージョン 1.6.20 からは **453 個のツール**（1.6.20 では 423 個、1.6.19 では 386 個、1.6.18 では 358 個、1.6.17 では 347 個、1.6.16 では 341 個、1.6.13 では 306 個、1.6.10 と 1.6.11 では 226 個）があり、認証情報が呼び出せる API v1 の操作ごとに 1 つずつです。admin ユーザーの `admin` スコープ付きキーには、すべてが表示されます。サーバーが一覧に表示するのは、付与されたスコープ（キーのスコープ、またはサインイン時に承認したアクセス）**と**ユーザーのロールの両方が許可するツールだけです。そのため、読み取り専用のキーや「**Read only**」の接続に書き込みツールが表示されることはありません。ツール名は API の `operationId` を snake_case にしたものです。引数は、操作のパス・クエリ・ヘッダーのパラメーターと、JSON ボディのフィールドです。再試行できる書き込みツールは、省略可能な `idempotency_key` を受け取ります。

すべての読み取りツールには `readOnlyHint` アノテーションが付いています。画像を見るだけの `detect_objects` と `analyze_image` にも付いています。削除（アラートルールを含む）、保護の解除、シークレットのローテーション、一括変更、インポート、`relocate_camera` には `destructiveHint` が付いています。`start_network_scan` と `lookup_network_address` は、ネットワークにトラフィックを送るため、読み取り専用とはされていません。Guardian のエントリーを書き込み、アラートルールを発火させることがある `analyze_camera` も同様です。

バージョン 1.6.9 から、[Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) によって、エージェントがリスクのあるツール（PTZ カメラの移動、スキャン、カメラ・ユーザー・Webhook・設定の変更、削除など）の前にあなたの承認を得る必要があるかが決まります。既定ではオンです。オンの間、これらのツールは省略可能な `confirm` 引数を受け取り、アプリが対応していればサーバーが「**Allow / Deny**」のプロンプトであなたに確認し、対応していなければ `confirmation_required` を返して、エージェントがチャットであなたに確認します。オフの間は、エージェントはそのまま実行します。どちらが適用されるかは `get_agent_policy` でエージェントに伝わります。

| スコープ | ツール |
| --- | --- |
| 任意の認証情報 | `get_agent_policy`, `get_me`, `get_server`, `get_thing_capabilities` |
| `cameras:read` | `analyze_image`, `create_camera_snapshot_url`, `create_camera_stream_url`, `detect_objects`, `get_camera`, `get_camera_clock` (admin, operator), `get_camera_audio_level`, `get_camera_audio_status`, `get_camera_hardware_id` (admin, operator), `get_camera_objects`, `get_camera_pipeline`, `get_camera_snapshot` (画像), `get_client` (admin, operator), `get_client_status_history` (admin, operator), `get_object_image` (画像), `get_reference_frame` (画像), `get_system_object_history`, `get_system_objects`, `get_thing`, `list_available_streams` (admin, operator), `list_camera_ai_services`, `list_cameras`, `list_client_audio_outputs` (admin, operator), `list_clients` (admin, operator), `list_outputs` (admin, operator), `list_things`, `suggest_ai_cameras` (admin, operator) |
| `cameras:write` (admin, operator) | `add_detected_cameras`, `bulk_update_cameras`, `capture_reference_frame`, `check_detected_camera_clock`, `set_camera_clock`, `set_detected_camera_clock`, `update_camera_clock`, `update_client` (admin), `client_action_install_ffmpeg` (admin), `client_action_restart` (admin), `client_action_resync_cameras` (admin), `client_action_update` (admin), `create_camera`, `create_client_camera` (admin), `create_output`, `create_room`, `delete_camera` (admin), `delete_client` (admin), `delete_output`, `delete_reference_frame`, `delete_room`, `delete_room_inventory`, `detect_camera`, `detect_camera_batch`, `disable_camera`, `disable_camera_ai`, `disable_camera_ai_service`, `enable_camera`, `enable_camera_ai`, `enable_camera_ai_service`, `get_detection_batch`, `get_dhcp_move` (admin), `move_device_to_dhcp` (admin), `probe_ptz`, `relocate_camera`, `replace_room_inventory`, `repush_camera`, `suggest_camera_name`, `update_camera`, `update_camera_ai_service`, `update_output`, `update_room`, `update_room_outputs` |
| `cameras:control` (admin, operator) | `delete_ptz_preset`, `get_ptz_preset`, `goto_ptz_preset`, `list_ptz_presets`, `move_ptz`, `move_ptz_in_room`, `play_audio_in_room`, `save_ptz_preset`, `speak_in_room`, `speak_on_camera`, `stop_ptz`, `test_output`, `update_ptz_preset` |
| `alerts:read` | `get_alert`, `get_alert_face_photo` (画像), `get_alert_rule`, `get_alert_snapshot` (画像), `get_alert_summary`, `get_face_crop` (画像), `get_face_photo` (画像), `get_label_alert_rule`, `get_latest_motion_levels`, `get_latest_people_counts`, `get_motion_rule`, `get_room_alert_rule`, `list_alert_rules`, `list_alerts`, `list_camera_alert_rules`, `list_camera_detection_events`, `list_camera_detection_tracks`, `list_camera_labels`, `list_faces`, `list_label_alert_rules`, `list_motion_levels`, `list_motion_rules`, `list_people_counts`, `list_room_alert_rules` |
| `alerts:write` (admin, operator) | `acknowledge_alert` (すべてのロール), `acknowledge_alerts` (すべてのロール), `create_alert`, `create_alert_rule`, `create_label_alert_rule`, `create_motion_rule`, `create_room_alert_rule`, `delete_alert`, `delete_alert_rule`, `delete_label_alert_rule`, `delete_motion_rule`, `delete_room_alert_rule`, `disable_alert_rule`, `enable_alert_rule`, `unacknowledge_alert` (すべてのロール), `update_alert_rule`, `update_label_alert_rule`, `update_motion_rule`, `update_room_alert_rule` |
| `recordings:read` | `get_alert_recording`, `get_camera_frame` (画像), `get_camera_timeline`, `get_clip`, `get_library_album`, `get_library_item`, `get_library_item_thumbnail` (画像), `get_library_stats`, `get_recording`, `list_camera_recording_days`, `list_cameras_with_recordings`, `list_clips`, `list_library_albums`, `list_library_folders`, `list_library_items`, `list_recordings` |
| `recordings:write` | `add_library_album_items`, `create_clip`, `create_clip_download_url`, `create_library_album`, `create_library_folder`, `create_library_item`, `delete_clip`, `delete_library_album`, `delete_library_folder`, `delete_library_item`, `move_library_folder`, `preflight_clips`, `protect_recording`, `remove_library_album_items`, `reorder_library_album`, `unprotect_recording`, `update_library_album`, `update_library_item` |
| `clips:share` | `create_clip_share`, `create_library_album_share`, `create_library_item_share`, `list_all_clip_shares`, `list_clip_shares`, `revoke_clip_share`, `revoke_share` |
| `events:read` | `list_events` |
| `guardian:read` | `get_ai_live_history`, `get_briefing`, `get_briefing_feed`, `get_briefing_recap`, `get_camera_transcript`, `get_guardian_clip_settings` (admin, operator), `get_guardian_entry`, `get_guardian_entry_frame` (画像), `get_guardian_trash_frame` (admin, operator; 画像), `get_guardian_trash_settings` (admin, operator), `get_view`, `list_camera_ai_live_sessions`, `list_guardian_conversation_messages`, `list_guardian_conversations`, `list_guardian_entries`, `list_guardian_trash` (admin, operator), `list_room_guardian_entries`, `list_transcripts`, `list_view_suggestions`, `list_views`, `search_guardian` |
| `guardian:write` | `analyze_camera` (admin, operator), `compare_reference_frame`, `compose_view`, `create_guardian_conversation`, `delete_camera_ai_live_session`, `delete_guardian_conversation`, `delete_guardian_entries` (admin, operator), `delete_guardian_entry` (admin, operator), `delete_view`, `get_room_ai_live_digest` (admin, operator), `guardian_chat`, `list_camera_ai_live_session_messages`, `list_room_ai_live_messages`, `mark_briefing_reviewed`, `purge_guardian_entries` (admin), `read_plates`, `recompute_guardian_clips` (admin), `recompute_guardian_frames` (admin), `record_room_ai_live_feedback` (admin, operator), `refine_view`, `refresh_briefing_recap`, `restore_guardian_entries` (admin, operator), `set_camera_ai_live_session_mode` (admin, operator), `start_camera_ai_live_session`, `start_room_ai_live` (admin, operator), `stop_camera_ai_live_session` (admin, operator), `stop_room_ai_live` (admin, operator), `summarize_transcript`, `translate_transcript`, `unmark_briefing_reviewed`, `update_guardian_conversation`, `update_view` |
| `analytics:read` | `get_analytics_bays`, `get_analytics_busy_hours`, `get_analytics_counts`, `get_analytics_dwell`, `get_analytics_flows`, `get_analytics_heatmap`, `get_analytics_occupancy`, `get_analytics_queues`, `get_analytics_speed`, `get_camera_analytics`, `list_analytics_alert_events`, `list_analytics_alert_rules`, `list_analytics_areas`, `list_analytics_displays` (admin, operator), `list_analytics_lines`, `list_analytics_zones` |
| `analytics:write` (admin, operator) | `create_analytics_alert_rule`, `create_analytics_area`, `create_analytics_display`, `create_analytics_line`, `create_analytics_zone`, `delete_analytics_alert_rule`, `delete_analytics_area`, `delete_analytics_line`, `delete_analytics_zone`, `revoke_analytics_display`, `set_analytics_occupancy`, `update_analytics_alert_rule`, `update_analytics_area`, `update_analytics_line`, `update_analytics_zone`, `update_camera_analytics` |
| `floorplans:read` | `get_camera_locations`, `get_floor_plan`, `get_floor_plan_live`, `list_floor_plan_items`, `list_floor_plan_rooms`, `list_floor_plan_sites`, `list_floor_plans` |
| `floorplans:write` (admin, operator) | `create_floor_plan`, `delete_floor_plan`, `replace_floor_plan_items`, `sync_floor_plan_rooms`, `update_floor_plan` |
| `devices:read` (admin, operator) | `get_bluetooth`, `get_bluetooth_device`, `get_home_assistant_bridge`, `get_home_assistant_instance`, `get_home_assistant_room_signals`, `get_home_assistant_rule_actions`, `get_io_t_device`, `get_io_t_zigbee_status`, `list_bluetooth_devices`, `list_bluetooth_scans`, `list_home_assistant_action_log`, `list_home_assistant_devices`, `list_home_assistant_instances`, `list_home_assistant_triggers`, `list_io_t_device_entities`, `list_io_t_devices` |
| `devices:write` (admin, operator) | `create_home_assistant_trigger`, `delete_home_assistant_trigger`, `expose_io_t_device`, `forget_io_t_device`, `identify_io_t_device`, `list_home_assistant_entities` (admin), `list_home_assistant_instance_entities` (admin), `reconfigure_io_t_device`, `remove_io_t_device` (admin), `scan_bluetooth`, `set_home_assistant_entity_access` (admin), `set_home_assistant_instance_entity_access` (admin), `unexpose_io_t_device`, `update_bluetooth_device`, `update_home_assistant_device`, `update_home_assistant_room_signals`, `update_home_assistant_rule_actions`, `update_home_assistant_trigger`, `update_io_t_device` |
| `devices:control` (admin, operator) | `command_home_assistant_device`, `set_io_t_device_entity` |
| `settings:read` (admin, operator) | `export_config` (admin), `get_agent_settings`, `get_auto_scan`, `get_client_error` (admin), `get_home_assistant` (admin), `get_layout` (すべてのロール), `get_line_integration`, `get_mqtt_integration`, `get_remote_access` (admin), `get_room` (すべてのロール), `get_room_inventory` (すべてのロール), `get_settings`, `get_setup_checklist`, `get_site`, `get_system_ai_status`, `get_system_cloud_plan` (admin), `get_system_dashboard` (すべてのロール), `get_system_edge` (admin), `get_system_health` (すべてのロール), `get_system_mesh` (admin), `get_system_plan` (admin), `get_system_status`, `get_system_update` (admin), `get_telegram_integration`, `list_client_errors` (admin), `list_home_assistant_zigbee_devices` (admin), `list_layout_sequences` (すべてのロール), `list_layouts` (すべてのロール), `list_room_actuations` (すべてのロール), `list_room_outputs` (すべてのロール), `list_rooms` (すべてのロール), `list_sites`, `list_stt_providers` (すべてのロール), `run_diagnostics` |
| `settings:write` (admin) | `check_system_update`, `connect_existing_home_assistant`, `connect_home_assistant_bridge`, `connect_home_assistant_instance`, `create_home_assistant_instance`, `create_layout` (すべてのロール), `create_layout_sequence` (すべてのロール), `create_site` (admin, operator), `delete_home_assistant_instance`, `delete_layout` (すべてのロール), `delete_layout_sequence` (すべてのロール), `delete_site` (admin, operator), `disconnect_home_assistant_bridge`, `disconnect_home_assistant_instance`, `expose_home_assistant_zigbee_device`, `identify_home_assistant_zigbee_device`, `install_home_assistant`, `permit_home_assistant_zigbee_join`, `reconfigure_home_assistant_zigbee_device`, `remove_home_assistant_zigbee_device`, `rename_home_assistant_zigbee_device`, `resolve_all_client_errors`, `resolve_client_error`, `restart_home_assistant`, `run_diagnostic_fix`, `setup_home_assistant_zigbee`, `test_home_assistant_instance`, `test_line_integration`, `test_mqtt_integration`, `test_telegram_integration`, `uninstall_home_assistant`, `update_agent_settings`, `update_auto_scan`, `update_guardian_clip_settings`, `update_guardian_trash_settings`, `update_home_assistant`, `update_home_assistant_instance`, `update_home_assistant_integration`, `update_layout` (すべてのロール), `update_line_integration`, `update_mqtt_integration`, `update_settings`, `update_setup_checklist`, `update_site` (admin, operator), `update_telegram_integration`, `unexpose_home_assistant_zigbee_device`, `unresolve_client_error` |
| `users:read` (admin) | `get_group`, `get_user`, `list_groups`, `list_users` |
| `users:write` (admin) | `create_group`, `create_user`, `delete_group`, `delete_user`, `update_group`, `update_user` |
| `admin` (admin) | `delete_face`, `import_config`, `rename_face` |
| `webhooks:read` (admin, operator) | `get_webhook`, `list_webhook_deliveries`, `list_webhooks` |
| `webhooks:write` (admin) | `create_webhook`, `delete_webhook`, `redeliver_webhook`, `rotate_webhook_secret`, `test_webhook`, `update_webhook` |
| `network:read` (admin, operator) | `discover_home_assistant` (admin), `dismiss_camera_candidate`, `get_network_scan`, `list_camera_candidates`, `list_network_devices`, `lookup_network_address`, `run_auto_scan`, `start_network_scan` |

書き込みスコープは対応する読み取りスコープも含み、`admin` はすべてのスコープを含みます（[認証とスコープ](https://vigiora.com/docs/developers/api-authentication)を参照してください）。サインイン（OAuth）では、カメラ、アラート、録画、イベント、Analytics、フロアプラン、Home Assistant デバイスのツールだけが提供されます（デバイスのコマンド、Analytics とフロアプランの書き込み、ネットワークツールは「**Read and control**」の場合）。Guardian、設定、ユーザー、共有リンク、Webhook、構成には API キーが必要です。`detect_objects` と `analyze_image` はカメラのツールなので、サインインの接続でも使えます。その場合、記述には `guardian:write` が必要なため、`analyze_image` は `describe: false` で呼び出してください。

### 1.7.3 の新機能

バージョン 1.7.3（API 1.105.0）では、サイレン用の 5 つのツールが追加されます（[API v1](https://vigiora.com/docs/developers/api-v1#api-1105-sirens-and-stop-all-sounds)を参照）。

- `list_active_sounds` と `stop_all_sounds`（`alerts:read`）：鳴っている可能性があるものを調べ、すべてを静かにします。`stop_all_sounds` は、止めることは常に安全なので、Human in the loop がオンでも確認を求めません。閲覧者の場合、見えるカメラだけに及びます。
- `stop_camera_siren`（`alerts:read`）：1 台のカメラのサイレンを止めます。確認は求めません。
- `start_camera_siren` と `dismiss_sound`（`cameras:control`、管理者とオペレーター）：カメラのサイレンを鳴らします（実際の建物では大音量です）。また、止められなかったサイレンを静かになったと記録します。どちらも、Human in the loop がオンの間は承認が必要です。`start_camera_siren` は、ユーザーがサイレンを求めたときだけ使ってください。

アプリ自体のアシスタントには、`stop_all_sounds`、`stop_siren`、`start_siren` があります。これらは MCP ツールではありません。

### 1.6.10 の新機能

ツールは API 1.9〜1.11 の追加に対応しています（[API v1](https://vigiora.com/docs/developers/api-v1#api-19-to-111-the-rest-of-the-app) を参照）。エージェントがよく使うもの：

- **物体：** `detect_objects` は、指定したもの（`prompts`。例：`["person", "red t-shirt"]`）をカメラのライブフレームで、または `at` を付けて録画のある時点で見つけます（`recordings:read` も必要）。`analyze_image` は、ユーザーから渡された写真（`image_base64`）を記述し、物体を見つけます。`get_object_image` は、ボックスを描いたフレームを 15 分間返します。`analyze_camera` は `include_objects: true` を受け取ります。これらには物体認識の[アドオン](https://vigiora.com/docs/ai/hal-services)が必要です（ない場合は `503 no_detector`）。
- **何が起きたか：** `list_camera_detection_events`（アドオンの報告を含む 1 つのフィード。`source` と `label` で絞り込み）、`get_guardian_entry_frame`、`get_camera_frame`（任意の時点の録画からの静止画）、`list_transcripts`、`get_briefing`、`get_briefing_recap`。
- **アラートルール：** `list_alert_rules`、`create_alert_rule`、`create_label_alert_rule`、`create_motion_rule` と、それぞれの更新と削除。
- **カメラと部屋：** `list_camera_ai_services`、`enable_camera_ai_service`、`update_camera_ai_service`、`speak_in_room`、`save_ptz_preset`、`list_clients`。

これらのうち書き込みのツールは、[Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) がオンの間は確認が必要な操作です。`detect_objects`、`analyze_image`、`get_camera_frame` は読み取るだけで、承認は不要です。

### 1.6.11 の新機能

バージョン 1.6.11（API 1.12〜1.14）ではツールは追加されていないため、引き続き 226 個ですが、一部のツールは新しいフィールドを受け取ったり返したりします（[API v1](https://vigiora.com/docs/developers/api-v1#api-112-to-114-speakers-person-confirmation-and-presence) を参照）。

- `create_output` と `update_output`：カメラのスピーカーの `client_id` は省略できます。省略するか `null` を送ると、サーバー自身がカメラのスピーカーを再生します。
- `create_alert_rule` と `update_alert_rule`：`require_detector_confirmation`（既定は `true`）は、物体検出器がクリップを見て誰もいなかった場合に、人に関するルールのアラートを保留します。
- `list_guardian_entries`、`get_guardian_entry`、`search_guardian`：`detector_checked`、`unconfirmed_alerts`、`person_present_seconds` により、AI が人が映っていると考えたクリップがなぜアラートにならなかったのかをエージェントが把握できます。

### 1.6.20 の新機能

バージョン 1.6.20（API 1.42.0〜1.53.0）では 37 個のツールが追加され、合計 423 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-142-to-153-bluetooth-camera-clocks-device-control-ptz-presets-and-the-library) を参照）。`set_io_t_device_entity`、`set_camera_clock`、`set_detected_camera_clock`、`update_camera_clock`、`update_client`、`delete_ptz_preset`、`update_ptz_preset`、ライブラリの削除、`scan_bluetooth` は Human in the loop がオンの間は承認が必要です。読み取りとほとんどの書き込みは不要です。

- **PTZ 巡回**（`cameras:control`）：`list_ptz_patrols`、`create_ptz_patrol`、`get_ptz_patrol`、`update_ptz_patrol`、`delete_ptz_patrol`、`get_ptz_patrol_status`、`start_ptz_patrol`、`stop_ptz_patrol`、`pause_ptz_patrol`、`resume_ptz_patrol`、`list_active_ptz_patrols`。カメラが自分でプリセットを巡回します（「ロビーのカメラの巡回を開始して」「今巡回しているカメラはどれ？」）。自動セットアップ：`start_ptz_patrol_scan`、`get_ptz_patrol_scan`、`accept_ptz_patrol_scan`、`cancel_ptz_patrol_scan`（スキャン画像は署名付きメディアであり、ツールではありません）。プリセットの `dwell_seconds` は `get_ptz_preset`、`save_ptz_preset`、`update_ptz_preset` にあります。
- **ハードウェアの健全性**（管理者）：`get_system_health`、`get_latest_health_report`、`list_health_reports`、`get_health_report`、`get_health_inventory`、`run_health_check`、およびヘルスの設定の `get`/`update`。「故障しかけているディスクはある？」「今すぐハードウェアチェックを実行して」。
- **カメラのスピーカー**（`cameras:control`）：`speak_on_camera` は、カメラ自身のスピーカーからメッセージを読み上げます。
- **デバイス制御**（`devices:control`）：`set_io_t_device_entity` は、共有された Home Assistant デバイスで、ライトをオンにしたり、明るさや色を設定したり、カバーを開けたり、ロックを施錠したり、ボタンを押したりします（「玄関のライトを 30% に」「ガレージを閉めて」）。デバイス自身の説明と照合されます。`command_home_assistant_device` は引き続き名前付きコマンドを実行します。
- **Bluetooth**（`devices:read`）：`get_bluetooth`（利用できるか、次のスキャンはいつか）、`list_bluetooth_devices`（「昨夜サーバーの近くで見かけたスマホは？」）、分類と Vigiora がどう使えるかを含む `get_bluetooth_device`、`list_bluetooth_scans`。`devices:write` では、`scan_bluetooth` が今すぐスキャンを実行し、`update_bluetooth_device` がメモまたは ignore をします。調査のみで、ペアリングは行われません。
- **カメラの時計**（`cameras:read`/`cameras:write`）：`get_camera_clock` はカメラの時計をサーバーの時計と照らし合わせて読み取り、`set_camera_clock` は修正し、`update_camera_clock` は設定すべきゾーンを設定します。追加中のカメラには `check_detected_camera_clock` と `set_detected_camera_clock`。`update_client`（`cameras:write`、admin）は、Client の背後にあるカメラのタイムゾーンを設定します。
- **PTZ プリセット**（`cameras:control`）：`save_ptz_preset`、`list_ptz_presets`、`goto_ptz_preset` に加えて、`get_ptz_preset`、`update_ptz_preset`（名前変更、または現在の位置への移動）、`delete_ptz_preset`。
- **Library**（`recordings:read`/`recordings:write`）：`list_library_items`、`list_library_folders`、`list_library_albums`、`get_library_item`、`get_library_item_thumbnail`、`get_library_album`、`get_library_stats`。そして、フォルダーとアルバムの作成、クリップの保存、アルバムへの追加と並べ替え、名前変更・移動・削除の各書き込み。保存したアイテムやアルバムは `create_library_item_share` と `create_library_album_share`（`clips:share`）で共有します。ファイル自体（`/library/items/{id}/media`）とアップロードは、ほかのメディアエンドポイントと同様にツールではありません。

### 1.6.19 の新機能

バージョン 1.6.19（API 1.36.0〜1.41.0）では 28 個のツールが追加され、合計 386 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-136-to-141-camera-names-zigbee-iot-devices-rooms-on-the-plan-and-client-errors) を参照）。`setup_home_assistant_zigbee`、`permit_home_assistant_zigbee_join`、expose・unexpose・remove の各ツール、`forget_io_t_device`、`update_io_t_device` は Human in the loop がオンの間は承認が必要です。その他は不要です。

- **IoT デバイス**（`devices:read`）：フィルター付きの `list_io_t_devices`（「どのドアが開いていますか？」「電池が少ないセンサーはありますか？」）、すべての読み取り値と Vigiora がそれを何として読むかを含む `get_io_t_device`、`list_io_t_device_entities`、`get_io_t_zigbee_status`。`devices:write` では、`update_io_t_device`（名前の変更、ルーム、カメラ、マッピングの上書き）、`expose_io_t_device`、`unexpose_io_t_device`、`reconfigure_io_t_device`、`identify_io_t_device`（「キッチンのセンサーを点滅させて」）、`forget_io_t_device`、`remove_io_t_device`（admin）。ツール名では、snake_case の規則に従って IoT が `io_t` と綴られます。
- **Zigbee**（`settings:write`、admin）：`setup_home_assistant_zigbee`、`permit_home_assistant_zigbee_join`（「新しいセンサーのペアリングを開いて」。`ieee` でルーター経由）、そして `settings:read` で `list_home_assistant_zigbee_devices`。`rename_`、`reconfigure_`、`identify_`、`expose_`、`unexpose_`、`remove_home_assistant_zigbee_device`。
- **カメラ**（`cameras:write`）：`suggest_camera_name` は、ほかのカメラのスタイルに合わせて画像からカメラの名前を付けます（「Living room – TV side」）。名前の変更は行わないため、ユーザーが同意したら `update_camera` を続けてください。AI クレジットを使います。`detect_camera` と `detect_camera_batch` は `unlock` を受け取ります。
- **フロアプラン**：`list_floor_plan_rooms` と `sync_floor_plan_rooms`。`replace_floor_plan_items` は `device_key` と `entity_id` を持つ `device` の項目を受け付け、ルームには `source`、`floor_plan`、`managed` のメンバー、`managed_devices` が付きます。
- **クライアントエラー**（`settings:read` と `settings:write`、admin）：サーバーの問題を確認して修正するエージェント向けに、`list_client_errors`、`get_client_error`、メモ付きの `resolve_client_error`、`unresolve_client_error`、`resolve_all_client_errors`。

### 1.6.18 の新機能

バージョン 1.6.18（API 1.33.2〜1.35.0）では 11 個のツールが追加され、合計 358 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-134-and-135-ai-views-linked-chat-answers-ai-availability-and-transcripts) を参照）。`delete_view` は Human in the loop がオンの間は承認が必要です。その他は不要ですが、ビューの作成・変更と文字起こしの翻訳・要約は AI クレジットを使うため、エージェントは実行前にその旨を伝えるべきです。

- **AI ビュー**（`guardian:write`）：`compose_view`（「玄関と車寄せのライブを、今日のアラートと一緒に見せて」）はビューのカードと `notes` を返します。`refine_view` はビューを変更し（「ガレージを追加して」「直近 48 時間にして」）、`update_view` はピン留め・名前の変更・カードの絞り込みを、`delete_view` は削除を行います。`guardian:read` では `list_views`、`get_view`、`list_view_suggestions` が使えます。ビューはカメラ上のカードの記述であって画像ではありません。ユーザーに何かを見せるには、カードが解決したカメラに対して続けて `get_camera_snapshot` や `list_alerts` を呼び出してください。
- **文字起こし**（`guardian:read`）：`get_camera_transcript` は、カメラまたはマイクの指定した時間帯の音声テキスト変換セグメントを古い順に一覧します。`guardian:write` では、`translate_transcript` が渡したパッセージを指定の言語に翻訳し、`summarize_transcript` が直近数分または数時間の発話を要約します（「この 1 時間にカウンターで何が話されましたか？」）。
- **顔**（`alerts:read`）：`get_face_crop` は確認待ちの顔（`has_crop`）の顔そのものを返します。`delete_face` は確認待ちの顔（`det-<alert id>`）と `not_a_face: true` を受け取ります。
- `guardian_chat` の回答には `refs` が含まれます。回答が引用する目撃ごとに 1 つで、カメラ、時刻、クリップやフレームの有無を持ちます。テキストから時刻を解析する代わりに、これを使って根拠を取得してください（`get_guardian_entry_frame`、`get_camera_frame`）。`get_server` は `ai.status` と `ai.retry_at` を報告します。AI が一時停止している間、AI ツールは `ai_unavailable` を返すため、再試行を繰り返すのではなく `retry_at` まで待ってください。

### 1.6.17 の新機能

バージョン 1.6.17（API 1.31〜1.33.1）では 6 個のツールが追加され、合計 347 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-131-to-133-camera-catalogue-and-floor-plans-from-a-description) を参照）。Human in the loop がオンの間に承認が必要なものはありません。

- **カメラカタログ**（`cameras:read`、admin と operator）：`search_camera_catalog`（「Tapo C230 はローカルでストリーミングできますか？」「Reolink のストリームのアドレスは何ですか？」）と `list_camera_catalog_brands`。`detect_camera` と `detect_cameras` は `model` を受け取り、スキャン結果と検出結果には `catalog`（何を認識したか、ローカルでストリーミングできるか、ユーザーに伝えるログインの案内）が含まれます。
- **説明からのフロアプラン**（`floorplans:write`）：`describe_floor_plan`（「家のプランを描いて：玄関はホールに通じていて、…」）、`refine_floor_plan`（「キッチンを入口の左に移動して」）、`undo_floor_plan_layout`。`floorplans:read` では、`get_floor_plan_layout` がレイアウトとチャットを返します。describe や refine のたびに、Guardian チャットと同じように AI クレジットを使います。エージェントはユーザーの言葉をそのまま渡し、回答の `notes` と `unplaced_cameras` を報告してください。

### 1.6.15 と 1.6.16 の新機能

バージョン 1.6.15 と 1.6.16（API 1.26〜1.30）では 35 個のツールが追加され、合計 341 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-126-to-130-analytics-alerts-door-displays-integrations-and-more) を参照）。

- **Analytics**（`analytics:read`）：`get_analytics_queues`、`get_analytics_bays`、`get_analytics_speed`、`get_analytics_busy_hours`、`get_analytics_flows`、`list_analytics_alert_rules`、`list_analytics_alert_events`。「レジ 1 の行列は長いですか？」は `get_analytics_queues`、「空いている駐車スペースはいくつですか？」は `get_analytics_bays` です。`analytics:write` では、`create_analytics_alert_rule`、`update_analytics_alert_rule`、`delete_analytics_alert_rule`、`create_analytics_display`、`revoke_analytics_display`（admin と operator には `list_analytics_displays`）。
- **カメラ**：`move_device_to_dhcp`（admin、確認が必要な操作）と `get_dhcp_move`。
- **連携**：`get_mqtt_integration`、`update_mqtt_integration`、`test_mqtt_integration`、および Telegram と LINE の同等のツール（変更は admin）。
- **Home Assistant インスタンス**：`list_home_assistant_instances`、`get_home_assistant_instance`、`create_home_assistant_instance`、`update_home_assistant_instance`、`delete_home_assistant_instance`、`connect_home_assistant_instance`、`disconnect_home_assistant_instance`、`test_home_assistant_instance`、`list_home_assistant_instance_entities`、`set_home_assistant_instance_entity_access`。Guardian チャットの `control_device` は、2 つのデバイスが同じ名前のとき「インスタンス / 名前」を受け付けます。
- **共有リンク**：`revoke_share` は、ID を指定して任意の共有リンクを取り消します。

### 1.6.13 の新機能

バージョン 1.6.13（API 1.15〜1.25）では 80 個のツールが追加され、合計 306 個になりました（[API v1](https://vigiora.com/docs/developers/api-v1#api-115-to-125-analytics-floor-plans-home-assistant-and-more) を参照）。

- **Analytics**（`analytics:read`）：`get_analytics_counts`、`get_analytics_occupancy`、`get_analytics_dwell`、`get_analytics_heatmap`、`get_camera_analytics`、`list_analytics_areas`、`list_analytics_lines`、`list_analytics_zones`。`analytics:write` では、ライン、ゾーン、エリアの作成・変更・削除、`update_camera_analytics`、`set_analytics_occupancy`。「9 時から 12 時までに何人のお客様が来店しましたか？」は、エリアと `from`/`to` を指定した `get_analytics_counts` です。`covered_pct` が 100 未満の場合はその値を伝えてください。
- **フロアプラン**（`floorplans:read`）：`list_floor_plan_sites`、`list_floor_plans`、`get_floor_plan`、`list_floor_plan_items`、`get_floor_plan_live`（「1 階で何が起きていますか？」）、`get_camera_locations`（「裏口のカメラはどこですか？」）。`floorplans:write` では、`create_floor_plan`、`update_floor_plan`、`replace_floor_plan_items`、`delete_floor_plan`。
- **Home Assistant**：`get_home_assistant`、`install_home_assistant`、`update_home_assistant_integration` とその他のインストール用ツール（admin）、およびブリッジ：`list_home_assistant_devices`、`command_home_assistant_device`、トリガー、ルールのアクション、ルームのシグナル、`list_home_assistant_action_log`。
- **場面**：`delete_guardian_entry`、`delete_guardian_entries`、`list_guardian_trash`、`restore_guardian_entries`、`purge_guardian_entries`、さらに `recompute_guardian_frames`、`recompute_guardian_clips`（先にドライラン）と、クリップとごみ箱の設定。
- **ライブメディアとデバイス**：`create_camera_stream_url`、`create_camera_snapshot_url`、`speak_on_camera`、`get_server`、`get_alert_summary`、`list_things`、`get_thing`、`get_thing_capabilities`。
- **ルーム**：ルームのアラートルール（`create_room_alert_rule` など）と `list_room_guardian_entries`。

> **スコープのないキーには Analytics のツールがありません**
>
> 「**設定 → ユーザーとアクセス → API キー**」で作成したスコープのないキーには、読み取り専用のものでも `analytics:read` がないため、その接続には Analytics のツールが **1 つも** 表示されません（フロアプランと Home Assistant デバイスのツールもありません）。`analytics:read` を持つスコープ付きのキーを使うか、サインインしてください。**Read only** には含まれています。[スコープのないキー](https://vigiora.com/docs/developers/api-authentication#keys-without-scopes)を参照してください。

アプリの Guardian チャットには、独自の Analytics ツール `query_analytics` があります。これは MCP のツールではありません。エージェントは上記の `get_analytics_*` ツールを使います。

`command_home_assistant_device` は確認が必要な操作です。**要注意** のデバイス（錠、警報パネル、サイレン）では、Human in the loop がオフでも、常に「**Allow / Deny**」のプロンプトでその人に確認します。

ツールとして提供されないもの：署名付きのメディアリンク（`/media/...`）、フロアプランの画像、Things のコマンド（エージェントはその背後の操作を呼び出し、そこで Human in the loop が適用されます）、ユーザーセッション専用の Home Assistant の操作（オーナーのパスワードと承認待ちの操作）。

そのほかにツールとして提供されないもの：

- **イベントストリーム**（`GET /api/v1/events/stream`）：MCP のツール呼び出しはリクエストとレスポンスの形式です。追いつくには `from`（とカーソル）を指定して `list_events` を使うか、プッシュ配信には [Webhook](https://vigiora.com/docs/developers/webhooks-and-events) を使います。
- **録画の動画**（`/recordings/{recording_id}/media`）：`create_clip` でクリップを書き出し、`create_clip_download_url` を使います。
- **API キーの管理：** キーでキーを管理することはできません。
- **ユーザーセッション専用の操作：** コストと請求、接続済みアプリ、AI サービスのインスタンス、外部 AI ツール、リモートアクセスの切り替え。
- **Guardian エントリーのクリップ**（`/guardian/entries/{entry_id}/clip`）：動画です。画像には `get_guardian_entry_frame` を使います。
- **OpenAPI ドキュメント：** 代わりにリソースとして提供されます（下記参照）。

### 結果

- JSON のレスポンスは、API が返すとおりのテキストコンテンツとして返されます。
- スナップショット、顔写真、録画からのフレーム（`get_camera_frame`）、Guardian エントリーのフレーム（`get_guardian_entry_frame`）、参照フレーム、物体の注釈付き画像（`get_object_image`）は**画像コンテンツ**（JPEG）として返され、スナップショットがライブでない場合は `age_seconds` を含む短い JSON メモが付きます。
- API のエラーは**ツールエラー**（`isError: true`）になり、そのテキストは `{"http_status": 404, "error": {"code": "not_found", "message": "...", "details": {}}}` です。コードは API の[エラーコード](https://vigiora.com/docs/developers/api-conventions)です。`not_found` は、その項目を見る権限がない場合も意味します。
- Human in the loop がオンの間、リスクのあるツールは `confirmation_required`（ユーザーに確認し、`confirm: true` を付けて呼び直す）または `user_declined`（ユーザーが「**Deny**」を選んだので再試行しない）を返すことがあります。[Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop#how-it-works)を参照してください。

### リソースとプロンプト

リソース：

- `vigiora://docs/overview`：API の規約（ページネーション、エラー、冪等性、レート制限、イベント）。
- `vigiora://docs/openapi-v1.yaml`：OpenAPI 3.1 ドキュメント全体。

プロンプトは、ガイド付きのワークフローです。Claude Code では `/mcp__vigiora__…` コマンドとして表示されます。

| プロンプト | 内容 |
| --- | --- |
| `daily_briefing`（`hours`、既定は 24） | アラート、カメラの状態、注目すべきイベントを、主要なアラートのスナップショット付きでまとめます。 |
| `investigate_alert`（`alert_id`） | アラートに何が写っているか、その前後にそのカメラで何があったか、動画があるかを調べ、判断を示します。 |
| `camera_health_check`（`camera_id`、省略可） | どのカメラがオンラインで、映像を出し、録画しているかと、録画の欠落を確認します。 |

## 安全性と制限

- **REST と同じルール。** ツール呼び出しは、REST のリクエストと同じチェックを通ります。カメラへのアクセス権がない viewer は、MCP でもそのカメラを読み取れません。カメラのパスワードは常に `REDACTED` になります。
- **Human in the loop。** オンの間、リスクのあるツールは呼び出しごとにあなたの承認が必要です。[Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop)を参照してください。
- **構成の書き出し。** `export_config` がカメラのパスワードを返すのは、認証情報に `admin` スコープがあり、ユーザーが admin で、12 文字以上のパスフレーズが指定された場合だけです。その場合、パスワードはそのパスフレーズで暗号化されます。サインインによる接続には、このツールは提供されません。
- **レート制限。** MCP の各メッセージは、認証情報の API レート制限（容量 120、毎秒 10 ずつ補充されるバケット）に対して 1 リクエストとして数えられ、JSON-RPC のバッチは最大 10 メッセージです。`analyze_camera` と `guardian_chat` には、REST と共有される独自の制限があります。制限を超えると、`Retry-After` 付きの `429` が返ります。
- **リクエストのサイズ。** MCP の呼び出しは最大 1 MB です。`analyze_image` に写真を送るには、base64 でエンコードして `image_base64` に入れます。画像は最大で約 750 KB なので、大きな写真は先に縮小してください。画像は分析されるだけで保存されません。
- **レスポンスのサイズ。** テキストの結果は約 100 KB に制限されます。結果のページが大きすぎる場合、サーバーは収まる先頭の項目を返し、`next_cursor` を削除して `truncated` のメモを追加します。小さい `limit` でもう一度リクエストしてください。4 MB を超える画像は返されません。
- **Cloudflare Tunnel。** Cloudflare Tunnel のアドレス経由では、REST と同じく画像ツールが `media_not_on_tunnel` を返します。画像を取得するには、サイトのアドレスか LAN 経由でエージェントを接続します。
- **ブラウザー。** ほかのサイトの Web ページからのリクエスト（サーバー自身以外の `Origin`）は `403` で拒否されます。サインインページと同意ページは、ほかのサイトのフレーム内には表示できません。
- **キーとトークンは記録されません。** 保存されるのは、API キーと OAuth トークンのハッシュだけです。
- **オフにする。** 管理者は、サーバーの設定ファイルで `VIGIORA_MCP_ENABLED=false` を設定して再起動すると、エンドポイントをオフにできます。エンドポイントは `404` を返すようになり、サインインもオフになります。

### サインインの仕組み

サーバーは [MCP の認可仕様](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization)（OAuth 2.1）に従います。

- トークンのないリクエストには、`WWW-Authenticate: Bearer resource_metadata="https://<site>/.well-known/oauth-protected-resource/api/v1/mcp"` 付きの `401` が返ります。
- Protected Resource Metadata（RFC 9728）は `/.well-known/oauth-protected-resource`（と `/api/v1/mcp` のパス付きの形式）で、認可サーバーのメタデータ（RFC 8414）は `/.well-known/oauth-authorization-server` で提供されます。発行者はリクエストが届いたアドレスなので、あるアドレスで発行されたトークンがほかのアドレスで使えることはありません。
- クライアントは Client ID Metadata Document（`client_id` としての `https` URL。claude.ai と ChatGPT が使います）で自分を識別するか、`/oauth/register` の Dynamic Client Registration で登録します。
- `/oauth/authorize` と `/oauth/token` での PKCE（`S256` のみ）付き認可コードフローで、`resource` パラメーター（RFC 8707）と、レスポンスの `iss`（RFC 9207）を使います。リダイレクト URI は完全に一致する必要があります。`http` は `localhost` と `127.0.0.1` にだけ、任意のポートで許可されます。
- アクセストークンの有効期間は 1 時間で、発行したサーバーの `/api/v1/mcp` でだけ使えます。REST の `/api/v1` では拒否されます。リフレッシュトークンは 30 日間使われないと失効し、使うたびに新しくなります。使用済みのリフレッシュトークンが再び提示されると、接続全体が取り消されます。トークンは `/oauth/revoke`（RFC 7009）で取り消せます。
- スコープ：`cameras:read`、`alerts:read`、`recordings:read`、`events:read`、`analytics:read`、`floorplans:read`、`devices:read`、さらに「**Read and control**」では `cameras:write`、`cameras:control`、`alerts:write`、`recordings:write`、`network:read`、`analytics:write`、`floorplans:write`、`devices:control`（カメラ、ネットワーク、Analytics の書き込み、フロアプランの書き込み、デバイスのスコープは admin と operator のみ）。Analytics、フロアプラン、デバイスのスコープはバージョン 1.6.13 から付与されます。付与される内容は同意ページでの選択で決まり、クライアントが求めた範囲に絞られます。

## アクセスを取り消す

接続済みのアプリは、「**設定 → ユーザーとアクセス → API キー**」の「**Connected apps**」に、接続日時と最終使用日時とともに表示されます。「**Revoke**」をクリックすると、そのアプリのアクセスはすぐに終了します。再び使うには、もう一度サインインが必要です。 各アプリには「**Ask before actions**」の選択（[Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop)）も表示されます。

アクセスは次の場合にも自動的に終了します。

- パスワードを変更したとき、ユーザーが無効にされたとき、またはロールが下げられたとき（そのユーザーのすべての接続済みアプリ）。
- 承認から 90 日後（アプリから再度サインインを求められます）。

API キーを使うエージェントを止めるには、同じページでキーを取り消します。キーはすぐに使えなくなります。

## 例

エージェントには、たとえば次のように頼めます。

- 「直近 12 時間のまとめをください。」（`daily_briefing` プロンプト、または `list_alerts` と `get_alert_snapshot`）
- 「深夜 0 時以降に玄関に誰かいましたか？スナップショットを見せてください。」
- 「どのカメラがオフラインか、今日録画していませんか？」
- 「アラート 4812 の前後 2 分を書き出して、ダウンロードリンクをください。」（`recordings:write` が必要）
- 「駐車場カメラの昨日の車のアラートをすべて確認済みにしてください。」（`alerts:write` が必要。`before` と `camera_id` を指定した `acknowledge_alerts`）
- 「Vigiora が見つけた新しいカメラを設定して」（`network:read` と `cameras:write` が必要です。`list_camera_candidates` の後、カメラのログイン情報で `detect_camera` を実行し、`add_detected_cameras` を実行します。カメラは数回の失敗でロックされるため、パスワードが拒否されると検出は終了します。1.6.8 以降。）
- 「MAC が 08:cc:81:4a:1f:02 の Hikvision を見つけて、アドレスを直してください。」（`network:read` と `cameras:write` が必要。`lookup_network_address` の後、まず `dry_run` 付きで `relocate_camera`。[ネットワークツール](https://vigiora.com/docs/developers/network-tools)をご覧ください。）
- 「カメラを動かす前に、私の許可が必要ですか？」（`get_agent_policy`：この接続で [Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) がオンかどうか）
- 「この 1 時間に、入口で赤いシャツの人を探してください。」（`from` を指定した `list_camera_detection_events`、次に「red shirt」で `search_guardian`、見つかった時点で `at` と `prompts: ["person", "red shirt"]` を指定した `detect_objects`、そして `get_object_image` で画像を見せます。1.6.10 以降。）
- 「今、ガレージのカメラにはどんな物が映っていますか？」（`at` なしの `detect_objects`。`t-shirt` だけでなく `black t-shirt` のように、探すものを説明してください。）
- 「この写真を説明してください。」（写真を `image_base64` に入れた `analyze_image`。保存されません。記述には `guardian:write` が必要です。）

通信上のツール呼び出し（HTTP POST 上の JSON-RPC）：

```bash
curl -s https://<your-server>/api/v1/mcp \
  -H "Authorization: Bearer $VIGIORA_API_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"list_alerts","arguments":{"is_alert":true,"limit":5}}}'
```

---

Source: https://vigiora.com/ja/docs/developers/mcp · Last updated 25 Nov 2026, 11:49 UTC
