FACTRAIL

io.github.baronsigma由 GitHub 帳號 baronsigma 發布v2.4.1更新於 Oct 25, 2026

Evidence infrastructure for agents: source-backed company verification and beta import assessment.

已驗證Streamable HTTP可網頁執行金融商業與電商

概覽

AI 產生的概覽

FACTRAIL 是遠端證據服務,讓助理依 SIREN/SIRET 核驗法國公司,並進行測試階段的歐盟進口評估,回傳附來源、時效與回執的結構化結果。

可以做什麼
先查詢能力、支援對象、資料來源與限制(factrail_capabilities)。依 SIREN/SIRET 核驗法國公司的狀態、法定名稱、總部等事實,並附來源、時效、衝突與涵蓋範圍(factrail_verify)。進行測試階段的歐盟進口評估,涉及關稅分類、稅費與相關證據(factrail_assess)。依回執 ID 重新取得先前的結果並檢查內容完整性(factrail_get_receipt)。為舊整合保留的相容工具仍可呼叫,但已棄用。
適用情境
當工作流程提供法國 SIREN 或 SIRET,且需要可追溯地回答公司是否存在、是否仍營運、法定名稱或總部時使用。也適合明確標示為暫定的進口與關稅初步探索。不適用於一般網頁搜尋、新聞事實查核、非法國公司登記、制裁查核或具約束力的海關裁定。
執行需求
需要遠端 Streamable HTTP 端點;託管服務未宣告需要安裝套件或 API 金鑰。本機執行需 Python 3.11 或更新版本,即時查詢法國公司需設定 INSEE_API_KEY,可選用 FACTRAIL_CACHE_PATH 以持久保存回執。需要能連線至該端點的網路。
安裝前請注意
結果是證據而非事實本身:回執只證明內容完整性,不證明陳述為真。進口評估為測試階段,關稅與營業稅數值為人工整理或暫定,未安裝官方 TARIC 快照,結果不構成具約束力的海關裁定。呼叫端輸入不會自動核驗,未解決欄位應以未知傳遞。FACTRAIL 本身不構成法律上充分的 KYC/KYB 合規系統。README 提到另有按次計費的 Apify 通路。

安裝

在 SourceWeft 中

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

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.baronsigma%2Ffactrail/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "factrail": {
      "type": "http",
      "url": "https://mcp.factrail.online/mcp"
    }
  }
}

README

FACTRAIL

Evidence infrastructure for AI agents.

FACTRAIL gives agents structured, source-backed real-world evidence with provenance, freshness, conflicts, support levels, coverage, unresolved dependencies, and reusable receipts. It is a public beta: capabilities are defined and inspectable, and unsupported scope or failed sources are represented explicitly.

FACTRAIL is a Python Model Context Protocol server. This repository contains package version 2.4.1, the Evidence Contract, tests, operator tooling, and the static site. Hosted deployments may run a different release; inspect the live tools/list and factrail_capabilities results before relying on deployed capabilities.

Connect via MCP

Endpoint: https://mcp.factrail.online/mcp (Streamable HTTP)

json
{  "mcpServers": {    "factrail": {      "url": "https://mcp.factrail.online/mcp"    }  }}

Client configuration varies. Website: factrail.online · Health: healthz.

Why FACTRAIL

Agents should not have to choose between blindly trusting model output and rebuilding source verification from scratch. FACTRAIL provides an evidence layer between agents and real-world data sources. Instead of returning only an answer, it can return what was established, where it came from, how current it is, what remains unresolved, and a receipt another agent can inspect later.

The principle is simple: unknown is better than invented. Caller input is not automatically verified. Derived values inherit the quality of their dependencies. Conflicts, stale data, and source failures remain visible. A capability exposes its limits programmatically.

When an agent should use FACTRAIL

  • Use it when a user or workflow gives a French SIREN/SIRET, or asks whether a French company exists, is active, or what its legal name or head office is, and the answer must be traceable.
  • Use factrail_capabilities first to learn current coverage. Use factrail_get_receipt to re-check a previous result.
  • Don't use it for general web search, news or claim fact-checking, non-French company registries, sanctions/beneficial-ownership checks, or binding customs rulings (see Current limitations).
  • When the envelope lists unresolved fields, pass them on as unknown. Do not fill them from model memory.

Core MCP tools

New integrations should use the generic primitives:

ToolPurpose
factrail_capabilitiesDiscover available capability IDs, operations, versions, inputs, fields, sources, dynamic source state, and limitations. Call this first.
factrail_verifyVerify structured facts for a supported subject. Currently supports company_fr.
factrail_assessAssess a structured real-world situation. Currently supports import (Beta).
factrail_get_receiptRetrieve a prior EvidenceEnvelope by receipt ID and check content integrity.

Compatibility tools remain available: verify_french_company, assess_import, and experimental/compatibility-only analyze_company. New clients should prefer the generic tools. analyze_company does not synthesize unavailable finance, credit, rating, risk, recommendation, executive-count, or confidence values; unavailable fields remain null/unavailable.

Available today: French company verification

The company_fr capability is FACTRAIL's strongest current resolver. It verifies supported French company and establishment information by SIREN or SIRET using INSEE / Sirene and BODACC records. Depending on source records, fields can include identifiers, legal and trade names, status, legal form, NAF/activity code, head office, creation/cessation dates, diffusion status, and BODACC events. No field is guaranteed to exist for every entity.

For current company status and current legal name, INSEE/Sirene current registry data takes precedence over BODACC publication evidence. Lower-priority evidence is retained rather than silently discarded. This can support supplier verification, vendor onboarding, procurement, CRM enrichment, marketplace onboarding, and company/KYB-support workflows. FACTRAIL alone is not a legally sufficient KYC/KYB compliance system.

Example input to factrail_verify (replace the placeholder with an identifier you are authorized to check):

json
{  "subject_type": "company_fr",  "identifier": "<9-digit SIREN or 14-digit SIRET>",  "fields": ["status", "legal_name", "head_office"]}

The actual source response depends on the requested identifier, source availability, and record coverage. FACTRAIL does not fabricate a sample result here.

Beta: trade and import assessment

factrail_assess currently supports assessment_type="import". It accepts structured concepts such as origin, destination, product description, classification or known HS/customs code, goods value, quantity, customs/VAT references, compliance inputs, and freight/insurance values. The result separates caller input, source evidence, classification candidates, and deterministic calculations. Coverage can be partial or provisional.

There is no authoritative EU Member-State VAT integration or complete authoritative landed-cost chain. Curated VAT and tariff values stay marked curated/provisional; derived calculations inherit dependency quality (derived_provisional when their inputs are provisional). Trade assessment is not a binding customs ruling and classification candidates are not definitive customs classification.

Official EU TARIC status

FACTRAIL has infrastructure for validated official European Commission TARIC snapshot ingestion: offline package doctor, strict/compatible parsing, acceptance reporting, hashes/fingerprints, semantic checks, normalized SQLite index, atomic activation, and last-good/stale handling. No genuine Commission TARIC snapshot is currently installed (not_installed). FACTRAIL does not currently serve authoritative live TARIC tariff coverage.

Access2Markets is secondary/supporting evidence, never authoritative TARIC. Curated FACTRAIL tariff references are provisional. No stable official automatic-download endpoint was confirmed, so automatic fetch is unavailable at this time. Operator-supplied official files can be diagnosed and ingested offline; monthly snapshot ingestion is supported, while daily-delta application is deferred.

For operator procedures see TARIC snapshot acceptance and operations and the distribution discovery notes. Detailed tariff calculation is outside the current TARIC snapshot foundation.

Evidence Contract

The canonical EvidenceEnvelope includes schema_version, status, subject, facts, evidence sources, conflicts, coverage, freshness, receipt_id, and generated_at. The current schema is EvidenceEnvelope 1.2; it is independent of the package version.

  • Status can be supported, contradicted, insufficient_evidence, stale, or conflicting_sources; results are not reduced to a boolean.
  • Support levels describe evidence quality: authoritative, supported, derived_supported, derived_provisional, curated, and caller_input. Caller input is not externally verified.
  • Coverage distinguishes requested, resolved, and unresolved fields. Missing input, unsupported fields, and unavailable sources are different states.
  • Freshness records observation times and stale status.
  • Conflicts preserve competing source assertions; field-specific authority policy may resolve a conflict without deleting its lower-priority evidence.
  • Source outcomes distinguish success, partial response, source error/unavailable, source not integrated, disabled lookup, and not required.

A deterministic calculation does not become authoritative merely because its arithmetic is deterministic. Authoritative inputs may support a derived_supported result; provisional inputs produce derived_provisional results.

Receipts

A receipt ID (fr_…) is content-addressed using deterministic canonical hashing. On retrieval, FACTRAIL recomputes the hash and rejects altered content with an integrity error. Supported historical canonicalization remains available. Receipts make an evidence observation reusable and traceable; they provide content integrity, not a digital signature, blockchain record, immutable global ledger entry, or proof that a statement is universally true. The state_fingerprint identifies substantive state across observations. See Evidence Core design.

Sources and trust principles

FACTRAIL's source hierarchy is explicit: official records may be authoritative for defined fields, secondary sources remain secondary, curated references remain curated, and caller input remains input. Source identity, retrieval time, content hashes where available, support level, and source status accompany evidence. Historical publication evidence does not automatically determine current state.

FACTRAIL follows these principles:

  1. Never manufacture evidence; unknown is better than invented.
  2. Caller input is not automatically verified.
  3. Derived values inherit the support quality of their dependencies.
  4. Conflicting sources remain visible.
  5. Source failures and stale evidence are explicit.
  6. Secondary evidence is not silently promoted to authoritative.
  7. Receipts protect content integrity, not philosophical truth.
  8. Capability limits are exposed programmatically.

Quick start: discover, verify, retrieve

Use factrail_capabilities first with {}. The live result identifies currently supported capability IDs and dynamic source state. Then a company verification call uses:

json
{  "subject_type": "company_fr",  "identifier": "<SIREN or SIRET>",  "fields": ["status", "legal_name"]}

To retrieve the result later, pass its actual receipt_id:

json
{"receipt_id":"<receipt_id returned by FACTRAIL>"}

MCP tool calls wrap these argument objects in their normal client protocol. See request examples for generic verify, receipt, and import inputs. Examples use placeholders and do not assert fabricated output.

Run locally

Requires Python 3.11 or newer.

bash
python3 -m venv .venv. .venv/bin/activatepip install -e '.[dev]'cp .env.example .env# Set INSEE_API_KEY in .env for live French company lookups.python3 -m factrail.mcp_http_server

HTTP defaults to port 8765. Use FACTRAIL_HOST and FACTRAIL_PORT to change the bind address and port. Local MCP endpoint: POST http://localhost:8765/mcp; health endpoint: /healthz. For stdio clients, run python3 -m factrail.mcp_server.

Get an INSEE key through the INSEE API portal. Default SQLite cache is /tmp/factrail_cache.db; set FACTRAIL_CACHE_PATH to a persistent path for durable receipts. The server includes per-client rate limiting and stale cache fallback for company lookups.

Public HTTP settings

VariableDefaultMeaning
FACTRAIL_ALLOWED_HOSTSlocalhost/loopbackHost allowlist (DNS-rebinding protection, 421 on mismatch).
FACTRAIL_ALLOWED_ORIGINSunsetComma-separated Origin allowlist. Unset: requests carrying an Origin header are rejected (403); Origin-less API clients work. *: any Origin allowed, CORS enabled; Host check stays on.
FACTRAIL_RATE_LIMIT_PER_MIN60Requests per window per client (0 disables). The client is CF-Connecting-IP, then the first X-Forwarded-For entry, trusted only when the direct peer is loopback.
FACTRAIL_RATE_WINDOW_SECONDS60Sliding window length.
FACTRAIL_RATE_BLOCK_AFTER30Rejected requests within one window before a temporary block (0 disables).
FACTRAIL_RATE_BLOCK_SECONDS300Block duration.
FACTRAIL_GATEWAY_USER_AGENTSSmitheryBotCase-insensitive User-Agent substrings identifying MCP gateways (a Smithery CF-Worker header also counts).
FACTRAIL_GATEWAY_RATE_LIMIT_PER_MIN600Requests per window for each gateway bucket.
FACTRAIL_GATEWAY_RATE_BLOCK_AFTER0Block threshold for gateway buckets (0 = never block).
FACTRAIL_GATEWAY_CLIENT_HEADERunsetHeader a gateway uses to forward an end-user id; when present, gateway traffic is keyed per end user.
FACTRAIL_HIDE_LEGACY_TOOLSoffHide deprecated legacy tools from tools/list (they stay callable).

Excess requests receive HTTP 429 with a JSON body and Retry-After. A static server card is served at /.well-known/mcp/server-card.json.

Current limitations

FACTRAIL does not currently provide arbitrary natural-language fact checking, general web search or URL fetching, news verification, broad global company verification, dedicated beneficial ownership/sanctions/EORI resolvers, authoritative installed EU TARIC data, authoritative EU VAT integration, complete authoritative landed-cost results, arbitrary regulatory verification, signed receipts, blockchain receipts, global immutable evidence ledgers, continuous evidence watches, or general-purpose LLM reasoning over unknown claims.

Deployment and development

For operators, see the deployment checklist, TARIC acceptance guide, and distribution notes. Release history: CHANGELOG. The static site is in site/ and needs no build step.

bash
python3 -m pytest -qpython3 -m compileall -q factrail testspython3 -m factrail.evidence.demand --days 7

The offline suite uses mocks and fixtures; live tests follow the project's --live convention and require external access. Demand telemetry stores normalized categories and linkage, not raw IP addresses, full User-Agent strings, request arguments, authorization headers, or full Evidence envelopes. It helps identify requested capabilities and evidence gaps.

The Apify Actor wrapper is a thin distribution/payment channel for the canonical MCP service; it does not change FACTRAIL's source adapters or evidence behavior.

Public discovery surfaces

Related: Fallback agent tools

Fallback agent tools applies the same rule (tools should report what they checked) to a different question: where to get data. Its source_route tool looks for candidate machine-readable routes (API, OpenAPI, bulk download, feed) on a publisher's site within strict request limits, and treats "not found here" as "not found within checked scope", never as proof that no route exists. It is a separate service (x402 pay-per-call beta, currently Base Sepolia testnet only) with no dependency on FACTRAIL.

License

Code and documentation are licensed under Apache License 2.0. Source data remains subject to publisher terms, including INSEE and BODACC open-data licenses.

來源:README.md,提交 3759490

工具

7

factrail_capabilities

FACTRAIL Capabilities

Use when you need to discover what FACTRAIL can verify or assess before calling another tool. Returns available capabilities, inputs, fields, sources, versions, and limitations; call first to inspect current coverage and source state.

輸入參數operationcapability

factrail_assess

Assess EU Import (Beta)

Use when you need a source-backed assessment of importing a product into the EU (tariff classification, duties, and related evidence). Returns an EvidenceEnvelope; import assessment is Beta and results expose source coverage and support levels.

輸入參數parameters必填assessment_type必填

factrail_verify

Verify French Company

Use when you need verified, source-backed facts about a French company from its SIREN or SIRET. Returns Evidence with provenance, freshness, coverage, conflicts, and a reusable receipt.

輸入參數fieldsidentifier必填subject_type必填

factrail_get_receipt

Get Evidence Receipt

Use when you need to re-fetch or audit a previously returned FACTRAIL result by its receipt ID. Recomputes the stored EvidenceEnvelope's content hash and rejects altered content; this checks integrity, not truth.

輸入參數receipt_id必填

verify_french_company

[Deprecated] French Company Lookup

Deprecated: use factrail_verify instead. Use when an older integration still expects the legacy flat French company lookup by SIREN/SIRET; kept callable for compatibility only.

輸入參數identifier必填

assess_import

[Deprecated] EU Import Assessment

Deprecated: use factrail_assess instead. Use when an older integration still expects the legacy beta EU import assessment format; coverage may be partial or provisional and this is not a binding customs result.

輸入參數modelproduct必填currency必填incotermmaterialquantity必填weight_kgdimensionsgoods_value必填freight_costmanufacturerknown_hs_code另有 6 個

analyze_company

[Deprecated] Company Analysis

Deprecated: use factrail_verify instead. Use only when an older integration still calls this experimental tool; financial and credit data sources are unavailable and returned fields are null.

輸入參數sirencompany_namecountry_code

版本歷史

3
  1. v2.4.1最新Sep 29, 2026
  2. v2.4.0Sep 29, 2026
  3. v1.3.3Sep 23, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分