Skip to main content
Glama
Gerar12

mcp-el-salvador-dte

by Gerar12

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.

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

calculate_iva

{ amount: number, includesIva?: boolean }

{ subtotal, iva, total }

list_dte_types

(none)

{ types: [{ code, name }] }

validate_dui

{ dui: string }

{ valid, reason? }

validate_nit

{ nit: string }

{ valid, normalized, reason? }

calculate_iva

El Salvador IVA (VAT) is 13%.

  • includesIva = false (default): amount is the net subtotal; IVA is added on top.

  • includesIva = true: amount already 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 a valid: false from 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: true means "well-formed", not "issued by Hacienda".

Install

Requires Node.js 18+.

# clone, then:
npm install
npm run build

Run the tests (unit tests for the pure functions + an stdio smoke test that boots the server and performs a full MCP handshake):

npm test

Start the server manually (it speaks JSON-RPC over stdio and waits for a client):

npm start
# or
node build/index.js

Run with npx (after publishing to npm)

npx mcp-el-salvador-dte

Add to Claude Desktop

Edit your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %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-dte

Project 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 test

License

MIT © 2026 Gerar Arévalo

Available Tools

4 tools
calculate_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
amountYesMonetary amount.
includesIvaNoWhether amount already includes the 13% IVA. Defaults to false.

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the rounding to 2 decimals and the return object {subtotal, iva, total}. Since no annotations are provided, the description carries the full burden, and it adequately covers the behavioral traits for a simple calculation, though edge cases or errors are not mentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences, front-loaded with the purpose. Every sentence adds essential information without redundancy or excess words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the description covers all needed aspects: purpose, parameter behavior, return structure. No output schema exists, but the description explains the return object. Sibling tools are unrelated, so no additional context is required.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, providing baseline 3. The description adds value by explaining the default behavior of includesIva (defaults to false) and how amount is interpreted in each mode, beyond the schema's type and required information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it computes El Salvador IVA at 13%, clearly distinguishing the tool from sibling tools like list_dte_types, validate_dui, and validate_nit. It specifies the two modes (net vs. gross amount) and the return structure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (when needing IVA calculation for El Salvador) and the two scenarios based on includesIva. It does not explicitly mention when not to use, but the sibling tools are unrelated, making the context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the full burden. It specifies the exact number (11), the content (two-digit code, Spanish name), and that these are official documents. This provides sufficient behavioral insight for a read-only list operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One well-constructed sentence, front-loaded with the key action, and no extraneous words. All information is relevant and efficiently presented.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no output schema, and a simple purpose, the description is complete. It fully explains what the tool returns (11 types, codes, Spanish names), sufficient for an agent to invoke and interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema coverage, so the baseline for parameter semantics is 4. The description does not need to add parameter details, and it correctly focuses on the return content.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns the 11 official Salvadoran electronic tax document types with their codes and names. It uses a specific verb ('Return') and resource ('DTE types'), and is distinct from sibling tools like calculate_iva which perform calculations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool vs alternatives, but the context of sibling tools (calculation/validation) makes it apparent. No exclusions or prerequisites are mentioned, but for a simple list operation this is acceptable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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? }.

ParametersJSON Schema
NameRequiredDescriptionDefault
duiYesDUI to validate, e.g. "01234567-8".

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes the validation checks (format and modulo-10 check digit) and the return object structure {valid, reason?}. No annotations provided, but description covers key behaviors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with all essential information. No extraneous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complete for a single-parameter validation tool. Explains input format, validation logic, and output structure. No output schema exists, but return type is specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds format details and example (e.g. 01234567-8) beyond the schema's simple parameter description. Schema coverage is 100%, but description enhances understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The tool explicitly states it validates a Salvadoran DUI, a specific document type. It distinguishes from siblings like validate_nit by naming the document.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose is clear but no explicit guidance on when to use this vs alternatives like validate_nit. Usage is implied by the document type.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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? }.

ParametersJSON Schema
NameRequiredDescriptionDefault
nitYesNIT to validate, e.g. "0614-123456-001-2".

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full behavioral disclosure. It explains behavior (format validation, hyphens flexible), and return structure ({valid, normalized, reason?}). Lacks details on normalization format (e.g., hyphens added or not).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences packed with essential information: purpose, format, input flexibility, and output structure. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one param, no output schema, no annotations), the description covers all needed aspects: what it does, how input is handled, and what is returned. Fully sufficient for correct agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

One required parameter (nit) with 100% schema coverage. Description adds semantic value: clarifies input flexibility (with or without hyphens) and gives format example, beyond the schema's description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool validates the format of El Salvador NIT, specifying the exact digit pattern and common formatting. It distinguishes itself from sibling tools like validate_dui by targeting a different identifier.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly notes 'format-only' which implies it does not check existence or other validity, guiding when to use vs. more comprehensive validation. Context from siblings aids differentiation, but no explicit when-not-to-use or alternative suggestions.

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. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedcalculate_iva
    • First observedlist_dte_types
    • First observedvalidate_dui
    • First observedvalidate_nit

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

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.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern using snake_case (calculate_iva, list_dte_types, validate_dui, validate_nit).

Tool Count5/5

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.

Completeness3/5

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

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Latin 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.
    28
    -
  • A
    license
    A
    quality
    F
    maintenance
    Argentine electronic invoicing (facturación electrónica) MCP Server for ARCA/AFIP. Emit invoices, manage credentials, check delegations, and look up taxpayers. 10 tools.
    12
    378
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides Japanese tax and invoice utilities such as consumption tax calculation, withholding tax, invoice number validation, and tax rate summarization, enabling AI assistants to perform these operations locally without external APIs.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to issue Peruvian electronic invoices (factura/boleta) declared to SUNAT via Nubefact. Supports creating, querying, and canceling invoices with automatic IGV tax computation.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gerar12/mcp-el-salvador-dte'

If you have feedback or need assistance with the MCP directory API, please join our Discord server