feat(mcp): connect_migration: one-click card into the previous-system wizard (#1960)

* feat(mcp): gnubok_connect_migration: one-click connect card into the previous-system wizard

'Jag hade Fortnox' now gets the same feel as Skatteverket: the tool
returns the migration-wizard link for the named provider and renders
the connect-card widget (new migration branch: 'Hämta från Fortnox',
button opens the wizard that logs into the old system and fetches all
fiscal years plus invoices, customers, suppliers and documents). For
visma/bokio (no API export) the instructions order the SIE drop card
first and this card as the complement. Scope companies:read; skill
step 3 points at the tool instead of raw wizard links; ceiling 62.4K
to 63K documented.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(mcp): 5-minute freshness hint on tools/list, widgets and prompts: the catalog changes with every deploy

The stateless-client CacheableResult hint on tools/list, resources/read
(widget HTML) and prompts/list was 1 hour. Claude.ai honors it, so for
up to an hour after a deploy the connector served a pre-deploy catalog:
a freshly shipped tool flapped in and out of the tool list depending on
which fetch hit the client cache, and two E2E runs dead-ended on
'tool does not exist' for a tool that was live server-side. These
payloads are static only within one deploy; 5 minutes bounds the stale
window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-08-26 19:19:24 +02:00
committed by GitHub
co-authored by Claude Fable 5 Jakob Wennberg
parent 5715dd3def
commit d8244ecaff
7 changed files with 159 additions and 15 deletions
@@ -166,8 +166,25 @@ export const CONNECT_CARD_HTML = `<!DOCTYPE html>
function render(sc) {
const isSkv = 'available' in sc;
const isMigration = 'provider_name' in sc;
connectUrl = sc.connect_url || null;
el('title').textContent = isSkv ? 'Anslut Skatteverket' : 'Anslut din bank';
el('title').textContent = isSkv
? 'Anslut Skatteverket'
: isMigration
? 'Hämta från ' + sc.provider_name
: 'Anslut din bank';
if (isMigration) {
el('lede').textContent = sc.api_connected
? 'Guiden loggar in hos ' + sc.provider_name + ' och hämtar bokföring, fakturor, kunder och underlag. Du behöver vara inloggad i Accounted i webbläsaren.'
: sc.provider_name + ' saknar API-export: importera SIE-filen här först; guiden kompletterar sedan med fakturor och kunder.';
if (connectUrl) {
el('url').textContent = connectUrl;
show('url');
show('actions');
}
return;
}
if (isSkv && !sc.available) {
el('lede').textContent = 'Skatteverket-kopplingen är inte aktiverad på den här installationen. Deklarationer kan fortfarande laddas ned som filer.';