Issue Chilean electronic receipts (SII) with an AI agent (MCP)
Short answer: connect your agent to the SharkPOS API documentation MCP server (https://api.sharkpos.cl/mcp, no API key), request a test key in the sandbox, and ask it to integrate issuing into your project. The agent reads the rules (idempotency, retries, SII statuses), looks up the exact contract of each endpoint and writes the code. If you also want the agent to issue test documents by itself, use the local MCP, which reads your sandbox key from an environment variable. (The SII is Chile's tax authority; a boleta is a receipt and a factura an invoice.)
Two MCP servers, for two different things
| Documentation MCP (remote) | Local MCP (for issuing) | |
|---|---|---|
| Address | https://api.sharkpos.cl/mcp | github.com/Notzeiro/sharkpos-api-ejemplos (mcp folder) |
| API key | Not needed | Reads SHARKPOS_API_KEY from your machine |
| What it does | Agent guide, documentation search, the contract of each endpoint and examples in curl, Python, Node and PHP | Issues, queries, lists, verifies with the SII and downloads PDFs; sandbox by default |
| What it is for | Having the agent write the integration without inventing fields | Testing issuing from the agent's chat |
Connect the documentation MCP
- Claude Code:
claude mcp add --transport http sharkpos https://api.sharkpos.cl/mcp - Codex:
codex mcp add sharkpos --url https://api.sharkpos.cl/mcp - Cursor: the "Agregar a Cursor" (Add to Cursor) button at /docs#agentes, or the MCP settings with the URL above.
- VS Code with Copilot:
code --add-mcp '{"name":"sharkpos","type":"http","url":"https://api.sharkpos.cl/mcp"}' - Without MCP: give the agent /en/docs/agents.md, or everything together at /llms-full.txt.
The starter prompt
We are going to integrate SharkPOS API (Chilean SII electronic receipts and invoices) into this project.
Use the sharkpos MCP: first call leer_guia_para_agentes and follow its rules.
Work against the sandbox, with the API key in the SHARKPOS_API_KEY variable, on the backend only.
Every issuance carries a stable Idempotency-Key per sale (the sale id).
Before changing anything, check how sales are recorded and propose where issuing should go.
The tool name leer_guia_para_agentes means "read the agent guide".
What to check in what the agent generates
- The sandbox base URL (
https://sandbox.sharkpos.cl) while you test. - The API key never in the browser, in a mobile app or in the repository.
- One
Idempotency-Keyper sale, not per attempt. After a network error, a 5xx or a 429, the retry goes with the same key and the same body; a new key would duplicate the sale with the SII. - The issuer RUT is not in the body: it comes from the API key.
- The SII result arrives later, by signed webhook or in the document status. The 201 response already carries the folio (document number) and the timbre (stamp) so you can hand over the receipt.
- If the agent uses a field that is not in the contract, it does not exist. Ask it to look it up with the
ver_endpoint("view endpoint") tool.
How much it costs
The sandbox is free. In production, CLP 5,990 a month per RUT, VAT included, with 20,000 documents a month. Comparison with other providers in this table with public prices.
Try it today in the sandbox
Get a sandbox API key: a test company with certificate and folios already loaded and a simulated SII. When you are ready, each RUT costs CLP 5,990 a month (VAT included) with 20,000 documents a month.