stringray-ai 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mcp.json +68 -0
- package/LICENSE +21 -0
- package/README.md +618 -0
- package/dist/agents/architect.d.ts +3 -0
- package/dist/agents/architect.d.ts.map +1 -0
- package/dist/agents/architect.js +84 -0
- package/dist/agents/architect.js.map +1 -0
- package/dist/agents/bug-triage-specialist.d.ts +3 -0
- package/dist/agents/bug-triage-specialist.d.ts.map +1 -0
- package/dist/agents/bug-triage-specialist.js +66 -0
- package/dist/agents/bug-triage-specialist.js.map +1 -0
- package/dist/agents/code-reviewer.d.ts +3 -0
- package/dist/agents/code-reviewer.d.ts.map +1 -0
- package/dist/agents/code-reviewer.js +66 -0
- package/dist/agents/code-reviewer.js.map +1 -0
- package/dist/agents/enforcer.d.ts +3 -0
- package/dist/agents/enforcer.d.ts.map +1 -0
- package/dist/agents/enforcer.js +109 -0
- package/dist/agents/enforcer.js.map +1 -0
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +26 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/librarian.d.ts +3 -0
- package/dist/agents/librarian.d.ts.map +1 -0
- package/dist/agents/librarian.js +70 -0
- package/dist/agents/librarian.js.map +1 -0
- package/dist/agents/log-monitor.d.ts +3 -0
- package/dist/agents/log-monitor.d.ts.map +1 -0
- package/dist/agents/log-monitor.js +102 -0
- package/dist/agents/log-monitor.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +3 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator.js +85 -0
- package/dist/agents/orchestrator.js.map +1 -0
- package/dist/agents/refactorer.d.ts +3 -0
- package/dist/agents/refactorer.d.ts.map +1 -0
- package/dist/agents/refactorer.js +67 -0
- package/dist/agents/refactorer.js.map +1 -0
- package/dist/agents/security-auditor.d.ts +3 -0
- package/dist/agents/security-auditor.d.ts.map +1 -0
- package/dist/agents/security-auditor.js +66 -0
- package/dist/agents/security-auditor.js.map +1 -0
- package/dist/agents/sisyphus.d.ts +3 -0
- package/dist/agents/sisyphus.d.ts.map +1 -0
- package/dist/agents/sisyphus.js +53 -0
- package/dist/agents/sisyphus.js.map +1 -0
- package/dist/agents/test-architect.d.ts +3 -0
- package/dist/agents/test-architect.d.ts.map +1 -0
- package/dist/agents/test-architect.js +81 -0
- package/dist/agents/test-architect.js.map +1 -0
- package/dist/agents/types.d.ts +29 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/mcps/architect-tools.server.d.ts +40 -0
- package/dist/mcps/architect-tools.server.d.ts.map +1 -0
- package/dist/mcps/architect-tools.server.js +563 -0
- package/dist/mcps/architect-tools.server.js.map +1 -0
- package/dist/mcps/auto-format.server.d.ts +20 -0
- package/dist/mcps/auto-format.server.d.ts.map +1 -0
- package/dist/mcps/auto-format.server.js +391 -0
- package/dist/mcps/auto-format.server.js.map +1 -0
- package/dist/mcps/boot-orchestrator.server.d.ts +50 -0
- package/dist/mcps/boot-orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/boot-orchestrator.server.js +871 -0
- package/dist/mcps/boot-orchestrator.server.js.map +1 -0
- package/dist/mcps/enforcer-tools.server.d.ts +26 -0
- package/dist/mcps/enforcer-tools.server.d.ts.map +1 -0
- package/dist/mcps/enforcer-tools.server.js +627 -0
- package/dist/mcps/enforcer-tools.server.js.map +1 -0
- package/dist/mcps/enhanced-orchestrator.server.d.ts +14 -0
- package/dist/mcps/enhanced-orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/enhanced-orchestrator.server.js +250 -0
- package/dist/mcps/enhanced-orchestrator.server.js.map +1 -0
- package/dist/mcps/framework-compliance-audit.server.d.ts +23 -0
- package/dist/mcps/framework-compliance-audit.server.d.ts.map +1 -0
- package/dist/mcps/framework-compliance-audit.server.js +511 -0
- package/dist/mcps/framework-compliance-audit.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/api-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.js +120 -0
- package/dist/mcps/knowledge-skills/api-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +110 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +32 -0
- package/dist/mcps/knowledge-skills/code-review.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.js +777 -0
- package/dist/mcps/knowledge-skills/code-review.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +44 -0
- package/dist/mcps/knowledge-skills/database-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.js +818 -0
- package/dist/mcps/knowledge-skills/database-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +44 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +1178 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.d.ts +48 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.js +1188 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js +112 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +108 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js +710 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +794 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js +769 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +37 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +865 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +47 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +672 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +42 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +1016 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js.map +1 -0
- package/dist/mcps/lint.server.d.ts +18 -0
- package/dist/mcps/lint.server.d.ts.map +1 -0
- package/dist/mcps/lint.server.js +334 -0
- package/dist/mcps/lint.server.js.map +1 -0
- package/dist/mcps/model-health-check.server.d.ts +17 -0
- package/dist/mcps/model-health-check.server.d.ts.map +1 -0
- package/dist/mcps/model-health-check.server.js +226 -0
- package/dist/mcps/model-health-check.server.js.map +1 -0
- package/dist/mcps/orchestrator.server.d.ts +39 -0
- package/dist/mcps/orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/orchestrator.server.js +908 -0
- package/dist/mcps/orchestrator.server.js.map +1 -0
- package/dist/mcps/performance-analysis.server.d.ts +28 -0
- package/dist/mcps/performance-analysis.server.d.ts.map +1 -0
- package/dist/mcps/performance-analysis.server.js +514 -0
- package/dist/mcps/performance-analysis.server.js.map +1 -0
- package/dist/mcps/processor-pipeline.server.d.ts +29 -0
- package/dist/mcps/processor-pipeline.server.d.ts.map +1 -0
- package/dist/mcps/processor-pipeline.server.js +520 -0
- package/dist/mcps/processor-pipeline.server.js.map +1 -0
- package/dist/mcps/security-scan.server.d.ts +20 -0
- package/dist/mcps/security-scan.server.d.ts.map +1 -0
- package/dist/mcps/security-scan.server.js +404 -0
- package/dist/mcps/security-scan.server.js.map +1 -0
- package/dist/mcps/state-manager.server.d.ts +29 -0
- package/dist/mcps/state-manager.server.d.ts.map +1 -0
- package/dist/mcps/state-manager.server.js +620 -0
- package/dist/mcps/state-manager.server.js.map +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +109 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +337 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js.map +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.d.ts +112 -0
- package/dist/orchestrator/intelligent-commit-batcher.d.ts.map +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.js +330 -0
- package/dist/orchestrator/intelligent-commit-batcher.js.map +1 -0
- package/dist/plugin/agents/architect.d.ts +3 -0
- package/dist/plugin/agents/architect.d.ts.map +1 -0
- package/dist/plugin/agents/architect.js +84 -0
- package/dist/plugin/agents/architect.js.map +1 -0
- package/dist/plugin/agents/bug-triage-specialist.d.ts +3 -0
- package/dist/plugin/agents/bug-triage-specialist.d.ts.map +1 -0
- package/dist/plugin/agents/bug-triage-specialist.js +66 -0
- package/dist/plugin/agents/bug-triage-specialist.js.map +1 -0
- package/dist/plugin/agents/code-reviewer.d.ts +3 -0
- package/dist/plugin/agents/code-reviewer.d.ts.map +1 -0
- package/dist/plugin/agents/code-reviewer.js +66 -0
- package/dist/plugin/agents/code-reviewer.js.map +1 -0
- package/dist/plugin/agents/enforcer.d.ts +3 -0
- package/dist/plugin/agents/enforcer.d.ts.map +1 -0
- package/dist/plugin/agents/enforcer.js +109 -0
- package/dist/plugin/agents/enforcer.js.map +1 -0
- package/dist/plugin/agents/index.d.ts +15 -0
- package/dist/plugin/agents/index.d.ts.map +1 -0
- package/dist/plugin/agents/index.js +26 -0
- package/dist/plugin/agents/index.js.map +1 -0
- package/dist/plugin/agents/librarian.d.ts +3 -0
- package/dist/plugin/agents/librarian.d.ts.map +1 -0
- package/dist/plugin/agents/librarian.js +70 -0
- package/dist/plugin/agents/librarian.js.map +1 -0
- package/dist/plugin/agents/log-monitor.d.ts +3 -0
- package/dist/plugin/agents/log-monitor.d.ts.map +1 -0
- package/dist/plugin/agents/log-monitor.js +102 -0
- package/dist/plugin/agents/log-monitor.js.map +1 -0
- package/dist/plugin/agents/orchestrator.d.ts +3 -0
- package/dist/plugin/agents/orchestrator.d.ts.map +1 -0
- package/dist/plugin/agents/orchestrator.js +85 -0
- package/dist/plugin/agents/orchestrator.js.map +1 -0
- package/dist/plugin/agents/refactorer.d.ts +3 -0
- package/dist/plugin/agents/refactorer.d.ts.map +1 -0
- package/dist/plugin/agents/refactorer.js +67 -0
- package/dist/plugin/agents/refactorer.js.map +1 -0
- package/dist/plugin/agents/security-auditor.d.ts +3 -0
- package/dist/plugin/agents/security-auditor.d.ts.map +1 -0
- package/dist/plugin/agents/security-auditor.js +66 -0
- package/dist/plugin/agents/security-auditor.js.map +1 -0
- package/dist/plugin/agents/sisyphus.d.ts +3 -0
- package/dist/plugin/agents/sisyphus.d.ts.map +1 -0
- package/dist/plugin/agents/sisyphus.js +53 -0
- package/dist/plugin/agents/sisyphus.js.map +1 -0
- package/dist/plugin/agents/test-architect.d.ts +3 -0
- package/dist/plugin/agents/test-architect.d.ts.map +1 -0
- package/dist/plugin/agents/test-architect.js +81 -0
- package/dist/plugin/agents/test-architect.js.map +1 -0
- package/dist/plugin/agents/types.d.ts +29 -0
- package/dist/plugin/agents/types.d.ts.map +1 -0
- package/dist/plugin/agents/types.js +2 -0
- package/dist/plugin/agents/types.js.map +1 -0
- package/dist/plugin/config-loader.d.ts +67 -0
- package/dist/plugin/config-loader.d.ts.map +1 -0
- package/dist/plugin/config-loader.js +125 -0
- package/dist/plugin/config-loader.js.map +1 -0
- package/dist/plugin/context-loader.d.ts +122 -0
- package/dist/plugin/context-loader.d.ts.map +1 -0
- package/dist/plugin/context-loader.js +273 -0
- package/dist/plugin/context-loader.js.map +1 -0
- package/dist/plugin/delegation/agent-delegator.d.ts +217 -0
- package/dist/plugin/delegation/agent-delegator.d.ts.map +1 -0
- package/dist/plugin/delegation/agent-delegator.js +928 -0
- package/dist/plugin/delegation/agent-delegator.js.map +1 -0
- package/dist/plugin/delegation/codebase-context-analyzer.d.ts +157 -0
- package/dist/plugin/delegation/codebase-context-analyzer.d.ts.map +1 -0
- package/dist/plugin/delegation/codebase-context-analyzer.js +1029 -0
- package/dist/plugin/delegation/codebase-context-analyzer.js.map +1 -0
- package/dist/plugin/delegation/complexity-analyzer.d.ts +61 -0
- package/dist/plugin/delegation/complexity-analyzer.d.ts.map +1 -0
- package/dist/plugin/delegation/complexity-analyzer.js +253 -0
- package/dist/plugin/delegation/complexity-analyzer.js.map +1 -0
- package/dist/plugin/enforcement/enforcer-tools.d.ts +62 -0
- package/dist/plugin/enforcement/enforcer-tools.d.ts.map +1 -0
- package/dist/plugin/enforcement/enforcer-tools.js +407 -0
- package/dist/plugin/enforcement/enforcer-tools.js.map +1 -0
- package/dist/plugin/enforcement/rule-enforcer.d.ts +171 -0
- package/dist/plugin/enforcement/rule-enforcer.d.ts.map +1 -0
- package/dist/plugin/enforcement/rule-enforcer.js +1342 -0
- package/dist/plugin/enforcement/rule-enforcer.js.map +1 -0
- package/dist/plugin/enforcement/test-auto-healing.d.ts +78 -0
- package/dist/plugin/enforcement/test-auto-healing.d.ts.map +1 -0
- package/dist/plugin/enforcement/test-auto-healing.js +318 -0
- package/dist/plugin/enforcement/test-auto-healing.js.map +1 -0
- package/dist/plugin/framework-logger.d.ts +20 -0
- package/dist/plugin/framework-logger.d.ts.map +1 -0
- package/dist/plugin/framework-logger.js +79 -0
- package/dist/plugin/framework-logger.js.map +1 -0
- package/dist/plugin/logging-config.d.ts +11 -0
- package/dist/plugin/logging-config.d.ts.map +1 -0
- package/dist/plugin/logging-config.js +44 -0
- package/dist/plugin/logging-config.js.map +1 -0
- package/dist/plugin/mcps/architect-tools.server.d.ts +40 -0
- package/dist/plugin/mcps/architect-tools.server.d.ts.map +1 -0
- package/dist/plugin/mcps/architect-tools.server.js +563 -0
- package/dist/plugin/mcps/architect-tools.server.js.map +1 -0
- package/dist/plugin/mcps/auto-format.server.d.ts +20 -0
- package/dist/plugin/mcps/auto-format.server.d.ts.map +1 -0
- package/dist/plugin/mcps/auto-format.server.js +391 -0
- package/dist/plugin/mcps/auto-format.server.js.map +1 -0
- package/dist/plugin/mcps/boot-orchestrator.server.d.ts +50 -0
- package/dist/plugin/mcps/boot-orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/boot-orchestrator.server.js +871 -0
- package/dist/plugin/mcps/boot-orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/enforcer-tools.server.d.ts +26 -0
- package/dist/plugin/mcps/enforcer-tools.server.d.ts.map +1 -0
- package/dist/plugin/mcps/enforcer-tools.server.js +627 -0
- package/dist/plugin/mcps/enforcer-tools.server.js.map +1 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.d.ts +14 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.js +250 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.d.ts +23 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.d.ts.map +1 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.js +511 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.js +120 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.js +110 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.d.ts +32 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.js +777 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.d.ts +44 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.js +818 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.d.ts +44 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.js +1178 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.d.ts +48 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.js +1188 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.js +112 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.js +108 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.js +710 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.js +794 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.js +769 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.d.ts +37 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.js +865 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.d.ts +47 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.js +672 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.d.ts +42 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.js +1016 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.js.map +1 -0
- package/dist/plugin/mcps/lint.server.d.ts +18 -0
- package/dist/plugin/mcps/lint.server.d.ts.map +1 -0
- package/dist/plugin/mcps/lint.server.js +334 -0
- package/dist/plugin/mcps/lint.server.js.map +1 -0
- package/dist/plugin/mcps/model-health-check.server.d.ts +17 -0
- package/dist/plugin/mcps/model-health-check.server.d.ts.map +1 -0
- package/dist/plugin/mcps/model-health-check.server.js +226 -0
- package/dist/plugin/mcps/model-health-check.server.js.map +1 -0
- package/dist/plugin/mcps/orchestrator.server.d.ts +39 -0
- package/dist/plugin/mcps/orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/orchestrator.server.js +908 -0
- package/dist/plugin/mcps/orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/performance-analysis.server.d.ts +28 -0
- package/dist/plugin/mcps/performance-analysis.server.d.ts.map +1 -0
- package/dist/plugin/mcps/performance-analysis.server.js +514 -0
- package/dist/plugin/mcps/performance-analysis.server.js.map +1 -0
- package/dist/plugin/mcps/processor-pipeline.server.d.ts +29 -0
- package/dist/plugin/mcps/processor-pipeline.server.d.ts.map +1 -0
- package/dist/plugin/mcps/processor-pipeline.server.js +520 -0
- package/dist/plugin/mcps/processor-pipeline.server.js.map +1 -0
- package/dist/plugin/mcps/security-scan.server.d.ts +20 -0
- package/dist/plugin/mcps/security-scan.server.d.ts.map +1 -0
- package/dist/plugin/mcps/security-scan.server.js +404 -0
- package/dist/plugin/mcps/security-scan.server.js.map +1 -0
- package/dist/plugin/mcps/state-manager.server.d.ts +29 -0
- package/dist/plugin/mcps/state-manager.server.d.ts.map +1 -0
- package/dist/plugin/mcps/state-manager.server.js +620 -0
- package/dist/plugin/mcps/state-manager.server.js.map +1 -0
- package/dist/plugin/monitoring/advanced-profiler.d.ts +48 -0
- package/dist/plugin/monitoring/advanced-profiler.d.ts.map +1 -0
- package/dist/plugin/monitoring/advanced-profiler.js +216 -0
- package/dist/plugin/monitoring/advanced-profiler.js.map +1 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.d.ts +331 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.d.ts.map +1 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.js +797 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.js.map +1 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.d.ts +111 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.js +339 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.js.map +1 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.d.ts +112 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.d.ts.map +1 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.js +330 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.js.map +1 -0
- package/dist/plugin/orchestrator.d.ts +91 -0
- package/dist/plugin/orchestrator.d.ts.map +1 -0
- package/dist/plugin/orchestrator.js +444 -0
- package/dist/plugin/orchestrator.js.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.d.ts +108 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.d.ts.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.js +620 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.js.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.d.ts +468 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.d.ts.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.js +11 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.js.map +1 -0
- package/dist/plugin/plugins/plugin-system.d.ts +152 -0
- package/dist/plugin/plugins/plugin-system.d.ts.map +1 -0
- package/dist/plugin/plugins/plugin-system.js +405 -0
- package/dist/plugin/plugins/plugin-system.js.map +1 -0
- package/dist/plugin/plugins/stringray-codex-injection.d.ts +68 -0
- package/dist/plugin/plugins/stringray-codex-injection.d.ts.map +1 -0
- package/dist/plugin/plugins/stringray-codex-injection.js +225 -0
- package/dist/plugin/plugins/stringray-codex-injection.js.map +1 -0
- package/dist/plugin/plugins/strray-codex-injection.d.ts +68 -0
- package/dist/plugin/plugins/strray-codex-injection.d.ts.map +1 -0
- package/dist/plugin/plugins/strray-codex-injection.js +225 -0
- package/dist/plugin/plugins/strray-codex-injection.js.map +1 -0
- package/dist/plugin/processors/index.d.ts +12 -0
- package/dist/plugin/processors/index.d.ts.map +1 -0
- package/dist/plugin/processors/index.js +12 -0
- package/dist/plugin/processors/index.js.map +1 -0
- package/dist/plugin/processors/processor-manager.d.ts +113 -0
- package/dist/plugin/processors/processor-manager.d.ts.map +1 -0
- package/dist/plugin/processors/processor-manager.js +498 -0
- package/dist/plugin/processors/processor-manager.js.map +1 -0
- package/dist/plugin/processors/processor-types.d.ts +50 -0
- package/dist/plugin/processors/processor-types.d.ts.map +1 -0
- package/dist/plugin/processors/processor-types.js +10 -0
- package/dist/plugin/processors/processor-types.js.map +1 -0
- package/dist/plugin/processors/refactoring-logging-processor.d.ts +61 -0
- package/dist/plugin/processors/refactoring-logging-processor.d.ts.map +1 -0
- package/dist/plugin/processors/refactoring-logging-processor.js +257 -0
- package/dist/plugin/processors/refactoring-logging-processor.js.map +1 -0
- package/dist/plugin/reporting/framework-reporting-system.d.ts +157 -0
- package/dist/plugin/reporting/framework-reporting-system.d.ts.map +1 -0
- package/dist/plugin/reporting/framework-reporting-system.js +783 -0
- package/dist/plugin/reporting/framework-reporting-system.js.map +1 -0
- package/dist/plugin/security/security-hardening-system.d.ts +220 -0
- package/dist/plugin/security/security-hardening-system.d.ts.map +1 -0
- package/dist/plugin/security/security-hardening-system.js +605 -0
- package/dist/plugin/security/security-hardening-system.js.map +1 -0
- package/dist/plugin/state/context-providers.d.ts +5 -0
- package/dist/plugin/state/context-providers.d.ts.map +1 -0
- package/dist/plugin/state/context-providers.js +2 -0
- package/dist/plugin/state/context-providers.js.map +1 -0
- package/dist/plugin/state/index.d.ts +5 -0
- package/dist/plugin/state/index.d.ts.map +1 -0
- package/dist/plugin/state/index.js +8 -0
- package/dist/plugin/state/index.js.map +1 -0
- package/dist/plugin/state/state-manager.d.ts +29 -0
- package/dist/plugin/state/state-manager.d.ts.map +1 -0
- package/dist/plugin/state/state-manager.js +153 -0
- package/dist/plugin/state/state-manager.js.map +1 -0
- package/dist/plugin/state/state-types.d.ts +6 -0
- package/dist/plugin/state/state-types.d.ts.map +1 -0
- package/dist/plugin/state/state-types.js +2 -0
- package/dist/plugin/state/state-types.js.map +1 -0
- package/dist/plugin/utils/codex-parser.d.ts +62 -0
- package/dist/plugin/utils/codex-parser.d.ts.map +1 -0
- package/dist/plugin/utils/codex-parser.js +396 -0
- package/dist/plugin/utils/codex-parser.js.map +1 -0
- package/dist/plugin/utils/command-runner.d.ts +24 -0
- package/dist/plugin/utils/command-runner.d.ts.map +1 -0
- package/dist/plugin/utils/command-runner.js +44 -0
- package/dist/plugin/utils/command-runner.js.map +1 -0
- package/dist/plugin/utils/import-resolver.d.ts +55 -0
- package/dist/plugin/utils/import-resolver.d.ts.map +1 -0
- package/dist/plugin/utils/import-resolver.js +198 -0
- package/dist/plugin/utils/import-resolver.js.map +1 -0
- package/dist/plugin/utils/memory-pool.d.ts +90 -0
- package/dist/plugin/utils/memory-pool.d.ts.map +1 -0
- package/dist/plugin/utils/memory-pool.js +245 -0
- package/dist/plugin/utils/memory-pool.js.map +1 -0
- package/dist/plugin/utils/path-resolver.d.ts +49 -0
- package/dist/plugin/utils/path-resolver.d.ts.map +1 -0
- package/dist/plugin/utils/path-resolver.js +126 -0
- package/dist/plugin/utils/path-resolver.js.map +1 -0
- package/dist/plugin/utils/test-template-generator.d.ts +26 -0
- package/dist/plugin/utils/test-template-generator.d.ts.map +1 -0
- package/dist/plugin/utils/test-template-generator.js +178 -0
- package/dist/plugin/utils/test-template-generator.js.map +1 -0
- package/dist/processors/index.d.ts +12 -0
- package/dist/processors/index.d.ts.map +1 -0
- package/dist/processors/index.js +12 -0
- package/dist/processors/index.js.map +1 -0
- package/dist/processors/processor-manager.d.ts +113 -0
- package/dist/processors/processor-manager.d.ts.map +1 -0
- package/dist/processors/processor-manager.js +498 -0
- package/dist/processors/processor-manager.js.map +1 -0
- package/dist/processors/processor-types.d.ts +50 -0
- package/dist/processors/processor-types.d.ts.map +1 -0
- package/dist/processors/processor-types.js +10 -0
- package/dist/processors/processor-types.js.map +1 -0
- package/dist/processors/refactoring-logging-processor.d.ts +61 -0
- package/dist/processors/refactoring-logging-processor.d.ts.map +1 -0
- package/dist/processors/refactoring-logging-processor.js +257 -0
- package/dist/processors/refactoring-logging-processor.js.map +1 -0
- package/dist/state/context-providers.d.ts +5 -0
- package/dist/state/context-providers.d.ts.map +1 -0
- package/dist/state/context-providers.js +2 -0
- package/dist/state/context-providers.js.map +1 -0
- package/dist/state/index.d.ts +5 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +8 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/state-manager.d.ts +29 -0
- package/dist/state/state-manager.d.ts.map +1 -0
- package/dist/state/state-manager.js +153 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/state/state-types.d.ts +6 -0
- package/dist/state/state-types.d.ts.map +1 -0
- package/dist/state/state-types.js +2 -0
- package/dist/state/state-types.js.map +1 -0
- package/dist/utils/codex-parser.d.ts +62 -0
- package/dist/utils/codex-parser.d.ts.map +1 -0
- package/dist/utils/codex-parser.js +396 -0
- package/dist/utils/codex-parser.js.map +1 -0
- package/dist/utils/command-runner.d.ts +24 -0
- package/dist/utils/command-runner.d.ts.map +1 -0
- package/dist/utils/command-runner.js +44 -0
- package/dist/utils/command-runner.js.map +1 -0
- package/dist/utils/import-resolver.d.ts +55 -0
- package/dist/utils/import-resolver.d.ts.map +1 -0
- package/dist/utils/import-resolver.js +198 -0
- package/dist/utils/import-resolver.js.map +1 -0
- package/dist/utils/memory-pool.d.ts +90 -0
- package/dist/utils/memory-pool.d.ts.map +1 -0
- package/dist/utils/memory-pool.js +245 -0
- package/dist/utils/memory-pool.js.map +1 -0
- package/dist/utils/path-resolver.d.ts +49 -0
- package/dist/utils/path-resolver.d.ts.map +1 -0
- package/dist/utils/path-resolver.js +126 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/test-template-generator.d.ts +26 -0
- package/dist/utils/test-template-generator.d.ts.map +1 -0
- package/dist/utils/test-template-generator.js +178 -0
- package/dist/utils/test-template-generator.js.map +1 -0
- package/package.json +138 -0
- package/scripts/analysis/analyze-context-awareness.ts +219 -0
- package/scripts/analysis/analyze-framework-usage.ts +208 -0
- package/scripts/analysis/analyzer-agent-runner.js +328 -0
- package/scripts/analysis/context-awareness-report.ts +250 -0
- package/scripts/analyze-imports.mjs +147 -0
- package/scripts/basic-security-audit.cjs +261 -0
- package/scripts/boot-check.cjs +188 -0
- package/scripts/build/check-syntax.sh +1 -0
- package/scripts/build/check-tsc.sh +1 -0
- package/scripts/build/check-types.sh +1 -0
- package/scripts/build/compile-single.sh +1 -0
- package/scripts/build/copy-plugin.sh +1 -0
- package/scripts/build/manual-build.sh +1 -0
- package/scripts/build/run-build-after-copy.sh +1 -0
- package/scripts/build/run-build-attempt.sh +1 -0
- package/scripts/build/run-build-errors-grep.sh +1 -0
- package/scripts/build/run-build-errors.sh +1 -0
- package/scripts/build/run-build-limited.sh +1 -0
- package/scripts/build/run-build-list.sh +1 -0
- package/scripts/build/run-build.sh +1 -0
- package/scripts/build/run-limited.sh +1 -0
- package/scripts/build/run-tsc-direct.sh +1 -0
- package/scripts/build/run-type-check.sh +1 -0
- package/scripts/build/run-typecheck.sh +1 -0
- package/scripts/build/test-build.sh +1 -0
- package/scripts/check-logs.sh +62 -0
- package/scripts/debug/debug-context-enhancement.ts +116 -0
- package/scripts/debug/debug-rules.mjs +23 -0
- package/scripts/demo/demo-clickable-monitoring.mjs +116 -0
- package/scripts/demo/profiling-demo.js +108 -0
- package/scripts/demo/profiling-demo.ts +126 -0
- package/scripts/demo/reporting-demonstration.ts +184 -0
- package/scripts/demo/reporting-examples.ts +105 -0
- package/scripts/dependency-scan.cjs +111 -0
- package/scripts/deploy-stringray-plugin.sh +323 -0
- package/scripts/disable-logging.sh +20 -0
- package/scripts/extract-framework.sh +405 -0
- package/scripts/fix-mcp-capabilities.js +83 -0
- package/scripts/framework/advanced-profiling-integration.sh +384 -0
- package/scripts/framework/check-agent-orchestration-health.sh +113 -0
- package/scripts/framework/enterprise-analysis-test.sh +174 -0
- package/scripts/framework/implement-analyzer-agent.sh +393 -0
- package/scripts/framework/merge-mcp-configs.sh +201 -0
- package/scripts/framework/validate-multi-agent-orchestration.sh +195 -0
- package/scripts/framework/validate-profiling.sh +64 -0
- package/scripts/github-actions-monitor.cjs +289 -0
- package/scripts/init.ts +121 -0
- package/scripts/monitoring/initialize-monitoring-pipeline.sh +89 -0
- package/scripts/monitoring/memory-dashboard.sh +52 -0
- package/scripts/monitoring/monitoring-daemon.mjs +67 -0
- package/scripts/monitoring/monitoring-daemon.sh +190 -0
- package/scripts/monitoring/profiling-dashboard.sh +69 -0
- package/scripts/performance-report.js +56 -0
- package/scripts/postinstall.cjs +240 -0
- package/scripts/profile-performance.sh +263 -0
- package/scripts/register-mcp-servers-fixed.sh +74 -0
- package/scripts/register-mcp-servers.sh +96 -0
- package/scripts/reporting/generate-phase1-report.js +28 -0
- package/scripts/reporting/run-postprocessor.js +59 -0
- package/scripts/reporting/trigger-report.js +15 -0
- package/scripts/run-simulations.mjs +29 -0
- package/scripts/scenario-data-processor.py +122 -0
- package/scripts/scenarios/scenario-security-check.ts +60 -0
- package/scripts/scenarios/scenario-user-management.ts +123 -0
- package/scripts/setup.cjs +128 -0
- package/scripts/simulation/run-simulations.js +84 -0
- package/scripts/simulation/simulate-full-orchestrator.ts +239 -0
- package/scripts/strray-triage.sh +349 -0
- package/scripts/test/run-memory-regression.sh +45 -0
- package/scripts/test/run-test.sh +2 -0
- package/scripts/test/test-deployment.sh +552 -0
- package/scripts/test/test-enhanced-report.ts +24 -0
- package/scripts/test/test-graceful-shutdown.sh +35 -0
- package/scripts/test/test-integration.mjs +79 -0
- package/scripts/test/test-manual-orchestration.sh +168 -0
- package/scripts/test/test-max-agents.sh +70 -0
- package/scripts/test/test-memory-monitor.sh +40 -0
- package/scripts/test/test-memory-pools.sh +58 -0
- package/scripts/test/test-module.ts +1 -0
- package/scripts/test/test-multi-agent-trigger.sh +251 -0
- package/scripts/test/test-orchestrator.txt +1 -0
- package/scripts/test/test-postinstall.js +1 -0
- package/scripts/test/test-security-module.ts +27 -0
- package/scripts/test/test-session-management.js +135 -0
- package/scripts/test/test-simulation.mjs +14 -0
- package/scripts/test/test-user-service.ts +111 -0
- package/scripts/test-comprehensive-path-resolution.mjs +62 -0
- package/scripts/test-data-processor.py +51 -0
- package/scripts/test-enforcement-e2e.mjs +127 -0
- package/scripts/test-full-plugin-no-timeout.sh +30 -0
- package/scripts/test-path-resolver.mjs +32 -0
- package/scripts/test-rules.mjs +128 -0
- package/scripts/test-stringray-plugin.mjs +66 -0
- package/scripts/test-utils/smart-test-runner.mjs +609 -0
- package/scripts/test-utils/test-quarantine.mjs +246 -0
- package/scripts/validate-codex.js +60 -0
- package/scripts/validate-phase1.mjs +189 -0
- package/scripts/validation/run-validators.js +114 -0
- package/scripts/validation/validate-external-processes.js +240 -0
- package/scripts/validation/validate-mcp-connectivity.js +165 -0
- package/scripts/validation/validate-oh-my-opencode-integration.js +200 -0
- package/scripts/validation/validate-reports.ts +114 -0
- package/scripts/verify-phase1.js +144 -0
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StrRay Security Audit MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Knowledge skill for comprehensive security analysis, vulnerability assessment,
|
|
5
|
+
* and compliance validation - ensures production-ready security posture
|
|
6
|
+
*/
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import * as fs from "fs";
|
|
11
|
+
import * as path from "path";
|
|
12
|
+
class StrRaySecurityAuditServer {
|
|
13
|
+
server;
|
|
14
|
+
constructor() {
|
|
15
|
+
this.server = new Server({
|
|
16
|
+
name: "strray-security-audit",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
}, {
|
|
19
|
+
capabilities: {
|
|
20
|
+
tools: {},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
this.setupToolHandlers();
|
|
24
|
+
console.log("StrRay Security Audit MCP Server initialized");
|
|
25
|
+
}
|
|
26
|
+
setupToolHandlers() {
|
|
27
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
28
|
+
return {
|
|
29
|
+
tools: [
|
|
30
|
+
{
|
|
31
|
+
name: "audit_security",
|
|
32
|
+
description: "Perform comprehensive security audit on codebase files",
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
files: {
|
|
37
|
+
type: "array",
|
|
38
|
+
items: { type: "string" },
|
|
39
|
+
description: "List of file paths to audit",
|
|
40
|
+
},
|
|
41
|
+
includeDependencies: {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
description: "Include dependency vulnerability analysis",
|
|
44
|
+
default: true,
|
|
45
|
+
},
|
|
46
|
+
complianceFrameworks: {
|
|
47
|
+
type: "array",
|
|
48
|
+
items: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: ["owasp-top-10", "nist", "iso-27001", "pci-dss"],
|
|
51
|
+
},
|
|
52
|
+
description: "Compliance frameworks to check against",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ["files"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "check_vulnerability",
|
|
60
|
+
description: "Check specific security vulnerability patterns in a file",
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
filePath: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Path to the file to check",
|
|
67
|
+
},
|
|
68
|
+
vulnerabilityType: {
|
|
69
|
+
type: "string",
|
|
70
|
+
enum: [
|
|
71
|
+
"injection",
|
|
72
|
+
"authentication",
|
|
73
|
+
"authorization",
|
|
74
|
+
"cryptography",
|
|
75
|
+
"xss",
|
|
76
|
+
"csrf",
|
|
77
|
+
"secrets",
|
|
78
|
+
"configuration",
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
severity: {
|
|
82
|
+
type: "string",
|
|
83
|
+
enum: ["critical", "high", "medium", "low", "info"],
|
|
84
|
+
description: "Minimum severity level to report",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
required: ["filePath", "vulnerabilityType"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "generate_security_report",
|
|
92
|
+
description: "Generate comprehensive security report with remediation steps",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
auditResults: {
|
|
97
|
+
type: "object",
|
|
98
|
+
description: "Results from audit_security tool",
|
|
99
|
+
},
|
|
100
|
+
format: {
|
|
101
|
+
type: "string",
|
|
102
|
+
enum: ["markdown", "json", "html"],
|
|
103
|
+
default: "markdown",
|
|
104
|
+
},
|
|
105
|
+
includeRemediation: {
|
|
106
|
+
type: "boolean",
|
|
107
|
+
default: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
required: ["auditResults"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
117
|
+
const { name, arguments: args } = request.params;
|
|
118
|
+
switch (name) {
|
|
119
|
+
case "audit_security":
|
|
120
|
+
return await this.auditSecurity(args);
|
|
121
|
+
case "check_vulnerability":
|
|
122
|
+
return await this.checkVulnerability(args);
|
|
123
|
+
case "generate_security_report":
|
|
124
|
+
return await this.generateSecurityReport(args);
|
|
125
|
+
default:
|
|
126
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async auditSecurity(args) {
|
|
131
|
+
const { files, includeDependencies = true, complianceFrameworks = ["owasp-top-10"], } = args;
|
|
132
|
+
try {
|
|
133
|
+
const vulnerabilities = [];
|
|
134
|
+
let totalFiles = 0;
|
|
135
|
+
for (const filePath of files) {
|
|
136
|
+
if (!fs.existsSync(filePath)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
totalFiles++;
|
|
140
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
141
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
142
|
+
const language = this.detectLanguage(extension);
|
|
143
|
+
const fileVulnerabilities = this.analyzeFileForVulnerabilities(content, filePath, language);
|
|
144
|
+
vulnerabilities.push(...fileVulnerabilities);
|
|
145
|
+
}
|
|
146
|
+
// Generate compliance analysis
|
|
147
|
+
const compliance = this.analyzeCompliance(vulnerabilities, complianceFrameworks);
|
|
148
|
+
// Calculate summary metrics
|
|
149
|
+
const summary = this.calculateSecuritySummary(vulnerabilities, totalFiles);
|
|
150
|
+
const report = {
|
|
151
|
+
summary,
|
|
152
|
+
vulnerabilities,
|
|
153
|
+
recommendations: this.generateRecommendations(vulnerabilities, compliance),
|
|
154
|
+
compliance,
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
content: [
|
|
158
|
+
{
|
|
159
|
+
type: "text",
|
|
160
|
+
text: `Security Audit Report:\n\n` +
|
|
161
|
+
`📊 SUMMARY\n` +
|
|
162
|
+
`Files Analyzed: ${totalFiles}\n` +
|
|
163
|
+
`Vulnerabilities Found: ${vulnerabilities.length}\n` +
|
|
164
|
+
`Critical: ${summary.criticalCount} | High: ${summary.highCount} | Medium: ${summary.mediumCount} | Low: ${summary.lowCount}\n` +
|
|
165
|
+
`Overall Risk Score: ${summary.overallRiskScore}/100\n` +
|
|
166
|
+
`Compliance Score: ${summary.complianceScore}/100\n\n` +
|
|
167
|
+
`🚨 TOP VULNERABILITIES\n${vulnerabilities
|
|
168
|
+
.slice(0, 5)
|
|
169
|
+
.map((v) => `${this.getSeverityIcon(v.severity)} ${v.title} (${v.category}) - ${v.file}:${v.line}`)
|
|
170
|
+
.join("\n")}\n\n` +
|
|
171
|
+
`💡 KEY RECOMMENDATIONS\n${report.recommendations
|
|
172
|
+
.slice(0, 3)
|
|
173
|
+
.map((r) => `• ${r}`)
|
|
174
|
+
.join("\n")}`,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
data: report, // Include full report data
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{
|
|
184
|
+
type: "text",
|
|
185
|
+
text: `Error performing security audit: ${error instanceof Error ? error.message : String(error)}`,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async checkVulnerability(args) {
|
|
192
|
+
const { filePath, vulnerabilityType, severity = "info" } = args;
|
|
193
|
+
try {
|
|
194
|
+
if (!fs.existsSync(filePath)) {
|
|
195
|
+
throw new Error(`File not found: ${filePath}`);
|
|
196
|
+
}
|
|
197
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
198
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
199
|
+
const language = this.detectLanguage(extension);
|
|
200
|
+
const vulnerabilities = this.analyzeFileForVulnerabilities(content, filePath, language)
|
|
201
|
+
.filter((v) => v.category === vulnerabilityType ||
|
|
202
|
+
this.mapVulnTypeToCategory(vulnerabilityType).includes(v.category))
|
|
203
|
+
.filter((v) => this.severityLevel(v.severity) >= this.severityLevel(severity));
|
|
204
|
+
return {
|
|
205
|
+
content: [
|
|
206
|
+
{
|
|
207
|
+
type: "text",
|
|
208
|
+
text: `Vulnerability Check Results for ${vulnerabilityType}:\n\n` +
|
|
209
|
+
`File: ${filePath}\n` +
|
|
210
|
+
`Vulnerabilities Found: ${vulnerabilities.length}\n\n` +
|
|
211
|
+
vulnerabilities
|
|
212
|
+
.map((v) => `${this.getSeverityIcon(v.severity)} ${v.title}\n` +
|
|
213
|
+
` Line ${v.line}: ${v.description}\n` +
|
|
214
|
+
` Impact: ${v.impact}\n` +
|
|
215
|
+
` Fix: ${v.recommendation}\n`)
|
|
216
|
+
.join("\n") +
|
|
217
|
+
(vulnerabilities.length === 0
|
|
218
|
+
? "\n✅ No vulnerabilities of this type found!"
|
|
219
|
+
: ""),
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
return {
|
|
226
|
+
content: [
|
|
227
|
+
{
|
|
228
|
+
type: "text",
|
|
229
|
+
text: `Error checking vulnerability: ${error instanceof Error ? error.message : String(error)}`,
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async generateSecurityReport(args) {
|
|
236
|
+
const { auditResults, format = "markdown", includeRemediation = true, } = args;
|
|
237
|
+
try {
|
|
238
|
+
const report = auditResults.data || auditResults;
|
|
239
|
+
let output = "";
|
|
240
|
+
switch (format) {
|
|
241
|
+
case "markdown":
|
|
242
|
+
output = this.generateMarkdownReport(report, includeRemediation);
|
|
243
|
+
break;
|
|
244
|
+
case "json":
|
|
245
|
+
output = JSON.stringify(report, null, 2);
|
|
246
|
+
break;
|
|
247
|
+
case "html":
|
|
248
|
+
output = this.generateHTMLReport(report, includeRemediation);
|
|
249
|
+
break;
|
|
250
|
+
default:
|
|
251
|
+
output = this.generateMarkdownReport(report, includeRemediation);
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
content: [
|
|
255
|
+
{
|
|
256
|
+
type: "text",
|
|
257
|
+
text: `Security Report Generated (${format.toUpperCase()}):\n\n${format === "json" ? "```\n" + output + "\n```" : output.substring(0, 2000) + (output.length > 2000 ? "\n\n... (truncated)" : "")}`,
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
fullReport: output,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
return {
|
|
265
|
+
content: [
|
|
266
|
+
{
|
|
267
|
+
type: "text",
|
|
268
|
+
text: `Error generating security report: ${error instanceof Error ? error.message : String(error)}`,
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
analyzeFileForVulnerabilities(content, filePath, language) {
|
|
275
|
+
const vulnerabilities = [];
|
|
276
|
+
const lines = content.split("\n");
|
|
277
|
+
lines.forEach((line, index) => {
|
|
278
|
+
const lineNum = index + 1;
|
|
279
|
+
// Injection vulnerabilities
|
|
280
|
+
vulnerabilities.push(...this.checkInjectionVulnerabilities(line, lineNum, filePath, language));
|
|
281
|
+
// Authentication & Authorization
|
|
282
|
+
vulnerabilities.push(...this.checkAuthVulnerabilities(line, lineNum, filePath, language));
|
|
283
|
+
// Cryptography issues
|
|
284
|
+
vulnerabilities.push(...this.checkCryptoVulnerabilities(line, lineNum, filePath, language));
|
|
285
|
+
// Configuration issues
|
|
286
|
+
vulnerabilities.push(...this.checkConfigurationVulnerabilities(line, lineNum, filePath, language));
|
|
287
|
+
// Data protection
|
|
288
|
+
vulnerabilities.push(...this.checkDataProtectionVulnerabilities(line, lineNum, filePath, language));
|
|
289
|
+
// Input validation
|
|
290
|
+
vulnerabilities.push(...this.checkInputValidationVulnerabilities(line, lineNum, filePath, language));
|
|
291
|
+
});
|
|
292
|
+
return vulnerabilities;
|
|
293
|
+
}
|
|
294
|
+
checkInjectionVulnerabilities(line, lineNum, filePath, language) {
|
|
295
|
+
const vulnerabilities = [];
|
|
296
|
+
// SQL Injection
|
|
297
|
+
if (line.includes("query(") ||
|
|
298
|
+
line.includes("execute(") ||
|
|
299
|
+
line.includes("sql(")) {
|
|
300
|
+
if (line.includes("${") ||
|
|
301
|
+
line.includes("+") ||
|
|
302
|
+
line.includes("concat(")) {
|
|
303
|
+
vulnerabilities.push({
|
|
304
|
+
id: `SQLI-${filePath}-${lineNum}`,
|
|
305
|
+
title: "Potential SQL Injection",
|
|
306
|
+
severity: "critical",
|
|
307
|
+
category: "injection",
|
|
308
|
+
cwe: "CWE-89",
|
|
309
|
+
owasp: "A03:2021-Injection",
|
|
310
|
+
file: filePath,
|
|
311
|
+
line: lineNum,
|
|
312
|
+
description: "String concatenation or template literals used in SQL queries",
|
|
313
|
+
impact: "Attackers can execute arbitrary SQL commands",
|
|
314
|
+
recommendation: "Use parameterized queries or prepared statements",
|
|
315
|
+
codeSnippet: line.trim(),
|
|
316
|
+
confidence: 85,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// Command Injection
|
|
321
|
+
if (line.includes("exec(") ||
|
|
322
|
+
line.includes("spawn(") ||
|
|
323
|
+
line.includes("system(")) {
|
|
324
|
+
if (line.includes("${") || line.includes("+")) {
|
|
325
|
+
vulnerabilities.push({
|
|
326
|
+
id: `CMDI-${filePath}-${lineNum}`,
|
|
327
|
+
title: "Potential Command Injection",
|
|
328
|
+
severity: "critical",
|
|
329
|
+
category: "injection",
|
|
330
|
+
cwe: "CWE-78",
|
|
331
|
+
owasp: "A03:2021-Injection",
|
|
332
|
+
file: filePath,
|
|
333
|
+
line: lineNum,
|
|
334
|
+
description: "Dynamic command execution with user input",
|
|
335
|
+
impact: "Attackers can execute arbitrary system commands",
|
|
336
|
+
recommendation: "Validate and sanitize input, use safe APIs",
|
|
337
|
+
codeSnippet: line.trim(),
|
|
338
|
+
confidence: 90,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return vulnerabilities;
|
|
343
|
+
}
|
|
344
|
+
checkAuthVulnerabilities(line, lineNum, filePath, language) {
|
|
345
|
+
const vulnerabilities = [];
|
|
346
|
+
// Weak password policies
|
|
347
|
+
if (line.includes("password") &&
|
|
348
|
+
(line.includes("length") || line.includes("min"))) {
|
|
349
|
+
if (line.includes("6") || line.includes("8")) {
|
|
350
|
+
vulnerabilities.push({
|
|
351
|
+
id: `WEAKPASS-${filePath}-${lineNum}`,
|
|
352
|
+
title: "Weak Password Policy",
|
|
353
|
+
severity: "medium",
|
|
354
|
+
category: "authentication",
|
|
355
|
+
cwe: "CWE-521",
|
|
356
|
+
owasp: "A02:2021-Cryptographic Failures",
|
|
357
|
+
file: filePath,
|
|
358
|
+
line: lineNum,
|
|
359
|
+
description: "Password minimum length is too short",
|
|
360
|
+
impact: "Weak passwords are easily cracked",
|
|
361
|
+
recommendation: "Require at least 12 characters, mix of character types",
|
|
362
|
+
codeSnippet: line.trim(),
|
|
363
|
+
confidence: 75,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
// JWT without expiration
|
|
368
|
+
if (line.includes("jwt") || line.includes("JWT")) {
|
|
369
|
+
if (!line.includes("expires") &&
|
|
370
|
+
!line.includes("exp") &&
|
|
371
|
+
!line.includes("expiresIn")) {
|
|
372
|
+
vulnerabilities.push({
|
|
373
|
+
id: `JWTNOEXP-${filePath}-${lineNum}`,
|
|
374
|
+
title: "JWT Without Expiration",
|
|
375
|
+
severity: "high",
|
|
376
|
+
category: "authentication",
|
|
377
|
+
cwe: "CWE-613",
|
|
378
|
+
owasp: "A07:2021-Identification and Authentication Failures",
|
|
379
|
+
file: filePath,
|
|
380
|
+
line: lineNum,
|
|
381
|
+
description: "JWT tokens created without expiration time",
|
|
382
|
+
impact: "Tokens never expire, infinite session vulnerability",
|
|
383
|
+
recommendation: "Always set expiration time on JWT tokens",
|
|
384
|
+
codeSnippet: line.trim(),
|
|
385
|
+
confidence: 80,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return vulnerabilities;
|
|
390
|
+
}
|
|
391
|
+
checkCryptoVulnerabilities(line, lineNum, filePath, language) {
|
|
392
|
+
const vulnerabilities = [];
|
|
393
|
+
// Weak hashing algorithms
|
|
394
|
+
if (line.includes("md5(") ||
|
|
395
|
+
line.includes("sha1(") ||
|
|
396
|
+
line.includes("MD5") ||
|
|
397
|
+
line.includes("SHA1")) {
|
|
398
|
+
vulnerabilities.push({
|
|
399
|
+
id: `WEAKHASH-${filePath}-${lineNum}`,
|
|
400
|
+
title: "Weak Hashing Algorithm",
|
|
401
|
+
severity: "high",
|
|
402
|
+
category: "cryptography",
|
|
403
|
+
cwe: "CWE-328",
|
|
404
|
+
owasp: "A02:2021-Cryptographic Failures",
|
|
405
|
+
file: filePath,
|
|
406
|
+
line: lineNum,
|
|
407
|
+
description: "Using deprecated or weak hashing algorithms",
|
|
408
|
+
impact: "Passwords and data easily compromised",
|
|
409
|
+
recommendation: "Use bcrypt, scrypt, or Argon2 for passwords; SHA-256+ for data",
|
|
410
|
+
codeSnippet: line.trim(),
|
|
411
|
+
confidence: 95,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
// Insecure random number generation
|
|
415
|
+
if (line.includes("Math.random(")) {
|
|
416
|
+
vulnerabilities.push({
|
|
417
|
+
id: `WEAKRAND-${filePath}-${lineNum}`,
|
|
418
|
+
title: "Weak Random Number Generation",
|
|
419
|
+
severity: "medium",
|
|
420
|
+
category: "cryptography",
|
|
421
|
+
cwe: "CWE-338",
|
|
422
|
+
owasp: "A02:2021-Cryptographic Failures",
|
|
423
|
+
file: filePath,
|
|
424
|
+
line: lineNum,
|
|
425
|
+
description: "Using Math.random() for security-sensitive operations",
|
|
426
|
+
impact: "Predictable random values compromise security",
|
|
427
|
+
recommendation: "Use crypto.randomBytes() or secure random APIs",
|
|
428
|
+
codeSnippet: line.trim(),
|
|
429
|
+
confidence: 85,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
return vulnerabilities;
|
|
433
|
+
}
|
|
434
|
+
checkConfigurationVulnerabilities(line, lineNum, filePath, language) {
|
|
435
|
+
const vulnerabilities = [];
|
|
436
|
+
// Debug mode in production
|
|
437
|
+
if (line.includes("DEBUG") || line.includes("debug")) {
|
|
438
|
+
if (line.includes("true") || line.includes("enabled")) {
|
|
439
|
+
vulnerabilities.push({
|
|
440
|
+
id: `DEBUGPROD-${filePath}-${lineNum}`,
|
|
441
|
+
title: "Debug Mode Enabled",
|
|
442
|
+
severity: "medium",
|
|
443
|
+
category: "configuration",
|
|
444
|
+
cwe: "CWE-489",
|
|
445
|
+
owasp: "A05:2021-Security Misconfiguration",
|
|
446
|
+
file: filePath,
|
|
447
|
+
line: lineNum,
|
|
448
|
+
description: "Debug mode appears to be enabled",
|
|
449
|
+
impact: "Sensitive information leaked in production",
|
|
450
|
+
recommendation: "Disable debug mode in production environments",
|
|
451
|
+
codeSnippet: line.trim(),
|
|
452
|
+
confidence: 70,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
// CORS misconfiguration
|
|
457
|
+
if (line.includes("cors") || line.includes("CORS")) {
|
|
458
|
+
if (line.includes("*") || line.includes("allow-all")) {
|
|
459
|
+
vulnerabilities.push({
|
|
460
|
+
id: `CORSMISCONFIG-${filePath}-${lineNum}`,
|
|
461
|
+
title: "CORS Misconfiguration",
|
|
462
|
+
severity: "medium",
|
|
463
|
+
category: "configuration",
|
|
464
|
+
cwe: "CWE-942",
|
|
465
|
+
owasp: "A05:2021-Security Misconfiguration",
|
|
466
|
+
file: filePath,
|
|
467
|
+
line: lineNum,
|
|
468
|
+
description: "Overly permissive CORS configuration",
|
|
469
|
+
impact: "Cross-origin requests from any domain allowed",
|
|
470
|
+
recommendation: "Specify allowed origins explicitly",
|
|
471
|
+
codeSnippet: line.trim(),
|
|
472
|
+
confidence: 75,
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return vulnerabilities;
|
|
477
|
+
}
|
|
478
|
+
checkDataProtectionVulnerabilities(line, lineNum, filePath, language) {
|
|
479
|
+
const vulnerabilities = [];
|
|
480
|
+
// Sensitive data logging
|
|
481
|
+
if (line.includes("console.log") || line.includes("logger.")) {
|
|
482
|
+
if (line.includes("password") ||
|
|
483
|
+
line.includes("token") ||
|
|
484
|
+
line.includes("secret") ||
|
|
485
|
+
line.includes("key")) {
|
|
486
|
+
vulnerabilities.push({
|
|
487
|
+
id: `SENSITIVELOG-${filePath}-${lineNum}`,
|
|
488
|
+
title: "Sensitive Data Logging",
|
|
489
|
+
severity: "high",
|
|
490
|
+
category: "data-protection",
|
|
491
|
+
cwe: "CWE-532",
|
|
492
|
+
owasp: "A09:2021-Security Logging and Monitoring Failures",
|
|
493
|
+
file: filePath,
|
|
494
|
+
line: lineNum,
|
|
495
|
+
description: "Logging sensitive information like passwords or tokens",
|
|
496
|
+
impact: "Credentials exposed in logs",
|
|
497
|
+
recommendation: "Never log sensitive data, use proper redaction",
|
|
498
|
+
codeSnippet: line.trim(),
|
|
499
|
+
confidence: 90,
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Insecure data transmission
|
|
504
|
+
if (line.includes("http://") &&
|
|
505
|
+
!line.includes("localhost") &&
|
|
506
|
+
!line.includes("127.0.0.1")) {
|
|
507
|
+
vulnerabilities.push({
|
|
508
|
+
id: `HTTPNOTLS-${filePath}-${lineNum}`,
|
|
509
|
+
title: "Insecure HTTP Transmission",
|
|
510
|
+
severity: "high",
|
|
511
|
+
category: "data-protection",
|
|
512
|
+
cwe: "CWE-319",
|
|
513
|
+
owasp: "A02:2021-Cryptographic Failures",
|
|
514
|
+
file: filePath,
|
|
515
|
+
line: lineNum,
|
|
516
|
+
description: "Data transmitted over unencrypted HTTP",
|
|
517
|
+
impact: "Data intercepted by attackers",
|
|
518
|
+
recommendation: "Use HTTPS for all data transmission",
|
|
519
|
+
codeSnippet: line.trim(),
|
|
520
|
+
confidence: 95,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
return vulnerabilities;
|
|
524
|
+
}
|
|
525
|
+
checkInputValidationVulnerabilities(line, lineNum, filePath, language) {
|
|
526
|
+
const vulnerabilities = [];
|
|
527
|
+
// Missing input validation
|
|
528
|
+
if (line.includes("req.body") ||
|
|
529
|
+
line.includes("req.query") ||
|
|
530
|
+
line.includes("req.params")) {
|
|
531
|
+
// Check if there's any validation on the same or next few lines
|
|
532
|
+
const nextLines = this.getNextLines(filePath, lineNum, 3);
|
|
533
|
+
const hasValidation = nextLines.some((nextLine) => nextLine.includes("validate") ||
|
|
534
|
+
nextLine.includes("sanitize") ||
|
|
535
|
+
nextLine.includes("joi") ||
|
|
536
|
+
nextLine.includes("zod") ||
|
|
537
|
+
nextLine.includes("isEmail") ||
|
|
538
|
+
nextLine.includes("isLength"));
|
|
539
|
+
if (!hasValidation) {
|
|
540
|
+
vulnerabilities.push({
|
|
541
|
+
id: `NOVALIDATION-${filePath}-${lineNum}`,
|
|
542
|
+
title: "Missing Input Validation",
|
|
543
|
+
severity: "medium",
|
|
544
|
+
category: "input-validation",
|
|
545
|
+
cwe: "CWE-20",
|
|
546
|
+
owasp: "A03:2021-Injection",
|
|
547
|
+
file: filePath,
|
|
548
|
+
line: lineNum,
|
|
549
|
+
description: "User input processed without validation",
|
|
550
|
+
impact: "Malicious input can cause security issues",
|
|
551
|
+
recommendation: "Validate and sanitize all user inputs",
|
|
552
|
+
codeSnippet: line.trim(),
|
|
553
|
+
confidence: 60,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return vulnerabilities;
|
|
558
|
+
}
|
|
559
|
+
getNextLines(filePath, startLine, count) {
|
|
560
|
+
try {
|
|
561
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
562
|
+
const lines = content.split("\n");
|
|
563
|
+
const result = [];
|
|
564
|
+
for (let i = startLine; i < Math.min(startLine + count, lines.length); i++) {
|
|
565
|
+
const line = lines[i];
|
|
566
|
+
if (line) {
|
|
567
|
+
result.push(line);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return result;
|
|
571
|
+
}
|
|
572
|
+
catch {
|
|
573
|
+
return [];
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
detectLanguage(extension) {
|
|
577
|
+
const languageMap = {
|
|
578
|
+
".ts": "typescript",
|
|
579
|
+
".tsx": "typescript",
|
|
580
|
+
".js": "javascript",
|
|
581
|
+
".jsx": "javascript",
|
|
582
|
+
".py": "python",
|
|
583
|
+
".java": "java",
|
|
584
|
+
".cpp": "cpp",
|
|
585
|
+
".c": "c",
|
|
586
|
+
".cs": "csharp",
|
|
587
|
+
".php": "php",
|
|
588
|
+
".rb": "ruby",
|
|
589
|
+
".go": "go",
|
|
590
|
+
".rs": "rust",
|
|
591
|
+
".swift": "swift",
|
|
592
|
+
".kt": "kotlin",
|
|
593
|
+
".scala": "scala",
|
|
594
|
+
};
|
|
595
|
+
return languageMap[extension] || "unknown";
|
|
596
|
+
}
|
|
597
|
+
calculateSecuritySummary(vulnerabilities, totalFiles) {
|
|
598
|
+
const counts = {
|
|
599
|
+
critical: vulnerabilities.filter((v) => v.severity === "critical").length,
|
|
600
|
+
high: vulnerabilities.filter((v) => v.severity === "high").length,
|
|
601
|
+
medium: vulnerabilities.filter((v) => v.severity === "medium").length,
|
|
602
|
+
low: vulnerabilities.filter((v) => v.severity === "low").length,
|
|
603
|
+
};
|
|
604
|
+
// Calculate risk score based on vulnerability counts and severity
|
|
605
|
+
const riskScore = Math.min(100, counts.critical * 10 +
|
|
606
|
+
counts.high * 5 +
|
|
607
|
+
counts.medium * 2 +
|
|
608
|
+
counts.low * 1);
|
|
609
|
+
// Calculate compliance score (inverse of risk score, adjusted for file count)
|
|
610
|
+
const baseCompliance = Math.max(0, 100 - riskScore);
|
|
611
|
+
const complianceScore = Math.max(0, baseCompliance - (totalFiles > 10 ? 5 : 0));
|
|
612
|
+
return {
|
|
613
|
+
totalFiles,
|
|
614
|
+
vulnerabilitiesFound: vulnerabilities.length,
|
|
615
|
+
criticalCount: counts.critical,
|
|
616
|
+
highCount: counts.high,
|
|
617
|
+
mediumCount: counts.medium,
|
|
618
|
+
lowCount: counts.low,
|
|
619
|
+
overallRiskScore: riskScore,
|
|
620
|
+
complianceScore,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
analyzeCompliance(vulnerabilities, frameworks) {
|
|
624
|
+
const owaspTop10 = {};
|
|
625
|
+
// OWASP Top 10 2021 mapping
|
|
626
|
+
const owaspMapping = {
|
|
627
|
+
"A01:2021-Broken Access Control": ["authorization"],
|
|
628
|
+
"A02:2021-Cryptographic Failures": ["cryptography"],
|
|
629
|
+
"A03:2021-Injection": ["injection"],
|
|
630
|
+
"A04:2021-Insecure Design": ["configuration", "input-validation"],
|
|
631
|
+
"A05:2021-Security Misconfiguration": ["configuration"],
|
|
632
|
+
"A06:2021-Vulnerable Components": [], // Would need dependency analysis
|
|
633
|
+
"A07:2021-Authentication Failures": ["authentication"],
|
|
634
|
+
"A08:2021-Software Integrity": ["configuration"],
|
|
635
|
+
"A09:2021-Security Logging": ["data-protection"],
|
|
636
|
+
"A10:2021-SSRF": ["injection"], // Simplified mapping
|
|
637
|
+
};
|
|
638
|
+
// Check each OWASP category
|
|
639
|
+
Object.entries(owaspMapping).forEach(([owaspId, categories]) => {
|
|
640
|
+
const hasVulnsInCategory = vulnerabilities.some((v) => categories.includes(v.category));
|
|
641
|
+
owaspTop10[owaspId] = !hasVulnsInCategory; // True if no vulnerabilities found
|
|
642
|
+
});
|
|
643
|
+
return {
|
|
644
|
+
owaspTop10,
|
|
645
|
+
frameworks,
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
generateRecommendations(vulnerabilities, compliance) {
|
|
649
|
+
const recommendations = [];
|
|
650
|
+
// Group vulnerabilities by category
|
|
651
|
+
const byCategory = vulnerabilities.reduce((acc, v) => {
|
|
652
|
+
acc[v.category] = (acc[v.category] || 0) + 1;
|
|
653
|
+
return acc;
|
|
654
|
+
}, {});
|
|
655
|
+
// Generate category-specific recommendations
|
|
656
|
+
if ((byCategory.injection || 0) > 0) {
|
|
657
|
+
recommendations.push("Implement parameterized queries and input sanitization to prevent injection attacks");
|
|
658
|
+
}
|
|
659
|
+
if ((byCategory.authentication || 0) > 0) {
|
|
660
|
+
recommendations.push("Strengthen authentication mechanisms and implement proper session management");
|
|
661
|
+
}
|
|
662
|
+
if ((byCategory.cryptography || 0) > 0) {
|
|
663
|
+
recommendations.push("Replace weak cryptographic algorithms with modern, secure alternatives");
|
|
664
|
+
}
|
|
665
|
+
if ((byCategory.configuration || 0) > 0) {
|
|
666
|
+
recommendations.push("Review and harden security configurations, disable debug modes in production");
|
|
667
|
+
}
|
|
668
|
+
if ((byCategory["data-protection"] || 0) > 0) {
|
|
669
|
+
recommendations.push("Implement proper data protection measures and avoid logging sensitive information");
|
|
670
|
+
}
|
|
671
|
+
// OWASP compliance recommendations
|
|
672
|
+
const failedOwasp = Object.entries(compliance.owaspTop10)
|
|
673
|
+
.filter(([_, compliant]) => !compliant)
|
|
674
|
+
.map(([category]) => category);
|
|
675
|
+
if (failedOwasp.length > 0) {
|
|
676
|
+
recommendations.push(`Address OWASP Top 10 compliance issues: ${failedOwasp.join(", ")}`);
|
|
677
|
+
}
|
|
678
|
+
// General recommendations
|
|
679
|
+
if (vulnerabilities.length === 0) {
|
|
680
|
+
recommendations.push("Maintain regular security audits and stay updated with security best practices");
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
recommendations.push("Implement automated security testing in CI/CD pipeline");
|
|
684
|
+
recommendations.push("Conduct regular security training for development team");
|
|
685
|
+
}
|
|
686
|
+
return recommendations;
|
|
687
|
+
}
|
|
688
|
+
severityLevel(severity) {
|
|
689
|
+
const levels = { info: 0, low: 1, medium: 2, high: 3, critical: 4 };
|
|
690
|
+
return levels[severity] || 0;
|
|
691
|
+
}
|
|
692
|
+
mapVulnTypeToCategory(type) {
|
|
693
|
+
const mapping = {
|
|
694
|
+
injection: ["injection"],
|
|
695
|
+
authentication: ["authentication"],
|
|
696
|
+
authorization: ["authorization"],
|
|
697
|
+
cryptography: ["cryptography"],
|
|
698
|
+
xss: ["injection", "data-protection"],
|
|
699
|
+
csrf: ["authentication", "authorization"],
|
|
700
|
+
secrets: ["data-protection", "configuration"],
|
|
701
|
+
configuration: ["configuration"],
|
|
702
|
+
};
|
|
703
|
+
return mapping[type] || [];
|
|
704
|
+
}
|
|
705
|
+
getSeverityIcon(severity) {
|
|
706
|
+
const icons = {
|
|
707
|
+
critical: "🚨",
|
|
708
|
+
high: "🔴",
|
|
709
|
+
medium: "🟡",
|
|
710
|
+
low: "🟢",
|
|
711
|
+
info: "ℹ️",
|
|
712
|
+
};
|
|
713
|
+
return icons[severity] || "❓";
|
|
714
|
+
}
|
|
715
|
+
generateMarkdownReport(report, includeRemediation) {
|
|
716
|
+
let output = `# Security Audit Report\n\n`;
|
|
717
|
+
output += `## Executive Summary\n\n`;
|
|
718
|
+
output += `- **Files Analyzed**: ${report.summary.totalFiles}\n`;
|
|
719
|
+
output += `- **Vulnerabilities Found**: ${report.summary.vulnerabilitiesFound}\n`;
|
|
720
|
+
output += `- **Risk Score**: ${report.summary.overallRiskScore}/100\n`;
|
|
721
|
+
output += `- **Compliance Score**: ${report.summary.complianceScore}/100\n\n`;
|
|
722
|
+
output += `## Vulnerability Breakdown\n\n`;
|
|
723
|
+
output += `| Severity | Count |\n`;
|
|
724
|
+
output += `|----------|-------|\n`;
|
|
725
|
+
output += `| Critical | ${report.summary.criticalCount} |\n`;
|
|
726
|
+
output += `| High | ${report.summary.highCount} |\n`;
|
|
727
|
+
output += `| Medium | ${report.summary.mediumCount} |\n`;
|
|
728
|
+
output += `| Low | ${report.summary.lowCount} |\n\n`;
|
|
729
|
+
if (includeRemediation) {
|
|
730
|
+
output += `## Key Recommendations\n\n`;
|
|
731
|
+
report.recommendations.forEach((rec, i) => {
|
|
732
|
+
output += `${i + 1}. ${rec}\n`;
|
|
733
|
+
});
|
|
734
|
+
output += `\n`;
|
|
735
|
+
}
|
|
736
|
+
output += `## Detailed Findings\n\n`;
|
|
737
|
+
report.vulnerabilities.forEach((vuln) => {
|
|
738
|
+
output += `### ${this.getSeverityIcon(vuln.severity)} ${vuln.title}\n\n`;
|
|
739
|
+
output += `- **File**: ${vuln.file}:${vuln.line}\n`;
|
|
740
|
+
output += `- **Category**: ${vuln.category}\n`;
|
|
741
|
+
output += `- **Severity**: ${vuln.severity}\n`;
|
|
742
|
+
output += `- **Description**: ${vuln.description}\n`;
|
|
743
|
+
output += `- **Impact**: ${vuln.impact}\n`;
|
|
744
|
+
output += `- **Recommendation**: ${vuln.recommendation}\n\n`;
|
|
745
|
+
if (vuln.cwe)
|
|
746
|
+
output += `- **CWE**: ${vuln.cwe}\n`;
|
|
747
|
+
if (vuln.owasp)
|
|
748
|
+
output += `- **OWASP**: ${vuln.owasp}\n`;
|
|
749
|
+
output += `\n---\n\n`;
|
|
750
|
+
});
|
|
751
|
+
return output;
|
|
752
|
+
}
|
|
753
|
+
generateHTMLReport(report, includeRemediation) {
|
|
754
|
+
// Simplified HTML generation - could be expanded
|
|
755
|
+
return `<html><body><h1>Security Audit Report</h1><p>Risk Score: ${report.summary.overallRiskScore}/100</p></body></html>`;
|
|
756
|
+
}
|
|
757
|
+
async run() {
|
|
758
|
+
const transport = new StdioServerTransport();
|
|
759
|
+
await this.server.connect(transport);
|
|
760
|
+
console.log("StrRay Security Audit MCP Server running...");
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
// Run the server if this file is executed directly
|
|
764
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
765
|
+
const server = new StrRaySecurityAuditServer();
|
|
766
|
+
server.run().catch(console.error);
|
|
767
|
+
}
|
|
768
|
+
export { StrRaySecurityAuditServer };
|
|
769
|
+
//# sourceMappingURL=security-audit.server.js.map
|