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와 동일한 아키텍처: stdio + Streamable HTTP 전송, bearer 정적 토큰 폴백이 있는 OAuth 2.1(WorkOS AuthKit), Turso(libSQL) 영속성, 선택적 다운로드 프록시, 외부 cron(GitHub Actions)을 사용한 Render 배포. OCR 없음: SAT CSV는 이미 구조화되어 있습니다.
도구
도구 | 수행 작업 |
| RFC를 검증 → 위험 판정( |
| 최대 500개 RFC를 검증하며, 심각도별 발견 사항만 반환합니다. |
| 이름/법인명으로 검색(FTS5, 악센트 구분 안 함). |
| SAT가 선언한 유효 기간, 개수 및 마지막 가져오기. |
| 목록을 다운로드하고 동기화합니다(해시 기준 멱등). |
위험: CRITICO(EFOS 확정) · ALTO(EFOS 추정) · MEDIO(69 확정/징수 가능/소재불명) · BAJO(반박됨/유리한 판결) · INFORMATIVO(69 취소/면제) · LIMPIO.
결과는 SAT 공개 파일의 마지막 가져오기를 반영합니다. 세무 또는 법률 자문을 구성하지 않습니다.
Related MCP server: Receita Federal: Situação Fiscal
아키텍처
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):/refresh및/reload(bearer M2M),/mcp(OAuth 또는 bearer).pipeline.py— 다운로드 → SHA-256(변경되지 않으면 생략) → Latin-1 파싱 → SQLite 교체 → Turso 푸시.database.py— 트리거가 있는 SQLite + FTS5; B-tree 인덱스로 RFC(핫 경로).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 -qClaude Desktop / Cowork에서 연결(stdio)
{
"mcpServers": {
"sat69": { "command": "sat69-mcp" }
}
}(또는 venv가 활성화된 상태에서 "command": "python", "args": ["-m", "sat69"].)
Render 배포
render.yaml은 네이티브 Python 런타임으로 웹 서비스를 프로비저닝합니다(Docker 불필요):
GitHub에 저장소를 올리고
render.yaml을 가리키는 Blueprint를 Render에 생성합니다.변수(
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). 저장소 시크릿: RENDER_BASE_URL, MCP_API_KEY. 수동: workflow_dispatch(force 포함).
영속성(Turso)
로컬 SQLite(Render에서는 임시, /tmp)가 쿼리를 처리하고, Turso는 재배포 후에도 유지되는 내구성 있는 저장소입니다. 시작 시 Turso에서 pull하고, 각 actualizar_datos//refresh 후 push합니다. TURSO_*가 없으면 순수 로컬 모드로 실행됩니다.
다운로드 프록시(선택 사항)
FETCH_PROXY 또는 DATAIMPULSE_*는 CSV 다운로드만 라우팅합니다. 테스트에서 SAT는 데이터센터 IP를 차단하지 않았고(직접 다운로드 200 응답), 보통은 필요하지 않습니다. 패리티와 복원력을 위해 유지됩니다.
데이터 출처(SAT · Datos Abiertos)
69-B:
Listado_Completo_69-B.csv(~14k 레코드, 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).
Inputs: dataset, force_refresh. Returns: object
buscar_nombreAInspect
Busca contribuyentes por nombre / razón social parcial (FTS5, sin acentos).
Inputs: texto (required), limite, dataset. Returns: object
estado_datosAInspect
Estado del dataset: vigencia declarada por el SAT, conteos y última importación.
Inputs: no named parameters. Returns: object
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).
Inputs: rfcs (required). Returns: object
verificar_loteBInspect
Verifica una lista de RFCs (p. ej. proveedores). Devuelve sólo hallazgos.
Inputs: rfcs (required). Returns: object
verificar_rfcAInspect
Verifica un RFC contra las listas del SAT (Art. 69, 69-B y 69-B Bis).
Inputs: rfc (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
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
Mexican RFC/SAT 69-B, CFDI, CURP (RENAPO) and INE checks against the official registries.
Mexican invoicing (CFDI 4.0) and SAT taxes: search, draft and stamp invoices, IVA/ISR, 32-D.
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.
Related MCP Servers
- 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 gradedqualityDmaintenanceQuery Brazilian Federal Revenue (Receita Federal) tax situation data from official sources via a single read-only tool, hosted and billed per use.MIT
- AlicenseAqualityBmaintenanceEnables 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.9342 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables official-source lookups on people and companies, covering registration status, tax and labor clearance certificates, sanctions lists, trademarks/patents, and electronic invoices, with platform-hosted pay-per-query access.MIT