New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

schrute

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schrute

Universal Self-Learning Browser Agent — UI automation for the first run, API-level replay for the 100th run

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

Schrute

Universal Self-Learning Browser Agent — record browser interactions, learn API patterns, and replay them as optimized MCP tools.

What It Does

  • Record — Open a browser, perform actions, and Schrute captures the underlying API calls
  • Learn — The capture pipeline extracts parameters, detects auth patterns, and generates replayable skills
  • Replay — Skills execute through a 4-tier optimization system, starting at browser-proxied and promoting to direct HTTP

Quick Start

# Run directly with npx
npx schrute serve

# Or install globally
npm install -g schrute
schrute serve

Installation

npm install -g schrute
schrute setup  # Installs Playwright Chromium

npx (no install)

npx schrute serve

From Source

git clone https://github.com/user/schrute.git
cd schrute
npm install
npx playwright install chromium
npm run build
node dist/index.js serve

Multi-Client Setup

Schrute works with any MCP client. Configure your preferred client:

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "schrute": {
      "command": "npx",
      "args": ["-y", "schrute", "serve"]
    }
  }
}

Or if installed as a plugin, use the built-in .mcp.json with ${CLAUDE_PLUGIN_ROOT}.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "schrute": {
      "command": "npx",
      "args": ["-y", "schrute", "serve"]
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "schrute": {
      "command": "npx",
      "args": ["-y", "schrute", "serve"]
    }
  }
}

Windsurf

Add to .codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "schrute": {
      "command": "npx",
      "args": ["-y", "schrute", "serve"]
    }
  }
}

Cline

Add to cline_mcp_settings.json:

{
  "mcpServers": {
    "schrute": {
      "command": "npx",
      "args": ["-y", "schrute", "serve"]
    }
  }
}

Generic (any MCP client)

Use stdio transport with the command: npx -y schrute serve

MCP Tools

Meta Tools

ToolDescriptionKey Parameters
schrute_exploreStart a browser session on a URLurl (required)
schrute_recordBegin recording an actionname (required), inputs (optional)
schrute_stopStop recording and process captures—
schrute_skillsList learned skillssite (optional filter)
schrute_sitesList known sites—
schrute_statusEngine status and session info—
schrute_dry_runPreview a skill executionskill_id (required), params (optional)
schrute_confirmApprove a pending skill confirmationtoken (required), approve (boolean)

Browser Tools (19 available)

browser_navigate, browser_click, browser_type, browser_snapshot, browser_fill_form, browser_press_key, browser_hover, browser_drag, browser_select_option, browser_file_upload, browser_handle_dialog, browser_tabs, browser_take_screenshot, browser_wait_for, browser_close, browser_resize, browser_console_messages, browser_network_requests, browser_navigate_back

Blocked for security: browser_evaluate, browser_run_code, browser_install

Dynamic Skill Tools

As you record actions, Schrute generates new MCP tools automatically. These appear with names like schrute_skill_<site>_<action> and can be called with their discovered parameters.

MCP Resources

URIDescription
schrute://statusEngine mode, uptime, active session info
schrute://skillsSkill catalog with redacted summaries
schrute://sitesKnown sites with visit history

MCP Prompts

NameDescriptionArguments
explore-siteGuided workflow for exploring a websiteurl (required)
record-actionGuided workflow for recording a browser actionurl (required), action_name (required)

Configuration

Environment Variables

VariableDescriptionDefault
SCHRUTE_DATA_DIRData directory path~/.schrute
SCHRUTE_LOG_LEVELLog levelinfo
SCHRUTE_AUTH_TOKENAuth token for HTTP transport—
SCHRUTE_NETWORKEnable network mode (true/false)false
SCHRUTE_HTTP_TRANSPORTEnable HTTP transport (true/false)false
SCHRUTE_HTTP_PORTHTTP server port3000

Config File

Settings persist in ~/.schrute/config.json. Manage with:

schrute config set server.authToken my-secret
schrute config get server

Precedence

CLI flags > Environment variables > Config file > Defaults

Security Model

Schrute enforces 9 security gates on every skill execution:

  • Capability check — Is the tier's capability enabled?
  • Domain allowlist — Is the target domain permitted?
  • Method restriction — Is the HTTP method allowed?
  • Path risk heuristics — Does the path look destructive?
  • Rate limiting — Is the site being hammered?
  • SSRF prevention — Is the target a private IP?
  • Redirect validation — Does each redirect hop pass policy?
  • Budget tracking — Are tool call limits respected?
  • Audit logging — Is the execution properly recorded?

All newly-activated skills require one-time confirmation before first execution.

Claude Code Plugin

When used as a Claude Code plugin, additional features are available:

Commands

CommandDescription
/schrute:explore <url>Start browser exploration
/schrute:recordRecord an action
/schrute:skillsList skills
/schrute:doctorRun health diagnostics
/schrute:statusCheck engine status

Agents

  • skill-validator — Validates recorded skills for correctness
  • exploration-guide — Interactive browser exploration assistant
  • skill-debugger — Diagnoses failing skill executions

Skills

  • schrute-usage — Comprehensive usage guide
  • browser-tool-selection — Decision guide for choosing browser approach

Development

Prerequisites

  • Node.js >= 22
  • Playwright Chromium: npx playwright install chromium

Build & Test

npm run build          # Compile TypeScript
npx tsc --noEmit       # Type check only
npx vitest run         # Run tests
npm run dev            # Watch mode

Project Structure

src/
  core/        — Engine, config, policy, logging
  server/      — MCP stdio/HTTP, REST API, daemon
  browser/     — Playwright adapter, browser manager
  capture/     — HAR pipeline, auth detection, parameter discovery
  replay/      — Tier-based executor, dry run, audit log
  skill/       — Types, validator, skill lifecycle
  storage/     — SQLite database, repositories, migrations
  discovery/   — Cold-start API discovery

Before Publishing

  • Update repository URL in package.json and .claude-plugin/plugin.json
  • Verify npm pack --dry-run includes all necessary files
  • Run full test suite: npx vitest run
  • Run type check: npx tsc --noEmit

License

MIT

Keywords

mcp

FAQs

Package last updated on 16 Mar 2026

Related posts