@albertomarturelo/sii-mcp 0.8.0 → 0.10.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 +33 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +20 -7
- 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,39 @@ 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.10.0 — 2026-09-12
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`carpeta_instituciones`** (`readOnlyHint`) — SII's live list of destination institutions
|
|
17
|
+
for the Carpeta Tributaria Regular. Its description tells the model the codes drift, so a
|
|
18
|
+
remembered one must be re-checked here rather than reused. A **public catalog**: the rows
|
|
19
|
+
are registered entities (banks, cooperatives), not taxpayer data. Session-keyed, no
|
|
20
|
+
arguments.
|
|
21
|
+
- **`auth_login` gains `www2` (boolean, optional)** — mints the second cookies-only layer the
|
|
22
|
+
`carpeta_*` tools need. It still takes **no password**: the tool opens SII's own OAuth page
|
|
23
|
+
and the user types the Clave there (ADR-006 / ADR-026). `auth_status` reports the layer and
|
|
24
|
+
`auth_logout` closes it.
|
|
25
|
+
|
|
26
|
+
### Note
|
|
27
|
+
|
|
28
|
+
- A www2 tool called without that layer fails with an actionable message naming the login,
|
|
29
|
+
never a silent retry — the classic session can be alive while the layer is missing.
|
|
30
|
+
|
|
31
|
+
## 0.9.0 — 2026-09-09
|
|
32
|
+
|
|
33
|
+
### Security
|
|
34
|
+
|
|
35
|
+
- **No keyring on the MCP runtime, by construction (ADR-025).** This release adds a keyring
|
|
36
|
+
login path to the CLI. The MCP server gains **nothing** from it — no tool, no argument, no
|
|
37
|
+
keyring read — and, more to the point, the runtime it is built from carries **no
|
|
38
|
+
`SecretStore` at all**: the keyring adapter is wired by the CLI's composition root alone,
|
|
39
|
+
never as a `createNodeRuntime` default, and `main.test.ts` pins `secrets` as `undefined`.
|
|
40
|
+
Keeping the Clave-handling tasks off the main barrel controls which *task* the model can
|
|
41
|
+
reach; this controls which *seam* the process holds, so "the MCP never reads the keyring"
|
|
42
|
+
is true because the keyring is not there — not because no code happens to call it. The
|
|
43
|
+
Clave still never crosses an MCP tool argument (ADR-006).
|
|
44
|
+
|
|
12
45
|
## 0.8.0 — 2026-09-09
|
|
13
46
|
|
|
14
47
|
### Added
|
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,CAuKvD"}
|
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,14 @@ 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);
|
|
77
86
|
if (!s.authenticated || !s.rut)
|
|
78
87
|
return 'No autenticado. Usa la tool auth_login.';
|
|
79
88
|
const ctx = await operatingStatus(runtime);
|
|
80
89
|
const op = ctx && !ctx.isSelf ? `\n${describeOperating(ctx)}` : '';
|
|
81
|
-
return `Autenticado (sesión local) como ${fmt(s.rut)}.${op}`;
|
|
90
|
+
return `Autenticado (sesión local) como ${fmt(s.rut)}.${op}\n${www2Line(s.www2)}`;
|
|
82
91
|
}));
|
|
83
92
|
// logout carries NO secret (best-effort server close + local cookie wipe), so
|
|
84
93
|
// ADR-006 does not bar it from MCP — switching accounts is logout→login (ADR-005).
|
|
@@ -92,7 +101,10 @@ export function buildServer(runtime) {
|
|
|
92
101
|
const r = await logout(runtime);
|
|
93
102
|
if (!r.loggedOut)
|
|
94
103
|
return 'No había sesión activa.';
|
|
95
|
-
|
|
104
|
+
const head = r.serverClosed
|
|
105
|
+
? 'Sesión cerrada (servidor y local).'
|
|
106
|
+
: 'Sesión cerrada (local).';
|
|
107
|
+
return r.www2Closed ? `${head} Sesión www2 cerrada.` : head;
|
|
96
108
|
}));
|
|
97
109
|
server.registerTool('operate', {
|
|
98
110
|
title: 'Operar como',
|
|
@@ -129,6 +141,7 @@ export function buildServer(runtime) {
|
|
|
129
141
|
registerDteTools(server, runtime);
|
|
130
142
|
registerBteTools(server, runtime);
|
|
131
143
|
registerPeticionesTools(server, runtime);
|
|
144
|
+
registerCarpetaTools(server, runtime);
|
|
132
145
|
return server;
|
|
133
146
|
}
|
|
134
147
|
//# 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,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AAC,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.10.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.10.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc -b"
|