๐ฌ Research Integration Guide
Learn how to integrate research findings and external knowledge into your architectural decisions.
๐ Overviewโ
The MCP ADR Analysis Server includes powerful research integration capabilities that help you:
- Gather relevant research and best practices
- Integrate findings into ADRs automatically
- Track research sources and citations
- Build knowledge-driven architectural decisions
๐ฏ Prerequisitesโ
- MCP ADR Analysis Server installed and configured
- Basic understanding of ADRs
- Access to research tools (optional: Firecrawl API)
๐ Quick Startโ
1. Generate Research Questionsโ
Use the perform_research tool to generate relevant research questions for your project:
await mcp.callTool('perform_research', {
topic: 'microservices architecture',
depth: 'comprehensive',
includeExamples: true,
});
2. Integrate Research into ADRsโ
The server automatically suggests research-backed decisions:
await mcp.callTool('research_integration_tool', {
adrPath: './docs/adrs/001-architecture.md',
researchTopics: ['scalability', 'performance'],
autoApply: false,
});
๐ Step-by-Step Guideโ
Step 1: Set Up Research Toolsโ
Configure your environment for research integration:
# .env file
FIRECRAWL_API_KEY=your_api_key_here # Optional but recommended
RESEARCH_CACHE_DIR=./.documcp/research
Step 2: Perform Initial Researchโ
Generate research questions for your domain:
const research = await mcp.callTool('research_question_tool', {
projectPath: './',
domain: 'backend-services',
focusAreas: ['architecture', 'security', 'performance'],
});
Step 3: Review Research Findingsโ
The server stores research in .documcp/research/:
.documcp/research/
โโโ perform_research_001.md
โโโ perform_research_002.md
โโโ index.json
Step 4: Integrate into ADRsโ
Apply research findings to your decisions:
await mcp.callTool('interactive_adr_planning_tool', {
includeResearch: true,
researchIntensity: 'high',
});
๐ก Advanced Techniquesโ
Custom Research Templatesโ
Create custom research templates for your domain:
const template = {
domain: 'machine-learning',
questions: [
'What are best practices for ML model deployment?',
'How to handle model versioning?',
'What monitoring strategies work best?',
],
sources: ['arxiv', 'industry-blogs', 'documentation'],
};
Automated Research Updatesโ
Set up periodic research updates:
# Add to your CI/CD pipeline
npm run research:update -- --topics architecture,security
Research-Driven ADR Generationโ
Generate ADRs directly from research:
await mcp.callTool('generate_adrs_from_prd', {
prdPath: './docs/requirements.md',
includeResearch: true,
researchDepth: 'comprehensive',
});
๐ Integration Workflowsโ
Workflow 1: New Project Setupโ
- Analyze project requirements
- Generate research questions
- Perform research
- Create ADRs with research backing
- Review and refine
Workflow 2: Existing Project Enhancementโ
- Review existing ADRs
- Identify research gaps
- Perform targeted research
- Update ADRs with findings
- Track improvements
Workflow 3: Continuous Learningโ
- Monitor industry trends
- Perform periodic research
- Update decision records
- Maintain knowledge base
- Share insights with team
๐ Best Practicesโ
1. Balance Research Depthโ
- Light: Quick validation of decisions (5-10 min)
- Standard: Comprehensive analysis (20-30 min)
- Deep: Thorough investigation (1-2 hours)
2. Cite Sources Properlyโ
Always include source attribution in ADRs:
## Context
Based on research from [Source Name](URL), we found that...
**Research References**:
- [Paper Title](link) - Key finding
- [Blog Post](link) - Implementation details
3. Keep Research Currentโ
Update research findings regularly:
# Re-run research quarterly
npm run research:refresh -- --older-than 90d
4. Organize Research Findingsโ
Structure your research directory:
docs/research/
โโโ architecture/
โ โโโ microservices.md
โ โโโ serverless.md
โโโ security/
โ โโโ authentication.md
โ โโโ encryption.md
โโโ performance/
โโโ caching.md
โโโ optimization.md
๐ ๏ธ Troubleshootingโ
Research Not Generatingโ
Issue: perform_research tool returns empty results
Solutions:
- Check Firecrawl API key configuration
- Verify internet connectivity
- Try different search topics
- Use
depth: 'standard'instead of 'quick'
Integration Failingโ
Issue: Research integration tool fails to update ADRs
Solutions:
- Verify ADR file format
- Check file permissions
- Ensure valid markdown structure
- Review error logs in
.documcp/logs/
Slow Research Performanceโ
Issue: Research takes too long to complete
Solutions:
- Use
depth: 'quick'for faster results - Limit number of research questions
- Cache research results locally
- Consider parallel processing
๐ Related Documentationโ
- Perform Research Tool - Tool reference
- Interactive ADR Planning - ADR workflows
- Firecrawl Setup - API configuration
- Research Architecture - System design
๐ฏ Examplesโ
Example 1: Architecture Researchโ
// Generate architecture research
const archResearch = await mcp.callTool('perform_research', {
topic: 'event-driven architecture',
depth: 'comprehensive',
outputPath: './docs/research/architecture/event-driven.md',
});
// Apply to ADR
await mcp.callTool('research_integration_tool', {
adrPath: './docs/adrs/005-event-architecture.md',
researchSource: archResearch.outputPath,
sections: ['context', 'decision', 'consequences'],
});
Example 2: Security Researchโ
// Research security patterns
const secResearch = await mcp.callTool('research_question_tool', {
projectPath: './',
domain: 'security',
focusAreas: ['authentication', 'authorization', 'encryption'],
});
// Generate security ADRs
await mcp.callTool('generate_adrs_from_prd', {
prdPath: './docs/security-requirements.md',
includeResearch: true,
researchResults: secResearch,
});
๐ฌ Need Help?โ
- Questions? โ Open an Issue
- Documentation โ Full API Reference
- Troubleshooting โ Troubleshooting Guide
Last Updated: 2025-10-12