sat69-mcp
MCP SAT 69 / 69-B · WATR
一个用 Python / FastMCP 编写的 MCP(Model Context Protocol) 服务器,用于查询 SAT 的公共列表:
CFF 第 69-B 条(EFOS) —— 虚构交易:推定、已推翻、最终、有利判决。
CFF 第 69 条 —— 确定的税务状况:已确定、可执行、未找到、已取消、已豁免。
与 SSC-CDMX 的 movilizaciones MCP 架构一致:FastMCP 采用 stdio + Streamable HTTP 传输;OAuth 2.1(WorkOS AuthKit) 可回退到静态 bearer;持久化使用 Turso(libSQL);支持可选的下载代理;部署在 Render 上,由外部 cron(GitHub Actions)触发。无需 OCR:SAT 的 CSV 本身就是结构化数据。
工具
工具 | 功能 |
| 验证一个 RFC → 风险判定( |
| 最多验证 500 个 RFC;仅按严重程度返回发现项。 |
| 按名称/法定名称搜索(FTS5,不区分重音)。 |
| SAT 声明的有效期、计数和最近一次导入。 |
| 下载 + 同步列表(按哈希幂等)。 |
风险: CRITICO(EFOS 最终)· ALTO(EFOS 推定)· MEDIO(69 已确定/可执行/未找到)· BAJO(已推翻/有利判决)· INFORMATIVO(69 已取消/已豁免)· LIMPIO。
结果反映 SAT 公共文件的最近一次导入。不构成税务或法律建议。
Related MCP server: bcra-deudores-mcp
架构
CSV del SAT (Latin-1) ┌────────── FastMCP ──────────┐
│ fetcher (httpx + proxy opcional) │ verificar_rfc / _lote │
▼ │ buscar_nombre / estado_datos │
pipeline (parse 69 / 69b) ──► SQLite ──┤ actualizar_datos │
│ (FTS5 unicode61, triggers) ▲ │ └──────────┬──────────────────┘
▼ │ │ stdio (server.py) + HTTP (web.py)
Turso (libSQL, durable) ◄── push │ └► pull al arranque │
└─────────────────── /health /refresh /reloadserver.py—— FastMCP(stdio)+ 工具 + AuthKit。web.py—— Starlette/uvicorn(HTTP):/health(公开)、/refresh和/reload(bearer M2M)、/mcp(OAuth 或 bearer)。pipeline.py—— 下载 → SHA-256(未变更则跳过)→ Latin-1 解析 → 在 SQLite 中替换 → 推送至 Turso。database.py—— SQLite + 带触发器的 FTS5;RFC 走 B-tree 索引(热路径)。turso.py—— Turso ↔ 本地的持久化同步。risk.py—— RFC 规范化 + 判定树(69-B 优先于 69)。
本地安装
cd sat69-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Primera ingesta (descarga ~22 MB; el 69 son ~½ millón de filas)
python -c "from sat69 import database as db, config; db.init_db(config.settings.db_path)"
python -c "from sat69.pipeline import process_import; print(process_import())"
# Probar
pytest -q在 Claude Desktop / Cowork 中连接(stdio)
{
"mcpServers": {
"sat69": { "command": "sat69-mcp" }
}
}(或在激活 venv 的情况下使用 "command": "python", "args": ["-m", "sat69"]。)
在 Render 上部署
render.yaml 使用原生 Python 运行时配置 Web 服务(无需 Docker):
将仓库推送到 GitHub,并在 Render 中创建一个指向
render.yaml的 Blueprint。变量(标记为
sync:false):MCP_API_KEY(bearer)、可选的AUTHKIT_DOMAIN+BASE_URL(OAuth)、TURSO_DATABASE_URL+TURSO_AUTH_TOKEN。MCP 端点:
POST https://<servicio>.onrender.com/mcp。
认证(两种模式,与 movilizaciones 相同)
静态 Bearer(
MCP_API_KEY):简单,保护/mcp、/refresh、/reload。OAuth 2.1(WorkOS AuthKit):设置
AUTHKIT_DOMAIN+BASE_URL后,/mcp将切换为使用 Dynamic Client Registration 的 OAuth;bearer 仍继续保护 M2M 端点。
自动刷新
.github/workflows/refresh.yml 每天执行 POST /refresh(11:30 UTC ≈ 05:30 CDMX)。仓库 Secrets:RENDER_BASE_URL、MCP_API_KEY。手动:workflow_dispatch(带 force)。
持久化(Turso)
本地 SQLite(在 Render 上为临时存储,位于 /tmp)负责处理查询;Turso 是持久化存储层,能够在重新部署后保留数据。启动时从 Turso 拉取;每次 actualizar_datos//refresh 后推送。未配置 TURSO_* 时,以纯本地模式运行。
下载代理(可选)
FETCH_PROXY 或 DATAIMPULSE_* 仅路由 CSV 的下载。测试中,SAT 并未屏蔽数据中心 IP(直接下载返回 200),因此通常无需代理;保留它只是为了对等性和弹性。
数据来源(SAT · 开放数据)
69-B:
Listado_Completo_69-B.csv(约 1.4 万条记录,20 列,表头在第 3 行)。69:
Firmes.csv、Cancelados.csv、NoLocalizados.csv、Exigibles.csv、Sentencias.csv、Condonados.csv(约 50 万条记录,6 列)。URL 见config.py。
Available Tools
6 toolsactualizar_datosBInspect
Descarga y sincroniza los listados del SAT (idempotente por hash).
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | No | "all" (default), "69", "69b" o "69bbis". | all |
| force_refresh | No | Reprocesa aunque el archivo no haya cambiado. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No hay anotaciones, por lo que la descripción asume la carga de transparencia. Aporta un rasgo relevante: la idempotencia por hash, que sugiere que es seguro reintentar. Sin embargo, no explica efectos colaterales de la sincronización, dependencia de red ni qué implica exactamente force_refresh sobre los datos locales.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Una sola oración con información esencial: verbo, objeto y propiedad clave (idempotencia). Es directa, sin relleno y con el detalle más relevante entre paréntesis.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Con un output-schema presente y parámetros bien cubiertos, la descripción es suficiente para ejecutar la llamada, pero no para entender cuándo conviene usarla respecto a sus hermanas ni qué implica 'sincronizar' a nivel de datos. Un agente podría invocarla sin saber que debe comprobar antes estado_datos o que puede forzar el refresco.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
La cobertura del esquema es del 100%, así que los parámetros ya están documentados en el input-schema. La descripción no añade semántica adicional a dataset ni a force_refresh; la referencia al hash se relaciona vagamente con force_refresh pero no explica su uso.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Describe una acción específica ('Descarga y sincroniza') sobre un recurso concreto ('los listados del SAT') y añade un matiz ('idempotente por hash') que delimita su comportamiento. No nombra ni contrasta explícitamente con las herramientas hermanas, pero su alcance queda claro frente a estado_datos o verificar_rfc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No se indica cuándo invocar esta herramienta frente a las alternativas, por ejemplo comprobar antes estado_datos o usar verificar_rfc según el caso. Tampoco hay prerequisitos, exclusiones ni contexto de uso; solo se infiere que sirve para actualizar los datos.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
buscar_nombreAInspect
Busca contribuyentes por nombre / razón social parcial (FTS5, sin acentos).
| Name | Required | Description | Default |
|---|---|---|---|
| texto | Yes | Fragmento del nombre (mínimo 3 caracteres). | |
| limite | No | Máximo de resultados por lista (1–100, default 25). | |
| dataset | No | "69", "69b", "69bbis" o "ambos" (default). | ambos |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It usefully discloses accent-insensitivity ('sin acentos') and the FTS5 full-text search mechanism, which tells an agent that 'garcia' will match 'García'. However, it does not explicitly confirm the read-only nature of the operation, though 'busca' strongly implies it, nor does it mention auth, rate limits, or dataset freshness.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single eight-word sentence that front-loads the verb and resource, then the search method, then the technical detail (FTS5, sin acentos). Zero waste, no repetition of schema content, and every element earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is a simple search with full schema coverage and an output schema, so return values are already documented. The description covers the search method and accent behavior adequately. However, with zero annotations, it lacks explicit confirmation of read-only behavior, any note on rate limits or data freshness, and any reference to the dataset parameter semantics beyond the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with all three parameters (texto, limite, dataset) fully documented in the schema including defaults and constraints. The description adds marginal value by disclosing accent-insensitivity relevant to the texto parameter, but the schema already does the heavy lifting, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Busca' = searches) with a specific resource ('contribuyentes' = taxpayers) and a precise method ('por nombre / razón social parcial' = by partial name/business name). It clearly differentiates from the closest sibling verificar_rfc, which is RFC-based lookup, since this tool searches by name fragment rather than by tax ID.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'por nombre / razón social parcial' phrasing implicitly signals that this tool is for name-fragment lookups, and the sibling names (verificar_rfc, verificar_lote) suggest the alternatives. However, the description never explicitly states when to use it versus those alternatives, so an agent must infer the decision boundary rather than being told it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
estado_datosAInspect
Estado del dataset: vigencia declarada por el SAT, conteos y última importación.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full transparency burden. It frames the tool as a status query and lists exactly what it reports, which strongly implies a safe, read-only operation. It does not mention refresh/network behavior or failure modes, but no destructive or surprising behavior is indicated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence that front-loads the core concept ('Estado del dataset') and uses a colon to list three concrete status dimensions. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no required parameters and an output schema available, the description sufficiently covers tool selection and expected content. It enumerates the status dimensions and does not need to describe return structure because the output schema already exists.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the schema fully reflects that, so there is no parameter ambiguity to resolve. The description adds no parameter-level detail, but none is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description identifies the resource ('dataset') and the specific status facets it exposes: SAT-declared validity, counts, and last import. It lacks an explicit verb but is unambiguous and clearly distinguishable from siblings like actualizar_datos and verificar_rfc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The purpose is clear enough to imply 'use this when you need dataset status', and the listed facets suggest it complements actualizar_datos and verificar_rfc. However, the description never explicitly states when to use it versus those alternative tools or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resumen_carteraAInspect
Resumen ejecutivo en lenguaje natural de una cartera de RFCs.
El riesgo de cada RFC lo calcula el motor de reglas (DETERMINISTA); la IA sólo redacta el brief a partir de esos veredictos ya calculados — nunca decide el riesgo. Proveedor de IA conmutable por env var (LLM_PROVIDER).
| Name | Required | Description | Default |
|---|---|---|---|
| rfcs | Yes | Lista de RFCs (máximo 500). |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral disclosure burden. It credibly explains that risk is computed deterministically by a rules engine, the AI only drafts the brief and never decides risk, and the AI provider is switchable via LLM_PROVIDER. This meaningfully prevents an agent from assuming the tool performs risk assessment itself.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: the first sentence states the core purpose, and the second paragraph provides crucial behavioral context about determinism and the AI provider. Every sentence adds value, and the most important information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the simple input schema with one documented parameter, and the important behavioral clarifications, the description is largely sufficient for an agent to invoke the tool correctly. It could mention data freshness or integration with estado_datos, but this is not essential for a correct call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the single 'rfcs' parameter, including the maximum of 500 items. The description adds no parameter-level detail beyond the schema, but with full schema coverage, the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool's output as an executive summary in natural language for a portfolio of RFCs, which is a specific resource and deliverable. It lacks an explicit imperative verb like 'genera' or 'resume', and does not directly name sibling tools for differentiation, though the purpose is distinct from the listed siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is implied by the first sentence: this tool is for summarizing a portfolio of RFCs. However, it does not explicitly state when to use this tool versus alternatives such as verificar_rfc, verificar_lote, or buscar_nombre, nor does it give exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verificar_loteBInspect
Verifica una lista de RFCs (p. ej. proveedores). Devuelve sólo hallazgos.
| Name | Required | Description | Default |
|---|---|---|---|
| rfcs | Yes | Lista de RFCs (máximo 500). |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It adds one useful behavioral fact: only findings are returned, implying no full-record dump. However, it does not mention read-only status, error handling, invalid RFC behavior, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with no filler. The primary action is front-loaded, and the second sentence adds meaningful return behavior without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter tool with an output schema, the core invocation is nearly self-contained. However, with no annotations and no mention of when to prefer verificar_lote over verificar_rfc, the description is not fully complete for correct tool selection in all contexts.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already covers 100% of the single parameter, including its type and maximum limit of 500. The description adds only the 'proveedores' example, which gives context but no substantial new parameter semantics, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb and resource: 'Verifica una lista de RFCs', and adds a distinctive return characteristic: 'Devuelve sólo hallazgos'. It is distinguishable from the sibling verificar_rfc by the batch aspect ('lista'), although it does not explicitly name that differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance about when to use this tool versus verificar_rfc or other siblings. The only contextual hint is 'lista' and the example 'proveedores', which implies batch use but leaves the routing decision to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verificar_rfcAInspect
Verifica un RFC contra las listas del SAT (Art. 69, 69-B y 69-B Bis).
| Name | Required | Description | Default |
|---|---|---|---|
| rfc | Yes | RFC a consultar (física o moral). Se normaliza automáticamente. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. The verb 'Verifica' clearly indicates a read-style checking operation rather than a mutation, and the specific article references add useful context about the data sources. It could more explicitly state that no changes are made or that external SAT lists are consulted, but the core behavior is adequately transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, tightly worded sentence that front-loads the action and resource. The parenthetical legal reference is informative rather than filler, and there is no redundant or vague language.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with an output schema, the description is largely complete: it states the object, the source, and the specific legal lists. The main gap is the absence of explicit routing guidance toward or away from verificar_lote, but the singular language and low complexity keep this from being a significant deficiency.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the single 'rfc' parameter is already described with automatic normalization. The tool description only repeats that it checks an RFC, adding no new meaning beyond the schema, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Verifica') and clearly identifies the resource (an RFC) and the target (SAT lists under Articles 69, 69-B, and 69-B Bis). The singular 'un RFC' distinguishes it from the sibling verificar_lote, making the tool's purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is used to verify a single RFC against SAT lists, but it does not explicitly state when to prefer this over siblings such as verificar_lote or when not to use it. There is no mention of alternatives or exclusionary conditions, leaving some inference to the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v1.0.0- First observed
actualizar_datos - First observed
buscar_nombre - First observed
estado_datos - First observed
resumen_cartera - First observed
verificar_lote - First observed
verificar_rfc
TDQS
Scored across 6 tools
Each tool has a clearly distinct concern: data status/update, single/batch verification, portfolio summary, and name search. The closest pair, verificar_rfc and verificar_lote, is disambiguated by singular vs batch operation.
Most tools follow a clear verb_noun pattern: actualizar_datos, verificar_rfc, verificar_lote, buscar_nombre. Two names are noun phrases, estado_datos and resumen_cartera, which is a minor deviation from the otherwise consistent style.
Six tools are well-scoped for this SAT list verification server. Each tool adds a distinct capability, covering data ingestion, verification, search, and summary without redundancy or bloat.
The toolset covers the core workflow: update and inspect dataset state, verify single or batch RFCs, search by name, and generate portfolio summaries. A dedicated detailed taxpayer-profile tool could be a minor addition, but the main use cases are well supported.
Maintenance
Related MCP Connectors
Official-source lookups on people and companies: registration status (CPF/CNPJ), Simples/MEI, SINTEG
Sanctions, PEP, watchlist, recall, business, and contract screening. Free tier, no auth required.
Brazilian company data, CNPJ/CPF validation and KYB risk score. Pay per call via x402 (USDC).
Verify Japanese companies, invoice-issuer registrations and addresses against government open data.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables querying the Colombian Business Registry (RUES) for company searches by name, location grouping, and detailed company information.-
- FlicenseNot gradedqualityDmaintenanceEnables consultation of Argentine credit situations (Central de Deudores) via BCRA API, providing tools for current status, historical trends, rejected checks, and consolidated reports.-
- AlicenseNot gradedqualityCmaintenanceQuery Brazilian Federal Revenue (Receita Federal) tax situation data from official sources via a single read-only tool, hosted and billed per use.MIT
- AlicenseAqualityAmaintenanceEnables AI agents to validate Mexican RFC, CURP, CLABE and NSS identifiers with real check digits, parse CFDI 4.0 invoices with labelled SAT catalogue codes and verified totals, and query the SAT's public status service to see whether an invoice is still valid. It also generates coherent test people and companies, all read-only and without API keys, certificates or PAC contracts.8187 npm1MIT