irpp-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
🧮 irpp-mcp — Official DGFiP IRPP Simulator
Python MCP server that calculates French income tax using the official DGFiP source code, compiled via Mlang (OCamlPro/DGFiP). 100% local calculation, zero network calls.
Income covered: 2023 (2024 tax return). See Limitations.
Architecture
Sources DGFiP (langage M) → Mlang (OCamlPro/DGFiP) → C (~55 Mo) → irpp_calc
↓
irpp_mcp.py (MCP)
↓
Claude CodeRelated MCP server: itr-mcp
Expected Directory Structure
Before starting, create a working directory. At the end of the installation, the structure will be:
~/impots/
├── calculette-ir-master/ ← sources DGFiP téléchargées (étape 1)
│ └── sources2023m_8_0/
├── mlang-src/ ← compilateur Mlang cloné (étape 2)
│ ├── _build/default/src/main.exe
│ ├── m_ext/2023/
│ └── examples/dgfip_c/ml_primitif/c_driver/
│ └── irdata.c
├── output/ ← C générés (étape 3) + binaire (étape 4)
│ ├── irpp_driver.c ← fourni dans ce repo
│ ├── Makefile ← fourni dans ce repo
│ └── irpp_calc ← binaire compilé
└── irpp-mcp/ ← ce repo (cloné en premier)
└── irpp_mcp.pyStart by cloning this repo:
mkdir ~/impots && cd ~/impots
git clone https://github.com/erwanpaccard/irpp-mcp.gitQuick Installation (pre-compiled binary)
If you are on Linux x86-64 or WSL (Ubuntu 22.04+), you can skip steps 1 to 4 and download the pre-compiled binary directly:
mkdir -p ~/impots/output
wget https://github.com/erwanpaccard/irpp-mcp/releases/download/v1.0.0/irpp_calc \
-O ~/impots/output/irpp_calc
chmod +x ~/impots/output/irpp_calc
# Tester
printf "V_0AC=1\nTSHALLOV=50000.00\n" | ~/impots/output/irpp_calc
# → {"IINET": 6786.00, "NBPT": 1.00, "RNI": 45000.00, ...}Then proceed directly to Step 5.
Full Installation (compilation from source)
Prerequisites
WSL (Ubuntu 22.04 recommended) — required to compile and run the Linux binary
Python 3.11+ with
pipgcc,make,git,opam,unzip
Step 1 — DGFiP Sources (M language)
The official tax code is published by the DGFiP on Adullact under the CeCILL 2.1 license. No account required.
cd ~/impots
curl -L "https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/calculette-ir/-/archive/master/calculette-ir-master.zip" \
-o calculette-ir-master.zip
unzip calculette-ir-master.zipUseful folder: calculette-ir-master/sources2023m_8_0/
Step 2 — Compile Mlang (~15 min)
cd ~/impots
sudo apt install libgmp-dev libmpfr-dev git opam bubblewrap unzip bzip2 patch
git clone https://gitlab.adullact.net/dgfip/impots-nationaux-revenu-patrimoine-particuliers/Mlang.git mlang-src
cd mlang-src
# Correctif obligatoire (version non substituée dans les fichiers opam)
sed -i 's/%%VERSION%%/0.0.1/g' mlang.opam irj_checker.opam
OPAMYES=1 make init
make buildProduced binary: mlang-src/_build/default/src/main.exe
Step 3 — Generate C files from M sources
cd ~/impots/mlang-src
eval $(opam env --switch=$(pwd) --set-switch)
./_build/default/src/main.exe \
-A iliad \
--display_time \
--precision double \
--mpp_function=enchainement_primitif \
--income-year=2023 \
--dgfip_options=-g,-O,-k4,-m2023,-X \
--backend dgfip_c \
--output ../output/irpp_2023.c \
$(find ../calculette-ir-master/sources2023m_8_0 -name 'tgvI.m') \
$(find ../calculette-ir-master/sources2023m_8_0 -name 'errI.m') \
$(find ../calculette-ir-master/sources2023m_8_0 -name '*.m' \
! -name 'err*.m' ! -name 'tgv*.m' ! -name 'cibles.m' | sort) \
m_ext/2023/cibles.m m_ext/2023/codes_1731.m m_ext/2023/commence_par_5.m \
m_ext/2023/commence_par_7.m m_ext/2023/commence_par_H.m \
m_ext/2023/correctif.m m_ext/2023/main.m
tgvI.mmust be passed first — it declares theiliadapplication.
Result: ~55 MB of C files in ~/impots/output/.
Step 4 — Compile the binary
irpp_driver.c and Makefile are already in output/ (provided by this repo). Copy from the repo:
cp ~/impots/irpp-mcp/output/irpp_driver.c ~/impots/output/
cp ~/impots/irpp-mcp/output/Makefile ~/impots/output/
cd ~/impots/output
make CDRIVER=../mlang-src/examples/dgfip_c/ml_primitif/c_driverTest:
printf "V_0AC=1\nTSHALLOV=50000.00\n" | ./irpp_calc
# → {"IINET": 6786.00, "NBPT": 1.00, "RNI": 45000.00, ...}Step 5 — Install the MCP server
pip install mcp pydanticVerify that BINARY_PATH in irpp_mcp.py points to the compiled binary. By default:
BINARY_PATH = Path(__file__).parent.parent / "output" / "irpp_calc"
# → ~/impots/output/irpp_calc ✓ si vous avez suivi l'arborescence ci-dessusStep 6 — Configure Claude Code
Create .mcp.json at the root of the Claude Code project:
{
"mcpServers": {
"irpp-mcp": {
"command": "python3",
"args": ["/home/user/impots/irpp-mcp/irpp_mcp.py"]
}
}
}On Windows (invocation via WSL):
{
"mcpServers": {
"irpp-mcp": {
"command": "wsl",
"args": ["-e", "python3", "/mnt/c/Users/vous/impots/irpp-mcp/irpp_mcp.py"]
}
}
}Adapt the path to your directory structure. Find the Python path:
which python3in WSL.
Usage
The MCP tool irpp_calculer_ir accepts parameters from form 2042:
Parameter | Box 2042 | Description |
| — |
|
| 1AJ | Net taxable wages declarant 1 |
| 1BJ | Net taxable wages declarant 2 |
| 1AS | Pensions, retirement, annuities declarant 1 |
| 1BS | Pensions, retirement, annuities declarant 2 |
| 5QC | Professional BNC standard regime |
| 4BE | Micro-foncier gross receipts |
| 2DC | Dividends (40% allowance) |
| 3VG | Capital gains on securities |
| 0CF | Dependent minor children |
| 0CH | Children in shared custody |
| 6NS | Deductible PER contributions declarant 1 |
| 6NT | Deductible PER contributions declarant 2 |
| 6GI | Alimony paid to adult child |
| 4BA | Net property income real regime |
| — | Birth year declarant 1 |
| — |
|
Returned variables: IINET (net tax), NBPT (shares), RNI (net taxable income), REVKIRE (reference tax income), IRNET, IAVIM, IRTOTAL.
Usage with the impots skill
The erwanpaccard/impots skill automatically detects this MCP server and uses it for IR simulations — calculations then rely on the official DGFiP engine rather than LLM estimates.
Limitations
2023 income only: 2024 sources (
sources2024m_3_13) are incompatible with the current version of Mlang (GLOBAL.REPRCMvariable not resolved in thecorrectifcontext).micro_bnc_declarant1(box 5TE): calculatesREVKIREcorrectly but givesIINET=0. Workaround: pass receipts × 66% inbnc_declarant1(5QC).Linux binary only: on Windows, the invocation automatically goes through WSL.
Sources and licenses
Component | Source | License |
DGFiP Sources (2023 income) | CeCILL 2.1 | |
Mlang Compiler | GPL-3.0 | |
| This repo | MIT |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The first fiscal MCP server for Spain: IAE/CNAE 2025, AEAT modelos, IRPF/IVA, RETA quota.
Calcul fiscal et retraite français, déterministe et sourcé. Aucun conseil.
MCP server for Quaderno — tax-rate calculation, invoices, contacts, products, receipts & expenses.
Calcul fiscal (IR, IFI, PER, plus-value) et retraite français — 32 régimes, sourcé et daté.
Related MCP Servers
- AlicenseAqualityFmaintenanceA local MCP server that enables Claude to answer Norwegian tax questions with actual calculations, covering income, wealth, stocks, funds, real estate, crypto, and more.6121MIT
- AlicenseAqualityBmaintenanceLocal-first MCP server for Indian income tax computation, enabling users to compute taxes, compare regimes, plan advance tax, and parse Form 26AS without sending data to the cloud.129 npm10MIT
- FlicenseAqualityDmaintenanceMCP server for the Swiss federal tax calculator, providing income, wealth, inheritance, and corporate tax figures for all Swiss municipalities and tax years 2010-2026.132-
- AlicenseNot gradedqualityDmaintenanceA standalone MCP server for Indian personal income-tax work (ITR-1/2/3/4 + post-filing notices) with 8 deterministic tools, running fully offline with no API keys.63 PyPIMIT