altalandi-mcp 0.7.8 → 0.7.10

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/README.md CHANGED
@@ -1,116 +1,116 @@
1
- # altalandi-mcp
2
-
3
- An [MCP](https://modelcontextprotocol.io) server that exposes
4
- [Altalandi](https://altalandi.is), native-Icelandic refinement with a
5
- meaning-preservation check, as a tool any MCP client can call. stdio transport.
6
-
7
- ## Set up (Claude Code or Codex)
8
-
9
- Connect this computer once. This opens altalandi.is, you approve, and the key
10
- is stored locally. You never copy it:
11
-
12
- ```bash
13
- npx altalandi login
14
- ```
15
-
16
- Then add the server. No key goes into any config file; the server reads the
17
- one `altalandi login` stored:
18
-
19
- ```bash
20
- claude mcp add altalandi -s user -- npx -y altalandi-mcp@latest # Claude Code
21
- codex mcp add altalandi -- npx -y altalandi-mcp@latest # Codex
22
- ```
23
-
24
- `@latest` makes each new session use the newest version. Added it without
25
- `@latest` before? npx keeps its first copy: remove the server
26
- (`claude mcp remove altalandi`) and add it again with the line above.
27
-
28
- Ask for Icelandic and mention Altalandi, e.g. *"Write this in proper Icelandic
29
- with Altalandi."* The agent calls the **`refine_icelandic`** tool.
30
-
31
- ### Without `altalandi login` (CI, services, other clients)
32
-
33
- Set `ALTALANDI_API_KEY` in the server's environment, from your host's secret
34
- manager. It takes precedence over a stored login. Mint a key at
35
- <https://altalandi.is/portal>. Never commit a plaintext key in MCP JSON.
36
-
37
- ```json
38
- { "mcpServers": { "altalandi": { "command": "npx", "args": ["-y", "altalandi-mcp@latest"] } } }
39
- ```
40
-
41
- ## The tool
42
-
43
- `refine_icelandic({ text, domain?, register?, sourceLang?, report? })` returns two
44
- parts. The first is one Markdown block: the verdict and nativeness score, the text
45
- before and after (Fyrir / Eftir), a numbered list of changes with their reasons,
46
- why a rewrite was refused if it was, and what the call cost with the balance and
47
- free units left (Kostnaður). The second is the full refined text to apply. The
48
- tool tells the agent to show the block to you as it is after every call, so you see
49
- what changed and what it cost in the terminal or the editor, not only on the website.
50
-
51
- - `domain`: `general` \| `marketing` \| `data-analysis` \| `childrens-fiction`
52
- - `register`: `formal` \| `neutral` \| `warm`
53
- - `sourceLang`: `auto` \| `en` \| `is`
54
- - `noStore`: `true` means Altalandi never keeps this text. Otherwise free use (the free
55
- daily units) is kept, with personal data scrubbed, to improve the service; paid use only
56
- with consent ([privacy](https://altalandi.is/personuvernd#textabanki)).
57
- - `report`: `true` also writes `./altalandi-reports/altalandi-<time>-<id>.md`
58
- (input, output, every change with its reason and layer, warnings, verdict).
59
- Default: on when `ALTALANDI_REPORT=1`. Reports contain the text, so they are opt-in.
60
-
61
- **Meaning guarantee:** on Icelandic input where the rewrite can't be verified to
62
- preserve meaning, the tool returns the **original unchanged** and flags it,
63
- never a silent change.
64
-
65
- ## Proofreading
66
-
67
- `proofread_icelandic({ text, suggestions?, minPrecision?, noStore? })` fixes only
68
- proven errors in Icelandic you wrote (punctuation, word boundaries, a misspelt word
69
- one slip from the right one) and keeps your wording. Everything else comes back as
70
- numbered **suggestions**, each with its reason and, when known, how sure it is. The
71
- agent shows you each one and applies only those you accept.
72
-
73
- - `suggestions`: `offer` (default: you choose) \| `apply` (the kinds of suggestion
74
- measured right at least `minPrecision` of the time are applied and listed; the rest
75
- are offered) \| `off` (only the safe fixes).
76
- - `minPrecision`: 0.5 to 0.99, default 0.9. A suggestion with a digit, or one that
77
- changes a name, is never applied unasked.
78
-
79
- Then `record_suggestion_decisions({ resultId, decisions })` tells Altalandi which
80
- suggestions you used or ignored (numbers only, no text, free). That is how the
81
- suggestions get better.
82
-
83
- Only **meaning preserved** is a verified result. **MEANING UNVERIFIED** means the
84
- check did not run or could not complete; review that output before use. API
85
- warnings are included under a clear `Warnings:` section in the tool's result.
86
-
87
- ## The Altalandi card
88
-
89
- In hosts that render MCP Apps (Claude Desktop, claude.ai), results appear in an
90
- Altalandi card: the text with a copy button, whether the meaning check passed,
91
- each change with its reason, and for proofreading each suggestion with **Nota**
92
- and **Hunsa** buttons. The card records the decisions itself. Terminals (Claude
93
- Code, Codex) get the same text as before. The server offers the card as the
94
- resource `ui://altalandi/result-v1.html`; both tools return its data as
95
- `structuredContent`.
96
-
97
- ## Config
98
-
99
- | env | default | purpose |
100
- |-----|---------|---------|
101
- | `ALTALANDI_API_KEY` | (the key from `altalandi login`) | your key (Bearer) |
102
- | `ALTALANDI_CONFIG_DIR` | `%APPDATA%\altalandi` / `~/.config/altalandi` | where `altalandi login` stored it |
103
- | `ALTALANDI_BASE_URL` | `https://altalandi.is/api` | API base (override for self-hosting) |
104
- | `ALTALANDI_REPORT` | — | `1` = write a report for every call |
105
- | `ALTALANDI_REPORT_DIR` | `./altalandi-reports` (the server's working folder) | where reports go |
106
-
107
- Each API request has a fixed 300-second deadline, including the response body,
108
- so a stalled provider cannot leave the tool hanging.
109
-
110
- ## Cost
111
-
112
- Every account gets 2,000 free units a day on the standard writer (about 2,000
113
- words); past that, calls are paid from prepaid credit in krónur, and a new account
114
- also starts with 500 kr. of trial credit. See <https://altalandi.is/verd>.
115
-
116
- MIT licensed. Requires Node ≥ 18.
1
+ # altalandi-mcp
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server that exposes
4
+ [Altalandi](https://altalandi.is), native-Icelandic refinement with a
5
+ meaning-preservation check, as a tool any MCP client can call. stdio transport.
6
+
7
+ ## Set up (Claude Code or Codex)
8
+
9
+ Connect this computer once. This opens altalandi.is, you approve, and the key
10
+ is stored locally. You never copy it:
11
+
12
+ ```bash
13
+ npx altalandi login
14
+ ```
15
+
16
+ Then add the server. No key goes into any config file; the server reads the
17
+ one `altalandi login` stored:
18
+
19
+ ```bash
20
+ claude mcp add altalandi -s user -- npx -y altalandi-mcp@latest # Claude Code
21
+ codex mcp add altalandi -- npx -y altalandi-mcp@latest # Codex
22
+ ```
23
+
24
+ `@latest` makes each new session use the newest version. Added it without
25
+ `@latest` before? npx keeps its first copy: remove the server
26
+ (`claude mcp remove altalandi`) and add it again with the line above.
27
+
28
+ Ask for Icelandic and mention Altalandi, e.g. *"Write this in proper Icelandic
29
+ with Altalandi."* The agent calls the **`refine_icelandic`** tool.
30
+
31
+ ### Without `altalandi login` (CI, services, other clients)
32
+
33
+ Set `ALTALANDI_API_KEY` in the server's environment, from your host's secret
34
+ manager. It takes precedence over a stored login. Mint a key at
35
+ <https://altalandi.is/stjornbord/forritarar>. Never commit a plaintext key in MCP JSON.
36
+
37
+ ```json
38
+ { "mcpServers": { "altalandi": { "command": "npx", "args": ["-y", "altalandi-mcp@latest"] } } }
39
+ ```
40
+
41
+ ## The tool
42
+
43
+ `refine_icelandic({ text, domain?, register?, sourceLang?, report? })` returns two
44
+ parts. The first is one Markdown block: the verdict and nativeness score, the text
45
+ before and after (Fyrir / Eftir), a numbered list of changes with their reasons,
46
+ why a rewrite was refused if it was, and what the call cost with the balance and
47
+ free characters left (Kostnaður). The second is the full refined text to apply. The
48
+ tool tells the agent to show the block to you as it is after every call, so you see
49
+ what changed and what it cost in the terminal or the editor, not only on the website.
50
+
51
+ - `domain`: `general` \| `marketing` \| `data-analysis` \| `childrens-fiction`
52
+ - `register`: `formal` \| `neutral` \| `warm`
53
+ - `sourceLang`: `auto` \| `en` \| `is`
54
+ - `noStore`: `true` means Altalandi never keeps this text. Otherwise free use (the free
55
+ daily characters) is kept, with personal data scrubbed, to improve the service; paid use only
56
+ with consent ([privacy](https://altalandi.is/personuvernd#textabanki)).
57
+ - `report`: `true` also writes `./altalandi-reports/altalandi-<time>-<id>.md`
58
+ (input, output, every change with its reason and layer, warnings, verdict).
59
+ Default: on when `ALTALANDI_REPORT=1`. Reports contain the text, so they are opt-in.
60
+
61
+ **Meaning guarantee:** on Icelandic input where the rewrite can't be verified to
62
+ preserve meaning, the tool returns the **original unchanged** and flags it,
63
+ never a silent change.
64
+
65
+ ## Proofreading
66
+
67
+ `proofread_icelandic({ text, suggestions?, minPrecision?, noStore? })` fixes only
68
+ proven errors in Icelandic you wrote (punctuation, word boundaries, a misspelt word
69
+ one slip from the right one) and keeps your wording. Everything else comes back as
70
+ numbered **suggestions**, each with its reason and, when known, how sure it is. The
71
+ agent shows you each one and applies only those you accept.
72
+
73
+ - `suggestions`: `offer` (default: you choose) \| `apply` (the kinds of suggestion
74
+ measured right at least `minPrecision` of the time are applied and listed; the rest
75
+ are offered) \| `off` (only the safe fixes).
76
+ - `minPrecision`: 0.5 to 0.99, default 0.9. A suggestion with a digit, or one that
77
+ changes a name, is never applied unasked.
78
+
79
+ Then `record_suggestion_decisions({ resultId, decisions })` tells Altalandi which
80
+ suggestions you used or ignored (numbers only, no text, free). That is how the
81
+ suggestions get better.
82
+
83
+ Only **meaning preserved** is a verified result. **MEANING UNVERIFIED** means the
84
+ check did not run or could not complete; review that output before use. API
85
+ warnings are included under a clear `Warnings:` section in the tool's result.
86
+
87
+ ## The Altalandi card
88
+
89
+ In hosts that render MCP Apps (Claude Desktop, claude.ai), results appear in an
90
+ Altalandi card: the text with a copy button, whether the meaning check passed,
91
+ each change with its reason, and for proofreading each suggestion with **Nota**
92
+ and **Hunsa** buttons. The card records the decisions itself. Terminals (Claude
93
+ Code, Codex) get the same text as before. The server offers the card as the
94
+ resource `ui://altalandi/result-v1.html`; both tools return its data as
95
+ `structuredContent`.
96
+
97
+ ## Config
98
+
99
+ | env | default | purpose |
100
+ |-----|---------|---------|
101
+ | `ALTALANDI_API_KEY` | (the key from `altalandi login`) | your key (Bearer) |
102
+ | `ALTALANDI_CONFIG_DIR` | `%APPDATA%\altalandi` / `~/.config/altalandi` | where `altalandi login` stored it |
103
+ | `ALTALANDI_BASE_URL` | `https://altalandi.is/api` | API base (override for self-hosting) |
104
+ | `ALTALANDI_REPORT` | — | `1` = write a report for every call |
105
+ | `ALTALANDI_REPORT_DIR` | `./altalandi-reports` (the server's working folder) | where reports go |
106
+
107
+ Each API request has a fixed 300-second deadline, including the response body,
108
+ so a stalled provider cannot leave the tool hanging.
109
+
110
+ ## Cost
111
+
112
+ Every account gets a free daily allowance of characters on the standard writer
113
+ (`GET /v1/pricing` has the figure); past that, calls are paid from prepaid credit in krónur, and a new account
114
+ also starts with 500 kr. of trial credit. See <https://altalandi.is/verd>.
115
+
116
+ MIT licensed. Requires Node ≥ 18.
package/api-client.mjs CHANGED
@@ -53,7 +53,7 @@ export async function requestRefine(
53
53
  }
54
54
  }
55
55
 
56
- /** The account behind the key (balance, free units), or null. Best-effort:
56
+ /** The account behind the key (balance, free characters), or null. Best-effort:
57
57
  * it only fills the cost lines of the review block. */
58
58
  export async function requestMe(baseUrl, apiKey, { fetchImpl = globalThis.fetch } = {}) {
59
59
  try {