UNPKG

zrald3

Version:

Sequential Thinking MCP Server - Advanced reasoning and analysis using data from zrald1 and zrald2 for comprehensive code intelligence

284 lines (228 loc) 6.7 kB
# 🧠 zrald3 - Sequential Thinking MCP Server Advanced sequential thinking and reasoning MCP server that integrates data from both **zrald1** (file analysis) and **zrald2** (function logic) to perform comprehensive code intelligence analysis. ## 🎯 Overview zrald3 is the third server in the zrald trilogy, designed to perform sophisticated reasoning and analysis by combining insights from: - **zrald1**: File structure, relationships, and graph data - **zrald2**: Function analysis, logic patterns, and complexity metrics The server uses sequential thinking methodology to break down complex problems into manageable steps, providing evidence-based insights and actionable recommendations. ## 🔗 Dependencies **REQUIRED**: Both zrald1 and zrald2 must be running before using zrald3. ```bash # Start zrald1 first npx -y zrald1 # Start zrald2 second npx -y zrald2 # Then start zrald3 npx -y zrald3 ``` ## 📦 Installation ### Global Installation ```bash npm install -g zrald3 ``` ### Direct Usage ```bash npx -y zrald3 ``` ## 🛠 MCP Tools ### 1. `sequential_thinking` Perform comprehensive sequential thinking analysis using integrated data. **Parameters:** - `user_query` (required): The question or problem to analyze - `thinking_depth`: 'shallow' | 'medium' | 'deep' (default: 'medium') - `focus_areas`: Array of specific areas to focus on - `max_steps`: Maximum thinking steps (default: 10) - `include_evidence`: Include detailed evidence (default: true) **Example:** ```json { "user_query": "Analyze the codebase for security vulnerabilities and performance issues", "thinking_depth": "deep", "focus_areas": ["security", "performance", "complexity"], "max_steps": 15, "include_evidence": true } ``` ### 2. `validate_dependencies` Check if both zrald1 and zrald2 are available and accessible. **Example:** ```json {} ``` ### 3. `get_thinking_summary` Get a formatted summary of the latest thinking session. **Parameters:** - `format`: 'brief' | 'detailed' | 'technical' (default: 'detailed') ### 4. `analyze_with_context` Analyze a specific context using integrated data. **Parameters:** - `context` (required): The specific context to analyze - `intent`: 'analyze' | 'debug' | 'optimize' | 'understand' | 'design' | 'solve' - `complexity`: 'low' | 'medium' | 'high' ### 5. `get_insights` Get insights from the latest thinking session with optional filtering. **Parameters:** - `priority_filter`: 'all' | 'high' | 'critical' (default: 'all') ## 📊 Resources - `thinking://latest` - Latest thinking session data - `insights://latest` - Latest insights from analysis - `recommendations://latest` - Latest recommendations ## 🔄 Sequential Thinking Process zrald3 follows a structured thinking methodology: 1. **Initial Analysis** - Gather and assess data from zrald1 and zrald2 2. **Data Correlation** - Find relationships between file structure and function logic 3. **Pattern Analysis** - Examine logic patterns and architectural insights 4. **Insight Synthesis** - Generate actionable insights from findings 5. **Recommendation Generation** - Formulate specific recommendations Each step includes: - Evidence collection from both servers - Confidence scoring - Reasoning documentation - Progressive refinement ## 🎯 Use Cases ### Code Quality Analysis ```json { "user_query": "Evaluate overall code quality and identify improvement areas", "thinking_depth": "deep", "focus_areas": ["complexity", "maintainability", "patterns"] } ``` ### Security Assessment ```json { "user_query": "Analyze the codebase for potential security vulnerabilities", "thinking_depth": "deep", "focus_areas": ["security", "input-validation", "error-handling"] } ``` ### Performance Optimization ```json { "user_query": "Find performance bottlenecks and optimization opportunities", "thinking_depth": "medium", "focus_areas": ["performance", "complexity", "algorithms"] } ``` ### Architecture Review ```json { "user_query": "Review the current architecture and suggest improvements", "thinking_depth": "deep", "focus_areas": ["architecture", "relationships", "modularity"] } ``` ## 🔧 Configuration ### MCP Server Configuration ```json { "mcpServers": { "zrald1": { "command": "npx", "args": ["-y", "zrald1"] }, "zrald2": { "command": "npx", "args": ["-y", "zrald2"] }, "zrald3": { "command": "npx", "args": ["-y", "zrald3"] } } } ``` ## 📈 Output Format ### Thinking Result ```json { "success": true, "thinking_result": { "session": { "id": "session-uuid", "steps": [...], "confidence": 0.85, "conclusion": "Analysis summary" }, "insights": [...], "recommendations": [...], "nextSteps": [...] }, "dependencies_used": { "zrald1_files": 5, "zrald2_functions": 12, "correlations": 3, "insights": 4 } } ``` ### Insights ```json { "id": "insight-uuid", "type": "risk" | "opportunity" | "pattern" | "anomaly", "description": "Insight description", "priority": "low" | "medium" | "high" | "critical", "confidence": 0.9, "evidence": [...], "actionable": true } ``` ### Recommendations ```json { "id": "rec-uuid", "type": "improvement" | "fix" | "optimization" | "investigation", "description": "Recommendation description", "priority": "low" | "medium" | "high" | "critical", "effort": "low" | "medium" | "high", "impact": "low" | "medium" | "high", "rationale": "Why this recommendation is important" } ``` ## 🚀 Integration Workflow 1. **Start Dependencies** ```bash npx -y zrald1 # File analysis server npx -y zrald2 # Function logic server ``` 2. **Start zrald3** ```bash npx -y zrald3 # Sequential thinking server ``` 3. **Validate Setup** ```json { "tool": "validate_dependencies" } ``` 4. **Perform Analysis** ```json { "tool": "sequential_thinking", "arguments": { "user_query": "Your analysis question" } } ``` ## 🔍 Error Handling If dependencies are missing: ```json { "success": false, "error": "zrald1 MCP server is required but not accessible. Please start zrald1 first: npx -y zrald1", "requirement": "zrald1_required", "dependencies_status": { "zrald1": false, "zrald2": true } } ``` ## 📝 License MIT License - see LICENSE file for details. ## 🤝 Contributing This is part of the zrald MCP server trilogy. Contributions welcome! ## 🔗 Related Projects - **zrald1**: File analysis and graph processing MCP server - **zrald2**: Function logic analysis MCP server - **zrald3**: Sequential thinking and reasoning MCP server (this project)