{"id":49030016,"url":"https://github.com/erwanpaccard/irpp-mcp","last_synced_at":"2026-04-19T09:01:23.557Z","repository":{"id":352360307,"uuid":"1214852680","full_name":"erwanpaccard/irpp-mcp","owner":"erwanpaccard","description":"🧮 Serveur MCP — Simulateur IRPP officiel DGFiP (code source Mlang/INRIA, revenus 2023)","archived":false,"fork":false,"pushed_at":"2026-04-19T07:07:39.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T08:27:07.927Z","etag":null,"topics":["claude-code","dgfip","france","impots","mcp","python","tax"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erwanpaccard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-19T06:12:41.000Z","updated_at":"2026-04-19T07:07:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"49af4a09-c2fb-45dc-9476-35e25cfca266","html_url":"https://github.com/erwanpaccard/irpp-mcp","commit_stats":null,"previous_names":["erwanpaccard/irpp-mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/erwanpaccard/irpp-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwanpaccard%2Firpp-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwanpaccard%2Firpp-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwanpaccard%2Firpp-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwanpaccard%2Firpp-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erwanpaccard","download_url":"https://codeload.github.com/erwanpaccard/irpp-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwanpaccard%2Firpp-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32000740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","dgfip","france","impots","mcp","python","tax"],"created_at":"2026-04-19T09:00:57.056Z","updated_at":"2026-04-19T09:01:23.542Z","avatar_url":"https://github.com/erwanpaccard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧮 irpp-mcp — Simulateur IRPP officiel DGFiP\n\nServeur MCP Python qui calcule l'impôt sur le revenu français à partir du **code source officiel DGFiP**, compilé via [Mlang (OCamlPro/DGFiP)](https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/Mlang). Calcul 100% local, zéro appel réseau.\n\n**Revenus couverts : 2023** (déclaration 2024). Voir [Limitations](#limitations).\n\n---\n\n## Architecture\n\n```\nSources DGFiP (langage M)  →  Mlang (OCamlPro/DGFiP)  →  C (~55 Mo)  →  irpp_calc\n                                                                           ↓\n                                                                    irpp_mcp.py (MCP)\n                                                                           ↓\n                                                                      Claude Code\n```\n\n---\n\n## Arborescence attendue\n\nAvant de commencer, créer un répertoire de travail. À la fin de l'installation, la structure sera :\n\n```\n~/impots/\n├── calculette-ir-master/           ← sources DGFiP téléchargées (étape 1)\n│   └── sources2023m_8_0/\n├── mlang-src/                      ← compilateur Mlang cloné (étape 2)\n│   ├── _build/default/src/main.exe\n│   ├── m_ext/2023/\n│   └── examples/dgfip_c/ml_primitif/c_driver/\n│       └── irdata.c\n├── output/                         ← C générés (étape 3) + binaire (étape 4)\n│   ├── irpp_driver.c               ← fourni dans ce repo\n│   ├── Makefile                    ← fourni dans ce repo\n│   └── irpp_calc                   ← binaire compilé\n└── irpp-mcp/                       ← ce repo (cloné en premier)\n    └── irpp_mcp.py\n```\n\n**Commencer par cloner ce repo :**\n\n```bash\nmkdir ~/impots \u0026\u0026 cd ~/impots\ngit clone https://github.com/erwanpaccard/irpp-mcp.git\n```\n\n---\n\n## Installation rapide (binaire pré-compilé)\n\nSi vous êtes sous Linux x86-64 ou WSL (Ubuntu 22.04+), vous pouvez sauter les étapes 1 à 4 et télécharger directement le binaire pré-compilé :\n\n```bash\nmkdir -p ~/impots/output\nwget https://github.com/erwanpaccard/irpp-mcp/releases/download/v1.0.0/irpp_calc \\\n     -O ~/impots/output/irpp_calc\nchmod +x ~/impots/output/irpp_calc\n\n# Tester\nprintf \"V_0AC=1\\nTSHALLOV=50000.00\\n\" | ~/impots/output/irpp_calc\n# → {\"IINET\": 6786.00, \"NBPT\": 1.00, \"RNI\": 45000.00, ...}\n```\n\nPuis passer directement à l'[étape 5](#étape-5--installer-le-serveur-mcp).\n\n---\n\n## Installation complète (compilation depuis les sources)\n\n### Prérequis\n\n- WSL (Ubuntu 22.04 recommandé) — nécessaire pour compiler et exécuter le binaire Linux\n- Python 3.11+ avec `pip`\n- `gcc`, `make`, `git`, `opam`, `unzip`\n\n---\n\n### Étape 1 — Sources DGFiP (langage M)\n\nLe code fiscal officiel est publié par la DGFiP sur Adullact sous licence CeCILL 2.1. Aucun compte requis.\n\n```bash\ncd ~/impots\ncurl -L \"https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/calculette-ir/-/archive/master/calculette-ir-master.zip\" \\\n     -o calculette-ir-master.zip\nunzip calculette-ir-master.zip\n```\n\nDossier utile : `calculette-ir-master/sources2023m_8_0/`\n\n---\n\n### Étape 2 — Compiler Mlang (~15 min)\n\n```bash\ncd ~/impots\nsudo apt install libgmp-dev libmpfr-dev git opam bubblewrap unzip bzip2 patch\n\ngit clone https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/Mlang.git mlang-src\ncd mlang-src\n\n# Correctif obligatoire (version non substituée dans les fichiers opam)\nsed -i 's/%%VERSION%%/0.0.1/g' mlang.opam irj_checker.opam\n\nOPAMYES=1 make init\nmake build\n```\n\nBinaire produit : `mlang-src/_build/default/src/main.exe`\n\n---\n\n### Étape 3 — Générer les fichiers C depuis les sources M\n\n```bash\ncd ~/impots/mlang-src\neval $(opam env --switch=$(pwd) --set-switch)\n\n./_build/default/src/main.exe \\\n  -A iliad \\\n  --display_time \\\n  --precision double \\\n  --mpp_function=enchainement_primitif \\\n  --income-year=2023 \\\n  --dgfip_options=-g,-O,-k4,-m2023,-X \\\n  --backend dgfip_c \\\n  --output ../output/irpp_2023.c \\\n  $(find ../calculette-ir-master/sources2023m_8_0 -name 'tgvI.m') \\\n  $(find ../calculette-ir-master/sources2023m_8_0 -name 'errI.m') \\\n  $(find ../calculette-ir-master/sources2023m_8_0 -name '*.m' \\\n    ! -name 'err*.m' ! -name 'tgv*.m' ! -name 'cibles.m' | sort) \\\n  m_ext/2023/cibles.m m_ext/2023/codes_1731.m m_ext/2023/commence_par_5.m \\\n  m_ext/2023/commence_par_7.m m_ext/2023/commence_par_H.m \\\n  m_ext/2023/correctif.m m_ext/2023/main.m\n```\n\n\u003e `tgvI.m` doit être passé en premier — il déclare l'application `iliad`.\n\nRésultat : ~55 Mo de fichiers C dans `~/impots/output/`.\n\n---\n\n### Étape 4 — Compiler le binaire\n\n`irpp_driver.c` et `Makefile` sont déjà dans `output/` (fournis par ce repo). Copier depuis le repo :\n\n```bash\ncp ~/impots/irpp-mcp/output/irpp_driver.c ~/impots/output/\ncp ~/impots/irpp-mcp/output/Makefile ~/impots/output/\n\ncd ~/impots/output\nmake CDRIVER=../mlang-src/examples/dgfip_c/ml_primitif/c_driver\n```\n\nTester :\n\n```bash\nprintf \"V_0AC=1\\nTSHALLOV=50000.00\\n\" | ./irpp_calc\n# → {\"IINET\": 6786.00, \"NBPT\": 1.00, \"RNI\": 45000.00, ...}\n```\n\n---\n\n### Étape 5 — Installer le serveur MCP\n\n```bash\npip install mcp pydantic\n```\n\nVérifier que `BINARY_PATH` dans `irpp_mcp.py` pointe vers le binaire compilé. Par défaut :\n\n```python\nBINARY_PATH = Path(__file__).parent.parent / \"output\" / \"irpp_calc\"\n# → ~/impots/output/irpp_calc  ✓ si vous avez suivi l'arborescence ci-dessus\n```\n\n---\n\n### Étape 6 — Configurer Claude Code\n\nCréer `.mcp.json` à la racine du projet Claude Code :\n\n```json\n{\n  \"mcpServers\": {\n    \"irpp-mcp\": {\n      \"command\": \"python3\",\n      \"args\": [\"/home/user/impots/irpp-mcp/irpp_mcp.py\"]\n    }\n  }\n}\n```\n\nSur Windows (invocation via WSL) :\n\n```json\n{\n  \"mcpServers\": {\n    \"irpp-mcp\": {\n      \"command\": \"wsl\",\n      \"args\": [\"-e\", \"python3\", \"/mnt/c/Users/vous/impots/irpp-mcp/irpp_mcp.py\"]\n    }\n  }\n}\n```\n\n\u003e Adapter le chemin à votre arborescence. Trouver le chemin Python : `which python3` dans WSL.\n\n---\n\n## Utilisation\n\nL'outil MCP `irpp_calculer_ir` accepte les paramètres du formulaire 2042 :\n\n| Paramètre | Case 2042 | Description |\n|-----------|-----------|-------------|\n| `situation` | — | `celibataire` / `marie` / `pacse` / `divorce` / `veuf` |\n| `salaires_declarant1` | 1AJ | Salaires nets imposables déclarant 1 |\n| `salaires_declarant2` | 1BJ | Salaires nets imposables déclarant 2 |\n| `pensions_declarant1` | 1AS | Pensions, retraites, rentes déclarant 1 |\n| `pensions_declarant2` | 1BS | Pensions, retraites, rentes déclarant 2 |\n| `bnc_declarant1` | 5QC | BNC professionnels régime normal |\n| `micro_foncier` | 4BE | Micro-foncier recettes brutes |\n| `dividendes` | 2DC | Dividendes (abattement 40 %) |\n| `plus_values` | 3VG | Plus-values mobilières |\n| `nb_enfants_charge` | 0CF | Enfants mineurs à charge |\n| `nb_enfants_alternee` | 0CH | Enfants en résidence alternée |\n| `per_declarant1` | 6NS | Cotisations PER déductibles déclarant 1 |\n| `per_declarant2` | 6NT | Cotisations PER déductibles déclarant 2 |\n| `pension_alimentaire` | 6GI | Pension alimentaire versée à enfant majeur |\n| `revenus_fonciers_reels` | 4BA | Revenus fonciers nets régime réel |\n| `annee_naissance_declarant1` | — | Année de naissance déclarant 1 |\n| `response_format` | — | `markdown` (défaut) ou `json` |\n\nVariables retournées : `IINET` (impôt net), `NBPT` (parts), `RNI` (revenu net imposable), `REVKIRE` (revenu fiscal de référence), `IRNET`, `IAVIM`, `IRTOTAL`.\n\n---\n\n## Utilisation avec le skill impôts\n\nLe skill [erwanpaccard/impots](https://github.com/erwanpaccard/impots) détecte automatiquement ce serveur MCP et l'utilise pour les simulations IR — les calculs s'appuient alors sur le moteur DGFiP officiel plutôt que sur des estimations LLM.\n\n---\n\n## Limitations\n\n- **Revenus 2023 uniquement** : les sources 2024 (`sources2024m_3_13`) sont incompatibles avec la version actuelle de Mlang (variable `GLOBAL.REPRCM` non résolue dans le contexte `correctif`).\n- **`micro_bnc_declarant1` (case 5TE)** : calcule `REVKIRE` correctement mais donne `IINET=0`. Workaround : passer les recettes × 66 % dans `bnc_declarant1` (5QC).\n- **Binaire Linux uniquement** : sur Windows, l'invocation passe automatiquement par WSL.\n\n---\n\n## Sources et licences\n\n| Composant | Source | Licence |\n|-----------|--------|---------|\n| Sources DGFiP (revenus 2023) | [Adullact — calculette-ir](https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/calculette-ir) | CeCILL 2.1 |\n| Compilateur Mlang | [Mlang (Adullact)](https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/Mlang) | GPL-3.0 |\n| `irpp_driver.c` + `irpp_mcp.py` | Ce dépôt | MIT |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwanpaccard%2Firpp-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferwanpaccard%2Firpp-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwanpaccard%2Firpp-mcp/lists"}