CLI Reference
Complete command-line interface reference for webMCP. Process, validate, and optimize web content for AI consumption with powerful CLI tools. Now includes React components, WordPress plugin integration, and multi-platform deployment options.
Installation
npm install -g @webmcp/clinpm install @webmcp/reactnpx @webmcp/cli --helpwebmcp --versionAvailable Commands
Complete reference for all webMCP CLI commands
webmcp scan
Scan HTML files or URLs to generate webMCP configurations
Syntax
webmcp scan <input> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --output, -o | string | auto | Output file for webMCP configuration |
| --format, -f | string | wmcp | Output format (json or wmcp) |
| --url | string | Page URL for context metadata | |
| --verbose | boolean | false | Enable detailed output |
Examples
webmcp scan login.html --output login.wmcp --verbosewebmcp scan https://example.com/signup --format json --output signup.jsonwebmcp scan form.html --url https://mysite.com/contact --verbosewebmcp validate
Validate webMCP configuration files against schema and best practices
Syntax
webmcp validate <file> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --schema | string | 0.2 | Schema version to validate against |
| --strict | boolean | false | Enable strict validation mode |
| --json | boolean | false | Output results in JSON format |
Examples
webmcp validate page.wmcpwebmcp validate page.wmcp --schema 0.2 --strictwebmcp validate page.wmcp --json > validation-report.jsonwebmcp optimize
Optimize webMCP configurations for AI model consumption
Syntax
webmcp optimize <file> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --target, -t | string | gpt-4o | Target AI model |
| --level, -l | string | advanced | Compression level |
| --output, -o | string | Output file for optimization | |
| --goal | string | Goal description for AI prompt |
Examples
webmcp optimize page.wmcp --target gpt-4o --level advancedwebmcp optimize login.wmcp --goal "Login with username and password" --output login-prompt.txtwebmcp optimize form.wmcp --target claude-3.5-sonnet --level premium --output optimized-form.jsonwebmcp lint
Lint webMCP files for best practices and code quality
Syntax
webmcp lint <pattern> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --fix | boolean | false | Automatically fix issues where possible |
| --config | string | Custom linter configuration file |
Examples
webmcp lint page.wmcpwebmcp lint "src/**/*.wmcp" --fixwebmcp lint "*.wmcp" --config .webmcp-lint.jsonwebmcp dev-server
alias: devStart development server with webMCP processing capabilities
Syntax
webmcp dev-server [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --port, -p | number | 3000 | Server port |
| --watch | boolean | false | Watch for file changes |
| --open | boolean | false | Open browser automatically |
Examples
webmcp dev-serverwebmcp dev-server --port 8080 --openwebmcp dev-server --watchwebmcp benchmark
PremiumBenchmark webMCP performance across AI models (Premium feature)
Syntax
webmcp benchmark <file> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --models | string | gpt-4o,claude-3.5-sonnet | Models to test (comma-separated) |
| --iterations | number | 10 | Number of test iterations |
| --detailed | boolean | false | Show detailed metrics |
Examples
webmcp benchmark page.wmcpwebmcp benchmark page.wmcp --models gpt-4o,claude-3.5-sonnet,gpt-4 --iterations 100webmcp benchmark page.wmcp --detailedwebmcp react
Generate React components with webMCP optimization
Syntax
webmcp react <component-name> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --type | string | form | Component type (form, input, button) |
| --output | string | ./ | Output directory |
| --typescript | boolean | true | Generate TypeScript component |
Examples
webmcp react ContactForm --type formwebmcp react SmartInput --type input --output ./componentswebmcp react OptimizedButton --typescriptwebmcp wordpress
Generate WordPress plugin files and configurations
Syntax
webmcp wordpress <plugin-name> [options]Options
| Option | Type | Default | Description |
|---|---|---|---|
| --forms | string | cf7,gravity,wpforms | Form plugins to integrate |
| --output | string | ./wp-plugin | Plugin output directory |
| --premium | boolean | false | Include premium features |
Examples
webmcp wordpress webmcp-optimizerwebmcp wordpress my-plugin --forms cf7,wpforms --premiumwebmcp wordpress site-optimizer --output ./pluginsSupported AI Models
Compression Levels
basic
30-40%Simple element filtering (free)
advanced
50-70%Context-aware optimization (free)
premium
70-85%Model-specific tuning (premium)
Environment Variables
DEBUGfalseEnable debug logging
WEBMCP_API_KEYunsetAPI key for premium features
WEBMCP_CACHE_DIR~/.webmcp/cacheCache directory location
Global Options
--help, -hShow command help
--version, -VShow version number
Performance Characteristics
Troubleshooting
Common issues and solutions
File Not Found
ls -la page.wmcp chmod 644 page.wmcp webmcp validate ./page.wmcp
Invalid JSON
cat page.wmcp | jq . # or python -m json.tool page.wmcp
Port Already in Use
lsof -ti:3000 | xargs kill -9 # or use different port webmcp dev-server --port 8080
Permission Denied
chmod 755 /usr/local/bin/webmcp # or reinstall globally npm install -g @webmcp/cli --force