duebuddy-mcp 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ FROM python:3.12-slim
2
+
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PYTHONDONTWRITEBYTECODE=1
5
+
6
+ WORKDIR /app
7
+
8
+ COPY requirements.txt ./
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY server.py ./
12
+
13
+ # stdio-транспорт: сервер общается с MCP-клиентом через stdin/stdout.
14
+ ENTRYPOINT ["python", "/app/server.py"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DueBuddy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.5
2
+ Name: duebuddy-mcp
3
+ Version: 1.1.0
4
+ Summary: MCP server that reads incoming supplier invoices (PDF, photo, XML e-invoices) and returns structured data plus a file for 1C, DATEV or CSV
5
+ Project-URL: Homepage, https://duebuddy.work/mcp-docs
6
+ Project-URL: Documentation, https://duebuddy.work/mcp-docs
7
+ Project-URL: Repository, https://github.com/ANTONDrakon/duebuddy-mcp
8
+ Project-URL: Issues, https://github.com/ANTONDrakon/duebuddy-mcp/issues
9
+ Author-email: DueBuddy <hello@duebuddy.work>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: 1c,accounting,bookkeeping,datev,e-invoicing,factur-x,fattura-pa,invoice,invoice-parsing,invoices,ksef,mcp,model-context-protocol,ocr,peppol,ubl,xrechnung,zugferd
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Financial and Insurance Industry
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Office/Business :: Financial :: Accounting
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: httpx<1,>=0.27
23
+ Requires-Dist: mcp<2,>=1.2.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=8; extra == 'dev'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # duebuddy-mcp
29
+
30
+ MCP server that reads incoming supplier invoices and returns structured data plus a file
31
+ ready for accounting. Works with Claude Desktop, Cursor, Cline and any MCP client.
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install duebuddy-mcp
37
+ ```
38
+
39
+ ## Run
40
+
41
+ ```bash
42
+ DUEBUDDY_API_KEY=your-key duebuddy-mcp
43
+ ```
44
+
45
+ Transport is stdio. Get an API key in the DueBuddy cabinet; 5 invoices are free.
46
+
47
+ ## What it reads
48
+
49
+ - PDF with embedded XML (ZUGFeRD, Factur-X), plain PDF, phone photos, scans
50
+ - E-invoices: XRechnung, FatturaPA, Peppol BIS, KSeF, UBL, ZATCA, 1C/УПД/ЭСФ
51
+ - QR bills
52
+
53
+ Country profiles: `de`, `fr`, `it`, `pl`, `ru`, `kz`, `by`, `us`, `ae`, `sa`, `ua`, `ge`.
54
+
55
+ ## Tools
56
+
57
+ | Tool | What it does | Cost |
58
+ |---|---|---|
59
+ | `parse_invoice` | Reads one invoice, returns a `job_id` | XML and QR free, scans 0.07 EUR per page |
60
+ | `get_result` | Returns status, extracted fields and export links | free, read-only |
61
+ | `get_balance` | Remaining prepaid pages for the key | free, read-only |
62
+ | `topup_link` | Top-up page URL and minimum amount | free, builds a link only |
63
+
64
+ Plus a prompt `invoice_to_accounting` — a step-by-step plan for a batch: check balance, parse,
65
+ poll, validate totals, report.
66
+
67
+ Typical flow: `parse_invoice` → poll `get_result` → use the fields or the export file
68
+ (DATEV EXTF category 21, CSV, Excel, JSON).
69
+
70
+ ## What it does not do
71
+
72
+ It does not issue invoices, does not take payments and does not post entries into 1C or DATEV.
73
+ It returns a file that those systems import.
74
+
75
+ ## Configuration
76
+
77
+ | Variable | Default | Meaning |
78
+ |---|---|---|
79
+ | `DUEBUDDY_API_KEY` | – | API key, so it need not be passed on every call |
80
+ | `DUEBUDDY_BASE_URL` | `https://duebuddy.work` | API endpoint |
81
+ | `DUEBUDDY_TIMEOUT` | `90` | HTTP timeout in seconds |
82
+
83
+ ## Docker
84
+
85
+ ```bash
86
+ docker build -t duebuddy-mcp .
87
+ docker run -i --rm -e DUEBUDDY_API_KEY=your-key duebuddy-mcp
88
+ ```
89
+
90
+ ## License
91
+
92
+ MIT
@@ -0,0 +1,65 @@
1
+ # duebuddy-mcp
2
+
3
+ MCP server that reads incoming supplier invoices and returns structured data plus a file
4
+ ready for accounting. Works with Claude Desktop, Cursor, Cline and any MCP client.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ pip install duebuddy-mcp
10
+ ```
11
+
12
+ ## Run
13
+
14
+ ```bash
15
+ DUEBUDDY_API_KEY=your-key duebuddy-mcp
16
+ ```
17
+
18
+ Transport is stdio. Get an API key in the DueBuddy cabinet; 5 invoices are free.
19
+
20
+ ## What it reads
21
+
22
+ - PDF with embedded XML (ZUGFeRD, Factur-X), plain PDF, phone photos, scans
23
+ - E-invoices: XRechnung, FatturaPA, Peppol BIS, KSeF, UBL, ZATCA, 1C/УПД/ЭСФ
24
+ - QR bills
25
+
26
+ Country profiles: `de`, `fr`, `it`, `pl`, `ru`, `kz`, `by`, `us`, `ae`, `sa`, `ua`, `ge`.
27
+
28
+ ## Tools
29
+
30
+ | Tool | What it does | Cost |
31
+ |---|---|---|
32
+ | `parse_invoice` | Reads one invoice, returns a `job_id` | XML and QR free, scans 0.07 EUR per page |
33
+ | `get_result` | Returns status, extracted fields and export links | free, read-only |
34
+ | `get_balance` | Remaining prepaid pages for the key | free, read-only |
35
+ | `topup_link` | Top-up page URL and minimum amount | free, builds a link only |
36
+
37
+ Plus a prompt `invoice_to_accounting` — a step-by-step plan for a batch: check balance, parse,
38
+ poll, validate totals, report.
39
+
40
+ Typical flow: `parse_invoice` → poll `get_result` → use the fields or the export file
41
+ (DATEV EXTF category 21, CSV, Excel, JSON).
42
+
43
+ ## What it does not do
44
+
45
+ It does not issue invoices, does not take payments and does not post entries into 1C or DATEV.
46
+ It returns a file that those systems import.
47
+
48
+ ## Configuration
49
+
50
+ | Variable | Default | Meaning |
51
+ |---|---|---|
52
+ | `DUEBUDDY_API_KEY` | – | API key, so it need not be passed on every call |
53
+ | `DUEBUDDY_BASE_URL` | `https://duebuddy.work` | API endpoint |
54
+ | `DUEBUDDY_TIMEOUT` | `90` | HTTP timeout in seconds |
55
+
56
+ ## Docker
57
+
58
+ ```bash
59
+ docker build -t duebuddy-mcp .
60
+ docker run -i --rm -e DUEBUDDY_API_KEY=your-key duebuddy-mcp
61
+ ```
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,3 @@
1
+ """DueBuddy MCP server: read incoming invoices from an AI assistant."""
2
+
3
+ __version__ = "1.1.0"
@@ -0,0 +1,331 @@
1
+ """DueBuddy MCP server — reading incoming invoices for AI assistants.
2
+
3
+ Thin, stateless client over the public DueBuddy HTTP API (https://duebuddy.work).
4
+ No customer data is stored here: every tool call proxies one HTTP request.
5
+
6
+ Transport: stdio. Auth: DueBuddy API key (X-Api-Key), passed per call or once
7
+ through the API_KEY environment variable.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ from typing import Any
14
+
15
+ import httpx
16
+ from mcp.server.fastmcp import FastMCP
17
+ from mcp.types import ToolAnnotations
18
+
19
+ BASE_URL = os.environ.get("DUEBUDDY_BASE_URL", "https://duebuddy.work").rstrip("/")
20
+ DEFAULT_KEY = os.environ.get("DUEBUDDY_API_KEY", "").strip()
21
+ TIMEOUT = float(os.environ.get("DUEBUDDY_TIMEOUT", "90"))
22
+
23
+ COUNTRIES = ("de", "fr", "it", "pl", "ru", "kz", "by", "us", "ae", "sa", "ua", "ge")
24
+
25
+ mcp = FastMCP(
26
+ name="duebuddy",
27
+ instructions=(
28
+ "Use this server to turn incoming supplier invoices into structured data. "
29
+ "Supported inputs: PDF (text or scan), phone photos, XML e-invoices "
30
+ "(ZUGFeRD, X-Rechnung, Factur-X, FatturaPA, Peppol BIS, KSeF, UBL) and QR bills. "
31
+ "Supported countries: de, fr, it, pl, ru, kz, by, us, ae, sa, ua, ge. "
32
+ "Typical flow: parse_invoice -> poll get_result -> export fields or a file for accounting. "
33
+ "Cost model: XML and QR invoices are parsed by code and cost nothing; scans and photos "
34
+ "cost 0.07 EUR per page from the prepaid balance. Check the balance with get_balance "
35
+ "before batch work. This server only READS invoices: it does not issue invoices, does not "
36
+ "take payments and does not post entries into DATEV or 1C — it returns a file that those "
37
+ "systems import."
38
+ ),
39
+ )
40
+
41
+
42
+ def _key(api_key: str) -> str:
43
+ return (api_key or DEFAULT_KEY).strip()
44
+
45
+
46
+ def _missing_key() -> dict[str, Any]:
47
+ return {
48
+ "ok": False,
49
+ "error": "api_key_required",
50
+ "message": (
51
+ "No DueBuddy API key. Pass api_key on the call or set DUEBUDDY_API_KEY. "
52
+ "A key is created in the DueBuddy cabinet after sign-up."
53
+ ),
54
+ "how_to_get_key": f"{BASE_URL}/pricing",
55
+ }
56
+
57
+
58
+ @mcp.tool(
59
+ name="parse_invoice",
60
+ annotations=ToolAnnotations(
61
+ title="Parse one incoming invoice",
62
+ readOnlyHint=False,
63
+ destructiveHint=False,
64
+ idempotentHint=False,
65
+ openWorldHint=True,
66
+ ),
67
+ description=(
68
+ "Reads ONE incoming supplier invoice and returns a job id for polling.\n\n"
69
+ "Use when: the user has a single invoice (PDF, photo, scan, XML e-invoice or QR bill) and "
70
+ "wants supplier, invoice number, dates, amounts, VAT or line items extracted.\n"
71
+ "Do not use when: the user asks to ISSUE an invoice, to send a payment, or to post entries "
72
+ "into DATEV/1C — this tool only reads documents. For several documents call it once per "
73
+ "document; the returned job ids can be polled independently.\n\n"
74
+ "Side effects and cost: the document is downloaded and queued for parsing. XML and QR "
75
+ "invoices are parsed by code and cost nothing; scans and photos cost 0.07 EUR per page and "
76
+ "are charged to the prepaid balance. The call is not idempotent: each call creates a new "
77
+ "job and a new charge for scans, so do not retry blindly after a timeout — poll get_result "
78
+ "with the job id instead.\n\n"
79
+ "Parameters: file_url must be a public https link to a single document on duebuddy.work "
80
+ "(upload first via the cabinet); country is a two-letter code from the supported list and "
81
+ "selects the parsing profile — it changes field names and tax rules, but does not change "
82
+ "the price.\n\n"
83
+ "Returns: {ok, job_id, status}. Next step: call get_result with that job_id."
84
+ ),
85
+ )
86
+ def parse_invoice(
87
+ file_url: str,
88
+ country: str = "de",
89
+ api_key: str = "",
90
+ ) -> dict[str, Any]:
91
+ """Start parsing of a single invoice document.
92
+
93
+ Args:
94
+ file_url: Public https URL of one invoice file on duebuddy.work.
95
+ country: Two-letter country profile: de, fr, it, pl, ru, kz, by, us, ae, sa, ua, ge.
96
+ api_key: DueBuddy API key; optional if DUEBUDDY_API_KEY is set.
97
+ """
98
+ key = _key(api_key)
99
+ if not key:
100
+ return _missing_key()
101
+ if country not in COUNTRIES:
102
+ return {"ok": False, "error": "unsupported_country", "supported": list(COUNTRIES)}
103
+
104
+ from urllib.parse import urlparse
105
+
106
+ parsed = urlparse(file_url or "")
107
+ if parsed.scheme != "https" or not (parsed.hostname or "").endswith("duebuddy.work"):
108
+ return {
109
+ "ok": False,
110
+ "error": "invalid_file_url",
111
+ "message": "file_url must be an https link to a file hosted on duebuddy.work",
112
+ }
113
+
114
+ try:
115
+ with httpx.Client(follow_redirects=False, timeout=TIMEOUT) as client:
116
+ got = client.get(file_url, headers={"User-Agent": "duebuddy-mcp/1.1"})
117
+ if got.status_code != 200:
118
+ return {"ok": False, "error": "download_failed", "http_status": got.status_code}
119
+ payload = got.content
120
+ except Exception as exc: # noqa: BLE001
121
+ return {"ok": False, "error": "download_failed", "detail": type(exc).__name__}
122
+
123
+ filename = parsed.path.rsplit("/", 1)[-1] or "invoice.pdf"
124
+ try:
125
+ with httpx.Client(timeout=TIMEOUT) as client:
126
+ resp = client.post(
127
+ f"{BASE_URL}/v1/parse",
128
+ headers={"X-Api-Key": key},
129
+ data={"country": country},
130
+ files={"file": (filename, payload, "application/octet-stream")},
131
+ )
132
+ except Exception as exc: # noqa: BLE001
133
+ return {"ok": False, "error": "request_failed", "detail": type(exc).__name__}
134
+
135
+ if resp.status_code == 402:
136
+ return {
137
+ "ok": False,
138
+ "error": "insufficient_balance",
139
+ "message": "Prepaid balance is empty. Top up from 8 EUR, then repeat the call.",
140
+ "topup_url": f"{BASE_URL}/pricing",
141
+ }
142
+ if resp.status_code not in (200, 201, 202):
143
+ return {"ok": False, "error": "parse_rejected", "http_status": resp.status_code,
144
+ "detail": resp.text[:500]}
145
+
146
+ body = resp.json()
147
+ return {
148
+ "ok": True,
149
+ "job_id": body.get("job_id") or body.get("id"),
150
+ "status": body.get("status"),
151
+ "next_step": "call get_result with this job_id",
152
+ }
153
+
154
+
155
+ @mcp.tool(
156
+ name="get_result",
157
+ annotations=ToolAnnotations(
158
+ title="Get parsed invoice result",
159
+ readOnlyHint=True,
160
+ destructiveHint=False,
161
+ idempotentHint=True,
162
+ openWorldHint=True,
163
+ ),
164
+ description=(
165
+ "Returns the result of a parse job started by parse_invoice: structured fields "
166
+ "(supplier, invoice number, dates, net/VAT/gross, currency, line items) plus export links "
167
+ "for accounting systems.\n\n"
168
+ "Use when: you already have a job_id and want its status or its extracted data.\n"
169
+ "Do not use when: you have no job_id yet — start with parse_invoice. Do not poll in a tight "
170
+ "loop; one call every few seconds is enough, and jobs for text PDFs or XML usually finish "
171
+ "in under a minute.\n\n"
172
+ "Side effects and cost: none. This call is read-only and idempotent, reads nothing from the "
173
+ "prepaid balance, and can be repeated safely.\n\n"
174
+ "Parameters: job_id is the identifier returned by parse_invoice for the same API key.\n\n"
175
+ "Returns: {ok, result} where result.status is one of queued, processing, done, failed; on "
176
+ "done it also carries fields and export links."
177
+ ),
178
+ )
179
+ def get_result(job_id: str, api_key: str = "") -> dict[str, Any]:
180
+ """Fetch status and data of a parse job.
181
+
182
+ Args:
183
+ job_id: Identifier returned by parse_invoice.
184
+ api_key: DueBuddy API key; optional if DUEBUDDY_API_KEY is set.
185
+ """
186
+ key = _key(api_key)
187
+ if not key:
188
+ return _missing_key()
189
+ if not job_id:
190
+ return {"ok": False, "error": "job_id_required"}
191
+ try:
192
+ with httpx.Client(timeout=TIMEOUT) as client:
193
+ resp = client.get(f"{BASE_URL}/v1/parse/{job_id}", headers={"X-Api-Key": key})
194
+ except Exception as exc: # noqa: BLE001
195
+ return {"ok": False, "error": "request_failed", "detail": type(exc).__name__}
196
+ if resp.status_code != 200:
197
+ return {"ok": False, "error": "not_found_or_forbidden", "http_status": resp.status_code}
198
+ return {"ok": True, "result": resp.json()}
199
+
200
+
201
+ @mcp.tool(
202
+ name="get_balance",
203
+ annotations=ToolAnnotations(
204
+ title="Check prepaid balance",
205
+ readOnlyHint=True,
206
+ destructiveHint=False,
207
+ idempotentHint=True,
208
+ openWorldHint=True,
209
+ ),
210
+ description=(
211
+ "Shows how many scanned pages are left on the prepaid balance for this API key.\n\n"
212
+ "Use when: before a batch of scans or photos, or when parse_invoice answered "
213
+ "insufficient_balance and you need to confirm the remaining amount.\n"
214
+ "Do not use when: the user asks about invoice content — that is get_result.\n\n"
215
+ "Side effects and cost: none; read-only and idempotent.\n\n"
216
+ "Parameters: api_key is the DueBuddy key; optional if DUEBUDDY_API_KEY is set.\n\n"
217
+ "Returns: {ok, balance} with the remaining pages and the current plan."
218
+ ),
219
+ )
220
+ def get_balance(api_key: str = "") -> dict[str, Any]:
221
+ """Return remaining prepaid pages for the API key.
222
+
223
+ Args:
224
+ api_key: DueBuddy API key; optional if DUEBUDDY_API_KEY is set.
225
+ """
226
+ key = _key(api_key)
227
+ if not key:
228
+ return _missing_key()
229
+ try:
230
+ with httpx.Client(timeout=TIMEOUT) as client:
231
+ resp = client.get(f"{BASE_URL}/v1/usage", headers={"X-Api-Key": key})
232
+ except Exception as exc: # noqa: BLE001
233
+ return {"ok": False, "error": "request_failed", "detail": type(exc).__name__}
234
+ if resp.status_code != 200:
235
+ return {"ok": False, "error": "request_failed", "http_status": resp.status_code}
236
+ return {"ok": True, "balance": resp.json()}
237
+
238
+
239
+ @mcp.tool(
240
+ name="topup_link",
241
+ annotations=ToolAnnotations(
242
+ title="Get top-up link",
243
+ readOnlyHint=True,
244
+ destructiveHint=False,
245
+ idempotentHint=True,
246
+ openWorldHint=False,
247
+ ),
248
+ description=(
249
+ "Returns the page where the prepaid balance can be topped up, and the minimum amount.\n\n"
250
+ "Use when: the balance is empty or too low for the documents the user wants to process.\n"
251
+ "Do not use when: the balance is sufficient — check it with get_balance first.\n\n"
252
+ "Side effects and cost: none. The call only builds a link; the payment itself happens in "
253
+ "the browser and is handled by the payment provider, never by this server.\n\n"
254
+ "Parameters: amount_eur is informational only and does not create an order.\n\n"
255
+ "Returns: {ok, url, minimum_eur}."
256
+ ),
257
+ )
258
+ def topup_link(amount_eur: float = 8.0) -> dict[str, Any]:
259
+ """Return the top-up page URL and the minimum amount.
260
+
261
+ Args:
262
+ amount_eur: Requested amount in euro, informational only.
263
+ """
264
+ return {
265
+ "ok": True,
266
+ "url": f"{BASE_URL}/pricing",
267
+ "minimum_eur": 8,
268
+ "requested_eur": amount_eur,
269
+ "note": "payment is handled by the payment provider inside the browser",
270
+ }
271
+
272
+
273
+ @mcp.prompt(
274
+ name="invoice_to_accounting",
275
+ description=(
276
+ "Reusable working instruction for a batch of incoming supplier invoices: check balance, "
277
+ "parse each document, poll results, validate totals, then report with export links."
278
+ ),
279
+ )
280
+ def invoice_to_accounting(country: str = "de", documents: str = "") -> str:
281
+ """Step-by-step plan for processing a batch of invoices.
282
+
283
+ Args:
284
+ country: Two-letter parsing profile for the batch.
285
+ documents: Short description of the batch, e.g. "37 PDF scans from one supplier".
286
+ """
287
+ return (
288
+ "You are processing incoming supplier invoices for accounting.\n\n"
289
+ f"Batch: {documents or 'not described'}. Country profile: {country}.\n\n"
290
+ "1. Call get_balance first. Scans cost 0.07 EUR per page; XML and QR invoices are free. "
291
+ "If the balance is too low, show topup_link instead of starting work that fails halfway.\n"
292
+ "2. Call parse_invoice once per document. Never retry a timed-out call blindly: it creates a "
293
+ "new job and a new charge; poll get_result with the existing job id.\n"
294
+ "3. Poll get_result with a pause between calls until status is done or failed.\n"
295
+ "4. Validate: document total vs sum of lines, and VAT rate against stated VAT. Flag mismatches.\n"
296
+ "5. Report per document: supplier, number, date, net, VAT, gross, currency, export link. "
297
+ "Then one summary line with the batch total.\n\n"
298
+ "Never invent values. This server only reads invoices; it does not issue invoices, take "
299
+ "payments, or post entries into 1C or DATEV."
300
+ )
301
+
302
+
303
+ def main() -> None:
304
+ """Запуск сервера. По умолчанию — stdio; --help и --version отвечают в консоли."""
305
+ import argparse
306
+
307
+ parser = argparse.ArgumentParser(
308
+ prog="duebuddy-mcp",
309
+ description=(
310
+ "MCP server that reads incoming supplier invoices (PDF, photo, XML e-invoices) "
311
+ "and returns structured data plus a file for 1C, DATEV or CSV. "
312
+ "Transport is stdio: run it from an MCP client, not from a terminal."
313
+ ),
314
+ )
315
+ parser.add_argument("--version", action="store_true", help="print version and exit")
316
+ parser.add_argument("--list-tools", action="store_true", help="print tool names and exit")
317
+ args = parser.parse_args()
318
+
319
+ if args.version:
320
+ from duebuddy_mcp import __version__
321
+
322
+ print(f"duebuddy-mcp {__version__}")
323
+ return
324
+
325
+ if args.list_tools:
326
+ for name in ("parse_invoice", "get_result", "get_balance", "topup_link"):
327
+ print(name)
328
+ print("prompt: invoice_to_accounting")
329
+ return
330
+
331
+ mcp.run(transport="stdio")
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "duebuddy-mcp"
7
+ version = "1.1.0"
8
+ description = "MCP server that reads incoming supplier invoices (PDF, photo, XML e-invoices) and returns structured data plus a file for 1C, DATEV or CSV"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "DueBuddy", email = "hello@duebuddy.work" }]
13
+ keywords = [
14
+ "mcp", "model-context-protocol", "invoice", "invoices", "invoice-parsing",
15
+ "e-invoicing", "zugferd", "xrechnung", "factur-x", "fattura-pa", "peppol",
16
+ "ksef", "ubl", "ocr", "accounting", "datev", "1c", "bookkeeping",
17
+ ]
18
+ classifiers = [
19
+ "Development Status :: 4 - Beta",
20
+ "Intended Audience :: Financial and Insurance Industry",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Topic :: Office/Business :: Financial :: Accounting",
27
+ ]
28
+ dependencies = [
29
+ "mcp>=1.2.0,<2",
30
+ "httpx>=0.27,<1",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ dev = ["pytest>=8"]
35
+
36
+ [project.urls]
37
+ Homepage = "https://duebuddy.work/mcp-docs"
38
+ Documentation = "https://duebuddy.work/mcp-docs"
39
+ Repository = "https://github.com/ANTONDrakon/duebuddy-mcp"
40
+ Issues = "https://github.com/ANTONDrakon/duebuddy-mcp/issues"
41
+
42
+ [project.scripts]
43
+ duebuddy-mcp = "duebuddy_mcp.server:main"
44
+
45
+ [tool.hatch.build.targets.wheel]
46
+ packages = ["duebuddy_mcp"]
@@ -0,0 +1,2 @@
1
+ mcp>=1.2.0,<2
2
+ httpx>=0.27,<1