CLI Commands Reference¶
Complete reference for all MCP Standards Server CLI commands.
Global Options¶
All commands support these global options:
--help
- Show help message--version
- Show version 1.0.0--verbose
,-v
- Enable verbose output--quiet
,-q
- Suppress output--config CONFIG
- Use specific configuration file
Commands Overview¶
Core Commands¶
serve
- Start the MCP servervalidate
- Validate code against standardsquery
- Query standards databasesync
- Synchronize standards from repository
Configuration Commands¶
Command Details¶
serve¶
Start the MCP Standards Server.
Options:
- --host HOST
- Server host (default: 0.0.0.0)
- --port PORT
- Server port (default: 8080)
- --reload
- Enable auto-reload on code changes
- --workers N
- Number of worker processes
Examples:
# Start server on default port
mcp-standards serve
# Start on specific port
mcp-standards serve --port 8081
# Development mode with auto-reload
mcp-standards serve --reload
validate¶
Validate code against development standards.
Arguments:
- PATH
- Path to validate (default: current directory)
Options:
- --standard STANDARD
- Use specific standard
- --language LANG
- Target language
- --framework FRAMEWORK
- Target framework
- --fix
- Auto-fix issues where possible
- --format FORMAT
- Output format (json, junit, sarif, text)
- --severity LEVEL
- Minimum severity (error, warning, info)
- --output FILE
- Output file
Examples:
# Validate current directory
mcp-standards validate
# Validate specific path with auto-fix
mcp-standards validate ./src --fix
# Validate Python code with specific standard
mcp-standards validate --language python --standard pep8
# Output SARIF format for CI integration
mcp-standards validate --format sarif --output results.sarif
query¶
Query the standards database.
Subcommands:
- applicable
- Find applicable standards
- search
- Search standards content
- list
- List all standards
- show
- Show specific standard
Options:
- --project-type TYPE
- Project type filter
- --language LANG
- Language filter
- --framework FRAMEWORK
- Framework filter
- --tags TAGS
- Tag filters
- --format FORMAT
- Output format
Examples:
# Find applicable standards for web app
mcp-standards query applicable --project-type web_application
# Search for accessibility standards
mcp-standards query search "accessibility"
# Show specific standard
mcp-standards query show react-patterns
# List all Python standards
mcp-standards query list --language python
sync¶
Synchronize standards from remote repository.
Options:
- --force
- Force full resync
- --url URL
- Custom repository URL
- --branch BRANCH
- Specific branch
- --no-cache
- Skip cache update
Examples:
# Standard sync
mcp-standards sync
# Force full resync
mcp-standards sync --force
# Sync from custom repository
mcp-standards sync --url https://github.com/custom/standards
config¶
Manage configuration settings.
Subcommands:
- init
- Initialize default configuration
- show
- Show current configuration
- set
- Set configuration value
- get
- Get configuration value
- validate
- Validate configuration
- test
- Test configuration
Examples:
# Initialize configuration
mcp-standards config init
# Show current config
mcp-standards config show
# Set configuration value
mcp-standards config set server.port 8081
# Validate configuration
mcp-standards config validate
status¶
Show system status and health.
Options:
- --detailed
- Show detailed status
- --json
- JSON output format
Examples:
# Basic status
mcp-standards status
# Detailed status
mcp-standards status --detailed
# JSON output for scripts
mcp-standards status --json
cache¶
Manage cache operations.
Subcommands:
- clear
- Clear cache
- status
- Show cache status
- warm
- Warm cache
- stats
- Show cache statistics
Examples:
# Clear all cache
mcp-standards cache clear
# Show cache status
mcp-standards cache status
# Warm cache with common standards
mcp-standards cache warm
Exit Codes¶
0
- Success1
- General error2
- Invalid arguments3
- Configuration error4
- Network error5
- Validation failures found
Environment Variables¶
MCP_CONFIG_FILE
- Configuration file pathMCP_CACHE_DIR
- Cache directoryMCP_LOG_LEVEL
- Logging levelMCP_NO_COLOR
- Disable colored output
Shell Completion¶
Enable shell completion:
# Bash
eval "$(mcp-standards completion bash)"
# Zsh
eval "$(mcp-standards completion zsh)"
# Fish
mcp-standards completion fish | source
Tips and Tricks¶
Batch Validation¶
# Validate multiple directories
find . -name "*.py" -exec dirname {} \; | sort -u | xargs -I {} mcp-standards validate {}
CI Integration¶
# GitHub Actions example
mcp-standards validate --format sarif --output results.sarif
gh api repos/:owner/:repo/code-scanning/sarifs --method POST --input results.sarif