Skip to main content

facturx-mcp

Serveur MCP officiel de FacturX API : un agent (Claude, Codex, Cursor…) peut simuler, convertir en Factur-X PDF/A-3, valider un fichier et expliquer une règle EN16931, sans écrire de code d'intégration. Construit sur le SDK facturx-api ; transports stdio et HTTP.

Statut 0.1.0 : non publié sur PyPI (ni annuaire MCP). Installation depuis les wheels construites localement. Testé avec le client MCP officiel (SDK Python), pas encore avec Claude Code, Codex ou Cursor (voir « Ce qui est prouvé »).

Installation (locale)

cd sdk/python && python -m build && cd ../mcp && python -m build
pip install ../python/dist/facturx_api-0.1.0-py3-none-any.whl dist/facturx_mcp-0.1.0-py3-none-any.whl
export FACTURX_BASE_URL=https://api.facturxapi.com FACTURX_API_KEY=…
facturx-mcp                                   # stdio (défaut)
facturx-mcp --transport streamable-http --port 8765   # HTTP : http://127.0.0.1:8765/mcp

Déclaration type d'un serveur stdio dans un client MCP (format mcpServers, non testée avec un client du marché) :

{"mcpServers": {"facturx": {"command": "facturx-mcp",
  "env": {"FACTURX_BASE_URL": "https://api.facturxapi.com", "FACTURX_API_KEY": "…"}}}}

Outils

Outil Ce qu'il fait Coût
facturx_dry_run(invoice, validation_target?, output?) simulation ; ready lit generationReadiness gratuit
facturx_convert(invoice, out_dir, validation_target?, output?, idempotency_key?) écrit factur-x.pdf / .xml, rend chemins, tailles, sha256, cible vérifiée 1 facture
facturx_validate(file_path, validation_target?) rapport de validation résumé (10 premières erreurs) facture traitée
facturx_explain_error(code_or_rule) champs du contrat d'intégration public liés à une règle (BR-…), un BT ou un chemin JSON gratuit, sans clé

Les descriptions d'outils disent à l'agent quand les appeler, ce qu'ils renvoient et ce qui coûte. Une erreur API devient un résultat is_error dont le texte est Error executing tool <nom>: {"error": {...}} avec status, code, api_message, request_id et idempotency_key tels que l'API les envoie. Aucune relance automatique (api#2111). Le registre public des codes d'erreur API n'existe pas encore (api#2089) : facturx_explain_error le dit au lieu d'inventer une explication.

Ce qui est prouvé (06/11/2026)

  • 6 tests hors réseau (PYTHONPATH=src python -m unittest discover -s tests, avec facturx-api et mcp installés), connexions sortantes interdites.
  • Client MCP officiel (SDK Python mcp 2.3.0, ClientSession) lançant facturx-mcp en stdio, contre staging (release 900685311ea7), clé sandbox de test, 16:02Z. Trace complète dans traces/stdio-staging-full-path.json :
facturx_explain_error BR-CO-15 -> totals.net (BT-109), totals.tax (BT-110), … depuis GET /api/v1/integration-contract
facturx_dry_run  -> ready=true, generationReadiness ready (request f51f89da-69df-4eea-bf8f-0da1a3e57163)
facturx_convert  -> target verified en16931, xml 4584 o sha256 f332975e…e03c, pdf 20624 o
facturx_validate -> valid=true, validationStatus=valid, profile EN16931, 0 erreur
  • Même serveur en streamable HTTP (16:03Z) : tools/list, facturx_explain_error BT-1 et facturx_dry_run OK ; avec une clé invalide, facturx_dry_run renvoie is_error avec invalid_api_key et le message API intact (traces/http-staging-*.json).
  • Aucune clé dans les traces ni dans les journaux du serveur (vérifié).

Pas encore prouvé : essai depuis Claude Code, Codex ou Cursor (à faire depuis une session du fondateur) ; xml_cii, URL signée, 409/503 réels ; soumission aux annuaires MCP (geste du fondateur).

mcp-name: com.facturxapi/mcp

Metadata

Release files for facturx-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facturx-mcp 0.1.0
File Size Uploaded Provenance Actions
facturx_mcp-0.1.0.tar.gz 9.7 kB Without provenance Details for facturx_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for facturx-mcp 0.1.0
File Interpreter ABI Platform Actions
facturx_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for facturx_mcp-0.1.0-py3-none-any.whl

Total release size: 17.9 kB

Release files / facturx_mcp-0.1.0.tar.gz

Download URL facturx_mcp-0.1.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8cf2e7330157bd56ef3c0e51f863b2fba9f56119ce5f860d9ad92811258c7b27
BLAKE2b-256 checksum
How to use checksums
2b731f1031d563002d8cd2360479038263d625b0a370c9f08d7d21846e87a6bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / facturx_mcp-0.1.0-py3-none-any.whl

Download URL facturx_mcp-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fbfdf3d55b9adbc5f5e3f9a47c9169688a10f23e8e8098eabdb0b79f0fac0da
BLAKE2b-256 checksum
How to use checksums
81ce31883016ea7e08d461aaf87c2d51806a999c3c4be924bce825678a2c5ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Security for facturx-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page