Skip to main content
Glama
morettimarco

MCP Buste Paga

by morettimarco
README.md
# MCP Buste Paga

An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that parses Italian INAZ payslip PDFs and stores them in a local SQLite database. Connect it to any MCP-compatible AI client to analyze your salary history, search payslip items, and get detailed breakdowns — all with your data staying on your machine.

## Installation

**Requirements:** Python 3.10+, [uv](https://docs.astral.sh/uv/)

Clone the repository and install dependencies:

```bash
git clone https://github.com/morettimarco/MCP-Buste-Paga.git
cd MCP-Buste-Paga
uv sync
```

Verify it runs:

```bash
uv run mcp-buste-paga
```

## Ingesting payslips

Once the server is connected to an AI client (see below), ask the assistant to ingest your payslip PDFs:

> "Ingest my payslips from ~/Documents/Buste"

The `ingest_payslips` tool will recursively scan the directory for `.pdf` files, parse each one, and store the data. Duplicates are automatically skipped via SHA-256 hashing.

## Database location

All data is stored in a local SQLite database at:

```
~/.mcp-buste-paga/buste_paga.db
```

The directory is created automatically on first run. The database contains four tables:

| Table | Description |
|---|---|
| `aziende` | Company information (name, fiscal code, INPS/INAIL codes) |
| `dipendenti` | Employee profile (name, fiscal code, hire date, role, contract) |
| `buste_paga` | Monthly payslip summaries (gross, net, taxes, TFR, etc.) |
| `voci_corpo_busta` | Individual payslip line items (base pay, overtime, deductions, etc.) |

## Available tools

| Tool | Description |
|---|---|
| `ingest_payslips` | Scan a directory for PDF payslips, parse and store them. Returns a summary of ingested/skipped/failed files. |
| `get_employee_summary` | Get employee profile and company details, plus the number of payslips stored. |
| `get_salary_history_tool` | Get salary history (net pay, gross, deductions) ordered by most recent month. Optionally filter by year. |
| `get_payslip_details_tool` | Get the full breakdown of a specific payslip by month and year, including all line items. |
| `search_payslip_items` | Search payslip line items by keyword (e.g. "Straordinario", "Ferie", "Ticket") with per-month and grand totals. |

## Connecting to AI clients

### Claude Desktop

Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "buste-paga": {
      "command": "/full/path/to/uv",
      "args": [
        "--directory",
        "/full/path/to/MCP-Buste-Paga",
        "run",
        "mcp-buste-paga"
      ]
    }
  }
}
```

> **Note:** Use absolute paths. Find your `uv` path with `which uv`.

Restart Claude Desktop. A hammer icon in the chat input confirms the server is connected.

### Claude Code (CLI)

Add to your project's `.mcp.json` or run:

```bash
claude mcp add buste-paga -- uv --directory /full/path/to/MCP-Buste-Paga run mcp-buste-paga
```

### ChatGPT Desktop

ChatGPT Desktop supports MCP servers via its settings. Go to **Settings > Beta features > MCP Servers**, click **Add**, and configure:

- **Name:** buste-paga
- **Command:** `/full/path/to/uv`
- **Arguments:** `--directory /full/path/to/MCP-Buste-Paga run mcp-buste-paga`

### Cursor

Add to `.cursor/mcp.json` in your project root:

```json
{
  "mcpServers": {
    "buste-paga": {
      "command": "/full/path/to/uv",
      "args": [
        "--directory",
        "/full/path/to/MCP-Buste-Paga",
        "run",
        "mcp-buste-paga"
      ]
    }
  }
}
```

### Windsurf

Add to `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "buste-paga": {
      "command": "/full/path/to/uv",
      "args": [
        "--directory",
        "/full/path/to/MCP-Buste-Paga",
        "run",
        "mcp-buste-paga"
      ]
    }
  }
}
```

## Privacy

All payslip data is parsed and stored locally on your machine. No data is sent to external services. The AI client only accesses the data through the MCP tools above.

## License

MIT

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct operation: ingestion, employee profile, salary summary, payslip details, and keyword search. There is no apparent overlap; even the two 'get' tools serve clearly separate purposes (aggregate history vs. individual payslip detail).

Naming Consistency4/5

Most names follow a verb_noun pattern, but two tools have the '_tool' suffix (get_salary_history_tool, get_payslip_details_tool) while others do not. This is a minor inconsistency that doesn't impede understanding, but it breaks the pattern slightly.

Tool Count5/5

With exactly 5 tools, the set is well-scoped for a payslip management server. Each tool addresses a necessary step (ingestion, querying summaries, details, and search) without redundancy or bloat.

Completeness4/5

The server covers the core lifecycle: import payslips, view employee context, review salary history, inspect specific payslips, and search line items. Minor gaps exist (e.g., no list of all payslips as a lightweight endpoint, no update/delete), but the core functionality is complete for typical read-only and ingestion use cases.