Complete reference for the MCpeg command-line interface.
MCpeg provides a unified binary with multiple subcommands for different operations:
mcpeg [global-options] <command> [command-options] [arguments]--help, -h Show help information
--version, -v Show version information
--config PATH Configuration file path (default: config/development.yaml)
--log-level LEVEL Log level: debug, info, warn, error (default: info)
--quiet, -q Suppress output except errors
--verbose Enable verbose output--config-override KEY=VALUE Override configuration valuesExamples:
mcpeg gateway --config-override server.address=0.0.0.0:9000
mcpeg gateway --config-override plugins.memory.enabled=falseStart the MCpeg gateway server.
mcpeg gateway [options]--dev Enable development mode
--daemon Run as daemon process
--address HOST:PORT Server address (default: 0.0.0.0:8080)
--tls Enable TLS
--cert-path PATH TLS certificate path
--key-path PATH TLS private key path
--pid-file PATH PID file path
--log-file PATH Log file path
--dry-run Validate configuration without starting
--list-plugins List available plugins and exit
--enable-plugin NAME Enable specific plugin
--disable-plugin NAME Disable specific plugin
--test-plugin NAME Test specific plugin and exit
--metrics Enable metrics endpoint
--health Enable health check endpoint
--debug Enable debug endpoints# Start in development mode
mcpeg gateway --dev
# Start with custom configuration
mcpeg gateway --config config/production.yaml
# Start with TLS enabled
mcpeg gateway --tls --cert-path cert.pem --key-path key.pem
# Start as daemon
mcpeg gateway --daemon --pid-file /var/run/mcpeg.pid
# Start with plugin management
mcpeg gateway --disable-plugin git --enable-plugin memory
# Test configuration without starting
mcpeg gateway --config config/production.yaml --dry-run
# List available plugins
mcpeg gateway --list-pluginsValidate configuration files and settings.
mcpeg validate [options]--config PATH Configuration file to validate
--schema PATH JSON schema file for validation
--strict Enable strict validation mode
--format FORMAT Output format: text, json, yaml (default: text)
--check-plugins Validate plugin configurations
--check-permissions Check file permissions
--check-network Check network connectivity
--check-dependencies Check external dependencies# Validate default configuration
mcpeg validate
# Validate specific configuration
mcpeg validate --config config/production.yaml
# Strict validation with plugin checks
mcpeg validate --strict --check-plugins
# Validate with JSON output
mcpeg validate --format json
# Comprehensive validation
mcpeg validate --check-plugins --check-permissions --check-networkGenerate code from OpenAPI specifications.
mcpeg codegen [options]--spec PATH OpenAPI specification file
--output DIR Output directory (default: generated/)
--language LANG Target language: go, python, javascript, typescript
--package NAME Package name for generated code
--template DIR Custom template directory
--client Generate client code
--server Generate server code
--models Generate model code only
--overwrite Overwrite existing files
--dry-run Show what would be generated# Generate Go client code
mcpeg codegen --spec api/openapi/mcp-gateway.yaml --language go --client
# Generate Python server code
mcpeg codegen --spec api/openapi/mcp-gateway.yaml --language python --server
# Generate models only
mcpeg codegen --spec api/openapi/mcp-gateway.yaml --models --language typescript
# Show what would be generated
mcpeg codegen --spec api/openapi/mcp-gateway.yaml --dry-runManage MCpeg plugins.
mcpeg plugin <subcommand> [options]mcpeg plugin list [options]Options:
--format FORMAT Output format: text, json, yaml (default: text)
--enabled Show only enabled plugins
--disabled Show only disabled plugins
--detailed Show detailed plugin informationmcpeg plugin install <plugin-name> [options]Options:
--source URL Plugin source URL or path
--version VERSION Specific version to install
--force Force installation
--dry-run Show what would be installedmcpeg plugin remove <plugin-name> [options]Options:
--force Force removal
--keep-config Keep plugin configurationmcpeg plugin enable <plugin-name>mcpeg plugin disable <plugin-name>mcpeg plugin info <plugin-name> [options]Options:
--format FORMAT Output format: text, json, yaml (default: text)# List all plugins
mcpeg plugin list
# List enabled plugins in JSON format
mcpeg plugin list --enabled --format json
# Show detailed plugin information
mcpeg plugin info memory --format json
# Install plugin from URL
mcpeg plugin install custom-plugin --source https://example.com/plugin.tar.gz
# Enable/disable plugins
mcpeg plugin enable memory
mcpeg plugin disable gitConfiguration management utilities.
mcpeg config <subcommand> [options]mcpeg config show [options]Options:
--config PATH Configuration file path
--format FORMAT Output format: yaml, json, text (default: yaml)
--key KEY Show specific configuration key
--effective Show effective configuration (after overrides)mcpeg config set <key> <value> [options]Options:
--config PATH Configuration file path
--create Create configuration file if not existsmcpeg config get <key> [options]Options:
--config PATH Configuration file path
--format FORMAT Output format: text, json, yaml (default: text)mcpeg config merge <source-config> [options]Options:
--config PATH Target configuration file
--output PATH Output file (default: update in place)
--strategy STRATEGY Merge strategy: merge, replace, append (default: merge)# Show current configuration
mcpeg config show
# Show effective configuration
mcpeg config show --effective
# Show specific key
mcpeg config get server.address
# Set configuration value
mcpeg config set server.address 0.0.0.0:9000
# Merge configurations
mcpeg config merge config/custom.yaml --config config/production.yamlHealth check utilities.
mcpeg health [options]--endpoint URL Health check endpoint (default: http://localhost:8080/health)
--timeout DURATION Request timeout (default: 5s)
--format FORMAT Output format: text, json, yaml (default: text)
--detailed Show detailed health information
--watch Watch health status continuously
--interval DURATION Watch interval (default: 30s)
--quiet Only show health status# Check health status
mcpeg health
# Check health with detailed output
mcpeg health --detailed --format json
# Watch health status
mcpeg health --watch --interval 10s
# Check remote server health
mcpeg health --endpoint http://remote-server:8080/healthShow version information.
mcpeg version [options]--format FORMAT Output format: text, json, yaml (default: text)
--short Show short version only
--build-info Show build information
--dependencies Show dependency versions# Show version
mcpeg version
# Show detailed version information
mcpeg version --build-info --dependencies
# Show version in JSON format
mcpeg version --format jsonGenerate shell completion scripts.
mcpeg completion <shell>bashzshfishpowershell
# Generate bash completion
mcpeg completion bash > /etc/bash_completion.d/mcpeg
# Generate zsh completion
mcpeg completion zsh > ~/.zsh/completions/_mcpeg
# Generate fish completion
mcpeg completion fish > ~/.config/fish/completions/mcpeg.fishMCpeg respects these environment variables:
MCPEG_CONFIG_FILE Configuration file path
MCPEG_LOG_LEVEL Log level (debug, info, warn, error)
MCPEG_DEVELOPMENT_MODE Enable development mode (true/false)MCPEG_SERVER_ADDRESS Server address (default: 0.0.0.0:8080)
MCPEG_SERVER_TLS_ENABLED Enable TLS (true/false)
MCPEG_SERVER_TLS_CERT_PATH TLS certificate path
MCPEG_SERVER_TLS_KEY_PATH TLS private key pathMCPEG_PLUGINS_MEMORY_ENABLED Enable memory plugin (true/false)
MCPEG_PLUGINS_MEMORY_DATA_FILE Memory plugin data file path
MCPEG_PLUGINS_GIT_ENABLED Enable git plugin (true/false)
MCPEG_PLUGINS_GIT_WORKING_DIR Git plugin working directory
MCPEG_PLUGINS_EDITOR_ENABLED Enable editor plugin (true/false)
MCPEG_PLUGINS_EDITOR_MAX_FILE_SIZE Editor plugin max file sizeMCPEG_AUTH_JWT_ENABLED Enable JWT authentication (true/false)
MCPEG_AUTH_JWT_SECRET_KEY JWT secret key
MCPEG_AUTH_JWT_ISSUER JWT issuer
MCPEG_AUTH_JWT_EXPIRATION JWT expiration durationMCpeg uses standard exit codes:
0- Success1- General error2- Configuration error3- Plugin error4- Network error5- Authentication error6- Permission error7- Validation error8- Resource error (disk space, memory, etc.)9- Service unavailable
MCpeg searches for configuration files in this order:
--configflag valueMCPEG_CONFIG_FILEenvironment variable./config/development.yaml(current directory)~/.mcpeg/config.yaml(user home directory)/etc/mcpeg/config.yaml(system-wide)
debug- Detailed debugging informationinfo- General information messageswarn- Warning messageserror- Error messages only
text- Human-readable text formatjson- Structured JSON format (default)
stdout- Standard output (default)stderr- Standard errorfile- Log file path
# Start development server
mcpeg gateway --dev
# Validate configuration
mcpeg validate --config config/development.yaml
# Test plugin
mcpeg plugin info memory
# Check health
mcpeg health --detailed# Validate production configuration
mcpeg validate --config config/production.yaml --strict
# Start production server
mcpeg gateway --config config/production.yaml --daemon
# Monitor health
mcpeg health --watch --interval 30s
# Check logs
tail -f /var/log/mcpeg/gateway.log# List all plugins
mcpeg plugin list --detailed
# Enable specific plugins
mcpeg plugin enable memory
mcpeg plugin enable git
# Test plugin configuration
mcpeg plugin info editor --format json# Show current configuration
mcpeg config show --effective
# Update configuration
mcpeg config set server.address 0.0.0.0:9000
mcpeg config set plugins.memory.enabled true
# Merge configurations
mcpeg config merge config/custom.yaml-
Command not found:
export PATH=$PATH:/usr/local/bin which mcpeg
-
Configuration errors:
mcpeg validate --config config/production.yaml
-
Permission errors:
sudo chown -R mcpeg:mcpeg /var/lib/mcpeg chmod 755 /var/lib/mcpeg
-
Plugin issues:
mcpeg plugin list --detailed mcpeg plugin info problematic-plugin
Enable debug mode for detailed output:
mcpeg gateway --dev --log-level debugTest configuration without starting:
mcpeg gateway --config config/production.yaml --dry-run# Install completion
mcpeg completion bash > /etc/bash_completion.d/mcpeg
source /etc/bash_completion.d/mcpeg
# Or for current session
eval "$(mcpeg completion bash)"# Install completion
mcpeg completion zsh > ~/.zsh/completions/_mcpeg
# Add to ~/.zshrc
fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinit# Install completion
mcpeg completion fish > ~/.config/fish/completions/mcpeg.fish#!/bin/bash
set -e
# Start MCpeg with error handling
if ! mcpeg gateway --config config/production.yaml --daemon; then
echo "Failed to start MCpeg gateway"
exit 1
fi
# Wait for health check
while ! mcpeg health --quiet; do
echo "Waiting for MCpeg to be healthy..."
sleep 5
done
echo "MCpeg is now running and healthy"#!/bin/bash
# Monitor MCpeg health
while true; do
if ! mcpeg health --quiet; then
echo "MCpeg health check failed"
# Restart or alert
fi
sleep 30
done#!/bin/bash
# Validate all configuration files
for config in config/*.yaml; do
if mcpeg validate --config "$config"; then
echo "✓ $config is valid"
else
echo "✗ $config is invalid"
exit 1
fi
done- Use configuration files instead of command-line flags for production
- Validate configurations before deployment
- Use environment variables for sensitive information
- Enable logging with appropriate levels
- Monitor health continuously in production
- Use shell completion for improved CLI experience
- Test plugins before enabling in production
- Use daemon mode for production deployments
- Installation: Installation Guide
- Configuration: Configuration Guide
- API Usage: API Reference
- Plugin Development: Plugin Development Guide
- Troubleshooting: Troubleshooting Guide