MCP Server for HEU Legal API - manage documents and PDFs for e-signature with Claude AI
Project description
HEU Legal MCP Server
MCP server (Model Context Protocol) per integrare l'API HEU Legal con Claude (Claude Desktop, Claude Code, e altri client MCP). Gestisce documenti nativi HEU e PDF firmabili end-to-end via conversazione: creazione, condivisione per firma elettronica (valida in 180+ paesi), sollecito firmatari, download PDF.
Funzionalità
14 tool che coprono l'intera API HEU v1:
Documenti nativi HEU — list_heu_documents, get_heu_document, list_heu_document_placeholders, create_heu_document, prompt_heu_document_signature, download_heu_document_pdf
PDF caricati — list_pdf_documents, get_pdf_document, list_pdf_document_signers, list_pdf_document_signer_placeholders, list_pdf_document_placeholders, create_pdf_document, prompt_pdf_document_signature
Health — get_heu_health
Requisiti
- Python ≥ 3.10
- Una API key HEU Legal (Profile → API Keys nella UI HEU; richiede subscription Enterprise)
- Almeno un template già creato sulla piattaforma HEU (documento nativo o PDF caricato)
Installazione
Da PyPI
pip install heu-mcp
Da sorgenti
git clone https://github.com/Lucav21/heu-mcp.git
cd heu-mcp
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Configurazione
Claude Desktop
Modifica ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) o %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"heu": {
"command": "heu-mcp",
"args": [],
"env": {
"HEU_API_KEY": "la_tua_api_key_qui"
}
}
}
}
Se hai installato da sorgenti con venv:
{
"mcpServers": {
"heu": {
"command": "/path/assoluto/heu-mcp/venv/bin/python",
"args": ["/path/assoluto/heu-mcp/server.py"],
"env": {
"HEU_API_KEY": "la_tua_api_key_qui"
}
}
}
}
Riavvia Claude Desktop dopo la modifica.
Claude Code (CLI)
claude mcp add heu heu-mcp -e HEU_API_KEY=la_tua_api_key_qui
Variabili d'ambiente
| Variabile | Descrizione | Default |
|---|---|---|
HEU_API_KEY |
API key HEU Legal (richiesto) | — |
HEU_BASE_URL |
URL base API | https://api.heulegal.com/v1 |
HEU_DOWNLOAD_DIR |
Cartella dove salvare i PDF scaricati | /tmp |
Esempi d'uso
Dopo aver configurato il MCP, chiedi a Claude:
- "Lista i miei template HEU"
- "Mostrami i firmatari del PDF con id 26"
- "Sollecita la firma del documento 15c587e0-1715-45c6-bf72-24bcb86c0f90"
- "Scarica il PDF del documento X con layout 220 e includi indice"
- "Crea un nuovo PDF firmabile dal template 56 per mario.rossi@example.com"
Note operative
- I tool che creano/inviano (
create_*,prompt_*) chiedono sempre conferma esplicita all'utente prima dell'esecuzione. - Rate limit dell'API: 300 richieste / 5 minuti. Gli header
X-RateLimit-*sono restituiti nelle risposte. prompt_*_signatureha un limite di 1 sollecito ogni 24h per documento (HTTP 429 conRetry-After).download_heu_document_pdfsalva il PDF inHEU_DOWNLOAD_DIRe restituisce il path: il binario non passa nel canale stdio.- Per
create_pdf_documentconsignature_type=feaserve avere credito FEA sufficiente per tutti i firmatari (altrimenti HTTP 422).
Sicurezza
- Le API key non sono mai loggate.
- L'API key è letta solo da variabile d'ambiente: non viene mai scritta nel codice o nelle risposte.
- Il binario PDF è salvato sul filesystem locale, non viene trasmesso via canale MCP.
Sviluppo
git clone https://github.com/Lucav21/heu-mcp.git
cd heu-mcp
python3 -m venv venv
source venv/bin/activate
pip install -e .
# Avvio manuale per debug
HEU_API_KEY=... python server.py
Licenza
MIT — vedi LICENSE.
Link
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 heu_mcp-0.1.0.tar.gz.
File metadata
- Download URL: heu_mcp-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93ea3ab2d55aa5abd73da46f494cfe41a6557a31c26a1bdce06687d6e5b2cf2
|
|
| MD5 |
2d1c0e6f23426413a8c359a9c85a559b
|
|
| BLAKE2b-256 |
487d3c52b878c18eb57240011a2224b5d5bada18ce0476711329223b87318def
|
File details
Details for the file heu_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: heu_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fa0b10c13b0c7a12dec0b50a47f13afb394ba12dfac4aa91a93b2acfaa0449f
|
|
| MD5 |
5d3901116b81a13df7f55bcb8a0fe58a
|
|
| BLAKE2b-256 |
2416909a3982ec57f300628a35539cf8f7c6dd566c6e287c6d7e8cc2535295ae
|