# Jobber MCP Server

A comprehensive Model Context Protocol (MCP) server for Jobber field service management platform.

## Features

### 50+ Tools Across Multiple Domains

- **Jobs** (8 tools): List, get, create, update, close jobs, manage visits and line items
- **Clients** (7 tools): Full CRUD for clients, search, archiving
- **Quotes** (9 tools): Create, send, approve, convert quotes
- **Invoices** (10 tools): Create, send, track payments, manage invoice lifecycle
- **Scheduling** (7 tools): Create, update, complete visits, assign team members
- **Team** (6 tools): Manage users, track time entries, team assignments
- **Expenses** (5 tools): Track job expenses, categories, receipts
- **Products** (5 tools): Product/service catalog management
- **Requests** (5 tools): Customer request inbox and conversion
- **Reporting** (4 tools): Revenue, job profitability, utilization metrics
- **Properties** (6 tools): Manage client properties and service locations
- **Timesheets** (7 tools): Time tracking, timesheet summaries
- **Line Items** (8 tools): Manage line items across jobs, quotes, invoices
- **Forms** (8 tools): Custom form builder and submissions
- **Taxes** (8 tools): Tax rates, calculations, line item tax management

**Total: 103 tools**

### 15 React Applications

Modern, dark-themed React apps for data visualization and management:

1. **Job Board** - Browse and filter all jobs
2. **Job Detail** - Comprehensive job view with visits and line items
3. **Client Dashboard** - Client overview with revenue metrics
4. **Client Detail** - Individual client profile and job history
5. **Quote Builder** - Interactive quote creation interface
6. **Invoice Dashboard** - Track invoices and payment status
7. **Schedule Calendar** - Visual scheduling interface
8. **Visit Tracker** - Field visit management
9. **Expense Manager** - Business expense tracking
10. **Timesheet Grid** - Team time entry tracking
11. **Request Inbox** - Customer inquiry management
12. **Form Builder** - Custom form designer
13. **Property Map** - Service location visualization
14. **Financial Dashboard** - Revenue, expenses, profitability
15. **Team Overview** - Team member management and metrics

Each app includes:
- `App.tsx` - Main React component
- `index.html` - HTML entry point
- `main.tsx` - React bootstrap
- `vite.config.ts` - Vite configuration

## Installation

```bash
npm install
npm run build
```

## Configuration

Set your Jobber API token as an environment variable:

```bash
export JOBBER_API_TOKEN=your_api_token_here
```

## Usage

### As MCP Server

Add to your MCP settings file:

```json
{
  "mcpServers": {
    "jobber": {
      "command": "node",
      "args": ["/path/to/jobber-server/dist/index.js"],
      "env": {
        "JOBBER_API_TOKEN": "your_api_token"
      }
    }
  }
}
```

### Running React Apps

Each React app can be run independently:

```bash
cd src/ui/react-app/src/apps/job-board
npm install
npm run dev
```

Apps are configured to run on ports 3000-3014.

## API Integration

This server integrates with the Jobber GraphQL API. All tools use GraphQL queries and mutations with proper error handling and pagination support.

## Development

```bash
# Watch mode for development
npm run dev

# Type checking
npx tsc --noEmit

# Build
npm run build
```

## Architecture

- **Client**: GraphQL client with query builder and pagination helpers
- **Types**: Comprehensive TypeScript types for all Jobber entities
- **Tools**: Organized by domain, each with Zod input validation
- **Server**: MCP server implementation with tool registration
- **UI**: React apps with Tailwind CSS dark theme

## Tools Highlights

### Job Management
- Create and update jobs with client and property assignments
- Track job status (Active, Completed, Late, etc.)
- Manage visits and schedule field work
- Add line items and calculate totals

### Client Management
- Full client CRUD operations
- Property management for service locations
- Client search and filtering
- Archive/unarchive capabilities

### Financial Operations
- Quote creation and approval workflow
- Invoice generation and payment tracking
- Expense management
- Tax calculation and application
- Revenue and profitability reporting

### Scheduling & Time Tracking
- Visit creation and assignment
- Team member scheduling
- Time entry tracking
- Timesheet summaries

### Custom Forms
- Build custom forms for field data collection
- Form submission tracking
- Link forms to jobs and visits

## License

MIT

## Author

MCPEngine
