@albertomarturelo/sii-mcp 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +9 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +26 -8
- package/dist/server.js.map +1 -1
- package/dist/tools/carpeta.d.ts +4 -0
- package/dist/tools/carpeta.d.ts.map +1 -0
- package/dist/tools/carpeta.js +17 -0
- package/dist/tools/carpeta.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,41 @@ Versions move in **lockstep** with `@albertomarturelo/sii-core` and
|
|
|
9
9
|
(ADR-003), so the domain detail behind each entry lives in the
|
|
10
10
|
[core changelog](../core/CHANGELOG.md).
|
|
11
11
|
|
|
12
|
+
## 0.11.0 — 2026-10-18
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **`auth_status` and the `sii://session` resource report the CLI's rejection latch**
|
|
17
|
+
(`loginBlocked`, ADR-028), so the model can tell the user that unattended logins for a RUT
|
|
18
|
+
are blocked after a rejected Clave. The MCP reports it and never lifts it; lifting it is a
|
|
19
|
+
person's act in the terminal.
|
|
20
|
+
- Runs on the browser-free core driver for every read (ADR-027). The MCP's own `auth_login`
|
|
21
|
+
still opens SII's real page in a browser, so the MCP keeps needing Chromium for login.
|
|
22
|
+
|
|
23
|
+
### Security
|
|
24
|
+
|
|
25
|
+
- **No Clave source was added to the MCP.** The new env/stdin login tasks live in the
|
|
26
|
+
CLI-only subpath, and a test asserts the main barrel the MCP imports lacks them.
|
|
27
|
+
|
|
28
|
+
## 0.10.0 — 2026-09-12
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **`carpeta_instituciones`** (`readOnlyHint`) — SII's live list of destination institutions
|
|
33
|
+
for the Carpeta Tributaria Regular. Its description tells the model the codes drift, so a
|
|
34
|
+
remembered one must be re-checked here rather than reused. A **public catalog**: the rows
|
|
35
|
+
are registered entities (banks, cooperatives), not taxpayer data. Session-keyed, no
|
|
36
|
+
arguments.
|
|
37
|
+
- **`auth_login` gains `www2` (boolean, optional)** — mints the second cookies-only layer the
|
|
38
|
+
`carpeta_*` tools need. It still takes **no password**: the tool opens SII's own OAuth page
|
|
39
|
+
and the user types the Clave there (ADR-006 / ADR-026). `auth_status` reports the layer and
|
|
40
|
+
`auth_logout` closes it.
|
|
41
|
+
|
|
42
|
+
### Note
|
|
43
|
+
|
|
44
|
+
- A www2 tool called without that layer fails with an actionable message naming the login,
|
|
45
|
+
never a silent retry — the classic session can be alive while the layer is missing.
|
|
46
|
+
|
|
12
47
|
## 0.9.0 — 2026-09-09
|
|
13
48
|
|
|
14
49
|
### Security
|
package/README.md
CHANGED
|
@@ -24,6 +24,15 @@ npx playwright install chromium
|
|
|
24
24
|
Requires **Node ≥ 20**. (The `sii` CLI is handy for the first `sii auth login`;
|
|
25
25
|
the login can also run through the `auth_login` tool.)
|
|
26
26
|
|
|
27
|
+
Two things live **only** here: the www2 session (`auth_login` with `www2`, which opens
|
|
28
|
+
SII's OAuth page, where reCAPTCHA runs) and the Carpeta Tributaria tools that need it
|
|
29
|
+
(`carpeta_instituciones`). `auth_status` also reports when the CLI's unattended login is
|
|
30
|
+
blocked after a rejected Clave (`loginBlocked`); the MCP shows it and never lifts it.
|
|
31
|
+
|
|
32
|
+
The MCP is **not** the way to run this unattended: no tool receives the Clave, by design.
|
|
33
|
+
For a bot, cron or CI, use the CLI with `--clave-env` (see the
|
|
34
|
+
[project README](https://github.com/albertomarturelo/sii#uso-autónomo-agentes-cron-ci)).
|
|
35
|
+
|
|
27
36
|
## Connect to Claude
|
|
28
37
|
|
|
29
38
|
**Claude Desktop** — add to `claude_desktop_config.json` and restart the app
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAcL,KAAK,OAAO,EACb,MAAM,4BAA4B,CAAC;AA4BpC,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CA+KvD"}
|
package/dist/server.js
CHANGED
|
@@ -8,6 +8,10 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { HOSTS, authStatus, describeOperating, formatOperableEntry, formatRut as fmt, listOperable, login, logout, operate, operateSelf, operatingStatus, statusRefresh, } from '@albertomarturelo/sii-core';
|
|
10
10
|
import { toolText } from './tool-helpers.js';
|
|
11
|
+
/** One human line for the www2 app-session layer (ADR-026). */
|
|
12
|
+
const www2Line = (w) => w.authenticated
|
|
13
|
+
? `Sesión www2: activa${w.expiresAt ? ` (hasta ${w.expiresAt})` : ''}.`
|
|
14
|
+
: 'Sesión www2: no iniciada (auth_login con www2=true para la Carpeta Tributaria).';
|
|
11
15
|
// Domain read surfaces — each module owns a tools/<mod>.ts register fn (append-only).
|
|
12
16
|
import { registerWhoamiTools } from './tools/whoami.js';
|
|
13
17
|
import { registerRcvTools } from './tools/rcv.js';
|
|
@@ -16,6 +20,7 @@ import { registerF29Tools } from './tools/f29.js';
|
|
|
16
20
|
import { registerDteTools } from './tools/dte.js';
|
|
17
21
|
import { registerBteTools } from './tools/bte.js';
|
|
18
22
|
import { registerPeticionesTools } from './tools/peticiones.js';
|
|
23
|
+
import { registerCarpetaTools } from './tools/carpeta.js';
|
|
19
24
|
const jsonResource = (uri, value) => ({
|
|
20
25
|
contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(value, null, 2) }],
|
|
21
26
|
});
|
|
@@ -55,13 +60,17 @@ export function buildServer(runtime) {
|
|
|
55
60
|
server.registerTool('auth_login', {
|
|
56
61
|
title: 'Iniciar sesión (navegador)',
|
|
57
62
|
description: 'Abre el navegador en la página del SII para que el usuario escriba su Clave Tributaria. ' +
|
|
58
|
-
'NUNCA recibe la Clave como argumento (ADR-006); persiste solo cookies. Idempotente sobre una sesión viva.'
|
|
63
|
+
'NUNCA recibe la Clave como argumento (ADR-006); persiste solo cookies. Idempotente sobre una sesión viva. ' +
|
|
64
|
+
'www2=true añade además la sesión de la plataforma www2 (necesaria para carpeta_*): el mismo ' +
|
|
65
|
+
'navegador abre la página OAuth del SII y el usuario vuelve a escribir su Clave ahí (ADR-026).',
|
|
66
|
+
inputSchema: { www2: z.boolean().optional() },
|
|
59
67
|
annotations: { readOnlyHint: false, openWorldHint: true },
|
|
60
|
-
}, () => toolText(async () => {
|
|
61
|
-
const r = await login(runtime);
|
|
62
|
-
|
|
68
|
+
}, ({ www2 }) => toolText(async () => {
|
|
69
|
+
const r = await login(runtime, www2 ? { www2: true } : {});
|
|
70
|
+
const head = r.reason === 'already_authenticated'
|
|
63
71
|
? `Ya tienes una sesión activa como ${fmt(r.rut)}.`
|
|
64
72
|
: `Sesión iniciada como ${fmt(r.rut)}.`;
|
|
73
|
+
return r.www2 ? `${head}\n${www2Line(r.www2)}` : head;
|
|
65
74
|
}));
|
|
66
75
|
server.registerTool('auth_status', {
|
|
67
76
|
title: 'Estado de sesión',
|
|
@@ -71,14 +80,19 @@ export function buildServer(runtime) {
|
|
|
71
80
|
}, ({ refresh }) => toolText(async () => {
|
|
72
81
|
if (refresh) {
|
|
73
82
|
const id = await statusRefresh(runtime);
|
|
74
|
-
return `RUT: ${fmt(id.rut)}\nNombre: ${id.nombre ?? '—'}\nTipo: ${id.accountType}`;
|
|
83
|
+
return `RUT: ${fmt(id.rut)}\nNombre: ${id.nombre ?? '—'}\nTipo: ${id.accountType}\n${www2Line(id.www2)}`;
|
|
75
84
|
}
|
|
76
85
|
const s = await authStatus(runtime);
|
|
86
|
+
// The rejection latch (ADR-028) is reported, never lifted here: unblock is CLI-only.
|
|
87
|
+
const blocked = s.loginBlocked
|
|
88
|
+
.map((b) => `\nLogin desatendido (CLI) bloqueado para ${fmt(b.rut)} desde ${b.at}` +
|
|
89
|
+
`${b.codigo ? ` (código ${b.codigo})` : ''}; lo levanta una persona en la terminal.`)
|
|
90
|
+
.join('');
|
|
77
91
|
if (!s.authenticated || !s.rut)
|
|
78
|
-
return
|
|
92
|
+
return `No autenticado. Usa la tool auth_login.${blocked}`;
|
|
79
93
|
const ctx = await operatingStatus(runtime);
|
|
80
94
|
const op = ctx && !ctx.isSelf ? `\n${describeOperating(ctx)}` : '';
|
|
81
|
-
return `Autenticado (sesión local) como ${fmt(s.rut)}.${op}`;
|
|
95
|
+
return `Autenticado (sesión local) como ${fmt(s.rut)}.${op}\n${www2Line(s.www2)}${blocked}`;
|
|
82
96
|
}));
|
|
83
97
|
// logout carries NO secret (best-effort server close + local cookie wipe), so
|
|
84
98
|
// ADR-006 does not bar it from MCP — switching accounts is logout→login (ADR-005).
|
|
@@ -92,7 +106,10 @@ export function buildServer(runtime) {
|
|
|
92
106
|
const r = await logout(runtime);
|
|
93
107
|
if (!r.loggedOut)
|
|
94
108
|
return 'No había sesión activa.';
|
|
95
|
-
|
|
109
|
+
const head = r.serverClosed
|
|
110
|
+
? 'Sesión cerrada (servidor y local).'
|
|
111
|
+
: 'Sesión cerrada (local).';
|
|
112
|
+
return r.www2Closed ? `${head} Sesión www2 cerrada.` : head;
|
|
96
113
|
}));
|
|
97
114
|
server.registerTool('operate', {
|
|
98
115
|
title: 'Operar como',
|
|
@@ -129,6 +146,7 @@ export function buildServer(runtime) {
|
|
|
129
146
|
registerDteTools(server, runtime);
|
|
130
147
|
registerBteTools(server, runtime);
|
|
131
148
|
registerPeticionesTools(server, runtime);
|
|
149
|
+
registerCarpetaTools(server, runtime);
|
|
132
150
|
return server;
|
|
133
151
|
}
|
|
134
152
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,kGAAkG;AAClG,gFAAgF;AAChF,kFAAkF;AAClF,2FAA2F;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,IAAI,GAAG,EAChB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,EACP,WAAW,EACX,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,kGAAkG;AAClG,gFAAgF;AAChF,kFAAkF;AAClF,2FAA2F;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,IAAI,GAAG,EAChB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,EACP,WAAW,EACX,eAAe,EACf,aAAa,GAGd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,QAAQ,GAAG,CAAC,CAAiB,EAAU,EAAE,CAC7C,CAAC,CAAC,aAAa;IACb,CAAC,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAA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AG;YAAE,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACzE,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,+CAA+C,CAAC;IACxF,CAAC,CAAC,CACL,CAAC;IAEF,4EAA4E;IAC5E,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carpeta.d.ts","sourceRoot":"","sources":["../../src/tools/carpeta.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGhF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAkB9E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { carpetaInstituciones } from '@albertomarturelo/sii-core';
|
|
2
|
+
import { toolText } from '../tool-helpers.js';
|
|
3
|
+
export function registerCarpetaTools(server, runtime) {
|
|
4
|
+
server.registerTool('carpeta_instituciones', {
|
|
5
|
+
title: 'Carpeta Tributaria — instituciones destinatarias',
|
|
6
|
+
description: 'Lista VIGENTE de las instituciones a las que puede dirigirse una Carpeta Tributaria ' +
|
|
7
|
+
'Regular (bancos, cooperativas, etc.): [{codigo, descripcion, abreviacion}]. `codigo` es ' +
|
|
8
|
+
'el valor que exige `carpeta_regular` como institución destinataria; los códigos cambian ' +
|
|
9
|
+
'con el tiempo, así que se leen del SII en cada llamada — no uses un código recordado sin ' +
|
|
10
|
+
'confirmarlo aquí. Catálogo público: no expone datos del contribuyente. Session-keyed: ' +
|
|
11
|
+
'requiere sesión; para una empresa, inicia sesión como ella. Necesita además la sesión ' +
|
|
12
|
+
'www2 del SII (ADR-026); si falta, el error lo indica.',
|
|
13
|
+
inputSchema: {},
|
|
14
|
+
annotations: { readOnlyHint: true },
|
|
15
|
+
}, () => toolText(async () => JSON.stringify(await carpetaInstituciones(runtime), null, 2)));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=carpeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carpeta.js","sourceRoot":"","sources":["../../src/tools/carpeta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAgB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,OAAgB;IACtE,MAAM,CAAC,YAAY,CACjB,uBAAuB,EACvB;QACE,KAAK,EAAE,kDAAkD;QACzD,WAAW,EACT,sFAAsF;YACtF,0FAA0F;YAC1F,0FAA0F;YAC1F,2FAA2F;YAC3F,wFAAwF;YACxF,wFAAwF;YACxF,uDAAuD;QACzD,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KACpC,EACD,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,oBAAoB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CACzF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albertomarturelo/sii-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP (stdio) server for Chile's SII (tax authority): exposes authenticated reads — RCV, F29, F22, boletas de honorarios, DTE-authorized, peticiones administrativas — plus factura borradores on the Portal MIPYME (never emission) and document downloads, as tools/resources for Claude Desktop and Claude Code. Each tool is a thin call into @albertomarturelo/sii-core tasks (ADR-003).",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
46
46
|
"playwright": "^1.49.0",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@albertomarturelo/sii-core": "^0.
|
|
48
|
+
"@albertomarturelo/sii-core": "^0.11.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc -b"
|