# How to Set Up the Developer Onboarding MCP Server in Other Projects

## 🎯 Overview

This guide shows you how to deploy and use the Developer Onboarding MCP Server across different projects in your organization.

## 🚀 Quick Setup for Any Project

### Method 1: Use the Working Test Server (Recommended for immediate testing)

1. **Start the MCP Server:**
```bash
cd "C:\Trimble Projects 2025\Onboarding MCP"
node test-server.js
```

2. **Configure Cursor for your new project:**
Create or update `%APPDATA%\Cursor\User\mcp_servers.json`:
```json
{
  "servers": {
    "developer-onboarding": {
      "command": "node",
      "args": ["C:\\Trimble Projects 2025\\Onboarding MCP\\test-server.js"],
      "env": {
        "NODE_ENV": "development",
        "PROJECT_ROOT": "${workspaceFolder}"
      }
    }
  }
}
```

3. **Restart Cursor and open any project**

4. **Use the onboarding tools** in Command Palette

### Method 2: Deploy as a Global Service (Enterprise)

1. **Build and install globally:**
```bash
cd "C:\Trimble Projects 2025\Onboarding MCP"

# Build the project (if TypeScript issues are resolved)
npm run build

# Or copy the working test server
cp test-server.js global-mcp-server.js

# Install globally
npm link
```

2. **Create a service configuration:**
```json
{
  "servers": {
    "enterprise-onboarding": {
      "command": "developer-onboarding-mcp-server",
      "args": ["--mode=production"],
      "env": {
        "NODE_ENV": "production",
        "DATABASE_URL": "your-enterprise-db-url"
      }
    }
  }
}
```

## 📋 Step-by-Step Setup for New Projects

### Step 1: Prepare the MCP Server

Since you're having build issues, let's use the working approach:

```bash
# Go to your MCP server directory
cd "C:\Trimble Projects 2025\Onboarding MCP"

# Test that it works
node test-server.js
```

### Step 2: Configure Cursor for Project-Specific Use

Create a **project-specific MCP configuration**:

**File: `your-new-project/.cursor/mcp_servers.json`**
```json
{
  "servers": {
    "project-onboarding": {
      "command": "node",
      "args": ["C:\\Trimble Projects 2025\\Onboarding MCP\\test-server.js"],
      "env": {
        "NODE_ENV": "development",
        "PROJECT_PATH": "${workspaceFolder}",
        "PROJECT_NAME": "Your Project Name"
      }
    }
  }
}
```

### Step 3: Initialize Onboarding for the New Project

1. **Open the new project in Cursor**
2. **Open Command Palette** (`Ctrl+Shift+P`)
3. **Run the onboarding sequence:**

#### 3.1 Present Available Roles
```
Tool: identify-user-role
Parameters:
{
  "action": "present_roles"
}
```

#### 3.2 Select Your Role
```
Tool: identify-user-role
Parameters:
{
  "action": "select_role",
  "userName": "Your Name",
  "role": "frontend",
  "experienceLevel": "intermediate",
  "projectPath": "${workspaceFolder}",
  "email": "you@company.com"
}
```

#### 3.3 Analyze the Project
```
Tool: analyze-project
Parameters:
{
  "projectPath": "${workspaceFolder}",
  "includeFileContent": false,
  "focusRoles": ["frontend"]
}
```

#### 3.4 Start Onboarding Session
```
Tool: track-progress
Parameters:
{
  "action": "start_session",
  "userName": "Your Name",
  "projectPath": "${workspaceFolder}",
  "role": "frontend"
}
```

## 🏢 Enterprise Deployment

### Option 1: Centralized Server

1. **Deploy on a server:**
```bash
# On your enterprise server
git clone your-onboarding-mcp-repo
cd onboarding-mcp

# Use Docker for reliable deployment
docker-compose -f docker/docker-compose.enterprise.yml up -d
```

2. **Configure all developer machines:**
```json
{
  "servers": {
    "enterprise-onboarding": {
      "command": "node",
      "args": ["-e", "require('http').get('http://your-server:3000/mcp', res => { /* proxy MCP calls */ })"],
      "env": {
        "MCP_SERVER_URL": "http://your-enterprise-server:3000"
      }
    }
  }
}
```

### Option 2: Distributed per Team

1. **Create team-specific configurations:**
```bash
# For each team/project
cp -r "C:\Trimble Projects 2025\Onboarding MCP" "C:\Team-Frontend-Onboarding"
cd "C:\Team-Frontend-Onboarding"

# Customize for the team
edit team-config.json
```

2. **Team-specific Cursor config:**
```json
{
  "servers": {
    "team-frontend-onboarding": {
      "command": "node",
      "args": ["C:\\Team-Frontend-Onboarding\\test-server.js"],
      "env": {
        "TEAM": "frontend",
        "PROJECT_TYPE": "web"
      }
    }
  }
}
```

## 🔄 Automated Project Setup Script

Create an automation script for new projects:

**File: `setup-project-onboarding.bat`**
```bat
@echo off
echo Setting up Developer Onboarding for new project...

set PROJECT_PATH=%1
if "%PROJECT_PATH%"=="" (
    echo Usage: setup-project-onboarding.bat "C:\path\to\your\project"
    exit /b 1
)

echo Creating .cursor directory...
mkdir "%PROJECT_PATH%\.cursor" 2>nul

echo Creating MCP configuration...
(
echo {
echo   "servers": {
echo     "project-onboarding": {
echo       "command": "node",
echo       "args": ["C:\\Trimble Projects 2025\\Onboarding MCP\\test-server.js"],
echo       "env": {
echo         "NODE_ENV": "development",
echo         "PROJECT_PATH": "%PROJECT_PATH%"
echo       }
echo     }
echo   }
echo }
) > "%PROJECT_PATH%\.cursor\mcp_servers.json"

echo Creating onboarding guide...
(
echo # Welcome to %PROJECT_PATH%
echo.
echo ## Getting Started with Onboarding
echo.
echo 1. Open Cursor in this project
echo 2. Use Ctrl+Shift+P to open Command Palette
echo 3. Look for "identify-user-role" tool
echo 4. Follow the onboarding workflow
echo.
echo ## Available Tools:
echo - identify-user-role: Set up your profile and role
echo - analyze-project: Understand the project structure
echo - track-progress: Monitor your onboarding progress
echo - generate-documentation: Get role-specific guides
echo.
) > "%PROJECT_PATH%\ONBOARDING.md"

echo Setup complete! Next steps:
echo 1. Open "%PROJECT_PATH%" in Cursor
echo 2. Restart Cursor to load MCP configuration
echo 3. Start onboarding with identify-user-role tool
```

**Usage:**
```bash
setup-project-onboarding.bat "C:\YourNewProject"
```

## 📱 Mobile/Remote Setup

For developers working remotely or on different machines:

### Cloud-based MCP Server
```json
{
  "servers": {
    "cloud-onboarding": {
      "command": "curl",
      "args": [
        "-X", "POST",
        "https://your-cloud-mcp.company.com/execute",
        "-H", "Content-Type: application/json",
        "-H", "Authorization: Bearer ${MCP_TOKEN}",
        "-d", "@-"
      ],
      "env": {
        "MCP_TOKEN": "your-auth-token"
      }
    }
  }
}
```

### VPN/Tunnel Setup
```bash
# For remote access to on-premise MCP server
ssh -L 3000:localhost:3000 user@your-company-server

# Then use local configuration
```

## 🎯 Project-Specific Customization

### Custom Milestones per Project

Create project-specific configuration:

**File: `project-onboarding-config.json`**
```json
{
  "projectName": "E-Commerce Platform",
  "projectType": "web",
  "customMilestones": {
    "frontend": [
      {
        "id": "setup_environment",
        "name": "Development Environment Setup",
        "description": "Set up React development environment",
        "estimatedTime": 30,
        "resources": ["docs/frontend-setup.md"]
      },
      {
        "id": "understand_architecture",
        "name": "Understand Component Architecture",
        "description": "Learn our component structure and state management",
        "estimatedTime": 60,
        "resources": ["docs/architecture.md", "src/components/README.md"]
      }
    ],
    "backend": [
      {
        "id": "api_overview",
        "name": "API Architecture Overview",
        "description": "Understand our REST API structure",
        "estimatedTime": 45,
        "resources": ["docs/api-guide.md"]
      }
    ]
  },
  "techStack": {
    "frontend": ["React", "Redux", "TypeScript", "Tailwind CSS"],
    "backend": ["Node.js", "Express", "PostgreSQL", "Redis"],
    "testing": ["Jest", "Cypress", "React Testing Library"],
    "devops": ["Docker", "GitHub Actions", "AWS"]
  }
}
```

## 🚦 Troubleshooting Common Issues

### Issue 1: MCP Server Not Found
```bash
# Check if the server file exists
ls "C:\Trimble Projects 2025\Onboarding MCP\test-server.js"

# Test the server directly
node "C:\Trimble Projects 2025\Onboarding MCP\test-server.js"
```

### Issue 2: Cursor Not Detecting MCP
```bash
# Check configuration path
echo %APPDATA%\Cursor\User\mcp_servers.json

# Verify JSON syntax
type "%APPDATA%\Cursor\User\mcp_servers.json"

# Restart Cursor completely
```

### Issue 3: Tools Not Working
```bash
# Test individual tools
node -e "
const server = require('./test-server.js');
console.log(server.executeTool('identify-user-role', {action: 'present_roles'}));
"
```

## 📊 Usage Analytics

Track usage across projects:

```bash
# View onboarding analytics
node -e "
const fs = require('fs');
const logs = fs.readFileSync('logs/application.log', 'utf8');
const sessions = logs.split('\n').filter(line => line.includes('session_started'));
console.log('Total onboarding sessions:', sessions.length);
"
```

## 🎉 Success Checklist

For each new project setup:

- [ ] MCP server is accessible
- [ ] Cursor configuration is correct
- [ ] Tools appear in Command Palette
- [ ] Role selection works
- [ ] Project analysis completes
- [ ] Progress tracking functions
- [ ] Documentation generates correctly
- [ ] Team members can onboard successfully

## 💡 Best Practices

1. **Standardize configurations** across projects
2. **Create project-specific milestones** for better relevance
3. **Monitor onboarding completion rates** per project
4. **Collect feedback** and iterate on the process
5. **Train team leads** on the onboarding tools
6. **Document project-specific workflows**
7. **Regular updates** to keep milestones current

This setup allows you to deploy the onboarding system across any number of projects while maintaining centralized management and consistent user experience!
