Skip to main content
Glama
enkryptai

Enkrypt AI Secure MCP Gateway

Official
by enkryptai
reference.txt38.4 kB
ENKRYPT SECURE MCP GATEWAY CLI - COMPREHENSIVE TEST REFERENCE =============================================================================== TOTAL TESTS: ~210+ command variations =============================================================================== TEST CATEGORIES & COMMAND COVERAGE =============================================================================== 1. SETUP COMMANDS (4 tests) 2. CONFIG COMMANDS (50+ tests) - INCLUDING GUARDRAILS 3. PROJECT COMMANDS (20+ tests) 4. USER COMMANDS (30+ tests) 5. SYSTEM COMMANDS (5+ tests) 6. ERROR SCENARIOS (25+ tests) - INCLUDING GUARDRAILS ERRORS 7. COMPLEX WORKFLOWS (31+ tests) - INCLUDING GUARDRAILS WORKFLOWS 8. HELP COMMANDS (13+ tests) - INCLUDING GUARDRAILS HELP 9. CLEANUP COMMANDS (36+ tests) NOTE: We can use `secure-mcp-gateway` instead of `python cli.py` in the commands below. =============================================================================== 1. SETUP COMMANDS TESTED (4 tests) =============================================================================== ✅ python cli.py generate-config ✅ python cli.py install --client claude-desktop ✅ python cli.py install --client cursor =============================================================================== 2. CONFIG COMMANDS TESTED (50+ tests) =============================================================================== BASIC CONFIG OPERATIONS: ------------------------ ✅ python cli.py config list ✅ python cli.py config add --config-name "test-config-1" ✅ python cli.py config add --config-name "test-config-2" ✅ python cli.py config add --config-name "production-config" ✅ python cli.py config add --config-name "development-config" ✅ python cli.py config copy --source-config "test-config-1" --target-config "test-config-copy" ✅ python cli.py config rename --config-name "test-config-copy" --new-name "test-config-renamed" ✅ python cli.py config get --config-name "test-config-1" ID-BASED CONFIG OPERATIONS: ---------------------------- ✅ python cli.py config get --config-id {config-id} ✅ python cli.py config rename --config-id {config-id} --new-name "test-config-1-renamed" ✅ python cli.py config list-servers --config-id {config-id} ✅ python cli.py config remove-server --config-id {config-id} --server-name "server-name" BASIC SERVER MANAGEMENT: ------------------------- ✅ python cli.py config add-server --config-name "test-config-1" --server-name "test-server-1" --server-command "python" --args "test.py" --description "Test server" ✅ python cli.py config add-server --config-name "test-config-1" --server-name "test-server-2" --server-command "node" --args "app.js" --description "Node server" ✅ python cli.py config list-servers --config-name "test-config-1" ✅ python cli.py config get-server --config-name "test-config-1" --server-name "test-server-1" ✅ python cli.py config update-server --config-name "test-config-1" --server-name "test-server-1" --description "Updated test server" ✅ python cli.py config remove-server --config-name "test-config-1" --server-name "test-server-2" ✅ python cli.py config remove-all-servers --config-name "test-config-2" ADVANCED SERVER CONFIGURATIONS: -------------------------------- ✅ python cli.py config add-server --config-name "development-config" --server-name "db-server" --server-command "python" --args "db.py" --env '{"DB_HOST": "localhost", "DB_PORT": "5432", "DEBUG": "true"}' --description "Database server with env vars" ✅ python cli.py config add-server --config-name "development-config" --server-name "tool-server" --server-command "python" --args "tools.py" --tools '{"search": {"enabled": true}, "calculator": {"enabled": false}, "file_reader": {"enabled": true}}' --description "Tool server with specific tools" ✅ python cli.py config add-server --config-name "production-config" --server-name "secure-input-server" --server-command "python" --args "secure.py" --input-guardrails-policy '{"enabled": true, "policy_name": "Input Security Policy", "additional_config": {"pii_redaction": true, "content_filtering": true}, "block": ["policy_violation", "injection_attack", "malicious_input"]}' --description "Server with input guardrails" ✅ python cli.py config add-server --config-name "production-config" --server-name "secure-output-server" --server-command "python" --args "secure_output.py" --output-guardrails-policy '{"enabled": true, "policy_name": "Output Security Policy", "additional_config": {"relevancy": true, "hallucination": true, "adherence": true, "toxicity_filter": true}, "block": ["policy_violation", "injection_attack", "harmful_content"]}' --description "Server with output guardrails" ✅ python cli.py config add-server --config-name "production-config" --server-name "fully-secure-server" --server-command "python" --args "fully_secure.py" --input-guardrails-policy {input-guardrails} --output-guardrails-policy {output-guardrails} --description "Fully secured server" ✅ python cli.py config add-server --config-name "production-config" --server-name "complex-server" --server-command "python" --args "complex.py" --env '{"API_KEY": "secret", "ENVIRONMENT": "production", "LOG_LEVEL": "INFO"}' --tools '{"web_search": {"enabled": true}, "code_interpreter": {"enabled": false}, "file_system": {"enabled": true, "read_only": true}}' --input-guardrails-policy {input-guardrails} --description "Complex server configuration" ADVANCED SERVER UPDATES: ------------------------- ✅ python cli.py config update-server --config-name "development-config" --server-name "tool-server" --tools '{"search": {"enabled": true}, "calculator": {"enabled": true}, "summarizer": {"enabled": false}}' ✅ python cli.py config update-server --config-name "development-config" --server-name "db-server" --env '{"DB_HOST": "remote-db", "DB_PORT": "5433", "DEBUG": "false", "CACHE_ENABLED": "true"}' 🛡️ GUARDRAILS POLICY UPDATES (NEW): ===================================== INPUT GUARDRAILS UPDATES: -------------------------- ✅ python cli.py config update-server-input-guardrails --config-name "production-config" --server-name "secure-input-server" --policy '{"enabled": true, "policy_name": "Custom Input Policy", "additional_config": {"pii_redaction": true}, "block": ["policy_violation"]}' ✅ python cli.py config update-server-input-guardrails --config-name "production-config" --server-name "fully-secure-server" --policy-file "input_policy.json" ✅ python cli.py config update-server-input-guardrails --config-id {config-id} --server-name "secure-input-server" --policy-file "input_policy.json" OUTPUT GUARDRAILS UPDATES: --------------------------- ✅ python cli.py config update-server-output-guardrails --config-name "production-config" --server-name "secure-output-server" --policy '{"enabled": true, "policy_name": "Custom Output Policy", "additional_config": {"relevancy": true, "hallucination": true, "adherence": true}, "block": ["policy_violation"]}' ✅ python cli.py config update-server-output-guardrails --config-name "production-config" --server-name "fully-secure-server" --policy-file "output_policy.json" ✅ python cli.py config update-server-output-guardrails --config-id {config-id} --server-name "secure-output-server" --policy-file "output_policy.json" COMBINED GUARDRAILS UPDATES: ----------------------------- ✅ python cli.py config update-server-guardrails --config-name "production-config" --server-name "complex-server" --input-policy '{"enabled": true, "policy_name": "Custom Input Policy", "additional_config": {"pii_redaction": true}, "block": ["policy_violation"]}' --output-policy '{"enabled": true, "policy_name": "Custom Output Policy", "additional_config": {"relevancy": true, "hallucination": true, "adherence": true}, "block": ["policy_violation"]}' ✅ python cli.py config update-server-guardrails --config-name "production-config" --server-name "fully-secure-server" --input-policy-file "input_policy.json" --output-policy-file "output_policy.json" PARTIAL GUARDRAILS UPDATES: ---------------------------- ✅ python cli.py config update-server-guardrails --config-name "production-config" --server-name "secure-input-server" --input-policy-file "input_policy.json" ✅ python cli.py config update-server-guardrails --config-name "production-config" --server-name "secure-output-server" --output-policy-file "output_policy.json" ✅ python cli.py config update-server-guardrails --config-id {config-id} --server-name "complex-server" --input-policy '{"enabled": true, "policy_name": "Updated Policy", "additional_config": {"pii_redaction": false}, "block": ["policy_violation"]}' CONFIG VALIDATION & EXPORT: ---------------------------- ✅ python cli.py config list-projects --config-name "test-config-1" ✅ python cli.py config validate --config-name "test-config-1" ✅ python cli.py config validate --config-name "development-config" ✅ python cli.py config validate --config-name "production-config" ✅ python cli.py config export --config-name "test-config-1" --output-file "config-export.json" ✅ python cli.py config export --config-name "production-config" --output-file "production-config-export.json" ✅ python cli.py config import --input-file "config-export.json" --config-name "imported-config" CONFIG SEARCH: -------------- ✅ python cli.py config search --search-term "test" ✅ python cli.py config search --search-term "production" ✅ python cli.py config search --search-term "secure" =============================================================================== 3. PROJECT COMMANDS TESTED (20+ tests) =============================================================================== BASIC PROJECT OPERATIONS: -------------------------- ✅ python cli.py project list ✅ python cli.py project create --project-name "test-project-1" ✅ python cli.py project create --project-name "test-project-2" ✅ python cli.py project create --project-name "Development" ✅ python cli.py project create --project-name "Production" ✅ python cli.py project get --project-name "test-project-1" ID-BASED PROJECT OPERATIONS: ----------------------------- ✅ python cli.py project get --project-id {project-id} CONFIG ASSIGNMENT: ------------------ ✅ python cli.py project assign-config --project-name "test-project-1" --config-name "test-config-1" ✅ python cli.py project assign-config --project-name "Development" --config-name "development-config" ✅ python cli.py project assign-config --project-name "Production" --config-name "production-config" ✅ python cli.py project assign-config --project-id {project-id} --config-id {config-id} ✅ python cli.py project get-config --project-name "test-project-1" ✅ python cli.py project get-config --project-name "Development" ✅ python cli.py project get-config --project-name "Production" ✅ python cli.py project unassign-config --project-name "test-project-2" USER MANAGEMENT: ---------------- ✅ python cli.py project list-users --project-name "test-project-1" ✅ python cli.py project add-user --project-name "test-project-1" --email "test-user-1@example.com" ✅ python cli.py project add-user --project-name "test-project-1" --email "updated-user-2@example.com" ✅ python cli.py project add-user --project-name "Development" --email "dev@example.com" ✅ python cli.py project add-user --project-name "Production" --email "prod@example.com" ✅ python cli.py project add-user --project-id {project-id} --user-id {user-id} ✅ python cli.py project remove-user --project-name "test-project-1" --email "updated-user-2@example.com" ✅ python cli.py project remove-all-users --project-name "test-project-2" EXPORT & SEARCH: ---------------- ✅ python cli.py project export --project-name "test-project-1" --output-file "project-export.json" ✅ python cli.py project export --project-name "Production" --output-file "production-project-export.json" ✅ python cli.py project search --search-term "test" ✅ python cli.py project search --search-term "Development" ✅ python cli.py project search --search-term "Production" =============================================================================== 4. USER COMMANDS TESTED (30+ tests) =============================================================================== BASIC USER OPERATIONS: ----------------------- ✅ python cli.py user list ✅ python cli.py user create --email "test-user-1@example.com" ✅ python cli.py user create --email "test-user-2@example.com" ✅ python cli.py user create --email "dev@example.com" ✅ python cli.py user create --email "prod@example.com" ✅ python cli.py user create --email "admin@company.com" ✅ python cli.py user get --email "test-user-1@example.com" ✅ python cli.py user update --email "test-user-2@example.com" --new-email "updated-user-2@example.com" ✅ python cli.py user list-projects --email "test-user-1@example.com" ID-BASED USER OPERATIONS: -------------------------- ✅ python cli.py user get --user-id {user-id} ✅ python cli.py user update --user-id {user-id} --new-email "admin-updated@company.com" API KEY MANAGEMENT: ------------------- ✅ python cli.py user generate-api-key --email "test-user-1@example.com" --project-name "test-project-1" ✅ python cli.py user generate-api-key --email "dev@example.com" --project-name "Development" ✅ python cli.py user generate-api-key --email "prod@example.com" --project-name "Production" ✅ python cli.py user generate-api-key --user-id {user-id} --project-id {project-id} API KEY LISTING: ---------------- ✅ python cli.py user list-api-keys --email "test-user-1@example.com" ✅ python cli.py user list-api-keys --email "dev@example.com" ✅ python cli.py user list-api-keys --email "prod@example.com" ✅ python cli.py user list-api-keys --user-id {user-id} ✅ python cli.py user list-api-keys --email "test-user-1@example.com" --project-name "test-project-1" ✅ python cli.py user list-api-keys --email "dev@example.com" --project-name "Development" ✅ python cli.py user list-all-api-keys API KEY LIFECYCLE: ------------------ ✅ python cli.py user disable-api-key --api-key {api-key} ✅ python cli.py user enable-api-key --api-key {api-key} ✅ python cli.py user rotate-api-key --api-key {api-key} ✅ python cli.py user delete-api-key --api-key {api-key} ✅ python cli.py user delete-all-api-keys --email "updated-user-2@example.com" ✅ python cli.py user delete-all-api-keys --email "dev@example.com" USER SEARCH & DELETION: ------------------------ ✅ python cli.py user search --search-term "test" ✅ python cli.py user search --search-term "admin" ✅ python cli.py user search --search-term "example.com" ✅ python cli.py user delete --email "admin-updated@company.com" --force =============================================================================== 5. SYSTEM COMMANDS TESTED (5+ tests) =============================================================================== SYSTEM OPERATIONS: ------------------ ✅ python cli.py system health-check ✅ python cli.py system backup --output-file "system-backup.json" ✅ python cli.py system backup --output-file "pre-restore-backup.json" ✅ python cli.py system restore --input-file "system-backup.json" ✅ python cli.py system health-check (after restore) NOTE: system reset --confirm is not tested to preserve test data =============================================================================== 6. ERROR SCENARIOS TESTED (25+ tests) - INCLUDING GUARDRAILS ERRORS =============================================================================== NON-EXISTENT RESOURCE ACCESS: ------------------------------ ❌ python cli.py config get --config-name "non-existent-config" (expected to fail) ❌ python cli.py project get --project-name "non-existent-project" (expected to fail) ❌ python cli.py user get --email "non-existent@example.com" (expected to fail) DUPLICATE CREATION: ------------------- ❌ python cli.py config add --config-name "test-config-1" (expected to fail) ❌ python cli.py project create --project-name "test-project-1" (expected to fail) ❌ python cli.py user create --email "test-user-1@example.com" (expected to fail) CONSTRAINT VIOLATIONS: ---------------------- ❌ python cli.py config remove --config-name "test-config-1" (expected to fail - in use) ❌ python cli.py user delete --email "prod@example.com" (expected to fail - has API keys) ❌ python cli.py project remove --project-name "Production" (expected to fail - has users) INVALID CONFIGURATIONS: ------------------------ ❌ python cli.py config add-server --config-name "non-existent-config" --server-name "test" --server-command "python" --args "test.py" (expected to fail) ❌ python cli.py config add-server --config-name "test-config-renamed" --server-name "bad-json-server" --server-command "python" --args "test.py" --env "invalid-json" (expected to fail) 🛡️ GUARDRAILS ERROR SCENARIOS (NEW): ===================================== ❌ python cli.py config update-server-input-guardrails --config-name "non-existent-config" --server-name "test-server" --policy '{"enabled": true}' (expected to fail) ❌ python cli.py config update-server-input-guardrails --config-name "test-config-1" --server-name "non-existent-server" --policy '{"enabled": true}' (expected to fail) ❌ python cli.py config update-server-input-guardrails --config-name "test-config-1" --server-name "test-server-1" --policy "invalid-json" (expected to fail) ❌ python cli.py config update-server-input-guardrails --config-name "test-config-1" --server-name "test-server-1" (expected to fail - missing policy) ❌ python cli.py config update-server-input-guardrails --config-name "test-config-1" --server-name "test-server-1" --policy '{"enabled": true}' --policy-file "input_policy.json" (expected to fail - both provided) MISSING ARGUMENTS: ------------------ ❌ python cli.py config add (expected to fail) ❌ python cli.py project create (expected to fail) ❌ python cli.py user create (expected to fail) INVALID API OPERATIONS: ----------------------- ❌ python cli.py user rotate-api-key --api-key "invalid-key-format" (expected to fail) ❌ python cli.py user delete-api-key --api-key "invalid-key-format" (expected to fail) FILE OPERATIONS: ---------------- ❌ python cli.py config import --input-file "non-existent-file.json" --config-name "test" (expected to fail) ❌ python cli.py system restore --input-file "non-existent-backup.json" (expected to fail) INVALID ID FORMATS: ------------------- ❌ python cli.py config get --config-id "invalid-uuid" (expected to fail) ❌ python cli.py project get --project-id "invalid-uuid" (expected to fail) ❌ python cli.py user get --user-id "invalid-uuid" (expected to fail) =============================================================================== 7. COMPLEX WORKFLOWS TESTED (31+ tests) - INCLUDING GUARDRAILS WORKFLOWS =============================================================================== MIGRATION WORKFLOW: ------------------- ✅ python cli.py system backup --output-file "pre-migration-backup.json" ✅ python cli.py config copy --source-config "production-config" --target-config "new-production-config" ✅ python cli.py config validate --config-name "new-production-config" ✅ python cli.py project create --project-name "New-Production" ✅ python cli.py project assign-config --project-name "New-Production" --config-name "new-production-config" ✅ python cli.py system health-check TEAM MANAGEMENT WORKFLOW: -------------------------- ✅ python cli.py user create --email "team-lead@example.com" ✅ python cli.py user create --email "developer-1@example.com" ✅ python cli.py user create --email "developer-2@example.com" ✅ python cli.py project add-user --project-name "New-Production" --email "team-lead@example.com" ✅ python cli.py project add-user --project-name "New-Production" --email "developer-1@example.com" ✅ python cli.py project add-user --project-name "New-Production" --email "developer-2@example.com" ✅ python cli.py user generate-api-key --email "team-lead@example.com" --project-name "New-Production" ✅ python cli.py user generate-api-key --email "developer-1@example.com" --project-name "New-Production" ✅ python cli.py user generate-api-key --email "developer-2@example.com" --project-name "New-Production" CONFIGURATION MANAGEMENT WORKFLOW: ----------------------------------- ✅ python cli.py config add --config-name "staging-config" ✅ python cli.py config add-server --config-name "staging-config" --server-name "staging-web" --server-command "python" --args "web.py" --env '{"ENVIRONMENT": "staging", "LOG_LEVEL": "DEBUG"}' --description "Staging web server" ✅ python cli.py config add-server --config-name "staging-config" --server-name "staging-tools" --server-command "python" --args "tools.py" --tools '{"web_search": {"enabled": true}, "file_system": {"enabled": true}}' --description "Staging tools server" ✅ python cli.py config add-server --config-name "staging-config" --server-name "staging-secure" --server-command "python" --args "secure.py" --input-guardrails-policy '{"enabled": true, "policy_name": "Staging Policy", "additional_config": {"content_filtering": false}, "block": ["injection_attack"]}' --description "Staging secure server" ✅ python cli.py config validate --config-name "staging-config" ✅ python cli.py config export --config-name "staging-config" --output-file "staging-config-export.json" 🛡️ GUARDRAILS MANAGEMENT WORKFLOW (NEW): ========================================== ✅ python cli.py config add-server --config-name "staging-config" --server-name "security-test-server" --server-command "python" --args "security.py" --description "Security testing server" ✅ python cli.py config update-server-input-guardrails --config-name "staging-config" --server-name "security-test-server" --policy-file "enhanced_input_policy.json" ✅ python cli.py config update-server-output-guardrails --config-name "staging-config" --server-name "security-test-server" --policy-file "enhanced_output_policy.json" ✅ python cli.py config update-server-guardrails --config-name "staging-config" --server-name "security-test-server" --input-policy '{"enabled": true, "policy_name": "Updated Input Policy", "additional_config": {"pii_redaction": false, "content_filtering": true}, "block": ["policy_violation"]}' --output-policy '{"enabled": true, "policy_name": "Updated Output Policy", "additional_config": {"relevancy": false, "hallucination": true, "adherence": true}, "block": ["policy_violation", "hallucination"]}' ✅ python cli.py config get-server --config-name "staging-config" --server-name "security-test-server" ✅ python cli.py config validate --config-name "staging-config" ✅ python cli.py config export --config-name "staging-config" --output-file "staging-config-with-guardrails.json" ✅ python cli.py system health-check =============================================================================== 8. HELP COMMANDS TESTED (13+ tests) - INCLUDING GUARDRAILS HELP =============================================================================== GENERAL HELP: ------------- ✅ python cli.py --help COMMAND GROUP HELP: ------------------- ✅ python cli.py config --help ✅ python cli.py project --help ✅ python cli.py user --help ✅ python cli.py system --help SPECIFIC COMMAND HELP: ---------------------- ✅ python cli.py config add --help ✅ python cli.py config add-server --help ✅ python cli.py user generate-api-key --help ✅ python cli.py project create --help ✅ python cli.py system backup --help 🛡️ GUARDRAILS COMMAND HELP (NEW): =================================== ✅ python cli.py config update-server-input-guardrails --help ✅ python cli.py config update-server-output-guardrails --help ✅ python cli.py config update-server-guardrails --help =============================================================================== 9. CLEANUP COMMANDS TESTED (36+ tests) =============================================================================== API KEY CLEANUP: ---------------- ✅ python cli.py user delete-all-api-keys --email {email} (for multiple users) USER CLEANUP: ------------- ✅ python cli.py project remove-all-users --project-name {project-name} (for multiple projects) ✅ python cli.py user delete --email {email} --force (for multiple users) PROJECT CLEANUP: ----------------- ✅ python cli.py project unassign-config --project-name {project-name} (for multiple projects) ✅ python cli.py project remove --project-name {project-name} (for multiple projects) CONFIG CLEANUP: --------------- ✅ python cli.py config remove-all-servers --config-name {config-name} (for multiple configs) ✅ python cli.py config remove --config-name {config-name} (for multiple configs) FINAL VALIDATION: ----------------- ✅ python cli.py system health-check =============================================================================== ADVANCED FEATURES TESTED =============================================================================== SERVER CONFIGURATIONS: ----------------------- ✅ Environment Variables: --env '{"KEY": "value"}' ✅ Tools Configuration: --tools '{"tool": {"enabled": true}}' ✅ Input Guardrails: --input-guardrails-policy '{"enabled": true, ...}' ✅ Output Guardrails: --output-guardrails-policy '{"enabled": true, ...}' ✅ Complex Combinations: Multiple features on single server 🛡️ GUARDRAILS POLICY MANAGEMENT (NEW): ======================================== ✅ Input Guardrails Updates: --policy (JSON string) & --policy-file (JSON file) ✅ Output Guardrails Updates: --policy (JSON string) & --policy-file (JSON file) ✅ Combined Guardrails Updates: --input-policy & --output-policy ✅ Partial Guardrails Updates: Input only or Output only ✅ Config ID Support: --config-id for guardrails operations ✅ Error Handling: Invalid configs, servers, JSON, missing policies ✅ Policy File Management: Creation and validation of JSON policies ID-BASED OPERATIONS: -------------------- ✅ Config operations with --config-id ✅ Project operations with --project-id ✅ User operations with --user-id ✅ Cross-reference operations with multiple IDs ✅ Guardrails operations with --config-id ERROR HANDLING: --------------- ✅ Non-existent resource access ✅ Duplicate creation attempts ✅ Constraint violations ✅ Invalid JSON configurations ✅ Missing required arguments ✅ Invalid formats and data ✅ Guardrails-specific errors (invalid policy, missing parameters) WORKFLOW TESTING: ----------------- ✅ Migration scenarios ✅ Team management ✅ Configuration management ✅ Multi-step operations ✅ Cross-resource dependencies ✅ Guardrails management workflows =============================================================================== TEST ARTIFACTS CREATED =============================================================================== CONFIG EXPORTS: --------------- - config-export.json - production-config-export.json - staging-config-export.json - staging-config-with-guardrails.json PROJECT EXPORTS: ---------------- - project-export.json - production-project-export.json SYSTEM BACKUPS: --------------- - system-backup.json - pre-restore-backup.json - pre-migration-backup.json 🛡️ POLICY FILES (NEW): ======================= - input_policy.json (basic input policy) - output_policy.json (basic output policy) =============================================================================== EXAMPLE POLICY FILES =============================================================================== INPUT_POLICY.JSON: ------------------ { "enabled": true, "policy_name": "Test Input Policy", "additional_config": { "pii_redaction": true, "content_filtering": true }, "block": ["policy_violation", "sensitive_data"] } OUTPUT_POLICY.JSON: ------------------- { "enabled": true, "policy_name": "Test Output Policy", "additional_config": { "relevancy": true, "hallucination": true, "adherence": true }, "block": ["policy_violation", "hallucination"] } =============================================================================== COVERAGE SUMMARY =============================================================================== COMMAND CATEGORIES: ------------------- - Setup Commands: 100% coverage (4/4) - Config Commands: 100% coverage (50+/50+) INCLUDING GUARDRAILS - Project Commands: 100% coverage (20+/20+) - User Commands: 100% coverage (30+/30+) - System Commands: 100% coverage (5+/5+, except destructive reset) - Error Scenarios: 100% coverage (25+/25+) INCLUDING GUARDRAILS ERRORS - Complex Workflows: 100% coverage (31+/31+) INCLUDING GUARDRAILS WORKFLOWS - Help Commands: 100% coverage (13+/13+) INCLUDING GUARDRAILS HELP ADVANCED FEATURES: ------------------ - Environment Variables: ✅ Tested - Tools Configuration: ✅ Tested - Input Guardrails: ✅ Tested - Output Guardrails: ✅ Tested - Complex Server Configs: ✅ Tested - ID-Based Operations: ✅ Tested - Error Scenarios: ✅ Tested - Multi-Step Workflows: ✅ Tested 🛡️ NEW GUARDRAILS FEATURES: ============================ - Input Guardrails Updates (JSON String): ✅ Tested - Input Guardrails Updates (JSON File): ✅ Tested - Output Guardrails Updates (JSON String): ✅ Tested - Output Guardrails Updates (JSON File): ✅ Tested - Combined Guardrails Updates: ✅ Tested - Partial Guardrails Updates: ✅ Tested - Config ID-based Guardrails Ops: ✅ Tested - Guardrails Error Scenarios: ✅ Tested - Guardrails Management Workflow: ✅ Tested - Policy File Creation/Management: ✅ Tested TOTAL COMMANDS TESTED: ~210+ SUCCESS CRITERIA: All commands execute without unexpected failures ERROR HANDLING: All expected failures properly handled GUARDRAILS COVERAGE: Complete coverage of all guardrails update operations =============================================================================== GUARDRAILS COMMAND QUICK REFERENCE =============================================================================== INPUT GUARDRAILS UPDATE: ------------------------ python cli.py config update-server-input-guardrails --config-name <config> --server-name <server> --policy <json-string> python cli.py config update-server-input-guardrails --config-name <config> --server-name <server> --policy-file <file.json> python cli.py config update-server-input-guardrails --config-id <id> --server-name <server> --policy-file <file.json> OUTPUT GUARDRAILS UPDATE: ------------------------- python cli.py config update-server-output-guardrails --config-name <config> --server-name <server> --policy <json-string> python cli.py config update-server-output-guardrails --config-name <config> --server-name <server> --policy-file <file.json> python cli.py config update-server-output-guardrails --config-id <id> --server-name <server> --policy-file <file.json> COMBINED GUARDRAILS UPDATE: --------------------------- python cli.py config update-server-guardrails --config-name <config> --server-name <server> --input-policy <json> --output-policy <json> python cli.py config update-server-guardrails --config-name <config> --server-name <server> --input-policy-file <file> --output-policy-file <file> python cli.py config update-server-guardrails --config-name <config> --server-name <server> --input-policy-file <file> # Input only python cli.py config update-server-guardrails --config-name <config> --server-name <server> --output-policy-file <file> # Output only =============================================================================== CROSS-PLATFORM COMPATIBILITY =============================================================================== PLATFORMS TESTED: ------------------ ✅ Windows: Uses 'python' command with proper JSON escaping ✅ Linux/Ubuntu: Uses 'python3' command with proper JSON escaping ✅ macOS: Uses 'python3' command with proper JSON escaping ✅ Auto-detection: Automatically detects correct Python executable JSON HANDLING: -------------- ✅ Windows CMD: Uses double quotes with escaping ✅ Windows PowerShell: Uses single quotes or variables ✅ Linux/macOS Bash: Uses single quotes ✅ File-based: Cross-platform JSON file support GUARDRAILS JSON EXAMPLES FOR DIFFERENT PLATFORMS: -------------------------------------------------- WINDOWS CMD: python cli.py config update-server-input-guardrails --config-name "production-config" --server-name "echo_server" --policy "{\"enabled\": true, \"policy_name\": \"Custom Policy\", \"additional_config\": {\"pii_redaction\": true}, \"block\": [\"policy_violation\", \"sensitive_data\"]}" WINDOWS POWERSHELL: $policy = '{"enabled": true, "policy_name": "Custom Policy", "additional_config": {"pii_redaction": true}, "block": ["policy_violation", "sensitive_data"]}' python cli.py config update-server-input-guardrails --config-name "production-config" --server-name "echo_server" --policy $policy LINUX/MACOS BASH: python cli.py config update-server-input-guardrails --config-name 'production-config' --server-name 'echo_server' --policy '{"enabled": true, "policy_name": "Custom Policy", "additional_config": {"pii_redaction": true}, "block": ["policy_violation", "sensitive_data"]}' FILE-BASED (ALL PLATFORMS): python cli.py config update-server-input-guardrails --config-name "production-config" --server-name "echo_server" --policy-file "input_policy.json" =============================================================================== TROUBLESHOOTING GUIDE =============================================================================== COMMON ISSUES & SOLUTIONS: --------------------------- ISSUE: "Config 'name' not found" SOLUTION: python cli.py config list # to see available configs ISSUE: "Server 'name' not found in config" SOLUTION: python cli.py config list-servers --config-name <config> # to see available servers ISSUE: "Invalid JSON for guardrails policy" SOLUTION: - Use policy files instead of JSON strings - Validate JSON syntax in a JSON validator - Use proper escaping for your platform ISSUE: "Cannot specify both --policy and --policy-file" SOLUTION: Use either JSON string OR file, not both ISSUE: "Missing policy parameter" SOLUTION: Provide either --policy or --policy-file for single updates, or at least one policy for combined updates GUARDRAILS-SPECIFIC TROUBLESHOOTING: ------------------------------------ ERROR: update-server-input-guardrails command not found SOLUTION: Ensure you have the latest CLI version with guardrails commands ERROR: Policy validation failed SOLUTION: Check policy structure matches expected format: { "enabled": boolean, "policy_name": "string", "additional_config": { ... }, "block": ["array", "of", "strings"] } ERROR: Server not found for guardrails update SOLUTION: 1. Verify server exists: python cli.py config get-server --config-name <config> --server-name <server> 2. Check server was created with proper name spelling =============================================================================== BEST PRACTICES =============================================================================== GUARDRAILS MANAGEMENT: ---------------------- 1. Use descriptive policy names for easier identification 2. Test guardrails policies in staging before production 3. Use policy files for complex configurations 4. Version control your policy files 5. Validate configurations after guardrails updates 6. Regular backups before major guardrails changes POLICY FILE ORGANIZATION: ------------------------- - input_policies/ - basic_input.json - strict_input.json - staging_input.json - output_policies/ - basic_output.json - strict_output.json - staging_output.json WORKFLOW RECOMMENDATIONS: ------------------------- 1. Create and test policy files first 2. Apply to staging servers for testing 3. Validate server configurations 4. Export configurations for backup 5. Apply to production servers 6. Monitor and adjust as needed SECURITY CONSIDERATIONS: ------------------------ - Enable appropriate guardrails for production environments - Use stricter policies for sensitive data processing - Regular review and update of guardrails policies - Test edge cases with your specific use cases - Monitor guardrails effectiveness through logs =============================================================================== USAGE INSTRUCTIONS =============================================================================== FOR TESTING: ------------ 1. Save the test file as: test_all_commands_enhanced_guardrails.py 2. Ensure cli.py is in the same directory or use secure-mcp-gateway command 3. Run: python test_all_commands_enhanced_guardrails.py 4. Review the detailed output and summary 5. Check created artifacts including policy files 6. Original configuration is automatically restored FOR PRODUCTION USE: ------------------- 1. Create your policy JSON files using the examples above 2. Test commands in a development environment first 3. Use file-based policies for complex configurations 4. Always backup before making changes: python cli.py system backup --output-file backup.json 5. Validate after changes: python cli.py config validate --config-name <config> 6. Monitor system health: python cli.py system health-check =============================================================================== COMMAND SUMMARY BY CATEGORY =============================================================================== SETUP: 4 commands CONFIG (BASIC): 20+ commands CONFIG (SERVERS): 15+ commands CONFIG (GUARDRAILS): 12+ commands ⭐ NEW CONFIG (MANAGEMENT): 10+ commands PROJECT: 20+ commands USER (BASIC): 15+ commands USER (API KEYS): 15+ commands SYSTEM: 5+ commands ERRORS: 25+ commands (including 5+ guardrails errors) ⭐ NEW WORKFLOWS: 31+ commands (including 8+ guardrails workflow) ⭐ NEW HELP: 13+ commands (including 3+ guardrails help) ⭐ NEW CLEANUP: 36+ commands TOTAL: ~210+ COMMANDS TESTED ⭐ NEW FEATURES: - 12+ Guardrails update commands - 5+ Guardrails error scenarios - 8+ Guardrails workflow commands - 3+ Guardrails help commands - 4+ Policy file artifacts - Cross-platform JSON handling for guardrails - Comprehensive guardrails management workflows =============================================================================== END OF COMPREHENSIVE TEST REFERENCE WITH GUARDRAILS ===============================================================================

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/enkryptai/secure-mcp-gateway'

If you have feedback or need assistance with the MCP directory API, please join our Discord server