ProofScan 実行例

実際のコマンド実行例とその出力

クイックスタート

ProofScanの基本的な使い方を4ステップで紹介します。

1. 設定の初期化

$ pfscan config init
✓ Configuration initialized at ~/.config/proofscan/config.json

2. MCPサーバーの追加

$ pfscan connectors add --id time --stdio "npx -y @modelcontextprotocol/server-time"
✓ Connector 'time' added successfully

3. スキャンの実行

$ pfscan scan start --id time
Starting scan for connector 'time'...
✓ Scan completed successfully (session: f2442c9b)

4. 結果の確認

$ pfscan tree
└── 📦 time
    └── 📋 f2442c9b... (2 rpcs, 8 events)
        ├── ↔️ ✓ tools/list (id=2, 12ms)
        └── ↔️ ✓ initialize (id=1, 269ms)

イベント表示 (view)

最近のイベントをタイムラインで表示します。

基本的な使用

$ pfscan view --limit 5
Time         Sym Dir St Method              Session      Extra
-------------------------------------------------------------------
21:01:58.743 → → ✓ initialize            f2442c... lat=269ms
21:01:59.018 ← ← ✓ initialize            f2442c...
21:01:59.025 • →   notifications/initi... f2442c...
21:01:59.037 → → ✓ tools/list            f2442c...
21:01:59.049 ← ← ✓ tools/list            f2442c... lat=12ms size=1.0KB

エラーのみを表示

$ pfscan view --errors --fulltime
Time                      Sym Dir St Method         Session      Extra
--------------------------------------------------------------------------
2026-01-04T12:05:23.456Z  ✖ → ✗ tools/call      abc123... err="timeout"
2026-01-04T12:10:15.789Z  ✖ → ✗ resources/list  def456... err="not_found"

特定のコネクタをフィルタ

$ pfscan view --connector time --limit 10
Time         Sym Dir St Method              Session      Extra
-------------------------------------------------------------------
21:01:58.743 → → ✓ initialize            f2442c... lat=269ms
21:01:59.018 ← ← ✓ initialize            f2442c...
21:01:59.037 → → ✓ tools/list            f2442c...
21:01:59.049 ← ← ✓ tools/list            f2442c... lat=12ms

階層表示 (tree)

コネクタ → セッション → RPCの階層構造を表示します。

全コネクタの表示

$ pfscan tree
└── 📦 time
    ├── 📋 f2442c9b... (2 rpcs, 8 events)
    │   ├── ↔️ ✓ tools/list (id=2, 12ms)
    │   └── ↔️ ✓ initialize (id=1, 269ms)
    └── 📋 3cf5a66e... (2 rpcs, 8 events)
        ├── ↔️ ✓ tools/list (id=2, 13ms)
        └── ↔️ ✓ initialize (id=1, 271ms)

1 connector(s), 2 session(s), 4 rpc(s)

特定のコネクタの詳細

$ pfscan tree time --rpc-all
└── 📦 time
    └── 📋 f2442c9b... (2 rpcs, 8 events)
        Started:  2026-01-04T12:01:58.610Z
        Ended:    2026-01-04T12:01:59.150Z
        Duration: 540ms
        
        RPCs:
        ├── ↔️ ✓ initialize (id=1, 269ms)
        │     Request:  2026-01-04T12:01:58.743Z
        │     Response: 2026-01-04T12:01:59.012Z
        │     Size:     58B → 1.2KB
        │
        └── ↔️ ✓ tools/list (id=2, 12ms)
              Request:  2026-01-04T12:01:59.037Z
              Response: 2026-01-04T12:01:59.049Z
              Size:     58B → 1.0KB

スキャン実行 (scan)

MCPサーバーに対してスキャンを実行します。

基本的なスキャン

$ pfscan scan start --id time
Starting scan for connector 'time'...
→ Connecting to MCP server...
✓ Connected (269ms)
→ Requesting tools/list...
✓ Received 2 tools (12ms)
→ Closing connection...
✓ Scan completed successfully

Session ID: f2442c9b
Duration:   540ms
Events:     8
RPCs:       2 (2 OK, 0 ERR)

タイムアウト指定

$ pfscan scan start --id weather --timeout 60
Starting scan for connector 'weather' (timeout: 60s)...
→ Connecting to MCP server...
✓ Connected (1.2s)
→ Requesting tools/list...
✓ Received 3 tools (245ms)
→ Closing connection...
✓ Scan completed successfully

Session ID: abc123de
Duration:   1.5s
Events:     10
RPCs:       2 (2 OK, 0 ERR)

ツール実行 (tool)

MCPツールを直接実行します。

ツール一覧

$ pfscan tool ls time
Found 2 tools:

  get_current_time
    Get the current time in a specific timezone
    
  get_timezone
    Get timezone information

ツールの詳細

$ pfscan tool show time get_current_time
Tool: get_current_time
Description: Get the current time in a specific timezone

Required arguments:
  timezone    string    IANA timezone (e.g., America/New_York)

Optional arguments:
  format      string    Time format (iso, unix, human)

ツールの実行

$ pfscan tool call time get_current_time --args '{"timezone":"Asia/Tokyo"}'
Calling tool 'get_current_time' on connector 'time'...

Result:
{
  "time": "2026-01-04T21:30:45+09:00",
  "timezone": "Asia/Tokyo",
  "formatted": "21:30:45 JST",
  "offset": "+09:00"
}

プロキシモード (proxy)

複数のMCPサーバーを統合プロキシとして実行します。

プロキシの起動

$ pfscan proxy start --all
Starting MCP proxy server...
→ Loading connectors...
  ✓ time (2 tools)
  ✓ weather (3 tools)
  ✓ filesystem (5 tools)
→ Starting proxy...
✓ Proxy running (3 connectors, 10 tools)

Mode:     stdio
Tools:    10 (namespaced)
Logging:  ~/.config/proofscan/proxy-logs.jsonl

Press Ctrl+C to stop

プロキシのステータス

$ pfscan proxy status
Proxy Status
═══════════════════════════════════════════════════

State:        RUNNING
Mode:         stdio
PID:          12345
Started:      2026-01-04T12:00:00.000Z
Uptime:       5m 30s
Heartbeat:    just now

Connectors:
  ● time: 2 tools
  ● weather: 3 tools
  ● filesystem: 5 tools

Clients:
  ● claude-desktop (active)
      Last seen: 2s ago
      Sessions: 1, Tool calls: 5

Logging:
  Level:      INFO
  Buffered:   45/1000 lines

プロキシログの確認

$ pfscan log --tail 10
[12:00:05.123] INFO  [server] Proxy started with 3 connector(s)
[12:00:07.456] INFO  Request: initialize
[12:00:07.457] INFO  [init] Client: claude-desktop (protocol=2024-11-05)
[12:00:09.234] INFO  Request: tools/list
[12:00:11.567] INFO  Listed 2 tool(s) from time (session=abc123)
[12:00:11.568] INFO  Listed 3 tool(s) from weather (session=def456)
[12:00:11.569] INFO  Returning 10 tool(s)
[12:00:15.890] INFO  Request: tools/call
[12:00:15.891] INFO  tools/call name=time__get_current_time
[12:00:16.123] INFO  Result: success sessionId=abc123

POPL生成 (popl)

公開安全な監査証跡を生成します。

POPLの初期化

$ cd /path/to/project
$ pfscan popl init
✓ POPL directory initialized at: /path/to/project/.popl

Created:
  .popl/README.md
  .popl/entries/

POPLエントリの作成

$ pfscan popl session --session f2442c9b --title "Time Server Test"
Creating POPL entry...
→ Loading session data...
  ✓ Loaded 2 RPCs
  ✓ Loaded 8 events
→ Sanitizing data...
  ✓ Redacted 0 secrets
  ✓ Redacted 3 file paths
  ✓ Hashed 2 RPC payloads
→ Generating artifacts...
  ✓ Created POPL.yml
  ✓ Created status.json
  ✓ Created rpc.sanitized.jsonl
  ✓ Created validation-run.log

✓ POPL entry created: 20260104-f2442c9b

Entry location:
  .popl/entries/20260104-f2442c9b/

Files created:
  POPL.yml              (1.2KB)
  status.json           (856B)
  rpc.sanitized.jsonl   (2.4KB)
  validation-run.log    (1.1KB)

POPLエントリの確認

$ pfscan popl show 20260104-f2442c9b
Entry: 20260104-f2442c9b
Title: Time Server Test
Created: 2026-01-04T12:05:30Z

Session:
  ID:         f2442c9b...
  Connector:  time
  Started:    2026-01-04T12:01:58Z
  Ended:      2026-01-04T12:01:59Z
  Duration:   540ms

Summary:
  RPCs:       2 (2 OK, 0 ERR)
  Events:     8
  Tool calls: 0
  Errors:     0

Sanitization:
  Ruleset:    v1
  Secrets:    redacted
  Paths:      redacted
  Payloads:   hashed (SHA-256)

Files:
  POPL.yml              (sha256:abc...)
  status.json           (sha256:def...)
  rpc.sanitized.jsonl   (sha256:ghi...)
  validation-run.log    (sha256:jkl...)