@webmcp/cli

Command Line Tools

Powerful CLI tools for scanning, validating, and optimizing HTML files for AI processing. Perfect for CI/CD pipelines, automation workflows, and development environments. Process files in ~100ms with 67.6% token reduction.

18K+
Downloads
1.9K
GitHub Stars
6
Commands
67.6%
Token Reduction

Quick Install

npm install -g @webmcp/cli

Available Commands

Six powerful commands for complete webMCP workflow automation

webmcp scan

Scan HTML files or URLs to generate webMCP configurations

webmcp scan login.html --output login.wmcp --verbose

webmcp validate

Validate webMCP configuration files against schema and best practices

webmcp validate page.wmcp --schema 0.2 --strict

webmcp optimize

Optimize webMCP configurations for AI model consumption

webmcp optimize page.wmcp --target gpt-4o --level advanced

webmcp lint

Lint webMCP files for best practices and code quality

webmcp lint "src/**/*.wmcp" --fix

webmcp dev-server

Start development server with webMCP processing capabilities

webmcp dev-server --port 3000 --open

webmcp benchmark

Benchmark webMCP performance across AI models (Premium)

webmcp benchmark page.wmcp --models gpt-4o,claude-3.5-sonnet

CLI Features

Enterprise-grade command line tools for professional workflows

Complete HTML Processing

Scan and process HTML files, URLs, or entire directories with intelligent element detection

Schema Validation

Comprehensive validation against webMCP schema with detailed error reporting

AI Model Optimization

Optimize for 8+ AI models including GPT-4o, Claude 3.5 Sonnet, and Gemini Pro

CI/CD Integration

Perfect for automation workflows, GitHub Actions, and continuous integration

Usage Examples

Real-world examples for common development scenarios

Basic HTML Scanning

# Scan a single HTML file
webmcp scan login.html --output login.wmcp --verbose

# Scan from URL
webmcp scan https://example.com/signup --format json --output signup.json

# Scan multiple files
webmcp scan "src/**/*.html" --output-dir ./webmcp-configs

Advanced Optimization

# Optimize for specific AI model with goal
webmcp optimize login.wmcp \
  --target gpt-4o \
  --goal "Login with username and password" \
  --level premium \
  --output optimized-prompt.txt

# Batch optimization with custom rules
webmcp optimize "configs/*.wmcp" \
  --target claude-3.5-sonnet \
  --level advanced \
  --output-dir ./optimized

CI/CD Pipeline Integration

# GitHub Actions workflow
name: webMCP Validation
on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
      
      - name: Install webMCP CLI
        run: npm install -g @webmcp/cli
      
      - name: Scan HTML files
        run: webmcp scan "src/**/*.html" --output-dir ./webmcp-configs
      
      - name: Validate configurations
        run: webmcp validate "webmcp-configs/*.wmcp" --strict
      
      - name: Optimize for production
        run: webmcp optimize "webmcp-configs/*.wmcp" --target gpt-4o --level advanced

Development Server

# Start development server with hot reload
webmcp dev-server --port 3000 --watch --open

# Custom configuration
webmcp dev-server \
  --port 8080 \
  --config ./webmcp.config.js \
  --cors \
  --verbose

# API endpoints available:
# GET  /api/scan     - Scan HTML content
# POST /api/validate - Validate webMCP config
# POST /api/optimize - Optimize for AI model

Performance Characteristics

Optimized for speed and efficiency in production environments

HTML Scanning

~100ms for 1,000 elements

Validation

~10ms average

Optimization

~50ms average

Linting

~25ms average

Automate Your Workflow

Install webMCP CLI tools and integrate AI optimization into your development pipeline