{"_id":"@casys/einvoice-rest","_rev":"4-d8636195bc521ca9a892491a2f5c9c21","name":"@casys/einvoice-rest","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.0":{"name":"@casys/einvoice-rest","version":"0.2.0","keywords":["einvoice","e-invoicing","rest","hono","openapi","iopole","storecove","superpdp"],"license":"MIT","_id":"@casys/einvoice-rest@0.2.0","maintainers":[{"name":"superworldsavior","email":"erpesle@gmail.com"}],"homepage":"https://github.com/Casys-AI/mcp-einvoice#readme","bugs":{"url":"https://github.com/Casys-AI/mcp-einvoice/issues"},"bin":{"einvoice-rest":"einvoice-rest.mjs"},"dist":{"shasum":"5ce68347a3c5621ae66b9c992e5c4f18eab65a3e","tarball":"https://registry.npmjs.org/@casys/einvoice-rest/-/einvoice-rest-0.2.0.tgz","fileCount":3,"integrity":"sha512-hTW+I12BTfXjsko/Dx1RP9UGdZm7HuKO1ra04hbTatt6GZQjDJCcCGXX1WpR2p7ssws0OhHDVB5ZWy+wuzfdcQ==","signatures":[{"sig":"MEUCIQCcHSuU+zWtmMXS9pVf3LnVcMPfekFJM+er3Axj8s/hmAIgRBnpOS8giq1e6Kk/sXiymIIYcDmw8VOC1f/AdsMWKIk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":409183},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"a85973cae95e309de38c409035e6a51990c061a4","_npmUser":{"name":"superworldsavior","email":"erpesle@gmail.com"},"repository":{"url":"git+https://github.com/Casys-AI/mcp-einvoice.git","type":"git"},"_npmVersion":"10.9.4","description":"REST API for e-invoicing — Hono + Zod OpenAPI, runtime-agnostic (Node.js build)","directories":{},"_nodeVersion":"22.22.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/einvoice-rest_0.2.0_1775055512202_0.1310000942238987","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@casys/einvoice-rest","version":"0.2.2","keywords":["einvoice","e-invoicing","rest","hono","openapi","iopole","storecove","superpdp"],"license":"MIT","_id":"@casys/einvoice-rest@0.2.2","maintainers":[{"name":"superworldsavior","email":"erpesle@gmail.com"}],"homepage":"https://github.com/Casys-AI/mcp-einvoice#readme","bugs":{"url":"https://github.com/Casys-AI/mcp-einvoice/issues"},"bin":{"einvoice-rest":"einvoice-rest.mjs"},"dist":{"shasum":"c531cc68e2efef43e365108b4161e4bb2375b0a1","tarball":"https://registry.npmjs.org/@casys/einvoice-rest/-/einvoice-rest-0.2.2.tgz","fileCount":3,"integrity":"sha512-N1P5dVDQM8iF7Hl4PvoMmnoPWSMIiG0do0XcORB7BIpLUeknc4N5Mogxiz9IhpaZq5AO0jujIODV5moEgE79LQ==","signatures":[{"sig":"MEYCIQDEUd/z3d1FFtzygZe5ictzWHZwW0UX9aUjQnR+GScOiQIhAO/pJPEDfR3qdLcKZI+9H38wlPEZYq5oR9xi1B3pqDlV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":401052},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"69bf5be7f3cfc217573e929e53e75ec807f55298","_npmUser":{"name":"superworldsavior","email":"erpesle@gmail.com"},"repository":{"url":"git+https://github.com/Casys-AI/mcp-einvoice.git","type":"git"},"_npmVersion":"10.9.7","description":"REST API for e-invoicing — Hono + Zod OpenAPI, runtime-agnostic (Node.js build)","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/einvoice-rest_0.2.2_1775452894327_0.1389288812271947","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@casys/einvoice-rest","version":"0.3.0","keywords":["einvoice","e-invoicing","rest","hono","openapi","iopole","storecove","superpdp"],"license":"MIT","_id":"@casys/einvoice-rest@0.3.0","maintainers":[{"name":"superworldsavior","email":"erpesle@gmail.com"}],"homepage":"https://github.com/Casys-AI/mcp-einvoice#readme","bugs":{"url":"https://github.com/Casys-AI/mcp-einvoice/issues"},"bin":{"einvoice-rest":"einvoice-rest.mjs"},"dist":{"shasum":"b5f0e01119814d46d0fe728b5c258914f626ee16","tarball":"https://registry.npmjs.org/@casys/einvoice-rest/-/einvoice-rest-0.3.0.tgz","fileCount":3,"integrity":"sha512-ef8ee8gqYC/W+ACgAGj7OjVhsz1ZvJJKKeBh0VLW0larlM4JSi2IMqI3cT78iYxLCvtOrhzsaenZXjMpUb6s3A==","signatures":[{"sig":"MEUCIQDWX03/cnBEd15TVfOT2ASZyE1nvqUnjeMSNOhSESVYJgIgQgnivAeIHduvvt5CzT+68AkemMl95dTJHqs/0ksbK54=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":401515},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"689c69d8335f8b55ea3fc3ff3be509e105c12f0c","_npmUser":{"name":"superworldsavior","email":"erpesle@gmail.com"},"repository":{"url":"git+https://github.com/Casys-AI/mcp-einvoice.git","type":"git"},"_npmVersion":"10.9.7","description":"REST API for e-invoicing — Hono + Zod OpenAPI, runtime-agnostic (Node.js build)","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/einvoice-rest_0.3.0_1775882905416_0.8649828666578474","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@casys/einvoice-rest","version":"0.4.0","description":"REST API for e-invoicing — Hono + Zod OpenAPI, runtime-agnostic (Node.js build)","type":"module","bin":{"einvoice-rest":"einvoice-rest.mjs"},"keywords":["einvoice","e-invoicing","rest","hono","openapi","iopole","storecove","superpdp"],"engines":{"node":">=20.0.0"},"repository":{"type":"git","url":"git+https://github.com/Casys-AI/mcp-einvoice.git"},"license":"MIT","_id":"@casys/einvoice-rest@0.4.0","gitHead":"025bb57bc5511e45693b22c8a207c9feac81ee9b","bugs":{"url":"https://github.com/Casys-AI/mcp-einvoice/issues"},"homepage":"https://github.com/Casys-AI/mcp-einvoice#readme","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-jAozlLZxN2Y1hy4RKmLWOcx8Jxco/F0V/NfPvfhZH3qicKPCmJPqww6yifbdjQ5VuEs8hhzas8LK2n4LFTY3Dg==","shasum":"908c864be53651f297a223cfbe1e43ff249ee052","tarball":"https://registry.npmjs.org/@casys/einvoice-rest/-/einvoice-rest-0.4.0.tgz","fileCount":3,"unpackedSize":410964,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFPnunXfH9AlYaHt8eQMk0IEXWUNYLtlFhcXa+6V2M2+AiEA4w0cgy2O6H5/bts5TVOZ6QOosCOzY6Wz3OI0nfcDwdc="}]},"_npmUser":{"name":"superworldsavior","email":"erpesle@gmail.com"},"directories":{},"maintainers":[{"name":"superworldsavior","email":"erpesle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/einvoice-rest_0.4.0_1776046469018_0.4356207559649521"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-01T14:58:32.117Z","modified":"2026-04-13T02:14:29.332Z","0.2.0":"2026-04-01T14:58:32.339Z","0.2.2":"2026-04-06T05:21:34.508Z","0.3.0":"2026-04-11T04:48:25.572Z","0.4.0":"2026-04-13T02:14:29.174Z"},"bugs":{"url":"https://github.com/Casys-AI/mcp-einvoice/issues"},"license":"MIT","homepage":"https://github.com/Casys-AI/mcp-einvoice#readme","keywords":["einvoice","e-invoicing","rest","hono","openapi","iopole","storecove","superpdp"],"repository":{"type":"git","url":"git+https://github.com/Casys-AI/mcp-einvoice.git"},"description":"REST API for e-invoicing — Hono + Zod OpenAPI, runtime-agnostic (Node.js build)","maintainers":[{"name":"superworldsavior","email":"erpesle@gmail.com"}],"readme":"# mcp-einvoice\n\n[![@casys/mcp-einvoice](https://img.shields.io/npm/v/@casys/mcp-einvoice?label=mcp-einvoice&color=4f46e5)](https://jsr.io/@casys/mcp-einvoice) [![JSR](https://jsr.io/badges/@casys/mcp-einvoice)](https://jsr.io/@casys/mcp-einvoice)\n\nServeur MCP pour la facturation électronique en France. Une interface unique\npour toutes les plateformes agréées (PA), utilisable par n'importe quel agent IA.\n\n<p align=\"center\">\n  <a href=\"https://www.iopole.com/contact?utm_medium=affiliate&utm_source=thenocodeguy&utm_campaign=erwan%20lee%20pesle\"><img src=\"docs/logos/iopole.svg\" alt=\"Iopole\" height=\"40\"></a>&nbsp;&nbsp;&nbsp;&nbsp;\n  <a href=\"https://www.storecove.com/\"><img src=\"docs/logos/storecove.png\" alt=\"Storecove\" height=\"40\"></a>&nbsp;&nbsp;&nbsp;&nbsp;\n  <a href=\"https://www.superpdp.tech/\"><img src=\"docs/logos/superpdp.svg\" alt=\"Super PDP\" height=\"40\"></a>&nbsp;&nbsp;&nbsp;&nbsp;\n  <a href=\"https://portail.chorus-pro.gouv.fr/\"><img src=\"docs/logos/choruspro.svg\" alt=\"Chorus Pro\" height=\"40\"></a>\n</p>\n\n## Le problème\n\nLa réforme de la facturation électronique en France (sept. 2026) impose le\npassage par une Plateforme Agréée. Il en existe 106+, chacune avec sa propre\nAPI. Intégrer une PA, c'est des semaines de travail. En changer, c'est repartir\nde zéro.\n\n**mcp-einvoice** résout ça : un serveur MCP avec 39 tools et 6 viewers qui\nmarchent avec n'importe quelle PA, grâce au pattern adapter.\n\n## Démarrage rapide\n\n```bash\n# 1. Cloner et configurer\ngit clone https://github.com/Casys-AI/mcp-einvoice.git\ncd mcp-einvoice\ncp .env.example .env\n# Remplir les credentials de votre PA (voir \"Obtenir un compte sandbox\")\n\n# 2. Lancer\ndeno task mcp:serve     # Mode HTTP sur localhost:3015\n```\n\n### Connecter à Claude Desktop (stdio)\n\n```json\n{\n  \"mcpServers\": {\n    \"einvoice\": {\n      \"command\": \"deno\",\n      \"args\": [\"run\", \"--allow-all\", \"packages/mcp/server.ts\"],\n      \"env\": {\n        \"EINVOICE_ADAPTER\": \"iopole\",\n        \"IOPOLE_API_URL\": \"https://api.ppd.iopole.fr/v1\",\n        \"IOPOLE_CLIENT_ID\": \"...\",\n        \"IOPOLE_CLIENT_SECRET\": \"...\",\n        \"IOPOLE_CUSTOMER_ID\": \"...\"\n      }\n    }\n  }\n}\n```\n\nRemplacer `EINVOICE_ADAPTER` par `storecove` ou `superpdp` avec les variables\ncorrespondantes (voir `.env.example`).\n\n## Plateformes supportées\n\n|                                                  | Plateforme    | Couverture          | Tools | \n| ------------------------------------------------ | ------------- | ------------------- | ----- |\n| <img src=\"docs/logos/iopole.svg\" height=\"16\">    | **[Iopole](https://www.iopole.com/contact?utm_medium=affiliate&utm_source=thenocodeguy&utm_campaign=erwan%20lee%20pesle)**    | PA française, B2B   | 39/39 |\n| <img src=\"docs/logos/storecove.png\" height=\"16\"> | **[Storecove](https://www.storecove.com/)** | Peppol, 40+ pays | 19/39 |\n| <img src=\"docs/logos/superpdp.svg\" height=\"16\">  | **[Super PDP](https://www.superpdp.tech/)** | PA française, B2B   | 20/39 |\n| <img src=\"docs/logos/choruspro.svg\" height=\"16\"> | **[Chorus Pro](https://portail.chorus-pro.gouv.fr/)** | PPF, secteur public | 6/39  |\n\nSeuls les tools supportés par la plateforme active sont exposés à l'agent.\n[Ajouter une plateforme →](#ajouter-une-plateforme)\n\n## Obtenir un compte sandbox\n\n- **[Iopole](https://www.iopole.com/contact?utm_medium=affiliate&utm_source=thenocodeguy&utm_campaign=erwan%20lee%20pesle)** —\n  couverture complète (39/39 tools), idéal pour démarrer.\n  [Demander un accès sandbox →](https://www.iopole.com/contact?utm_medium=affiliate&utm_source=thenocodeguy&utm_campaign=erwan%20lee%20pesle)\n- **[Storecove](https://www.storecove.com/)** — réseau Peppol international\n- **[Super PDP](https://www.superpdp.tech/)** — PA française, socle AFNOR\n- **[Chorus Pro](https://portail.chorus-pro.gouv.fr/)** — PPF gouvernemental,\n  secteur public. Nécessite un compte PISTE + un compte technique Chorus Pro\n\n## Ce qu'on peut faire\n\n### 39 tools\n\n| Catégorie | Exemples |\n|-----------|----------|\n| **Factures** (11) | Rechercher, consulter, soumettre, télécharger, générer (CII/UBL/Factur-X) |\n| **Annuaire** (3) | Recherche FR (SIRET/SIREN), recherche internationale, vérification Peppol |\n| **Statuts** (2) | Historique de cycle de vie, envoi de statut (accepter, refuser, payer) |\n| **Reporting** (2) | Déclaration de transactions e-reporting |\n| **Webhooks** (5) | CRUD complet sur les webhooks |\n| **Configuration** (16) | Gestion des entités, identifiants, réseaux, enrollment |\n\n### 6 viewers interactifs\n\n| Viewer | Usage |\n|--------|-------|\n| **invoice-viewer** | Facture détaillée + actions (accepter, rejeter, déposer) |\n| **doclist-viewer** | Table avec drill-down, filtres direction/statut |\n| **status-timeline** | Timeline verticale des changements de statut |\n| **directory-card** | Fiche entreprise (SIREN/SIRET, réseaux) |\n| **directory-list** | Résultats annuaire avec recherche client |\n| **action-result** | Feedback visuel d'action |\n\n### Workflow facture\n\n1. `generate_*` → prévisualise la facture dans le viewer\n2. Vérification visuelle + bouton \"Déposer\"\n3. `submit` → envoi à la plateforme\n\n## REST API\n\n```bash\ndeno task rest:serve     # Port 3016\n```\n\n- Swagger UI sur `http://localhost:3016/docs`\n- Auth via `X-API-Key` (env `EINVOICE_REST_API_KEY`, `--no-auth` en dev)\n- Même couche adapter que le serveur MCP\n\n## Packages\n\nMonorepo Deno avec 3 packages, publiés sur [JSR](https://jsr.io/@casys) et [npm](https://www.npmjs.com/org/casys) :\n\n| Package | Rôle |\n|---------|------|\n| [`@casys/einvoice-core`](packages/core/) | Adapters, types, utils partagés |\n| [`@casys/mcp-einvoice`](packages/mcp/) | Serveur MCP — tools + viewers |\n| [`@casys/einvoice-rest`](packages/rest/) | REST API Hono |\n\n```bash\n# Deno / JSR\ndeno add jsr:@casys/mcp-einvoice\n\n# Node / npm\nnpm install @casys/mcp-einvoice\n```\n\n## Commandes\n\n```bash\ndeno task mcp:serve      # MCP HTTP (port 3015)\ndeno task rest:serve     # REST API (port 3016)\ndeno task test           # Tous les tests\ndeno task inspect        # MCP Inspector\n```\n\nOptions serveur : `--http`, `--port=N`, `--adapter=name`, `--categories=csv`\n\n## Ajouter une plateforme\n\nUn template, un contrat de test, et un guide sont fournis pour intégrer une\nnouvelle PA :\n\n```bash\ncp -r packages/core/src/adapters/template/ packages/core/src/adapters/ma-pa/\n# Implémenter client.ts + adapter.ts, puis valider :\ndeno test  # runAdapterContract() vérifie les shapes automatiquement\n```\n\n| Cas | Classe de base | Exemple |\n|-----|----------------|---------|\n| PA française avec AFNOR | `AfnorBaseAdapter` | SuperPDP |\n| PA française sans AFNOR | `BaseAdapter` | Iopole |\n| PPF gouvernemental | `BaseAdapter` | Chorus Pro |\n| Plateforme non-française | `BaseAdapter` | Storecove |\n\nGuide complet : [`packages/core/src/adapters/GUIDE.md`](packages/core/src/adapters/GUIDE.md)\n","readmeFilename":"README.md"}