hourledger-mcp
# hourledger-mcp
An [MCP](https://modelcontextprotocol.io) server that calculates **work hours, overtime, and gross pay** — wrapping the same tested rules engine that powers [HourLedger](https://hourledger.com), a suite of free, no-sign-up work-hours calculators.
## Tools
### `calculate_work_hours`
Takes clock in/out entries (with unpaid breaks), an hourly rate, and a ruleset; returns the per-day and total regular / overtime / double-time split plus gross pay.
Supported rulesets, each covered by the automated test suite:
| Ruleset | Rule |
| --- | --- |
| `federal` | 1.5× past 40 h/week ([FLSA](https://www.dol.gov/agencies/whd/overtime)) |
| `california` | 1.5× past 8 h/day, 2× past 12 h/day, 7th-day rule, no pyramiding ([Labor Code §510](https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=LAB§ionNum=510.)) |
| `alaska` | 1.5× past 8 h/day or 40 h/week (AS 23.10.060) |
| `colorado` | 1.5× past 12 h/day or 40 h/week (COMPS Order) |
| `nevada` | daily 8 h rule only below 1.5× minimum wage — applied automatically from the rate (NRS 608.018) |
Handles overnight shifts, per-entry rounding policies (exact / 5 min / 15 min / 0.1 h), and configurable workweek start day.
### `time_and_a_half`
Quick 1.5× rate and overtime-pay calculation from a rate and OT hours.
## Setup
### Claude Desktop / Claude Code
```json
{
"mcpServers": {
"hourledger": {
"command": "npx",
"args": ["-y", "hourledger-mcp"]
}
}
}
```
Or with Claude Code: `claude mcp add hourledger -- npx -y hourledger-mcp`
## Example
> "How much do I make this week? I worked Monday to Thursday 7am–5pm at $19/hour in Nevada."
The model calls `calculate_work_hours` with the four 10-hour entries and gets back the correct Nevada answer ($19 ≥ $18 cutoff → weekly rule only → 40 regular hours, no OT), with day-by-day detail.
## Interactive calculators
Prefer a UI? Every ruleset has a free, no-sign-up calculator at **[hourledger.com](https://hourledger.com)**:
- [Work hours & overtime](https://hourledger.com) · [Overtime](https://hourledger.com/overtime-calculator) · [Time and a half](https://hourledger.com/time-and-a-half-calculator)
- [California](https://hourledger.com/california-overtime-calculator) · [Alaska](https://hourledger.com/alaska-overtime-calculator) · [Colorado](https://hourledger.com/colorado-overtime-calculator) · [Nevada](https://hourledger.com/nevada-overtime-calculator)
- [Embed a calculator on your own site](https://hourledger.com/embed)
## Disclaimer
General information, not legal or payroll advice. Exemptions and local rules vary — verify disputed pay with your state labor agency or a qualified professional.
## Development
The pay-rules engine (`src/engine.ts` + its 27 tests) is mirrored from the HourLedger site project, where rule changes land first. `npm test` runs the full suite; `prepublishOnly` enforces tests + build before any publish.
## License
MIT
TDQS
Scored across 2 tools
The two tools have distinct purposes: one computes full work-hour calculations with various rulesets, while the other is a simple time-and-a-half overtime rate calculator. Though time_and_a_half overlaps conceptually with calculate_work_hours, the descriptions clearly indicate their different use cases, and an agent would likely select the right tool without confusion.
The naming pattern is inconsistent: 'calculate_work_hours' follows a verb_noun structure, while 'time_and_a_half' is a noun phrase. Both are descriptive and readable, but the lack of a uniform convention makes the set slightly less predictable.
With only two tools, the server feels thin, but the scope is narrowly focused on hourly pay calculations. The tools cover the core functionality well, though a user might expect additional calculator types (e.g., double-time or salary-based) to round out the set.
The calculate_work_hours tool comprehensively handles regular, overtime, and double-time pay across multiple jurisdictions, while time_and_a_half covers a specific standalone use case. No obvious gaps exist within the server's stated purpose, though one could imagine additional pay-related calculators.