MCP Server for Fatture in Cloud API - Italian electronic invoicing with Claude AI
Project description
Fatture in Cloud MCP Server
๐ฎ๐น Italiano | ๐ฌ๐ง English
Italiano
Server MCP (Model Context Protocol) per integrare Fatture in Cloud con Claude AI e altri assistenti compatibili.
Permette di gestire fatture elettroniche italiane tramite conversazione naturale.
โจ Funzionalitร (23 tool)
| Tool | Descrizione |
|---|---|
list_invoices |
Lista fatture/NDC/proforma emesse per anno/mese |
get_invoice |
Dettaglio completo documento |
get_pdf_url |
URL PDF e link web documento |
list_clients |
Lista clienti con filtro |
get_company_info |
Info azienda collegata |
create_client |
Crea nuovo cliente in anagrafica |
update_client |
Aggiorna dati cliente esistente |
create_invoice |
Crea nuova fattura (bozza) con codice SDI automatico โ opzionale revenue_center ๐ |
create_credit_note |
Crea nota di credito (bozza) โ opzionale revenue_center ๐ |
create_proforma |
Crea proforma (bozza, non inviabile SDI) โ opzionale revenue_center ๐ |
convert_proforma_to_invoice |
Converte proforma in fattura elettronica โ opzionale revenue_center ๐ |
update_document |
Modifica parziale documento bozza โ opzionale revenue_center ๐ |
duplicate_invoice |
Duplica fattura con codice SDI aggiornato โ opzionale revenue_center ๐ |
delete_invoice |
Elimina documento bozza (non inviato) |
send_to_sdi |
Invia fattura allo SDI |
get_invoice_status |
Stato fattura elettronica SDI |
send_email |
Invia copia cortesia via email |
list_received_documents |
Fatture passive (fornitori) โ espone cost_center ๐ |
get_received_document |
๐ Dettaglio fattura passiva per ID |
create_received_document |
๐ Crea documento passivo (spesa/NDC) con opzionale cost_center |
list_cost_centers |
๐ Lista centri di costo/ricavo configurati |
get_situation |
Dashboard: fatturato netto, incassato, costi, margine |
check_numeration |
Verifica continuitร numerica fatture |
Nota: La marcatura dei pagamenti come "pagato" non รจ supportata. Usa il pannello web di Fatture in Cloud per questa operazione.
๐ Installazione
Prerequisiti
- Python 3.10+
- Account Fatture in Cloud con API attive
- Claude Desktop o altro client MCP
1. Clona il repository
git clone https://github.com/aringad/fattureincloud-mcp.git
cd fattureincloud-mcp
2. Crea ambiente virtuale e installa dipendenze
python -m venv venv
source venv/bin/activate # Linux/Mac
# oppure: venv\Scripts\activate # Windows
pip install -r requirements.txt
3. Configura le credenziali
Copia il file di esempio e inserisci i tuoi dati:
cp .env.example .env
Modifica .env:
FIC_ACCESS_TOKEN=a/xxxxx.yyyyy.zzzzz
FIC_COMPANY_ID=123456
FIC_SENDER_EMAIL=fatturazione@tuaazienda.it
# Opzionali (cache locale, vedi sezione Caching):
# FIC_CACHE_DIR=~/.fattureincloud-mcp/cache
# FIC_CACHE_DISABLED=1
Come ottenere le credenziali:
- Accedi a Fatture in Cloud
- Vai su Impostazioni > API e Integrazioni
- Crea un Token Manuale con i permessi necessari
- Il
COMPANY_IDรจ visibile nell'URL quando sei loggato
4. Configura Claude Desktop
Modifica ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) o %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"fattureincloud": {
"command": "/percorso/completo/fattureincloud-mcp/venv/bin/python",
"args": ["/percorso/completo/fattureincloud-mcp/server.py"],
"env": {
"FIC_ACCESS_TOKEN": "a/xxxxx.yyyyy.zzzzz",
"FIC_COMPANY_ID": "123456",
"FIC_SENDER_EMAIL": "fatturazione@tuaazienda.it"
}
}
}
}
5. Riavvia Claude Desktop
Chiudi completamente Claude Desktop (Cmd+Q su Mac) e riaprilo.
๐ฌ Esempi d'uso
"Mostrami le fatture di dicembre 2024"
"Qual รจ la situazione finanziaria del 2025?"
"Duplica la fattura 310 cambiando 2025 in 2026"
"Invia la fattura 326 allo SDI"
"Manda la copia cortesia via email"
"Quali fatture devo ancora incassare?"
"Verifica la numerazione delle fatture 2025"
"Converti la proforma 12 in fattura"
"Crea un nuovo cliente: Rossi SRL, P.IVA 01234567890"
"Quali centri di costo ho configurato?"
"Crea una fattura per Acme con centro di ricavo 'Progetto Alpha'"
"Registra una spesa di 500โฌ + IVA da Fornitore X sul centro di costo 'Progetto Alpha'"
๐พ Caching
Per ridurre le chiamate API ridondanti, le anagrafiche clienti e la lista dei centri di costo vengono mantenute in cache locale (file JSON in ~/.fattureincloud-mcp/cache/, scoped per company_id, TTL 24h).
| Env var | Default | Effetto |
|---|---|---|
FIC_CACHE_DIR |
~/.fattureincloud-mcp/cache |
Sovrascrive la directory di cache |
FIC_CACHE_DISABLED |
0 |
Se 1, disabilita lettura e scrittura cache |
Per forzare il refresh, cancella la directory di cache:
rm -rf ~/.fattureincloud-mcp/cache
๐ท๏ธ Centri di costo / ricavo
FattureInCloud usa la stessa anagrafica per i "centri di ricavo" sui documenti emessi e i "centri di costo" sui documenti ricevuti. Puoi:
- Recuperare la lista con
list_cost_centers - Passare
revenue_center="<nome>"quando crei una fattura, NDC, proforma, oppure duplichi/aggiorni/converti un documento emesso - Passare
cost_center="<nome>"quando crei un documento ricevuto
Il valore deve esistere giร โ i centri si gestiscono dal pannello web di FattureInCloud (Impostazioni โ Centri di costo). Se passi un nome non riconosciuto, il tool risponde con la lista dei nomi validi.
๐ Known issues
- Duplicazione fattura per cliente specifico: in alcuni casi
duplicate_invoicepuรฒ fallire su configurazioni cliente non identificate. Workaround: duplicare manualmente dal pannello web di FattureInCloud. Bug in indagine โ vedidocs/KNOWN_ISSUES.md.
โ ๏ธ Note di sicurezza
- Le operazioni di scrittura (create, send_to_sdi) richiedono sempre conferma
- L'invio allo SDI รจ irreversibile
- Le fatture vengono create come bozze (draft)
- Il codice univoco SDI viene recuperato automaticamente dall'anagrafica cliente
- Il metodo di pagamento di default รจ MP05 (bonifico)
๐ Changelog
Vedi CHANGELOG.md
๐ Licenza
MIT - Vedi LICENSE
๐จโ๐ป Autore
Sviluppato da Mediaform s.c.r.l. - Genova, Italia
English
MCP (Model Context Protocol) Server to integrate Fatture in Cloud with Claude AI and other compatible assistants.
Manage Italian electronic invoices through natural conversation.
โจ Features (23 tools)
| Tool | Description |
|---|---|
list_invoices |
List invoices/credit notes/proforma by year/month |
get_invoice |
Full document details |
get_pdf_url |
PDF URL and web link for document |
list_clients |
List clients with filter |
get_company_info |
Connected company info |
create_client |
Create new client in registry |
update_client |
Update existing client data |
create_invoice |
Create new invoice (draft) with automatic SDI code โ optional revenue_center ๐ |
create_credit_note |
Create credit note (draft) โ optional revenue_center ๐ |
create_proforma |
Create proforma (draft, not sendable to SDI) โ optional revenue_center ๐ |
convert_proforma_to_invoice |
Convert proforma to electronic invoice โ optional revenue_center ๐ |
update_document |
Partial update of draft document โ optional revenue_center ๐ |
duplicate_invoice |
Duplicate invoice with updated SDI code โ optional revenue_center ๐ |
delete_invoice |
Delete draft document (not yet sent) |
send_to_sdi |
Send invoice to SDI (Italian e-invoice system) |
get_invoice_status |
E-invoice SDI status |
send_email |
Send courtesy copy via email |
list_received_documents |
Received invoices (suppliers) โ exposes cost_center ๐ |
get_received_document |
๐ Received document detail by ID |
create_received_document |
๐ Create passive document (expense / credit note) with optional cost_center |
list_cost_centers |
๐ List configured cost/revenue centers |
get_situation |
Dashboard: net revenue, collected, costs, margin |
check_numeration |
Verify invoice numbering continuity |
Note: Marking payments as "paid" is not supported. Use the Fatture in Cloud web panel for this operation.
๐ Installation
Prerequisites
- Python 3.10+
- Fatture in Cloud account with API enabled
- Claude Desktop or other MCP client
1. Clone the repository
git clone https://github.com/aringad/fattureincloud-mcp.git
cd fattureincloud-mcp
2. Create virtual environment and install dependencies
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
pip install -r requirements.txt
3. Configure credentials
Copy the example file and fill in your data:
cp .env.example .env
Edit .env:
FIC_ACCESS_TOKEN=a/xxxxx.yyyyy.zzzzz
FIC_COMPANY_ID=123456
FIC_SENDER_EMAIL=billing@yourcompany.com
# Optional (local cache, see Caching section):
# FIC_CACHE_DIR=~/.fattureincloud-mcp/cache
# FIC_CACHE_DISABLED=1
How to get credentials:
- Log into Fatture in Cloud
- Go to Settings > API and Integrations
- Create a Manual Token with required permissions
- The
COMPANY_IDis visible in the URL when logged in
4. Configure Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"fattureincloud": {
"command": "/full/path/to/fattureincloud-mcp/venv/bin/python",
"args": ["/full/path/to/fattureincloud-mcp/server.py"],
"env": {
"FIC_ACCESS_TOKEN": "a/xxxxx.yyyyy.zzzzz",
"FIC_COMPANY_ID": "123456",
"FIC_SENDER_EMAIL": "billing@yourcompany.com"
}
}
}
}
5. Restart Claude Desktop
Fully quit Claude Desktop (Cmd+Q on Mac) and reopen it.
๐ฌ Usage examples
"Show me invoices from December 2024"
"What's the financial situation for 2025?"
"Duplicate invoice 310 changing 2025 to 2026"
"Send invoice 326 to SDI"
"Send the courtesy copy via email"
"Which invoices are still pending payment?"
"Check invoice numbering for 2025"
"Convert proforma 12 to invoice"
"Create a new client: Rossi SRL, VAT 01234567890"
"Which cost centers do I have configured?"
"Create an invoice for Acme with revenue center 'Project Alpha'"
"Record a 500โฌ + VAT expense from Supplier X on cost center 'Project Alpha'"
๐พ Caching
To reduce redundant API calls, client lookups and the cost-centers list are cached locally as JSON files (under ~/.fattureincloud-mcp/cache/, scoped per company_id, 24h TTL).
| Env var | Default | Effect |
|---|---|---|
FIC_CACHE_DIR |
~/.fattureincloud-mcp/cache |
Override cache directory |
FIC_CACHE_DISABLED |
0 |
If 1, disable both cache reads and writes |
To force refresh, delete the cache directory:
rm -rf ~/.fattureincloud-mcp/cache
๐ท๏ธ Cost / Revenue Centers
FattureInCloud uses the same registry for "revenue centers" on issued documents and "cost centers" on received documents. You can:
- Retrieve the list via
list_cost_centers - Pass
revenue_center="<name>"when creating an invoice, credit note, proforma, or duplicating/updating/converting an issued document - Pass
cost_center="<name>"when creating a received document
The value must already exist โ centers are managed from the FattureInCloud web panel (Settings โ Cost Centers). If you pass an unknown name, the tool replies with the list of valid names.
๐ Known issues
- Invoice duplication fails for some clients: in specific cases
duplicate_invoicemay fail on unidentified client configurations. Workaround: duplicate manually from the FattureInCloud web panel. Investigation pending โ seedocs/KNOWN_ISSUES.md.
โ ๏ธ Security notes
- Write operations (create, send_to_sdi) always require confirmation
- Sending to SDI is irreversible
- Invoices are created as drafts
- SDI unique code is automatically retrieved from client registry
- Default payment method is MP05 (bank transfer)
๐ Changelog
See CHANGELOG.md
๐ License
MIT - See LICENSE
๐จโ๐ป Author
Developed by Mediaform s.c.r.l. - Genova, Italy
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fattureincloud_mcp-1.9.0.tar.gz.
File metadata
- Download URL: fattureincloud_mcp-1.9.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba2a17e5c7f1a98a3bca54036932591cb6f294a5481d838558c20f1a0dac8ff
|
|
| MD5 |
63374550fad18d1168b5521e35cbd107
|
|
| BLAKE2b-256 |
ab8456a7de0f4fec8b587ae924bc07a868a212ca4fad8e6cddc4423c9227f1a1
|
File details
Details for the file fattureincloud_mcp-1.9.0-py3-none-any.whl.
File metadata
- Download URL: fattureincloud_mcp-1.9.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5292741def49b861f520c138b3354db2f3c4a105a3576a83033221304ede528
|
|
| MD5 |
457f5645ea0ff4a50c46f4709b2a7aa2
|
|
| BLAKE2b-256 |
93155d4aec7e35e5e4397d89d41726538d7ce6e7ce375decfc5ab215e28e53cd
|