### Complete Ramparts Configuration File Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md A comprehensive example of the ramparts.yaml file, showing all available configuration options with their default values. This file controls LLM, scanner, security, logging, and performance settings. ```yaml # Ramparts Configuration File # All values shown are defaults # LLM Configuration for AI-powered security analysis llm: provider: "${LLM_PROVIDER:-openai}" # LLM provider: "openai" model: "${LLM_MODEL:-gpt-4o}" # Model name base_url: "${LLM_URL:-https://api.openai.com/v1/chat/completions}" # Complete API endpoint URL api_key: "${LLM_API_KEY:-}" # API key (use environment variable LLM_API_KEY) timeout: 30 # Request timeout in seconds max_tokens: 4000 # Maximum tokens in response temperature: 0.1 # Temperature for randomness (0.0-1.0) # Scanner Configuration scanner: http_timeout: 30 # HTTP request timeout in seconds scan_timeout: 60 # Total scan timeout in seconds detailed: false # Enable detailed analysis by default format: "table" # Default output format: "table", "json", "text", "raw" parallel: true # Enable parallel processing max_retries: 3 # Maximum retry attempts retry_delay_ms: 1000 # Delay between retries in milliseconds llm_batch_size: 10 # Number of tools to analyze in one LLM request enable_yara: true # Enable/disable YARA-X scanning # Security Analysis Configuration security: enabled: true # Enable security analysis min_severity: "low" # Minimum severity to report: "low", "medium", "high", "critical" # Security check categories checks: tool_poisoning: true # Detect malicious or destructive tools secrets_leakage: true # Detect secret/credential exposure sql_injection: true # Detect SQL injection vulnerabilities command_injection: true # Detect command injection vulnerabilities path_traversal: true # Detect path traversal vulnerabilities auth_bypass: true # Detect authentication bypass issues cross_origin_escalation: true # Detect cross-origin escalation attacks prompt_injection: true # Detect prompt injection vulnerabilities pii_leakage: true # Detect PII leakage jailbreak: true # Detect jailbreak attempts # Logging Configuration logging: level: "info" # Log level: "error", "warn", "info", "debug", "trace" colored: true # Enable colored output timestamps: true # Include timestamps in logs # Performance Monitoring performance: tracking: true # Enable performance tracking slow_threshold_ms: 5000 # Threshold for slow operation warnings ``` -------------------------------- ### Start Ramparts Server Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Start the Ramparts server on the default port or a custom port and host. ```bash # Start server on default port 3000 ramparts server ``` ```bash # Start server on custom port and host ramparts server --port 8080 --host 0.0.0.0 ``` -------------------------------- ### Start STDIO Server and Scan via HTTP API Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Demonstrates how to start the scanner server and then use curl to send a scan request to the HTTP API for a STDIO target. Ensure the server is running before executing the curl command. ```bash # Start the scanner server cargo run -- server --port 3001 # Scan STDIO server via HTTP API curl -X POST http://localhost:3001/v1/ramparts/scan \ -H "Content-Type: application/json" \ -d '{ "url": "stdio:///usr/local/bin/mcp-server", "timeout": 60, "detailed": true, "format": "json" }' ``` -------------------------------- ### Check Rust Installation Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Verify that Rust and Cargo are installed and accessible in your environment. ```bash rustc --version ``` ```bash cargo --version ``` -------------------------------- ### Batch STDIO Scanning CLI Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Demonstrates batch scanning of multiple STDIO servers using a configuration file. ```bash # Scan multiple STDIO servers cargo run -- scan-config \ --auth-headers "Authorization: Bearer token123" ``` -------------------------------- ### Install Ramparts to user directory for permission issues Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If you encounter 'Permission denied' errors when installing to system directories, install to your user directory and update your PATH. ```bash cargo install ramparts --root "$HOME/.local" export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Verify Node.js installation Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If using Node.js for STDIO servers, check that Node.js is installed and accessible in your PATH. ```bash node --version ``` -------------------------------- ### Server Command Usage Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Displays the basic usage for starting the Ramparts server microservice. ```bash ramparts server [OPTIONS] ``` -------------------------------- ### CI Integration Example for SARIF Upload Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Example GitHub Actions workflow step to run Ramparts in SARIF format and upload the results using `github/codeql-action/upload-sarif`. ```yaml - name: Run ramparts run: ramparts scan-config --format sarif > ramparts.sarif - name: Upload SARIF uses: github/codeql-action/upload-sarif@v3 with: sarif_file: ramparts.sarif ``` -------------------------------- ### Start Ramparts Server with Custom Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Initiates the Ramparts server using a custom configuration file located at a specified path. ```bash ramparts server --config /path/to/custom-config.yaml ``` -------------------------------- ### STDIO Scan with Options CLI Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Shows how to perform STDIO scans with additional options like timeout, detailed output, and authentication headers. ```bash # Scan with timeout and detailed output cargo run -- scan stdio:///usr/local/bin/mcp-server \ --timeout 60 \ --detailed \ --format json # Scan with authentication (if supported by the server) cargo run -- scan stdio:///usr/local/bin/mcp-server \ --auth-headers "Authorization: Bearer token123" ``` -------------------------------- ### Verify Python installation Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If using Python for STDIO servers, check that Python 3 is installed and accessible in your PATH. ```bash python3 --version ``` -------------------------------- ### Start HTTP Server Source: https://github.com/highflame-ai/ramparts/blob/main/AGENT.md Launches the Ramparts HTTP API server on a specified port. Defaults to host 0.0.0.0. ```bash ramparts server --port 3000 ``` -------------------------------- ### Basic Ramparts CLI Commands Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Commonly used commands for scanning, starting the server, and managing configurations. ```bash # Scan an MCP server ramparts scan [options] # Start Ramparts server mode ramparts server [options] # Scan from IDE configuration files ramparts scan-config [options] # Scan AI agent skills (Claude Code commands, etc.) ramparts skills scan [options] ramparts skills scan-config [options] # Re-emit a previously-saved scan result in another format ramparts replay [--format ] # Initialize configuration file ramparts init-config # Run Ramparts itself as an MCP server ramparts mcp-stdio ramparts mcp-http [--host HOST] [--port PORT] ramparts mcp-sse [--host HOST] [--port PORT] # alias of mcp-http (rmcp 1.x folds SSE into streamable HTTP) # Show help ramparts --help ramparts scan --help ramparts skills --help ``` -------------------------------- ### Start Ramparts Server with Custom Port and Host Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Starts the Ramparts server on a specified custom port (e.g., 8080) and host (e.g., 127.0.0.1). ```bash ramparts server --port 8080 --host 127.0.0.1 ``` -------------------------------- ### Replay Archived Multi-Server Scan Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Shows how to view an archived multi-server scan-config result locally using the replay command. ```bash # View an archived multi-server scan-config result locally ramparts scan-config --format json > all-servers.json ramparts replay all-servers.json ``` -------------------------------- ### Basic STDIO Scan CLI Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Demonstrates basic command-line scanning of a local MCP server using STDIO transport, including direct commands. ```bash # Scan a local MCP server cargo run -- scan stdio:///usr/local/bin/mcp-server # Scan with command arguments cargo run -- scan "stdio://node /path/to/server.js --debug" # Direct command (without stdio:// prefix) cargo run -- scan "/usr/local/bin/mcp-server" ``` -------------------------------- ### Replay Scan to SARIF Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Demonstrates capturing a scan result in JSON format and then replaying it to convert to SARIF format. ```bash # Capture once in CI, convert to SARIF later ramparts scan https://api.example.com/mcp/ --format json > scan.json ramparts replay scan.json --format sarif > scan.sarif ``` -------------------------------- ### Configuration File for Batch STDIO Scanning Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md A JSON configuration file example specifying multiple STDIO servers for batch scanning. ```json { "servers": [ { "name": "local-server-1", "url": "stdio:///usr/local/bin/mcp-server-1", "description": "Local development server 1" }, { "name": "local-server-2", "url": "stdio://node /path/to/server.js", "description": "Node.js MCP server" } ] } ``` -------------------------------- ### Install Ramparts using Cargo Source: https://github.com/highflame-ai/ramparts/blob/main/README.md Install the Ramparts CLI tool using the Cargo package manager. This is the primary method for getting Ramparts onto your system. ```bash cargo install ramparts ``` -------------------------------- ### Start Default Ramparts Server Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Launches the Ramparts server with default settings (port 3000, host 0.0.0.0). ```bash ramparts server ``` -------------------------------- ### Command with Arguments URL Formats Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Examples of specifying local MCP server commands with arguments using the STDIO protocol. ```plaintext stdio://mcp-server --port 3000 --debug stdio://node server.js --env production stdio://python3 -m mcp_server --config config.yaml ``` -------------------------------- ### Refresh Tools with Javelin Integration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md This example shows how to refresh tools using cURL, including a Javelin API key for authentication. ```bash curl -X POST http://localhost:3000/v1/ramparts/refresh-tools \ -H "Content-Type: application/json" \ -H "X-Javelin-Apikey: your-javelin-key" \ -d '{ "urls": ["https://api.githubcopilot.com/mcp/"], "timeout": 60 }' ``` -------------------------------- ### JSON Output Piped to jq Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Example of scanning skills with JSON output and piping it to 'jq' for further processing. ```bash ramparts skills scan ./.claude/commands --json | jq '.yara_results' ``` -------------------------------- ### Ramparts STDIO JSON-RPC Method Not Found Error Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Displays an example of a JSON-RPC error indicating that the requested method is not supported by the MCP server. Ensure the server implements the necessary methods. ```json Error: JSON-RPC error: {"code": -32601, "message": "Method not found"} ``` -------------------------------- ### API Documentation Response Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Example JSON response for the API documentation endpoint, listing available endpoints, transports, and examples. ```json { "service": "Ramparts Microservice", "version": "0.2.0", "protocol_version": "2025-06-18", "endpoints": { "GET /v1/ramparts/health": "Health check with protocol info", "GET /v1/ramparts/protocol": "MCP protocol information", "POST /v1/ramparts/scan": "Scan a single MCP server", "POST /v1/ramparts/validate": "Validate scan configuration", "POST /v1/ramparts/batch-scan": "Scan multiple MCP servers", "POST /v1/ramparts/refresh-tools": "Refresh tool descriptions from MCP servers", "GET /v1/ramparts/": "API documentation" }, "transports": { "http": { "supported": true, "description": "HTTP/HTTPS transport with intelligent fallback (simple HTTP, rmcp streamable, SSE)", "features": ["session_management", "authentication_headers", "automatic_fallback"], "examples": [ "http://localhost:3000", "https://api.githubcopilot.com/mcp" ] }, "stdio": { "supported": true, "description": "STDIO transport for local MCP server processes using rmcp subprocess implementation", "features": ["process_management", "argument_parsing", "concurrent_execution"], "examples": [ "stdio:npx:mcp-server-commands", "stdio:python3:/path/to/server.py", "stdio:///usr/local/bin/mcp-server" ] } } } ``` -------------------------------- ### Batch Scan with Javelin Integration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md This example demonstrates how to initiate a batch scan using `curl`, including the `X-Javelin-Apikey` header for Javelin MCP server authentication. ```bash curl -X POST http://localhost:3000/v1/ramparts/batch-scan \ -H "Content-Type: application/json" \ -H "X-Javelin-Apikey: your-javelin-key" \ -d '{ "urls": ["https://api.githubcopilot.com/mcp/"], "options": {"detailed": true} }' ``` -------------------------------- ### Direct Command URL Formats Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Examples of using direct command paths without the 'stdio://' prefix for local MCP server processes. ```plaintext /usr/local/bin/mcp-server node /path/to/mcp-server.js python3 /path/to/mcp-server.py mcp-server --config config.json ``` -------------------------------- ### Scan All Skill Files in a Directory Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Example of recursively scanning all markdown skill files within a directory. ```bash ramparts skills scan ./.claude/commands ``` -------------------------------- ### Install Ramparts without YARA-X support Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Use this option if YARA-X compilation fails during installation. Refer to the README for more details on YARA-X. ```bash cargo install ramparts --no-default-features ``` -------------------------------- ### Initialize Ramparts Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Creates a default ramparts.yaml configuration file in the current directory. This is useful for starting with a complete set of options. ```bash ramparts init-config ``` -------------------------------- ### Start Ramparts Server on Custom Host and Port Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Starts the Ramparts REST API server, specifying a custom port (e.g., 8080) and host address (e.g., 0.0.0.0) to listen on. ```bash ramparts server --port 8080 --host 0.0.0.0 ``` -------------------------------- ### Basic Ramparts Scan Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Performs a basic scan of an MCP server URL. ```bash ramparts scan https://api.githubcopilot.com/mcp/ ``` -------------------------------- ### Set Azure OpenAI Environment Variables Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Example environment variables for configuring Azure OpenAI, including provider, model, URL with api-version, and API key. ```bash export LLM_PROVIDER="openai" export LLM_MODEL="gpt-4" export LLM_URL="https://your-resource.openai.azure.com/openai/deployments/your-deployment/chat/completions?api-version=2024-02-15-preview" export LLM_API_KEY="your-azure-api-key" ``` -------------------------------- ### Legacy Environment Variable Override Examples Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Override configuration values using the `RAMPARTS_SECTION_KEY` format. Examples include LLM model, HTTP timeout, log level, and YARA scanning. ```bash # Override LLM model export RAMPARTS_LLM_MODEL="gpt-3.5-turbo" # Override timeout export RAMPARTS_SCANNER_HTTP_TIMEOUT="60" # Override log level export RAMPARTS_LOGGING_LEVEL="debug" # Disable YARA scanning export RAMPARTS_SCANNER_ENABLE_YARA="false" ``` -------------------------------- ### Scan a Single Skill File Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Example of scanning a specific skill file using the 'ramparts skills scan' command. ```bash ramparts skills scan ./.claude/commands/deploy.md ``` -------------------------------- ### Ramparts STDIO Command Not Found Error Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Illustrates a common error message when the specified STDIO command is not found or not executable. Verify the executable path and its permissions. ```text Error: STDIO command may not exist or be executable: /usr/local/bin/mcp-server ``` -------------------------------- ### Install ca-certificates for older Ramparts releases Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md For Ramparts versions prior to 0.7.0, if you encounter 'Failed to create HTTP client' errors, ensure the 'ca-certificates' package is installed and updated. ```bash sudo apt-get update && sudo apt-get install -y ca-certificates sudo update-ca-certificates ``` -------------------------------- ### Set LLM Environment Variables Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Example of setting environment variables to configure LLM settings for a specific provider like Anthropic. Ensure API keys are kept secure. ```bash export LLM_PROVIDER="anthropic" export LLM_MODEL="claude-3-sonnet-20240229" export LLM_URL="https://api.anthropic.com/v1/messages" export LLM_API_KEY="your-anthropic-api-key" ramparts scan https://example.com ``` -------------------------------- ### Test STDIO server command manually Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If the STDIO server fails to start, test the server command directly in your terminal to check for execution errors or permission issues. ```bash /usr/local/bin/mcp-server --help ``` -------------------------------- ### Explicit STDIO Protocol URL Formats Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Examples of explicit STDIO protocol URL formats for specifying local MCP server executables or scripts. ```plaintext stdio:///usr/local/bin/mcp-server stdio://node /path/to/mcp-server.js stdio://python3 /path/to/mcp-server.py ``` -------------------------------- ### Run Ramparts in Server Mode with Queuing Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Start Ramparts in server mode to handle requests with a queue, which can help manage rate limiting. ```bash # Use server mode with queuing ramparts server --port 3000 & # Send requests individually with delays ``` -------------------------------- ### Claude Desktop MCP Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Configuration for Claude Desktop using the claude_desktop_config.json format. Includes servers with environment variables and a disabled server example. ```json { "mcpServers": { "brave-search": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-brave-search"], "env": { "BRAVE_API_KEY": "your-api-key" } }, "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop"], "type": "stdio" }, "disabled-server": { "command": "npx", "args": ["-y", "@disabled/server"], "disabled": true } }, "globalShortcut": "Cmd+Shift+M" } ``` -------------------------------- ### Custom YARA Rule Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Define custom YARA rules with metadata in `.yar` files. Rules can be placed in `rules/pre/` or `rules/post/` directories. ```yara rule CustomSecurityRule { meta: name = "Custom Security Check" author = "Your Name" date = "2024-01-01" version = "1.0" description = "Custom security rule description" severity = "HIGH" category = "custom" confidence = "HIGH" tags = "security,custom" strings: $pattern1 = /dangerous_pattern/ $pattern2 = "risky_string" condition: any of them } ``` -------------------------------- ### Check Port Usage Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Use these commands to identify which process is using a specific port, often helpful when a server fails to start due to an address conflict. ```bash lsof -i :3000 ``` ```bash netstat -tulpn | grep 3000 ``` -------------------------------- ### Protocol Information Response Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Example JSON response detailing the MCP protocol version, name, transport capabilities, and supported features. ```json { "protocol": { "version": "2025-06-18", "name": "Model Context Protocol", "transport": { "stdio": "supported", "http": "supported", "features": [ "JSON-RPC 2.0", "Stateful Session Management", "Protocol Version Headers", "STDIO Process Communication", "Intelligent Transport Fallback", "rmcp Library Integration", "Multi-Transport Support" ] }, "capabilities": [ "tools/list", "resources/list", "prompts/list", "server/info" ] }, "server": { "version": "0.2.0", "stdio_support": true, "mcp_compliance": "2025-06-18" } } ``` -------------------------------- ### Common Error Response: Unsupported Protocol Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md This JSON structure represents a 400 Bad Request error when a URL does not start with http:// or https://. ```json { "success": false, "error": "HTTP URL must start with http:// or https://", "timestamp": "2024-01-01T12:00:00.000Z" } ``` -------------------------------- ### Run MCP Server Modes Source: https://github.com/highflame-ai/ramparts/blob/main/AGENT.md Starts the Ramparts agent in different MCP server modes: stdio, SSE, or streamable HTTP. Specify ports as needed. ```bash ramparts mcp-stdio ramparts mcp-sse --port 8000 ramparts mcp-http --port 8081 ``` -------------------------------- ### High-Security Environment Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Configure for a high-security environment with detailed scanning, YARA enabled, and specific security checks enabled starting from medium severity. ```yaml llm: provider: "openai" model: "gpt-4o" temperature: 0.0 # Most consistent results scanner: detailed: true enable_yara: true security: enabled: true min_severity: "medium" # Only report medium+ issues checks: tool_poisoning: true secrets_leakage: true sql_injection: true command_injection: true path_traversal: true auth_bypass: true cross_origin_escalation: true prompt_injection: true pii_leakage: true jailbreak: true logging: level: "info" ``` -------------------------------- ### Initialize Configuration with Force Option Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Overwrites an existing `ramparts.yaml` configuration file with default settings. ```bash ramparts init-config --force ``` -------------------------------- ### Ramparts STDIO Process Timeout Error Example Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Shows the error message for a STDIO process timeout. This typically requires increasing the timeout value or checking the responsiveness of the target server. ```text Error: STDIO read timeout ``` -------------------------------- ### Clear Cargo cache and retry installation Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md A corrupted Cargo cache can cause compilation issues. Cleaning it and retrying the installation may help. ```bash cargo clean ``` -------------------------------- ### Create Server List for Batch Scan Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Creates a text file named 'servers.txt' containing a list of URLs, one per line, intended for batch scanning. ```bash echo "https://server1.com/mcp/\nhttps://server2.com/mcp/\nhttps://server3.com/mcp/" > servers.txt ``` -------------------------------- ### Install Ramparts Without YARA-X Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Install Ramparts without YARA-X support if YARA functionality is not required or is causing issues. This can be useful for reducing dependencies or troubleshooting build problems. ```bash cargo install ramparts --no-default-features --force ``` -------------------------------- ### Logging Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Configure log level, color output, and timestamps. Recommended log level is 'info'. ```yaml logging: level: "info" colored: true timestamps: true ``` -------------------------------- ### Use full path for STDIO server executable Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If the STDIO server is not in your PATH, provide the full path to the executable in the STDIO URL. ```bash ramparts scan "stdio:///usr/local/bin/python3:/path/to/server.py" ``` -------------------------------- ### Development Environment Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Configure for development with a faster LLM model, detailed scanning disabled, shorter timeouts, and YARA disabled for quicker testing. Logging level is set to debug. ```yaml llm: provider: "openai" model: "gpt-3.5-turbo" # Faster for development scanner: detailed: false http_timeout: 15 # Shorter timeouts scan_timeout: 30 enable_yara: false # Disable for faster testing security: enabled: true min_severity: "low" # Show all issues logging: level: "debug" # Verbose logging colored: true ``` -------------------------------- ### Run Ramparts Server on a Different Port Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If the default port is in use, specify a different port when starting the Ramparts server. ```bash ramparts server --port 8080 ``` -------------------------------- ### Scan URL with Custom Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Executes a scan on a URL using a specified custom configuration file instead of the default ones. ```bash ramparts scan --config custom-ramparts.yaml ``` -------------------------------- ### Health Check Response Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Example JSON response for the health check endpoint, indicating server status and version information. ```json { "status": "healthy", "timestamp": "2024-01-01T12:00:00.000Z", "service": "ramparts-server", "version": "0.2.0", "protocol_version": "2025-06-18" } ``` -------------------------------- ### STDIO Server Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Configuration for command-line MCP servers using STDIO. Specify the command, arguments, and environment variables. ```json { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"], "env": { "NODE_ENV": "development" } } ``` -------------------------------- ### Replay Command Usage Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Shows the basic usage of the 'ramparts replay' command with path and optional format. ```bash ramparts replay [--format ] ``` -------------------------------- ### Performance Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Enable performance monitoring and set a threshold for warning about slow operations in milliseconds. ```yaml performance: tracking: true slow_threshold_ms: 5000 ``` -------------------------------- ### Server Command Options Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Lists the available options for the 'ramparts server' command, including port, host, and configuration file. ```bash Options: -p, --port Server port [default: 3000] --host Server host [default: 0.0.0.0] --config Configuration file path -h, --help Print help information ``` -------------------------------- ### Replay Command Options Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Lists the available options for the 'ramparts replay' command, including output format and help. ```bash Options: --format Output format [default: from config.yaml] [possible values: text, table, json, raw, sarif] -h, --help Print help information ``` -------------------------------- ### Test Ramparts Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Scan a URL with a specified configuration file to test its validity. Use 'ramparts init-config --force' to recreate default configuration. ```bash # Test configuration ramparts scan https://httpbin.org/json --config ramparts.yaml # Validate configuration without scanning ramparts init-config --force # Recreate with defaults ``` -------------------------------- ### STDIO Scan with Executable Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Initiate a scan using a local executable via STDIO, specifying a custom timeout and enabling detailed analysis. ```json { "url": "stdio:///usr/local/bin/mcp-server", "timeout": 180, "detailed": true, "format": "json" } ``` -------------------------------- ### Scan stdio/subprocess MCP Servers Source: https://github.com/highflame-ai/ramparts/blob/main/README.md Scan MCP servers that communicate via standard input/output or subprocesses. This is useful for local or custom server setups. ```bash # stdio / subprocess MCP servers ramparts scan "stdio:npx:mcp-server-commands" ramparts scan "stdio:python3:/path/to/mcp_server.py" ``` -------------------------------- ### Scan All Discovered IDE Configurations Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Command to scan all discovered MCP server configurations from IDEs. This is the basic command for initiating a scan. ```bash # Scan all discovered IDE configurations ramparts scan-config ``` -------------------------------- ### Scan with httpbin for Testing Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Use the httpbin service to test Ramparts scanning functionality, as it's designed to always respond. ```bash ramparts scan https://httpbin.org/json ``` -------------------------------- ### Scan a Single Server Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Initiates a scan on a specified URL with detailed options. Ensure 'your-token' is replaced with a valid authentication token. ```bash curl -X POST http://localhost:3000/v1/ramparts/scan \ -H "Content-Type: application/json" \ -d '{ "url": "https://api.githubcopilot.com/mcp/", "timeout": 60, "detailed": true, "format": "json", "auth_headers": { "Authorization": "Bearer your-token" } }' ``` -------------------------------- ### Basic Scan-Config Usage Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Execute a basic scan using default settings to find MCP servers from IDE configurations. ```bash ramparts scan-config ``` -------------------------------- ### CI/CD Environment Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Configure for CI/CD with a specific LLM model, detailed scanning enabled, parallel processing, and increased retries for reliability. Security checks are set to high severity, and logging is minimal. ```yaml llm: provider: "openai" model: "gpt-4o" scanner: detailed: true parallel: true max_retries: 5 # More retries for reliability retry_delay_ms: 2000 security: enabled: true min_severity: "high" # Only fail on serious issues logging: level: "warn" # Minimal logging colored: false # No colors in CI timestamps: true performance: tracking: false # Disable in CI ``` -------------------------------- ### Scan Configurations with Table Output Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Command to scan MCP server configurations and display the results in a human-readable table format. Ideal for quick visual inspection. ```bash # Output in table format ramparts scan-config --format table ``` -------------------------------- ### Scan from IDE Configurations Source: https://github.com/highflame-ai/ramparts/blob/main/AGENT.md Initiates a scan based on IDE configurations, such as those from VSCode, Cursor, or Claude. Outputs results in JSON format. ```bash ramparts scan-config --format json ``` -------------------------------- ### Scan Configurations with Authentication Headers Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Command to scan MCP server configurations while including custom authentication headers. This is necessary for accessing protected resources. ```bash # Add authentication headers ramparts scan-config --auth-headers "Authorization: Bearer token" ``` -------------------------------- ### YARA-X Rule Metadata Example Source: https://github.com/highflame-ai/ramparts/blob/main/docs/features.md This JSON structure represents metadata associated with a YARA-X rule, providing details about the rule's name, author, severity, and categorization. ```json { "rule_metadata": { "name": "Environment Variable Leakage", "author": "Ramparts Security Team", "version": "1.0", "description": "Detects exposure of sensitive environment variables and API keys", "severity": "HIGH", "category": "environment,secrets,api-keys,credentials" }, "status": "warning" } ``` -------------------------------- ### Check API key permissions Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Verify that your API key has the necessary permissions to access the target URL by making a direct request with the authorization header. ```bash curl -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Make Ramparts binary executable Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md If the downloaded Ramparts binary is not executable, use chmod to grant execute permissions. ```bash chmod +x /path/to/ramparts ``` -------------------------------- ### Common Error Responses Source: https://github.com/highflame-ai/ramparts/blob/main/docs/api.md Details common error responses encountered when interacting with the Ramparts API, including status codes and example JSON payloads for various client-side and server-side issues. ```APIDOC ## Common Error Responses ### 400 Bad Request - Invalid URL **Description**: Indicates that a provided URL is malformed or missing. **Response Body Example**: ```json { "success": false, "error": "URL is required", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ### 400 Bad Request - Empty URLs Array (Batch Scan) **Description**: Returned when a batch scan request is made with an empty array of URLs. **Response Body Example**: ```json { "success": false, "error": "URLs array is required", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ### 400 Bad Request - Invalid Timeout **Description**: Indicates that the provided timeout value is outside the acceptable range (1-3600 seconds). **Response Body Example**: ```json { "success": false, "error": "Timeout must be between 1 and 3600 seconds", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ### 400 Bad Request - Unsupported Protocol **Description**: Returned when a URL does not start with a supported protocol (http:// or https://). **Response Body Example**: ```json { "success": false, "error": "HTTP URL must start with http:// or https://", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ### 400 Bad Request - Scan Failed **Description**: Indicates a failure during the scanning process, such as a connection timeout. **Response Body Example**: ```json { "success": false, "error": "Connection timeout after 30 seconds", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ### 500 Internal Server Error **Description**: Indicates an unexpected error occurred on the server. **Response Body Example**: ```json { "success": false, "error": "Internal server error occurred", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ``` -------------------------------- ### SARIF Output for GitHub Code Scanning Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Demonstrates generating SARIF output for GitHub Code Scanning, showing two equivalent ways to specify the format. ```bash ramparts skills scan ./.claude/commands --format sarif > skills.sarif ``` ```bash ramparts skills scan ./.claude/commands --sarif > skills.sarif ``` -------------------------------- ### Process Scan Results with jq Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Utilize jq to parse and filter JSON output from Ramparts scans. Examples include extracting specific fields, filtering by severity, and listing tool names. ```bash # Extract security issue count ramparts scan --output json | jq '.security_issues.total_issues' ``` ```bash # Filter high severity issues ramparts scan --output json | \ jq '.security_issues.tool_issues[] | select(.severity == "HIGH")' ``` ```bash # Get all tool names ramparts scan --output json | jq -r '.tools[].name' ``` -------------------------------- ### Run Batch Scan from File Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Performs a scan on multiple URLs listed in a specified file (e.g., 'servers.txt') using the --batch option. ```bash ramparts scan --batch servers.txt ``` -------------------------------- ### CI/CD Pipeline Scan with STDIO Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Integrate Ramparts scanning into your CI/CD pipeline (e.g., GitHub Actions) to automatically scan servers on code changes. This example uses cargo to run the scan command. ```yaml # .github/workflows/mcp-scan.yml - name: Scan MCP Servers run: | cargo run -- scan stdio:///usr/local/bin/mcp-server \ --timeout 30 \ --format json > scan-results.json ``` -------------------------------- ### Skill File Markdown Structure Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Illustrates the expected markdown structure for an AI agent skill file, including optional YAML frontmatter. ```markdown --- description: One-liner shown in the agent's command picker argument-hint: --- # Body of the skill The body is the prompt the agent executes when this skill is invoked. Ramparts treats this body as untrusted instructions and runs prompt- injection / sensitive-data-exposure / jailbreak checks over it. ``` -------------------------------- ### Check Scan Exit Code and Send Alert Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Execute a Ramparts scan and check its exit code. If the scan finds high severity issues (indicated by a non-zero exit code in this example), send an email alert. ```bash # Check exit code and send alert if ! ramparts scan --min-severity high; then echo "High severity issues found!" | mail -s "Security Alert" admin@example.com fi ``` -------------------------------- ### Scan-Config with Authentication and JSON Output Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Perform a scan with custom authentication headers and specify JSON as the output format. ```bash ramparts scan-config \ --auth-headers "Authorization: Bearer $TOKEN" \ --format json ``` -------------------------------- ### Build and Test Commands Source: https://github.com/highflame-ai/ramparts/blob/main/AGENT.md Commands for building, testing, linting, and formatting the Ramparts project. These ensure code quality and project integrity. ```bash make build make check cargo test --all-features make test cargo clippy --all-features -- -D warnings make lint cargo fmt make fmt-check make ci-check ``` -------------------------------- ### Scan with Minimal Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Test Ramparts scanning with an empty configuration object passed via stdin, useful for verifying basic functionality. ```bash ramparts scan --config <(echo "{}") ``` -------------------------------- ### IDE Configuration with STDIO Server Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Configure your IDE (e.g., Cursor) to connect to a local Ramparts tool using the stdio transport. This allows for seamless integration of development tools within your IDE. ```json // ~/.cursor/mcp.json { "servers": [ { "name": "local-tools", "url": "stdio:///usr/local/bin/mcp-tools", "description": "Local development tools" } ] } ``` -------------------------------- ### Verify YARA Rules Directory Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md List the contents of the YARA rules directory and check if YARA is enabled in the configuration file. ```bash # Check rules directory ls -la rules/pre/ # Verify YARA is enabled grep enable_yara ramparts.yaml ``` -------------------------------- ### Configure RAMPARTS_SKILL_ROOTS Environment Variable Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Demonstrates the correct way to set the RAMPARTS_SKILL_ROOTS environment variable before invoking the Ramparts binary. Setting it via cargo run's shell expansion is ineffective. ```bash # Works export RAMPARTS_SKILL_ROOTS="~/work/skills,/srv/skills" ramparts skills scan-config ``` ```bash # Also works RAMPARTS_SKILL_ROOTS="~/work/skills" ramparts skills scan-config ``` ```bash # Doesn't work — env var doesn't survive into ramparts' process echo $RAMPARTS_SKILL_ROOTS ``` -------------------------------- ### Discover and Scan Skills from Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/features.md Discovers and scans agent skills from well-known locations defined in the configuration, such as ~/.claude/commands. ```bash ramparts skills scan-config ``` -------------------------------- ### Check STDIO server file permissions Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Ensure that the STDIO server executable has the correct file permissions for execution. ```bash ls -la /usr/local/bin/mcp-server ``` -------------------------------- ### Scan URL with Text Format Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Scans a given URL and outputs the results in a simple text format. ```bash ramparts scan --format text ``` -------------------------------- ### Scan IDE Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/README.md Scan IDE configuration files to identify connected servers and their security status. Generates a detailed report. ```bash ramparts scan-config --report ``` -------------------------------- ### Use correct STDIO URL format for commands Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Ensure STDIO commands are specified using the correct colon-separated format, e.g., 'stdio:command:args'. ```bash ramparts scan "stdio:npx:mcp-server-commands" ``` -------------------------------- ### Scan with Authentication Headers Source: https://github.com/highflame-ai/ramparts/blob/main/AGENT.md Scans an MCP server that requires authentication. Include necessary authorization headers in the command. ```bash ramparts scan https://api.example.com/mcp --auth-headers "Authorization: Bearer TOKEN" ``` -------------------------------- ### Docker Integration for Ramparts Scanning Source: https://github.com/highflame-ai/ramparts/blob/main/examples/stdio_example.md Set up a Dockerfile to build and run Ramparts for scanning. This ensures a consistent scanning environment across different machines and deployments. ```dockerfile # Dockerfile FROM rust:latest COPY . /app WORKDIR /app RUN cargo build --release ENTRYPOINT ["cargo", "run", "--release", "--", "scan"] ``` -------------------------------- ### Batch Scan URLs from a File Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Automate scanning multiple URLs by reading them from a file. Each URL is processed individually, and results are appended to a JSON file. ```bash # Create a file with URLs echo "https://server1.com/mcp/\nhttps://server2.com/mcp/\nstdio:///usr/local/bin/mcp-server" > servers.txt # Scan each URL while IFS= read -r url; do ramparts scan "$url" --output json >> results.json done < servers.txt ``` -------------------------------- ### Rate-Limited Environment Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Configure for a rate-limited environment with a longer LLM timeout, sequential scanning, smaller batch sizes, and increased retries with longer delays. Security is enabled at medium severity. ```yaml llm: provider: "openai" model: "gpt-3.5-turbo" timeout: 60 # Longer timeout scanner: parallel: false # Sequential processing llm_batch_size: 5 # Smaller batches max_retries: 10 # More retries retry_delay_ms: 5000 # Longer delays security: enabled: true min_severity: "medium" logging: level: "info" ``` -------------------------------- ### Use correct STDIO URL format for Node.js scripts Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Specify Node.js STDIO servers using the format 'stdio:node:/path/to/server.js'. ```bash ramparts scan "stdio:node:/path/to/server.js" ``` -------------------------------- ### HTTP Server Configuration Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Configuration for HTTP-based MCP servers. Define the type, URL, and whether to include gallery information. ```json { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "gallery": true } ``` -------------------------------- ### Containerized Server Configuration (Docker MCP Toolkit) Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Configuration for servers running within containers, such as the Docker MCP Toolkit. Specifies the image and command to run. ```json { "image": "ghcr.io/highflame-ai/ramparts:latest", "command": ["/app/ramparts", "mcp-stdio"], "description": "Ramparts MCP server over stdio" } ``` -------------------------------- ### Scan All MCP Servers in IDE Configurations Source: https://github.com/highflame-ai/ramparts/blob/main/README.md Automatically discover and scan all MCP servers configured across various supported IDEs. This provides a comprehensive overview of your development environment's MCP posture. ```bash # Auto-discover and scan every MCP server in your IDE configs # (Cursor, Windsurf, VS Code, Claude Desktop, Claude Code, Cline) ramparts scan-config ``` -------------------------------- ### Confirm Default Skill Roots Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Verify if any default skill discovery roots exist on your system. This command checks common locations for skill files. ```bash # Confirm at least one default root exists ls -d ~/.claude/commands ~/.cursor/commands ./.claude/commands 2>/dev/null ``` -------------------------------- ### Scan-Config from a Specific Root Directory Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Scan for IDE configuration files within a specified directory, outputting results in SARIF format. This is useful for CI pipelines. The command automatically skips common build directories. ```bash # `--root` walks the directory recursively, picks up `mcp.json`, # `*.mcp.json`, `claude_desktop_config.json`, `settings.json`, etc. # Skips `.git`, `node_modules`, `target`, `dist`, `build`, `.venv`, # and similar build directories. Symlinks are not followed. ramparts scan-config --root ./ide-configs --format sarif > ramparts.sarif ``` -------------------------------- ### Setting Custom Skill Discovery Roots Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Define additional roots for skill discovery using the `RAMPARTS_SKILL_ROOTS` environment variable. Paths are comma-separated and `~/` is expanded. ```bash # Comma-separated list of paths; leading `~/` is expanded to $HOME. # Other tilde forms (~user/) are not expanded — use absolute paths. export RAMPARTS_SKILL_ROOTS="~/work/agent-skills,/srv/shared-skills" ramparts skills scan-config ``` -------------------------------- ### Scan URL with Table Format Source: https://github.com/highflame-ai/ramparts/blob/main/docs/cli.md Scans a given URL and outputs the results in a human-readable table format. This is the default format. ```bash ramparts scan ramparts scan --format table ``` -------------------------------- ### Verify SSL/TLS certificate with openssl Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Use openssl to perform a detailed check of the SSL/TLS connection and certificate for a given host and port. ```bash openssl s_client -connect :443 -servername < /dev/null ``` -------------------------------- ### Check Server Requirements for Environment Variables Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Inspect the server's JavaScript file to identify which environment variables are mandatory. This helps in diagnosing 'Missing required environment variables' errors. ```bash head -20 /path/to/mcp-server.js ``` -------------------------------- ### Check File Permissions Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md Verify read and execute permissions for the Ramparts executable and configuration file. ```bash ls -la $(which ramparts) ``` ```bash ls -la ramparts.yaml ``` -------------------------------- ### Scan Configurations with JSON Output Source: https://github.com/highflame-ai/ramparts/blob/main/docs/latest-formats.md Command to scan MCP server configurations and output the results in JSON format. Useful for programmatic processing of scan results. ```bash # Output in JSON format ramparts scan-config --format json ``` -------------------------------- ### Check LLM API Key Source: https://github.com/highflame-ai/ramparts/blob/main/docs/configuration.md Verify if the LLM API key environment variable is set and test its validity by making a request to the API endpoint. ```bash # Check environment variable echo $OPENAI_API_KEY # Test API key curl -H "Authorization: Bearer $OPENAI_API_KEY" \ https://api.openai.com/v1/models ``` -------------------------------- ### Correct STDIO URL format for multiple arguments Source: https://github.com/highflame-ai/ramparts/blob/main/docs/troubleshooting.md When passing multiple arguments to a STDIO server, separate each argument with a colon. ```bash ramparts scan "stdio:python3:/path/to/server.py:--port:8080" ```