irpp-mcp
🧮 irpp-mcp — 공식 DGFiP IRPP 시뮬레이터
Mlang (OCamlPro/DGFiP)을 통해 컴파일된 공식 DGFiP 소스 코드를 사용하여 프랑스 소득세를 계산하는 Python MCP 서버입니다. 100% 로컬 계산, 네트워크 호출 제로.
대상 소득: 2023년 (2024년 신고). 제한 사항을 참조하세요.
아키텍처
Sources DGFiP (langage M) → Mlang (OCamlPro/DGFiP) → C (~55 Mo) → irpp_calc
↓
irpp_mcp.py (MCP)
↓
Claude CodeRelated MCP server: itr-mcp
예상 디렉토리 구조
시작하기 전에 작업 디렉토리를 만듭니다. 설치가 완료되면 구조는 다음과 같습니다:
~/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.py먼저 이 저장소를 복제합니다:
mkdir ~/impots && cd ~/impots
git clone https://github.com/erwanpaccard/irpp-mcp.git빠른 설치 (사전 컴파일된 바이너리)
Linux x86-64 또는 WSL (Ubuntu 22.04+)을 사용하는 경우, 1~4단계를 건너뛰고 사전 컴파일된 바이너리를 직접 다운로드할 수 있습니다:
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, ...}그런 다음 5단계로 바로 이동합니다.
전체 설치 (소스에서 컴파일)
필수 조건
WSL (Ubuntu 22.04 권장) — Linux 바이너리를 컴파일하고 실행하는 데 필요
Python 3.11+ 및
pipgcc,make,git,opam,unzip
1단계 — DGFiP 소스 (M 언어)
공식 세법은 DGFiP가 CeCILL 2.1 라이선스 하에 Adullact에 게시합니다. 계정이 필요하지 않습니다.
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.zip유용한 폴더: calculette-ir-master/sources2023m_8_0/
2단계 — Mlang 컴파일 (~15분)
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 build생성된 바이너리: mlang-src/_build/default/src/main.exe
3단계 — M 소스에서 C 파일 생성
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.m을 가장 먼저 전달해야 합니다 —iliad애플리케이션을 선언합니다.
결과: ~/impots/output/에 약 55MB의 C 파일 생성.
4단계 — 바이너리 컴파일
irpp_driver.c와 Makefile은 이미 output/에 있습니다(이 저장소에서 제공). 저장소에서 복사:
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_driver테스트:
printf "V_0AC=1\nTSHALLOV=50000.00\n" | ./irpp_calc
# → {"IINET": 6786.00, "NBPT": 1.00, "RNI": 45000.00, ...}5단계 — MCP 서버 설치
pip install mcp pydanticirpp_mcp.py의 BINARY_PATH가 컴파일된 바이너리를 가리키는지 확인합니다. 기본값:
BINARY_PATH = Path(__file__).parent.parent / "output" / "irpp_calc"
# → ~/impots/output/irpp_calc ✓ si vous avez suivi l'arborescence ci-dessus6단계 — Claude Code 구성
Claude Code 프로젝트 루트에 .mcp.json을 생성합니다:
{
"mcpServers": {
"irpp-mcp": {
"command": "python3",
"args": ["/home/user/impots/irpp-mcp/irpp_mcp.py"]
}
}
}Windows의 경우 (WSL을 통한 호출):
{
"mcpServers": {
"irpp-mcp": {
"command": "wsl",
"args": ["-e", "python3", "/mnt/c/Users/vous/impots/irpp-mcp/irpp_mcp.py"]
}
}
}경로를 자신의 디렉토리 구조에 맞게 조정하세요. Python 경로 찾기: WSL에서
which python3.
사용법
MCP 도구 irpp_calculer_ir은 2042 양식의 매개변수를 허용합니다:
매개변수 | 2042 항목 | 설명 |
| — |
|
| 1AJ | 신고자 1의 과세 대상 순 급여 |
| 1BJ | 신고자 2의 과세 대상 순 급여 |
| 1AS | 신고자 1의 연금, 퇴직금, 연금 수령액 |
| 1BS | 신고자 2의 연금, 퇴직금, 연금 수령액 |
| 5QC | BNC 전문직 일반 체계 |
| 4BE | 마이크로 부동산 총수입 |
| 2DC | 배당금 (40% 공제) |
| 3VG | 유가증권 양도소득 |
| 0CF | 부양 미성년 자녀 수 |
| 0CH | 공동 양육 자녀 수 |
| 6NS | 신고자 1의 공제 가능한 PER 기여금 |
| 6NT | 신고자 2의 공제 가능한 PER 기여금 |
| 6GI | 성인 자녀에게 지급된 부양비 |
| 4BA | 실제 체계의 순 부동산 소득 |
| — | 신고자 1의 출생 연도 |
| — |
|
반환 변수: IINET (순 세액), NBPT (몫), RNI (과세 대상 순 소득), REVKIRE (기준 과세 소득), IRNET, IAVIM, IRTOTAL.
impots 스킬과 함께 사용
erwanpaccard/impots 스킬은 이 MCP 서버를 자동으로 감지하여 IR 시뮬레이션에 사용합니다. 계산은 LLM 추정이 아닌 공식 DGFiP 엔진을 기반으로 합니다.
제한 사항
2023년 소득만 해당: 2024년 소스(
sources2024m_3_13)는 현재 Mlang 버전과 호환되지 않습니다 (correctif컨텍스트에서GLOBAL.REPRCM변수가 해결되지 않음).micro_bnc_declarant1(항목 5TE):REVKIRE는 올바르게 계산하지만IINET=0을 반환합니다. 해결 방법: 수입의 66%를bnc_declarant1(5QC)에 입력하세요.Linux 바이너리 전용: Windows에서는 호출이 자동으로 WSL을 통합니다.
출처 및 라이선스
구성 요소 | 출처 | 라이선스 |
DGFiP 소스 (2023년 소득) | CeCILL 2.1 | |
Mlang 컴파일러 | GPL-3.0 | |
| 이 저장소 | 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
Exact French tax & payroll calculations for AI agents: income tax (impôt sur le revenu: parts, quotient familial, décote, TMI), micro-entrepreneur URSSAF contributions (ACRE, versement libératoire) with an optional VAT franchise check (franchise en base de TVA: must I charge VAT?), and gross-to-net salary with employer cost — CDI or CDD (prime de précarité, congés payés), full-time or part-time. Missing information? Your agent gets, for free, the exact questions to ask the user (in French, with types and allowed values) in a single round trip. Deterministic, no LLM: matches all 7,095 values of the official DGFiP tax tables, 60 cases from the official simulators and the official worked examples of the tax doctrine (BOFiP). Unsupported cases are refused for free; you pay $0.005 in USDC via x402 only when the calculation succeeds. Free catalogue tool: list_france_calculators.
The first fiscal MCP server for Spain: IAE/CNAE 2025, AEAT modelos, IRPF/IVA, RETA quota.
Brazil tax reform simulator for AI (CBS/IBS/IS) on Receita Federal's official open-source code.
TaxSort — Tollbooth-monetized MCP server for personal tax transaction classification
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.16461 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.66 PyPIMIT