mcp-el-salvador-dte
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-el-salvador-dteValidate DUI 01234567-8"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-el-salvador-dte
A small, focused Model Context Protocol (MCP) server that exposes El Salvador electronic invoicing (DTE) and fiscal helpers as tools an LLM can call: IVA calculation, the official DTE document-type catalog, and DUI / NIT validation.
Built with the official @modelcontextprotocol/sdk for TypeScript, ESM, Node 18+, and the stdio transport.
Author: Gerar Arévalo — github.com/Gerar12 · gcoder.dev
License: MIT
What it is
The Documento Tributario Electrónico (DTE) is El Salvador's mandatory electronic invoicing standard, administered by the Ministerio de Hacienda. This server bundles a few pure, deterministic helpers that come up constantly when building DTE integrations, and makes them available to any MCP-capable client (Claude Desktop, Claude Code, etc.).
Related MCP server: keycae-mcp
Tools
Tool | Input | Output |
|
|
|
| (none) |
|
|
|
|
|
|
|
calculate_iva
El Salvador IVA (VAT) is 13%.
includesIva = false(default):amountis the net subtotal; IVA is added on top.includesIva = true:amountalready includes IVA; it is broken out.
Values are rounded to 2 decimals, and subtotal + iva === total always holds.
// input
{ "amount": 100 }
// output
{ "subtotal": 100, "iva": 13, "total": 113 }// input
{ "amount": 113, "includesIva": true }
// output
{ "subtotal": 100, "iva": 13, "total": 113 }list_dte_types
Returns the 11 official DTE document types (code — name):
Code | Name |
01 | Factura (Consumidor Final) |
03 | Comprobante de Crédito Fiscal (CCF) |
04 | Nota de Remisión |
05 | Nota de Crédito |
06 | Nota de Débito |
07 | Comprobante de Retención |
08 | Comprobante de Liquidación |
09 | Documento Contable de Liquidación |
11 | Factura de Exportación |
14 | Factura de Sujeto Excluido |
15 | Comprobante de Donación |
// output (abridged)
{ "types": [ { "code": "01", "name": "Factura (Consumidor Final)" }, ... ] }validate_dui
Validates a Salvadoran DUI (Documento Único de Identidad): 8 digits, a hyphen, then 1 check digit (e.g. 01234567-8).
It checks the format and the modulo-10 check digit. The 8 base digits are weighted 9, 8, 7, 6, 5, 4, 3, 2 (left to right); the expected check digit is (10 - (weightedSum % 10)) % 10.
// input
{ "dui": "01234567-8" }
// output
{ "valid": true }// input
{ "dui": "01234567-9" }
// output
{ "valid": false, "reason": "Invalid check digit: expected 8, got 9" }Honesty note on the DUI check digit. The modulo-10 algorithm above is a widely-used community algorithm and was verified in this repo against known-valid DUIs (
00016297-5,01234567-8). It is not reproduced from an official, government-published specification. If your use case is high-stakes (e.g. legally rejecting a real person's ID), treat avalid: falsefrom the check-digit test as "likely a typo, please re-check" rather than an authoritative rejection. The format check (^\d{8}-\d$) is unambiguous; the check-digit step is best-effort.
validate_nit
Validates the format only of an El Salvador NIT (Número de Identificación Tributaria): 14 digits, commonly formatted NNNN-NNNNNN-NNN-N. Input is accepted with or without hyphens/whitespace, and a canonically hyphenated normalized value is returned.
// input
{ "nit": "06141234560012" }
// output
{ "valid": true, "normalized": "0614-123456-001-2" }Honesty note on NIT. This is format/length validation only — it does not verify a check digit. NIT check-digit rules are not consistently documented in public sources, so shipping a check-digit validator here would imply a correctness guarantee that cannot be honestly backed up. A
valid: truemeans "well-formed", not "issued by Hacienda".
Install
Requires Node.js 18+.
# clone, then:
npm install
npm run buildRun the tests (unit tests for the pure functions + an stdio smoke test that boots the server and performs a full MCP handshake):
npm testStart the server manually (it speaks JSON-RPC over stdio and waits for a client):
npm start
# or
node build/index.jsRun with npx (after publishing to npm)
npx mcp-el-salvador-dteAdd to Claude Desktop
Edit your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"el-salvador-dte": {
"command": "node",
"args": ["/absolute/path/to/mcp-el-salvador-dte/build/index.js"]
}
}
}Once published to npm you can instead use:
{
"mcpServers": {
"el-salvador-dte": {
"command": "npx",
"args": ["-y", "mcp-el-salvador-dte"]
}
}
}Restart Claude Desktop, and the four tools will appear.
Add to Claude Code
# local build
claude mcp add el-salvador-dte -- node /absolute/path/to/mcp-el-salvador-dte/build/index.js
# or, after publishing to npm
claude mcp add el-salvador-dte -- npx -y mcp-el-salvador-dteProject layout
src/lib.ts Pure, side-effect-free domain logic (unit-tested directly)
src/index.ts MCP server: registers the 4 tools over stdio
test/ node:test unit tests + stdio smoke testLicense
MIT © 2026 Gerar Arévalo
Available Tools
4 toolscalculate_ivaCalculate IVA (El Salvador, 13%)A
Compute El Salvador IVA (13%). If includesIva is false (the default), amount is treated as the net subtotal and IVA is added on top. If includesIva is true, amount already includes IVA and it is broken out. Returns { subtotal, iva, total } rounded to 2 decimals.
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Monetary amount. | |
| includesIva | No | Whether amount already includes the 13% IVA. Defaults to false. |
list_dte_typesList El Salvador DTE document typesA
Return the 11 official El Salvador electronic tax document (DTE) types, each with its two-digit code and Spanish name.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
validate_duiValidate Salvadoran DUIA
Validate a Salvadoran DUI (Documento Único de Identidad). Checks the format (8 digits, hyphen, 1 check digit — e.g. 01234567-8) and the official modulo-10 check digit. Returns { valid, reason? }.
| Name | Required | Description | Default |
|---|---|---|---|
| dui | Yes | DUI to validate, e.g. "01234567-8". |
validate_nitValidate El Salvador NIT (format)A
Validate an El Salvador NIT (Número de Identificación Tributaria). Format-only: 14 digits, commonly formatted NNNN-NNNNNN-NNN-N. Accepts input with or without hyphens. Returns { valid, normalized, reason? }.
| Name | Required | Description | Default |
|---|---|---|---|
| nit | Yes | NIT to validate, e.g. "0614-123456-001-2". |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
calculate_iva - First observed
list_dte_types - First observed
validate_dui - First observed
validate_nit
TDQS
Scored across 4 tools
Each tool has a unique and clear purpose: IVA calculation, listing DTE types, and validation of DUI and NIT. There is no overlap or ambiguity.
All tools follow a consistent verb_noun pattern using snake_case (calculate_iva, list_dte_types, validate_dui, validate_nit).
With 4 tools, the server is well-scoped for its domain of Salvadoran tax and ID validation. Each tool serves a distinct need without being excessive.
The server provides essential validation and information tools but lacks the core DTE generation and submission functionality implied by its name. Missing create or process DTE tools is a notable gap.
Maintenance
Related MCP Connectors
Argentina CUIT/CUIL validation and AFIP fiscal QR generation. Pure, no-auth MCP tools.
Issue, sign and manage Mexican CFDI 4.0 e-invoices, complements and credit notes.
Issue, void and check facturas, boletas and notes sent to SUNAT in NubeFact.
1CFDI 4.0 invoicing for Mexico: invoices, payments, receipts and SAT catalogs, stamped with SAT
Related MCP Servers
- AlicenseAqualityDmaintenanceLatin American business compliance suite — 28 tools for tax ID validation (CPF, CNPJ, RFC, RUT, CUIT, NIT), banking (PIX, CLABE, CBU), VAT rules, e-invoicing (NF-e, CFDI, DTE), holidays, and labor calendar across Brazil, Mexico, Chile, Argentina, and Colombia.28MIT
- AlicenseAqualityFmaintenanceArgentine electronic invoicing (facturación electrónica) MCP Server for ARCA/AFIP. Emit invoices, manage credentials, check delegations, and look up taxpayers. 10 tools.12378 npmMIT
- AlicenseNot gradedqualityCmaintenanceLets AI agents issue and query Colombia DIAN electronic invoices (factura electrónica) via the Matias API, handling IVA math locally and forwarding requests to Matias for signing and DIAN transmission.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.9120 npm1MIT