Facture Électronique France

io.github.cmendezs由 GitHub 帳號 cmendezs 發布v0.9.1更新於 Oct 24, 2026

MCP server for French e-invoicing (XP Z12-013). Manages invoices, validation and compliance.

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理提交法國電子發票與電子申報、查詢發票流、管理 PPF 目錄與 Webhook,並驗證 Factur-X XML

可以做什麼
提交發票(Factur-X、UBL、CII)或電子申報資料,搜尋與取得發票流,更新生命週期狀態,並檢查 Flow API 連線。依 SIREN 查詢公司、依 SIRET 查詢營業場所的 PPF 目錄資訊。管理路由碼與目錄列,包括建立、更新和刪除收票地址。列出、建立、更新和刪除發票流事件的 Webhook 訂閱。安裝選用的 XSLT 2.0 擴充後,可依 Factur-X Schematron 規則驗證 CII XML。
適用情境
適用於參與法國電子發票改革(XP Z12-013)、需要助理與認可平台交換發票和申報、查詢 SIREN/SIRET 目錄資料或管理 Webhook 訂閱的情境。較適合已接入 PA/PDP 的團隊,而非一般開票用途。
執行需求
以 Python 套件形式在本機執行(pip 或 uvx)。需要認可平台提供的憑證,透過環境變數設定:PA_BASE_URL_FLOW、PA_CLIENT_ID、PA_CLIENT_SECRET 和 PA_TOKEN_URL,另可選用 PA_ORGANIZATION_ID 與 PPF_ANNUAIRE_BASE_URL。需要連線至平台與 PPF 目錄的網路。真正的 Schematron 驗證需安裝 xslt2 擴充。
安裝前請注意
需要 OAuth2 用戶端憑證(PA_CLIENT_ID、PA_CLIENT_SECRET),盡量避免以明文寫入設定檔。它會提交發票和申報、變更生命週期狀態,並建立、更新或刪除目錄列與 Webhook,操作會影響真實業務紀錄。它不驗證發票內容,也不產生 PDF/A-3 封裝;最終驗證由認可平台執行,提交可能被拒絕。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Facture Électronique France,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-facture-electronique-fr 🇫🇷

English | Francais

[License] [PyPI version] [Python] [mcp-facture-electronique-fr MCP server]

A Python MCP server exposing the standardized AFNOR XP Z12-013 APIs for the French e-invoicing reform (effective September 1, 2026). This project enables AI agents (Claude, IDEs) to interact natively with the Approved Platform (PA/PDP) ecosystem as a Compatible Solution (SC).


Introduction

This package is built on top of mcp-einvoicing-core, a shared base library for European e-invoicing MCP servers. It provides the OAuth2 HTTP client, token cache, shared models, logging utilities, and exception hierarchy used by this package.

mcp-einvoicing-core is installed automatically as a transitive dependency, no extra step is needed.

For contributors: pip install -e ".[dev]" installs the base package from PyPI automatically.

This server operates in Compatible Solution (CS) mode as defined by the French e-invoicing reform. The CS acts as an intermediary between the company's information system and an Approved Platform (AP/PDP). This means:

  • No profile validation of caller-supplied payloads. The server transmits the invoice file (Factur-X PDF/A-3, UBL 2.1, or CII XML) as provided. Structural and business-rule validation (NF XP Z12-012 profiles, Schematron rules) is performed by the receiving Approved Platform, not by this server.
  • No e-reporting payload validation beyond schema-level XSD. Transaction reports (Flux 10.1/10.3) and payment reports (Flux 10.2/10.4) are validated against the DGFiP v3.2 XSD schema when validate_ereporting_xml is called, but deeper business-rule checks (e.g. coherence between declared amounts and invoice totals) are the responsibility of the AP.
  • No PDF/A-3 envelope generation. The caller must produce the conformant Factur-X PDF/A-3 file with embedded CII XML. This server transmits the finished binary.

The Approved Platform performs final validation and may reject non-conformant submissions with an error code and message.

Installation

Via PyPI (recommended)

bash
pip install mcp-facture-electronique-fr

Or without prior installation using uvx:

bash
uvx mcp-facture-electronique-fr

For Factur-X Schematron validation (validate_facturx, requires the XSLT 2.0 / Saxon-HE backend — see FR-XSLT2-1 in Available tools below):

bash
pip install mcp-facture-electronique-fr[xslt2]

From source

bash
# Clone the repositorygit clone https://github.com/cmendezs/mcp-facture-electronique-fr.gitcd mcp-facture-electronique-fr
# Create the virtual environmentpython -m venv .venvsource .venv/bin/activate  # On Windows: .venv\Scripts\activate
# Install in editable modepip install -e ".[dev]"
bash
# Initial configurationcp .env.example .env# Edit .env with the credentials provided by your PA/PDP

Configuration (.env)

The server requires the following variables to authenticate with an Approved Platform (PA):

VariableDescription
PA_BASE_URL_FLOWBase URL of the PA Flow Service
PA_BASE_URL_DIRECTORYDeprecated — no longer read; see PPF_ANNUAIRE_BASE_URL
PPF_ANNUAIRE_BASE_URLBase URL of the PPF Annuaire service (defaults to the production swagger servers URL; override for sandbox testing)
PA_CLIENT_IDOAuth2 Client ID
PA_CLIENT_SECRETOAuth2 Client Secret
PA_TOKEN_URLAuthentication server URL
PA_ORGANIZATION_IDOrganization identifier for multi-tenant AP (optional)
HTTP_TIMEOUTRequest timeout (default: 30s)
PPF_GLOBAL_IDPPF party GlobalID for the CDAR second RecipientTradeParty (optional; unset by default, see submit_lifecycle_status)
PPF_SCHEME_IDschemeID for PPF_GLOBAL_ID (default 0238)
PPF_NAMEName for the PPF RecipientTradeParty (default PPF)
PPF_ROLE_CODERoleCode for the PPF RecipientTradeParty (default DFH)

Claude Desktop integration

To use this server with Claude, add this configuration to your claude_desktop_config.json file:

json
{  "mcpServers": {    "facture-electronique-fr": {      "command": "uvx",      "args": ["mcp-facture-electronique-fr"],      "env": {        "PA_BASE_URL_FLOW": "https://api.votre-pdp.fr/flow",        "PPF_ANNUAIRE_BASE_URL": "https://aife.economie.gouv.fr/ppf/annuaire-public/v1",        "PA_CLIENT_ID": "votre-id",        "PA_CLIENT_SECRET": "votre-secret",        "PA_TOKEN_URL": "https://auth.votre-pdp.fr/oauth/token"      }    }  }}

Cursor integration

Cursor supports MCP servers via stdio. Add the configuration in:

  • Global (all projects): ~/.cursor/mcp.json
  • Project (this repository only): .cursor/mcp.json
json
{  "mcpServers": {    "facture-electronique-fr": {      "command": "uvx",      "args": ["mcp-facture-electronique-fr"],      "env": {        "PA_BASE_URL_FLOW": "https://api.votre-pdp.fr/flow",        "PPF_ANNUAIRE_BASE_URL": "https://aife.economie.gouv.fr/ppf/annuaire-public/v1",        "PA_CLIENT_ID": "votre-id",        "PA_CLIENT_SECRET": "votre-secret",        "PA_TOKEN_URL": "https://auth.votre-pdp.fr/oauth/token"      }    }  }}

Reload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.

Kiro integration

Kiro supports MCP servers via its dedicated configuration file. Two levels are available:

  • Global (all projects): ~/.kiro/settings/mcp.json
  • Workspace (this repository only): .kiro/settings/mcp.json
json
{  "mcpServers": {    "facture-electronique-fr": {      "command": "uvx",      "args": ["mcp-facture-electronique-fr"],      "env": {        "PA_BASE_URL_FLOW": "https://api.votre-pdp.fr/flow",        "PPF_ANNUAIRE_BASE_URL": "https://aife.economie.gouv.fr/ppf/annuaire-public/v1",        "PA_CLIENT_ID": "votre-id",        "PA_CLIENT_SECRET": "votre-secret",        "PA_TOKEN_URL": "https://auth.votre-pdp.fr/oauth/token"      },      "disabled": false,      "autoApprove": []    }  }}

The file is automatically reloaded on save. You can also open the config via the command palette (Cmd+Shift+P / Ctrl+Shift+P) then MCP.

Kiro security tip: rather than writing secrets in plain text, use the syntax "PA_CLIENT_SECRET": "${PA_CLIENT_SECRET}", Kiro resolves shell environment variables at startup.

Available tools

ServiceDomainStandardMCP Tools
Flow ServiceInvoice flows and e-reportingAnnex A, v1.2.05 tools
PPF Annuaire (directory)Central directory (SIREN/SIRET/routing/addressing)PPF swagger v1.11.020 tools
Webhook ServiceEvent notification subscriptionsAnnex A, v1.2.05 tools
Factur-X ServiceCII XML validation (Schematron)Factur-X 1.09.21 tool

Text bumped to June 2026 (v1.2.0 swagger current) — AFNOR resupplied the XP Z12-013 narrative text in June 2026 without an updated swagger; the server continues to implement the v1.2.0 wire contract.

Note (FR-XSLT2-1, resolved): the bundled Factur-X 1.09.2 Schematron stylesheets require XSLT 2.0, which lxml/libxslt (XSLT 1.0 only) cannot compile — the same root cause as the DE-XSLT2-1 gap tracked for ZUGFeRD. validate_facturx now runs real Schematron validation via Saxon-HE. Install the optional xslt2 extra for this to work: pip install mcp-facture-electronique-fr[xslt2]. Without it, the tool degrades gracefully to level="unavailable".

Note (FR-FLUX11-2026-06, PPF Annuaire): the directory tools are wired directly against the bundled PPF-platform swagger ppf-openapi-annuaire-api-public-1.11.0-openapi.json — this is a PPF-platform-specific interface, not a PDP-agnostic Annex B abstraction. Per the swagger's own description, these endpoints are subject to change and require prior PISTE application publication before use.

Flow Service (Flow management)

  • submit_flow: Submit invoices (Factur-X, UBL, CII) or e-reporting data.
  • search_flows: Multi-criteria search of sent or received flows using the standard filters.
  • submit_lifecycle_status: Update the lifecycle status (e.g., Made available, Collected, Dispute).
  • get_flow: Retrieve the full details and attachments of a specific flow.
  • healthcheck_flow: Test the connectivity and availability of the PA Flow API.

PPF Annuaire (directory)

Wired directly against the bundled PPF-platform swagger ppf-openapi-annuaire-api-public-1.11.0-openapi.json — see the note above.

  • search_company / get_company_by_siren / get_company_by_id_instance: Look up legal units (SIREN).
  • search_establishment / get_establishment_by_siret / get_establishment_by_id_instance: Look up establishments (SIRET).
  • search_routing_code / get_routing_code_by_siret_and_code / get_routing_code_by_id_instance / create_routing_code / update_routing_code / replace_routing_code: Manage routing codes (code-routage).
  • search_directory_line / get_directory_line_by_code / get_directory_line / create_directory_line / update_directory_line / replace_directory_line / delete_directory_line: Manage directory lines (ligne-annuaire), the electronic-invoice receiving addresses.
  • check_ppf_annuaire_health: Check availability of the PPF Annuaire service.

Webhook Service (Webhook management)

  • list_webhooks: List all webhook subscription IDs for the current token holder.
  • get_webhook: Retrieve the full details of a webhook subscription.
  • create_webhook: Subscribe to flow event notifications (filter by flow type, direction, processing rule).
  • update_webhook: Update a webhook's technical parameters (authentication, signature).
  • delete_webhook: Unsubscribe from a webhook.

Architecture

The server acts as an intelligent communication interface between your AI agent and the technical infrastructure of the reform:

text
[ ERP / Business IS ] <--> [ MCP Server ] <--> [ Approved Platform (PA/PDP) ]          ^                        |          |                        v   [ AI Agent (Claude) ] <--- (XP Z12-013 Standard)

Vendor neutrality

This server implements the standard itself: it builds, validates, and signs the document locally. It is not a client for a commercial invoicing platform, and your signing keys and credentials never leave your own infrastructure.

A PDP (Plateforme de Dématérialisation Partenaire) is required by law, but its API is standardized under XP Z12-013, so switching providers is a configuration change, not a code change.

Supported standards

  • AFNOR XP Z12-012: Invoice message formats, profiles, and lifecycle statuses (v1.4, June 2026 edition).
  • AFNOR XP Z12-013: Service interface specifications (June 2026 edition; v1.2.0 wire contract).
  • AFNOR XP Z12-014: Technical implementation guide for business use cases (v1.4, June 2026 edition).
  • France B2B reform: Mandatory rollout schedule (2024-2026).

Tests

bash
# Run the unit and integration test suitepytest tests/ -v

Contributing

Contributions are welcome — see CONTRIBUTING.md for guidelines.

Other e-invoicing MCP servers

CountryServer
🌍 Globalmcp-einvoicing-core
🇧🇪 Belgiummcp-einvoicing-be
🇧🇷 Brazilmcp-nfe-br
🇫🇷 Francemcp-facture-electronique-fr
🇩🇪 Germanymcp-einvoicing-de
🇮🇳 Indiamcp-einvoicing-in
🇮🇹 Italymcp-fattura-elettronica-it
🇲🇽 Mexicomcp-cfdi-mx
🇵🇱 Polandmcp-ksef-pl
🇸🇬 Singaporemcp-invoicenow-sg
🇪🇸 Spainmcp-facturacion-electronica-es
🇦🇪 United Arab Emiratesmcp-einvoicing-ae

License

This project is distributed under the Apache 2.0 license. See the LICENSE file for details. For the full version history, see CHANGELOG.md.

來源:README.md,提交 10daa58

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.9.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分