mcp-server-chile
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-server-chile Is RUT 12.345.678-5 valid, and what's the IVA on 250,000 CLP net?"
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-server-chile — A Least-Privilege MCP Server for Chilean Business Tasks
🇪🇸 Resumen en español: README.es.md
An MCP server that gives AI agents exact, auditable tools (RUT validation, IVA maths, economic indicators, order lookup, refund requests) instead of letting models guess. Built from scratch on the wire protocol (no SDK, zero dependencies) so every security decision is visible, and designed around least privilege: read-only by default, writes only on request, and even then the agent proposes while a person decides.
Why this project
Agents become dangerous when they get tools. This repo shows how to expose tools responsibly: validated inputs, honest annotations, scoped capabilities, rate limits, masked audit logs and no existence leaks, plus a protocol implementation that is current (spec 2026-07-28) and compatible with the 2025 clients still in the wild.
Related MCP server: chile-invoice-mcp
Tools
Tool | Scope | What it does |
| read | Modulo-11 check digit; normalises/format RUTs. Invalid RUT = normal result, not an error |
| read | Net/IVA/total from a net or gross amount, exact integer arithmetic |
| read | IVA = 19% of net (±1 peso) and net + exempt + IVA = total |
| read | UF, dólar, euro, UTM, IPC. Offline = synthetic sample ( |
| read | UF → CLP at a date's UF value, |
| read | Status of an order only if it belongs to the given customer; missing and foreign look identical |
| write (needs | Creates a refund request pending human approval. |
Try it (no keys, no cost)
python examples/client_demo.py --allow-write # spawns the server and talks to it over stdio
python -m unittest discover -s tests -t . # 55 tests, incl. a real subprocess over stdioconnected: modern (2026-07-28), server=mcp-server-chile
tools: ['calculate_iva', 'check_invoice_totals', ..., 'request_refund', 'validate_rut']
check_invoice_totals(100000, 19000, 120000)
-> {"consistent": false, "expected_iva": 19000, "expected_total": 119000, "problems": ["net + exempt + IVA = 119000, but total says 120000"]}
get_order_status(20001, someone else's order)
-> ERROR "order not found for that customer"
request_refund(...) -> {"status": "pending_human_approval", "replayed": false, ...}
same call again -> {"status": "pending_human_approval", "replayed": true, ...}Connect it to an AI host
pip install -e . # makes `python -m mcp_chile` work from anywhere
claude mcp add chile -- python -m mcp_chile # Claude Code (verify syntax for your version)Claude Desktop / other hosts: see examples/claude_desktop_config.json and docs/CONFIGURATION.md.
Protocol: dual era
Modern (2026-07-28) | Legacy (2025-06-18 / 2025-11-25) | |
Opening | None. Every request carries |
|
Discovery |
|
|
Methods |
| + |
Results | include | classic shape |
Version error |
| negotiated down in |
Stdio rules honoured: newline-delimited JSON, nothing but protocol on stdout (logs → stderr), UTF-8, exit on stdin EOF, LF line endings even on Windows (tested end-to-end). Details and what I verified against the spec: docs/PROTOCOL.md.
Security model (summary: docs/SECURITY.md)
Threat | Control (each has tests) |
Excessive agency | Read-only by default; write tool absent (not merely "denied") unless |
Hallucinated/unsafe arguments | Strict JSON-Schema validation ( |
Runaway agent loops / abuse | Sliding-window rate limits (all calls, and a tighter one for writes) |
Double actions on retry | Idempotency keys; same key + different params is rejected |
Confused deputy / data leak | Ownership check on every order; missing and foreign orders return the same error |
Prompt injection in arguments | Free text is stored and never interpreted; nothing in the server executes it |
SSRF via the model | Online provider builds URLs from a whitelist of codes and a strict date; no model-controlled host or path |
Leaky errors | Crashes return a generic message; details go to stderr only |
PII in logs | Audit JSONL masks e-mails/RUTs and reduces free text to its length |
Mislabelled tools | Annotations are honest ( |
Output flooding | Result size cap |
Docs
PRD · Architecture · Protocol · Security & threat model · Configuration · Enterprise Q&A · Risk matrix
Limitations (honest list)
Only tools. No resources, prompts, sampling, tasks or notifications; no HTTP transport or OAuth (stdio only, so authentication is the host/OS user's, not the server's).
The MCP spec moves fast. Verified against 2026-07-28 on the date in docs/PROTOCOL.md; legacy-era details (2025-11-25 tools page) are only partially verified. Re-check before relying on it.
Offline indicators are synthetic.
--onlineuses a third-party free API (mindicador.cl) whose terms and format you should verify; it is tested only with a fake transport.Orders are a fixture; a real deployment would use the company's order API with a service credential of minimal scope.
Rate limiting is per process, not per user; the stdio server serves exactly one host session.
Free-text
reasonis stored as submitted; a downstream human UI must escape it.
License
MIT
Available Tools
6 toolscalculate_ivaCalculate Chilean IVA (19%)ARead-onlyIdempotent
Computes net, IVA and total in whole pesos. base='neto' means the amount is the net price; base='total' means the amount already includes IVA. Exact integer arithmetic (round half up).
Inputs: base (required), amount (required). Returns: iva, neto, total
check_invoice_totalsCheck invoice totalsARead-onlyIdempotent
Verifies that IVA is 19% of the net amount (±1 peso rounding) and that net + exempt + IVA equals the total. Returns the list of problems; consistent=false is a normal result.
Inputs: iva (required), neto (required), total (required), exento. Returns: problems, consistent, expected_iva, expected_total
convert_uf_to_clpConvert UF to pesosARead-onlyIdempotent
Converts an amount in UF to CLP using the UF value of the given date (YYYY-MM-DD). Whole pesos, round half up.
Inputs: date (required), amount_uf (required). Returns: clp, date, fuente, uf_value, +2 more
get_economic_indicatorGet an economic indicatorARead-onlyIdempotent
Returns UF, dólar, euro, UTM or IPC for a date (YYYY-MM-DD) or the latest available. OFFLINE MODE: returns synthetic sample values (is_sample=true); do not use for real decisions.
Inputs: code (required), date. Returns: fecha, valor, codigo, fuente, +3 more
get_order_statusGet the status of a customer's orderARead-onlyIdempotent
Returns status, ETA and total of an order, only if it belongs to the given customer e-mail. Missing and foreign orders return the same error.
Inputs: order_number (required), customer_email (required). Returns: eta, number, status, total_clp
validate_rutValidate a Chilean RUTARead-onlyIdempotent
Checks a Chilean RUT (RUN/RUT) with the modulo-11 check digit. Accepts '12.345.678-5' or '12345678-5'. An invalid RUT is a normal result (valid=false), not an error.
Inputs: rut (required). Returns: valid, reason, formatted, normalized, +1 more
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 verb+resource target: IVA math, invoice consistency verification, UF→CLP conversion, indicator lookup, RUT validation, and order lookup. The only mild friction is that convert_uf_to_clp implicitly depends on the same UF data as get_economic_indicator, and get_order_status is an outlier from the finance/tax theme, but the descriptions make the boundaries clear enough.
All six tools follow a strict verb_noun snake_case pattern (calculate_iva, check_invoice_totals, convert_uf_to_clp, get_economic_indicator, get_order_status, validate_rut). Verbs are specific and predictable, and noun objects are unambiguous.
Six tools is well within a comfortable scope and each one performs a concrete, non-redundant operation. There are no filler or wrapper tools; every entry earns its slot.
The surface covers the core Chilean finance helpers: IVA calculation, invoice verification, UF conversion, economic indicators, and RUT validation. The notable gaps are the reverse CLP→UF conversion and any batch/multi-indicator retrieval, but agents can work around these.
Maintenance
Related MCP Connectors
Chile DTE for AI agents - boleta/factura electronica via OpenFactura or LibreDTE. Stateless BYO.
Connect AI agents to the legacy systems LATAM business runs on. Live in Chile: tax, banks, payroll.
Chilean DTE/SII invoicing — issue invoices, reconcile payments and manage clients with AI agents.
15 deterministic validation tools for AI agents: tax IDs (15 countries), VAT, IBAN, LEI, HS codes.
Related MCP Servers
- AlicenseAqualityDmaintenanceAllows AI assistants to query public procurement opportunities, purchase orders, and government entities from Chile's Mercado Público (ChileCompra) API in real time.1220 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to issue Chilean electronic tax documents (boleta and factura) stamped at SII via OpenFactura, with stateless bring-your-own-credentials.MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to interact with Chile's SII tax authority through natural language, including checking tax documents, invoices, filings, and administrative requests. It supports browser-based login and optional write operations when explicitly enabled.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables access to a curated registry of Chilean administrative and regulatory entities, including institutional details, official record deep-links, RUT validation, live economic indicators, and regulatory data, along with executable legal reasoning tools.1MIT