Diario Oficial de la Federación (unofficial)

io.github.amatiasdev由 GitHub 帳號 amatiasdev 發布v0.2.2更新於 Oct 27, 2026

Publications and financial indicators from Mexico's Diario Oficial de la Federación (DOF)

已驗證STDIO僅桌面網頁搜尋與抓取金融

概覽

AI 產生的概覽

針對墨西哥《聯邦官方公報》的唯讀 MCP 伺服器,可透過公開 SIDOF API 取得每日公告、公告全文與金融指標。

可以做什麼
  • 依版次與機關彙整某日的公報發布內容,並可依版次或機關篩選
  • 以純文字讀取單篇公告,長文可分頁取得
  • 查詢某日的 FIX 匯率、UDI 與 TIIE 利率,或某一指標的每日序列
  • 每筆結果附上 dof.gob.mx 官方連結與來源資訊(來源網址、擷取時間、SHA-256)
適用情境
適合需要查閱墨西哥聯邦法律、法令、稅務或海關規定以及官方金融指標,並引用官方來源的情境。適用於研究或起草工作,使用者之後可再對照官方版本核實。
執行需求
npm 套件需 Node.js 22 或更新版本,透過 stdio 執行(例如使用 npx)。未宣告需要帳號、API 金鑰或環境變數。也可使用公開託管的 Streamable HTTP 端點,或在 127.0.0.1 本機以 HTTP 方式執行。需要能連線至 SIDOF API 的網路。
安裝前請注意
非官方專案,與墨西哥內政部無關,資料可能隨時變動。回傳文字為純文字轉換結果,並非官方版本,須對照官方簽署 PDF 核實。託管端點為免費盡力服務、無 SLA,會在 CloudWatch 保留 7 天請求中繼資料,流量經 Cloudflare 處理。本機 HTTP 模式沒有身分驗證與速率限制。SIDOF 內容可在註明來源的前提下非商業性轉載,商業使用需取得書面許可。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Diario Oficial de la Federación (unofficial),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

其他 MCP 客戶端

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

README

dof-mcp

[CI] [Contract] [OpenSSF Scorecard] [OpenSSF Best Practices] [npm]

MCP server and typed TypeScript client for Mexico's Diario Oficial de la Federación (DOF), built on the public SIDOF JSON API, so AI agents (Claude Code, Claude Desktop, Cursor, etc.) can read official publications and financial indicators.

Why

The DOF is where federal laws, decrees, tax and customs rules, and official indicators are published. Its JSON API is public, with only sparse official documentation (https://sidof.segob.gob.mx/datos_abiertos), and there is no typed client or MCP server for it on npm. This project wraps it with validation, provenance and a stable, normalized shape.

MCP server

Three read-only tools:

ToolWhat it returns
dof_daily_summaryA day's publications with counts by edition and organization; filter by edition or organization
dof_get_noteOne publication as plain text, paged with offset / maxChars for long notes
dof_get_indicatorsFIX exchange rate, UDI and TIIE rates for a day, or a daily series of one indicator

Every result includes:

  • officialUrl: the publication on dof.gob.mx, so a person can check the official text
  • provenance: the SIDOF URL the data came from, when it was fetched (UTC) and a SHA-256 of the raw response

Install

Requires Node.js 22 or later. The server runs over stdio; add it to your MCP client:

json
{  "mcpServers": {    "dof": { "command": "npx", "args": ["-y", "dof-mcp"] }  }}
  • Claude Desktop: Settings → Developer → Edit Config, which opens claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS).
  • Cursor: .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project.
  • Claude Code: claude mcp add dof -- npx -y dof-mcp
  • Windows: if your client cannot start npx directly, use "command": "cmd", "args": ["/c", "npx", "-y", "dof-mcp"].

Hosted endpoint (no install)

A public instance runs at https://mcp.aldomatias.com/mcp (Streamable HTTP, no authentication, rate limited). Use it from clients that accept remote MCP servers, such as custom connectors in Claude, or:

bash
claude mcp add --transport http dof https://mcp.aldomatias.com/mcp

It serves the same tools and the same release as the npm package. It is a free, best-effort service with no SLA; for heavy use, run the package yourself.

Privacy. The endpoint does not store IP addresses, tool arguments or results. For each request it logs the HTTP method and path, status, duration, the JSON-RPC method, the tool name, and the name and version your MCP client reports about itself (for example claude-ai). Those logs are kept for 7 days in AWS CloudWatch and are used only to count usage and detect failures. Traffic passes through Cloudflare, which processes IP addresses to apply rate limiting and DDoS protection under its own privacy policy. Questions: [email protected].

Streamable HTTP

bash
npx dof-mcp --http --port 3000   # endpoint http://127.0.0.1:3000/mcp, probe /healthz

The HTTP transport is stateless, binds to 127.0.0.1 and validates the Host and Origin headers (--allowed-host <name> adds hostnames). It has no authentication or rate limiting: to expose it beyond localhost, put it behind a reverse proxy that adds them. See SECURITY.md.

Client

The package is ESM. import works everywhere; require("dof-mcp") works on Node.js 22.12 and later (require(esm)).

ts
import { DofClient } from "dof-mcp";
const dof = new DofClient();
const notes = await dof.getNotes("2026-10-16");// [{ id: 5801377, title: "Acuerdo por el que se crea ...", date: "2026-10-16",//    edition: "matutina", branch: "PODER EJECUTIVO",//    organization: "SECRETARIA DE SEGURIDAD Y PROTECCION CIUDADANA", page: 4,//    hasPdf: true, hasHtml: true,//    officialUrl: "https://dof.gob.mx/nota_detalle.php?codigo=5801377&fecha=16/10/2026" }, ...]
const note = await dof.getNote(5801457); // full text as plain textconst fix = await dof.getIndicatorSeries("fix", "2026-10-01", "2026-10-16");
const { data, source } = await dof.getNotesWithSource("2026-10-16");// source: { sourceUrl, fetchedAt, sha256, bytes }

Options (all optional):

OptionDefault
timeoutMs15000Per-request timeout
retries2Retries for network errors, 429 and 5xx, with exponential backoff and full jitter; honors Retry-After up to 30 s
maxResponseBytes10 MiBLarger responses are rejected unparsed
cacheTtlMs10 minIn-memory cache; identical concurrent requests share one fetch. 0 disables
cacheMaxEntries256LRU bound
maxCacheableBytes512 KiBLarger responses are returned but not cached
maxConcurrency4Requests in flight to SIDOF at once
maxQueue64Requests waiting for a slot; beyond it they fail fast with DofQueueFullError

Design notes

  • Validation at the boundary. Every response is parsed with Zod; an unexpected shape fails loudly instead of leaking undefined into callers.
  • Normalization. SIDOF mixes section headers and publications in one list and writes some missing values as the string "null"; the client returns titled publications only, with ISO dates, booleans and plain-text content.
  • Polite to the source. Identifying User-Agent, concurrency limit, cache, no redirects. SIDOF answers 406 to a bare Accept: application/json, so the client sends a header with a fallback.
  • Recorded fixtures. Tests run against real recorded responses; a nightly contract test checks the live API still matches.

Roadmap

  • Typed client for daily publications, note detail and indicators (FIX, UDIS, TIIE)
  • MCP server (stdio + Streamable HTTP) with dof_daily_summary, dof_get_note, dof_get_indicators
  • Hardening: size limits, backoff with jitter, cache, provenance; nightly contract test
  • Release pipeline: npm trusted publishing with provenance, MCP Registry
  • Optional: hosted endpoint, local search index (dof_search_notes; SIDOF's own search is broken)

Development

See CONTRIBUTING.md and RELEASING.md.

bash
npm installnpm run lint && npm run typecheck && npm test && npm run buildnpm run test:live   # contract tests against the live API

Disclaimer

Unofficial project, not affiliated with the Secretaría de Gobernación. Data comes from the public SIDOF API and may change without notice. The text this package returns is a plain-text conversion, not the official edition: the official DOF is the signed PDF on dof.gob.mx, so always confirm against it.

The MIT license covers this code, not DOF content. SIDOF's legal notice allows reproducing its content for non-commercial purposes when the source is cited; commercial use requires written consent from the Secretaría de Gobernación. If you republish content obtained with this package, cite the Diario Oficial de la Federación as the source.

License

MIT

來源:README.md,提交 2d0d84d

工具

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

版本歷史

2
  1. v0.2.2最新Oct 18, 2026
  2. v0.1.0Oct 18, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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