@nado-language/mcp 0.1.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/README.md +225 -0
- package/dist/nado-language-server.mjs +1020 -0
- package/dist/nado-mcp-auth.mjs +495 -0
- package/dist/nado-mcp-cli.mjs +521 -0
- package/dist/probe-nado-mcp.mjs +222 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Nado Language MCP
|
|
2
|
+
|
|
3
|
+
This stdio MCP server lets AI chat clients save and practice Nado Language study items.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
- `nado_whoami`: validates the configured Nado account.
|
|
8
|
+
- `nado_save_flashcard`: saves a structured flashcard generated by the user's chat AI. Nado does not call AI for this path.
|
|
9
|
+
- `nado_analyze_and_save_flashcard`: Pro/Admin only. Nado AI generates the learner definition, usage note, examples, and variants, then saves the flashcard.
|
|
10
|
+
- `nado_list_study_items`: loads saved flashcards for the authenticated user.
|
|
11
|
+
- `nado_generate_practice`: builds practice exercises from saved flashcards only.
|
|
12
|
+
|
|
13
|
+
The default MCP path is designed to avoid double charging for AI. ChatGPT, Claude, Codex, or another user-paid AI model should fill the structured flashcard fields, and Nado only validates/saves them. Nado AI quality generation is a separate Pro/Admin tool.
|
|
14
|
+
|
|
15
|
+
## Authentication
|
|
16
|
+
|
|
17
|
+
Installed package browser login:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
nado-mcp login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Source checkout alias:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run mcp:nado:auth -- --provider google
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This opens the provider login page, relays the Supabase OAuth callback through the existing Azure Static Web Apps site, receives the final callback on `127.0.0.1`, and writes ignored local tokens to the user's OS config directory for package installs or `.env.mcp.local` in a repo checkout:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
NADO_MCP_ACCESS_TOKEN='supabase-user-access-token'
|
|
33
|
+
NADO_MCP_REFRESH_TOKEN='supabase-user-refresh-token'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
By default this uses the existing Azure Static Web Apps production site as a static OAuth relay. It does not require a new Azure Function, App Service, database, or paid runtime. The local helper still receives the final callback on `127.0.0.1`; Azure only serves the static relay page.
|
|
37
|
+
|
|
38
|
+
The MCP server refreshes expired access tokens with `NADO_MCP_REFRESH_TOKEN` and updates the auth file when Supabase rotates the refresh token.
|
|
39
|
+
|
|
40
|
+
Supported local browser providers are `google`, `kakao`, and `apple`. Naver login is not available in the local MCP flow yet because the current Naver Edge Function uses fixed web/native redirect URLs.
|
|
41
|
+
|
|
42
|
+
Supabase Auth must allow the Azure relay redirect URL:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
https://language.nado.ai.kr/auth/mcp-callback
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For direct local callback mode, run with `--redirect-mode local` and allow:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
http://127.0.0.1:*/callback
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You can inspect or clear local MCP auth with:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
nado-mcp status
|
|
58
|
+
nado-mcp logout
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Source checkout aliases:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run mcp:nado:auth -- status
|
|
65
|
+
npm run mcp:nado:auth -- logout
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Manual access-token option:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
export NADO_MCP_ACCESS_TOKEN='supabase-user-access-token'
|
|
72
|
+
export NADO_MCP_REFRESH_TOKEN='supabase-user-refresh-token'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Password fallback:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
export NADO_MCP_EMAIL='user@example.com'
|
|
79
|
+
export NADO_MCP_PASSWORD='password'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
For local development, the server also loads ignored local env files from the current working directory or repo root:
|
|
83
|
+
|
|
84
|
+
- `.env.mcp.local`
|
|
85
|
+
- `.env.local`
|
|
86
|
+
|
|
87
|
+
Example `.env.mcp.local`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
NADO_MCP_ACCESS_TOKEN=supabase-user-access-token
|
|
91
|
+
NADO_MCP_REFRESH_TOKEN=supabase-user-refresh-token
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Optional environment:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
export NADO_MCP_SUPABASE_URL='https://ptbwzhxifxdnfmqsiugi.supabase.co'
|
|
98
|
+
export NADO_MCP_SUPABASE_ANON_KEY='...'
|
|
99
|
+
export NADO_MCP_AUTH_RELAY_URL='https://language.nado.ai.kr/auth/mcp-callback'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Client Registration
|
|
103
|
+
|
|
104
|
+
Installed package, one-command setup plus browser login:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
nado-mcp connect codex
|
|
108
|
+
nado-mcp connect claude
|
|
109
|
+
nado-mcp connect opencode
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Setup without login:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
nado-mcp setup codex
|
|
116
|
+
nado-mcp setup claude
|
|
117
|
+
nado-mcp setup opencode
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For any other MCP-compatible client, print portable stdio config:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
nado-mcp config
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If the client uses a JSON file with a top-level `mcpServers` object:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
nado-mcp setup mcp-json --file /path/to/mcp.json
|
|
130
|
+
nado-mcp login
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Unknown clients are handled as generic MCP clients. `nado-mcp setup <client-name>` prints the portable config instead of failing.
|
|
134
|
+
|
|
135
|
+
Manual Codex registration from a source checkout:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
codex mcp add nado-language -- node /Users/jin/Documents/nado/eng/mcp/nado-language-server.mjs
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Then run Codex from a shell where the auth environment variables above are set.
|
|
142
|
+
Alternatively, create `.env.mcp.local` in the repo root before Codex starts the MCP server.
|
|
143
|
+
When using the installed package, `nado-mcp login` saves auth to the user's OS config directory and the server reads it automatically.
|
|
144
|
+
|
|
145
|
+
## Verification
|
|
146
|
+
|
|
147
|
+
Basic tool discovery:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
nado-mcp probe list
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Source checkout alias:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm run mcp:nado:probe -- list
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Authenticated account check:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
nado-mcp probe whoami
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Source checkout alias:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm run mcp:nado:probe -- whoami
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
End-to-end admin verification. This saves a unique word, lists it back, and confirms generated practice cites only saved card IDs:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
nado-mcp probe verify-admin "serendipity"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Source checkout alias:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npm run mcp:nado:probe -- verify-admin "serendipity"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The admin verification requires browser login, `NADO_MCP_ACCESS_TOKEN`, or `NADO_MCP_EMAIL` and `NADO_MCP_PASSWORD`, either in the current process, the package auth file, or `.env.mcp.local`.
|
|
184
|
+
|
|
185
|
+
Save a user-AI generated card without Nado AI cost:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
nado-mcp probe save "serendipity"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Source checkout alias:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm run mcp:nado:probe -- save "serendipity"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Pro/Admin Nado AI quality path:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
nado-mcp probe save-nado-ai "serendipity"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Source checkout alias:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm run mcp:nado:probe -- save-nado-ai "serendipity"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## Package CLI
|
|
211
|
+
|
|
212
|
+
Install/register/login flow:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
nado-mcp connect codex
|
|
216
|
+
nado-mcp connect claude
|
|
217
|
+
nado-mcp connect opencode
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Generic MCP fallback:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
nado-mcp config
|
|
224
|
+
nado-mcp login
|
|
225
|
+
```
|