# Developer Onboarding MCP Server

An AI-powered developer onboarding system built as a Model Context Protocol (MCP) server. This tool provides role-based, personalized onboarding experiences for developers joining new projects, with intelligent project analysis and progress tracking.

## 🎯 Features

### Role-Based Onboarding
- **Frontend Developers**: UI/UX components, styling systems, state management
- **Backend Developers**: APIs, databases, server architecture, business logic
- **Testing Engineers**: Testing strategies, automation frameworks, quality assurance
- **DevOps Engineers**: Infrastructure, CI/CD pipelines, deployment processes
- **Full-Stack Developers**: Complete system understanding across all layers

### Intelligent Project Analysis
- Automatic tech stack detection
- Architecture pattern recognition
- Component mapping to roles
- Dependency analysis
- Complexity assessment

### Personalized Learning
- Individual progress tracking
- Role-specific milestones
- Adaptive difficulty based on experience level
- Personalized recommendations
- Session persistence across multiple sessions

### Comprehensive Tracking
- User profiles and preferences
- Session management
- Milestone completion tracking
- Time spent analytics
- Activity logging

## 🏗️ Architecture

### Core Components
- **MCP Server**: Protocol-compliant server for Cursor integration
- **Project Analyzer**: Scans and understands project structure
- **Role Identifier**: Captures developer role and preferences
- **Progress Tracker**: Monitors onboarding milestones
- **Documentation Generator**: Creates role-specific guides
- **User Manager**: Handles profiles and sessions

### Tools Available
- `identify-user-role`: Role selection and profile setup
- `analyze-project`: Project structure and tech stack analysis
- `track-progress`: Milestone and progress management
- `manage-user`: User profile and session management
- `generate-documentation`: Role-specific guide generation
- `analyze-code`: Code patterns and best practices
- `setup-environment`: Environment validation and setup

### Resources Available
- `project://`: Project structure, tech stack, and analysis
- `onboarding://`: Session progress and milestone data
- `user://`: User profiles and personal dashboards
- `knowledge://`: Documentation, guides, and best practices

## 🚀 Getting Started

### Prerequisites
- Node.js 18 or higher
- npm or pnpm
- Git

### Installation

1. **Clone the repository**
   ```bash
   git clone <repository-url>
   cd developer-onboarding-mcp
   ```

2. **Install dependencies**
   ```bash
   npm install
   ```

3. **Build the project**
   ```bash
   npm run build
   ```

4. **Start the server**
   ```bash
   npm start
   ```

### Development

1. **Run in development mode**
   ```bash
   npm run dev
   ```

2. **Run tests**
   ```bash
   npm test
   ```

3. **Lint and format**
   ```bash
   npm run lint
   npm run format
   ```

## 🔧 Cursor Integration

### Configure MCP in Cursor

1. **Add to Cursor MCP settings** (`~/.cursor/mcp_servers.json`):
   ```json
   {
     "servers": {
       "developer-onboarding": {
         "command": "node",
         "args": ["path/to/developer-onboarding-mcp/dist/index.js"],
         "env": {}
       }
     }
   }
   ```

2. **Restart Cursor** to load the MCP server

3. **Verify connection** by checking MCP tools are available

### Usage in Cursor

1. **Start onboarding**:
   ```
   Use the identify-user-role tool to begin the onboarding process
   ```

2. **Analyze your project**:
   ```
   Use analyze-project with your project path to understand the structure
   ```

3. **Track progress**:
   ```
   Use track-progress to monitor your learning milestones
   ```

## 📊 Database Schema

The system uses SQLite with the following main tables:
- `users`: Developer profiles and preferences
- `projects`: Project metadata and analysis results
- `user_roles`: Role assignments per project
- `onboarding_sessions`: Active learning sessions
- `progress_tracking`: Individual milestone progress
- `role_milestones`: Predefined learning milestones
- `user_activity`: Activity and engagement logs

## 🛠️ Configuration

### Environment Variables
- `LOG_LEVEL`: Logging level (debug, info, warn, error)
- `DATABASE_PATH`: Custom database file location

### Project Configuration
Create a `.onboarding-config.json` in your project root for custom settings:
```json
{
  "projectType": "web",
  "customRoles": ["data", "security"],
  "skipSteps": ["environment_setup"],
  "estimatedTime": 480
}
```

## 📈 Analytics and Insights

The system tracks comprehensive analytics:
- **User Engagement**: Session duration, activity patterns
- **Learning Effectiveness**: Completion rates, time estimates
- **Project Complexity**: Difficulty assessment accuracy
- **Role Efficiency**: Role-specific learning effectiveness

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Development Guidelines
- Follow TypeScript strict mode
- Write comprehensive tests
- Use conventional commit messages
- Update documentation for new features

## 📝 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Built on the Model Context Protocol by Anthropic
- Inspired by developer onboarding best practices
- Designed for seamless Cursor IDE integration

## 📞 Support

For support and questions:
- Create an issue in this repository
- Review the troubleshooting guide in the knowledge base
- Check the documentation for common solutions

---

**Happy Onboarding! 🚀**
