๐ Analysis Tools Reference
Complete reference for MCP ADR Analysis Server analysis and discovery tools.
๐ Quick Referenceโ
| Tool | Purpose | Key Parameters | Output |
|---|---|---|---|
analyze_project_ecosystem | Comprehensive project analysis | projectPath, enhancedMode | Technology stack, patterns, recommendations |
analyze_environment | Environment and deployment analysis | includeSecurityAnalysis | Environment config, deployment readiness |
analyze_content_security | Security content scanning | content, enhancedMode | Security issues, masking recommendations |
review_existing_adrs | ADR compliance and gap analysis | adrDirectory, includeTreeSitter | Compliance scores, missing decisions |
๐๏ธ analyze_project_ecosystemโ
Purpose: Comprehensive analysis of project technology stack, architecture patterns, and development practices.
Parametersโ
interface AnalyzeProjectEcosystemParams {
projectPath: string; // Required: Absolute path to project
analysisType?: 'quick' | 'standard' | 'comprehensive';
enhancedMode?: boolean; // Enable AI-powered analysis
knowledgeEnhancement?: boolean; // Use knowledge generation framework
recursiveDepth?: 'shallow' | 'medium' | 'comprehensive';
includeEnvironment?: boolean; // Analyze deployment environment
securityFocused?: boolean; // Focus on security analysis
includeTreeSitter?: boolean; // Enable AST analysis
}
Usage Examplesโ
Basic Project Analysisโ
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": "/path/to/project",
"analysisType": "standard"
}
}
Comprehensive Security-Focused Analysisโ
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": "/path/to/project",
"analysisType": "comprehensive",
"enhancedMode": true,
"securityFocused": true,
"includeEnvironment": true,
"includeTreeSitter": true
}
}
Quick Technology Stack Discoveryโ
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": "/path/to/project",
"analysisType": "quick",
"recursiveDepth": "shallow"
}
}
Response Formatโ
interface ProjectEcosystemAnalysis {
projectInfo: {
name: string;
type: string;
primaryLanguage: string;
framework: string;
};
technologyStack: {
languages: string[];
frameworks: string[];
databases: string[];
tools: string[];
dependencies: Record<string, string>;
};
architecturalPatterns: {
patterns: string[];
confidence: number;
evidence: string[];
};
securityAnalysis?: {
issues: SecurityIssue[];
riskLevel: 'low' | 'medium' | 'high';
recommendations: string[];
};
recommendations: {
adrSuggestions: string[];
improvements: string[];
bestPractices: string[];
};
confidence: number;
}
Common Use Casesโ
- New Project Onboarding: Understand unfamiliar codebase quickly
- Architecture Review: Assess current architectural decisions
- Technology Migration: Analyze current stack before migration
- Security Audit: Identify security patterns and issues
- Documentation Generation: Create architectural documentation
๐ analyze_environmentโ
Purpose: Analyze deployment environment, infrastructure configuration, and operational readiness.
Parametersโ
interface AnalyzeEnvironmentParams {
includeSecurityAnalysis?: boolean; // Include security configuration analysis
checkContainerization?: boolean; // Analyze Docker/container setup
validateDeploymentSecurity?: boolean; // Validate deployment security
includeOptimizations?: boolean; // Suggest performance optimizations
environmentType?: 'development' | 'staging' | 'production';
}
Usage Examplesโ
Basic Environment Analysisโ
{
"tool": "analyze_environment",
"parameters": {
"includeSecurityAnalysis": true
}
}
Container Security Analysisโ
{
"tool": "analyze_environment",
"parameters": {
"checkContainerization": true,
"validateDeploymentSecurity": true,
"environmentType": "production"
}
}
Performance Optimization Analysisโ
{
"tool": "analyze_environment",
"parameters": {
"includeOptimizations": true,
"includeSecurityAnalysis": true
}
}
Response Formatโ
interface EnvironmentAnalysis {
environment: {
type: string;
platform: string;
containerized: boolean;
cloudProvider?: string;
};
configuration: {
environmentVariables: Record<string, string>;
configFiles: string[];
secrets: string[];
};
security: {
issues: SecurityIssue[];
recommendations: string[];
compliance: Record<string, boolean>;
};
performance: {
optimizations: string[];
bottlenecks: string[];
recommendations: string[];
};
deployment: {
readiness: boolean;
blockers: string[];
requirements: string[];
};
}
Common Use Casesโ
- Deployment Readiness: Validate environment before deployment
- Security Audit: Check environment security configuration
- Performance Tuning: Identify optimization opportunities
- Compliance Check: Validate against security standards
- Infrastructure Review: Assess current infrastructure setup
๐ analyze_content_securityโ
Purpose: Scan content for security issues, sensitive data, and compliance violations.
Parametersโ
interface AnalyzeContentSecurityParams {
content: string; // Required: Content to analyze
contentType?: 'code' | 'configuration' | 'logs' | 'documentation';
enhancedMode?: boolean; // Enable advanced security analysis
enableTreeSitterAnalysis?: boolean; // Use AST-based analysis
userDefinedPatterns?: string[]; // Custom security patterns
checkFilePatterns?: boolean; // Check for sensitive file patterns
strictValidation?: boolean; // Use strict security validation
}
Usage Examplesโ
Basic Security Scanโ
{
"tool": "analyze_content_security",
"parameters": {
"content": "const apiKey = 'sk-1234567890abcdef';",
"contentType": "code",
"enhancedMode": true
}
}
Advanced Security Analysis with Custom Patternsโ
{
"tool": "analyze_content_security",
"parameters": {
"content": "COMPANY_SECRET=internal-token-12345",
"contentType": "configuration",
"enhancedMode": true,
"enableTreeSitterAnalysis": true,
"userDefinedPatterns": ["COMPANY_[A-Z_]+", "internal-.*-token"],
"strictValidation": true
}
}
File Pattern Security Checkโ
{
"tool": "analyze_content_security",
"parameters": {
"content": "Check if .env files are in git",
"contentType": "configuration",
"checkFilePatterns": true
}
}
Response Formatโ
interface ContentSecurityAnalysis {
securityIssues: SecurityIssue[];
riskLevel: 'low' | 'medium' | 'high' | 'critical';
maskingRecommended: boolean;
patterns: {
detected: string[];
confidence: number;
locations: Array<{
line: number;
column: number;
pattern: string;
}>;
};
recommendations: string[];
compliance: {
gdpr: boolean;
pci: boolean;
hipaa: boolean;
};
}
interface SecurityIssue {
type: string;
severity: 'low' | 'medium' | 'high' | 'critical';
line?: number;
column?: number;
pattern: string;
description: string;
recommendation: string;
}
Common Use Casesโ
- Pre-Commit Security: Scan code before committing
- Documentation Review: Check docs for sensitive information
- Configuration Audit: Validate config files for secrets
- Compliance Check: Ensure content meets compliance standards
- Incident Response: Analyze potentially compromised content
๐ review_existing_adrsโ
Purpose: Analyze existing ADRs for compliance, completeness, and identify missing architectural decisions.
Parametersโ
interface ReviewExistingAdrsParams {
adrDirectory: string; // Required: Path to ADR directory
includeTreeSitter?: boolean; // Enable code analysis
complianceFramework?: 'madr' | 'nygard' | 'custom';
analysisDepth?: 'basic' | 'comprehensive';
projectPath?: string; // Project path for code analysis
generateRecommendations?: boolean; // Generate improvement recommendations
}
Usage Examplesโ
Basic ADR Reviewโ
{
"tool": "review_existing_adrs",
"parameters": {
"adrDirectory": "./adrs"
}
}
Comprehensive ADR Analysis with Code Validationโ
{
"tool": "review_existing_adrs",
"parameters": {
"adrDirectory": "./adrs",
"includeTreeSitter": true,
"complianceFramework": "madr",
"analysisDepth": "comprehensive",
"projectPath": ".",
"generateRecommendations": true
}
}
Quick Compliance Checkโ
{
"tool": "review_existing_adrs",
"parameters": {
"adrDirectory": "./adrs",
"complianceFramework": "nygard",
"analysisDepth": "basic"
}
}
Response Formatโ
interface AdrReviewAnalysis {
summary: {
totalAdrs: number;
complianceScore: number;
completenessScore: number;
qualityScore: number;
};
adrAnalysis: Array<{
file: string;
title: string;
status: string;
compliance: {
score: number;
issues: string[];
recommendations: string[];
};
implementation: {
implemented: boolean;
evidence: string[];
gaps: string[];
};
}>;
gaps: {
missingDecisions: string[];
undocumentedPatterns: string[];
implementationGaps: string[];
};
recommendations: {
newAdrs: string[];
improvements: string[];
processChanges: string[];
};
}
Common Use Casesโ
- ADR Audit: Assess quality of existing ADRs
- Gap Analysis: Identify missing architectural decisions
- Compliance Check: Validate ADRs against standards
- Process Improvement: Identify ADR process improvements
- Documentation Cleanup: Find outdated or incomplete ADRs
๐ง Advanced Analysis Patternsโ
Chaining Analysis Toolsโ
Progressive Analysis Workflow:
// 1. Start with ecosystem analysis
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": ".",
"analysisType": "standard"
}
}
// 2. Deep dive into security if issues found
{
"tool": "analyze_content_security",
"parameters": {
"content": "/* code from ecosystem analysis */",
"enhancedMode": true,
"enableTreeSitterAnalysis": true
}
}
// 3. Review existing ADRs for gaps
{
"tool": "review_existing_adrs",
"parameters": {
"adrDirectory": "./adrs",
"includeTreeSitter": true,
"projectPath": "."
}
}
// 4. Analyze deployment environment
{
"tool": "analyze_environment",
"parameters": {
"includeSecurityAnalysis": true,
"checkContainerization": true
}
}
Performance Optimizationโ
For Large Projects:
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": ".",
"analysisType": "quick",
"recursiveDepth": "shallow",
"enhancedMode": false
}
}
For Detailed Analysis:
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": ".",
"analysisType": "comprehensive",
"enhancedMode": true,
"knowledgeEnhancement": true,
"includeTreeSitter": true
}
}
Error Handlingโ
Common Error Patterns:
- Path not found: Ensure absolute paths are used
- Permission denied: Check file/directory permissions
- Analysis timeout: Reduce scope or use quick analysis
- Memory issues: Process large projects in chunks
Diagnostic Commands:
// Check environment
{
"tool": "analyze_environment",
"parameters": {
"includeOptimizations": true
}
}
// Validate project structure
{
"tool": "analyze_project_ecosystem",
"parameters": {
"projectPath": ".",
"analysisType": "quick"
}
}
๐ Analysis Best Practicesโ
1. Start with Quick Analysisโ
- Use
analysisType: "quick"for initial exploration - Progressively increase depth based on findings
- Focus on specific areas of concern
2. Security-First Approachโ
- Always include security analysis for production systems
- Use custom patterns for organization-specific secrets
- Validate security configurations before deployment
3. Iterative Analysisโ
- Analyze โ Review โ Refine โ Re-analyze
- Use findings from one tool to inform parameters for others
- Build comprehensive understanding through multiple passes
4. Context-Aware Analysisโ
- Provide project context through parameters
- Use appropriate analysis depth for project size
- Consider team expertise and project maturity
5. Performance Considerationsโ
- Monitor analysis time and resource usage
- Use caching for repeated analyses
- Optimize parameters for your specific use case
๐ Related Documentationโ
- Generation Tools - ADR and content generation tools
- Security Tools - Specialized security analysis tools
- Validation Tools - Progress tracking and validation tools
- Environment Configuration - Analysis configuration options
Need help with analysis tools? โ Troubleshooting Guide or File an Issue