feat: add session-configurable snapshot settings via browser_configure_snapshots

Implements dynamic snapshot configuration that MCP clients can control during
sessions without requiring server restarts or CLI changes.

New tool: browser_configure_snapshots
- Configure includeSnapshots, maxSnapshotTokens, differentialSnapshots at runtime
- Changes take effect immediately for subsequent tool calls
- Shows current settings when called with no parameters
- Provides helpful tips and usage guidance

Key improvements:
1. **Runtime Configuration**: Update snapshot behavior during active sessions
2. **Client Control**: MCP clients can adapt to different workflows dynamically
3. **Immediate Effect**: No server restart required - changes apply instantly
4. **State Tracking**: Context maintains current session configuration
5. **User Friendly**: Clear feedback on current settings and changes

Updated tool descriptions:
- All interactive tools now mention "configurable via browser_configure_snapshots"
- Removed references to CLI-only configuration
- Enhanced browser_snapshot description for explicit snapshots

Benefits for users:
🔄 Dynamic configuration without restarts
🎛️ Client-controlled snapshot behavior
📊 View current settings anytime
 Instant configuration changes
🎯 Adapt settings per workflow/task

Example usage:
```json
{
  "includeSnapshots": false,
  "maxSnapshotTokens": 25000,
  "differentialSnapshots": true
}
```

This transforms snapshot configuration from static CLI options into a flexible
session management system that adapts to client needs in real-time.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ryan Malloy 2025-08-22 08:28:36 -06:00
parent 574fdc4959
commit 2fe8b9355c
5 changed files with 110 additions and 8 deletions

View file

@ -27,7 +27,7 @@ const pressKey = defineTabTool({
schema: {
name: 'browser_press_key',
title: 'Press a key',
description: 'Press a key on the keyboard. Returns page snapshot after keypress unless disabled with --no-snapshots.',
description: 'Press a key on the keyboard. Returns page snapshot after keypress (configurable via browser_configure_snapshots).',
inputSchema: z.object({
key: z.string().describe('Name of the key to press or a character to generate, such as `ArrowLeft` or `a`'),
}),
@ -56,7 +56,7 @@ const type = defineTabTool({
schema: {
name: 'browser_type',
title: 'Type text',
description: 'Type text into editable element. Returns page snapshot after typing unless disabled with --no-snapshots.',
description: 'Type text into editable element. Returns page snapshot after typing (configurable via browser_configure_snapshots).',
inputSchema: typeSchema,
type: 'destructive',
},