nworks-plus 1.3.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 ADDED
@@ -0,0 +1,416 @@
1
+ # nworks
2
+
3
+ [![npm version](https://img.shields.io/npm/v/nworks.svg)](https://www.npmjs.com/package/nworks)
4
+ [![license](https://img.shields.io/npm/l/nworks.svg)](LICENSE)
5
+ [![npm downloads](https://img.shields.io/npm/dm/nworks.svg)](https://www.npmjs.com/package/nworks)
6
+ [![nworks MCP server](https://glama.ai/mcp/servers/yjcho9317/nworks/badges/score.svg)](https://glama.ai/mcp/servers/yjcho9317/nworks)
7
+
8
+ Featured in [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)
9
+
10
+ πŸ‡ΊπŸ‡Έ English | [πŸ‡°πŸ‡· ν•œκ΅­μ–΄](README.ko.md) | [πŸ‡―πŸ‡΅ ζ—₯本θͺž](README.ja.md)
11
+
12
+ <p align="center">
13
+ <img src="assets/demo.gif" width="600" alt="nworks demo">
14
+ </p>
15
+
16
+ Full-featured MCP server for LINE WORKS (NAVER WORKS).
17
+ CLI + MCP server β€” 28 tools covering messages, calendar, drive, mail, tasks, and boards.
18
+
19
+ ## Quickstart
20
+
21
+ ```bash
22
+ npm install -g nworks
23
+ nworks login --user
24
+ nworks calendar list
25
+ ```
26
+
27
+ ### AI Agents Actually Use It Like This
28
+
29
+ ```
30
+ User: Show me today's schedule
31
+
32
+ Claude β†’ nworks_calendar_list
33
+ β†’ 3 events: Standup (10:00), Lunch meeting (12:00), Code review (15:00)
34
+
35
+ User: Send a deploy complete message to the team channel
36
+
37
+ Claude β†’ nworks_message_send
38
+ { "channel": "C001", "text": "v1.2.0 deploy complete" }
39
+ β†’ Message sent
40
+
41
+ User: Check my unread emails and summarize them
42
+
43
+ Claude β†’ nworks_mail_list (unread)
44
+ β†’ 3 unread emails
45
+ Claude β†’ nworks_mail_read (each)
46
+ β†’ "3 unread: 1) Deploy approval from CTO, 2) Meeting invite for Friday, 3) Weekly report reminder"
47
+ ```
48
+
49
+ ## Install
50
+
51
+ ```bash
52
+ npx nworks # Run directly
53
+ npm install -g nworks # Global install
54
+ ```
55
+
56
+ ## Login
57
+
58
+ ```bash
59
+ # User OAuth (calendar, drive, mail, tasks, boards)
60
+ nworks login --user --scope "calendar calendar.read file file.read mail mail.read task task.read board board.read user.read"
61
+
62
+ # Bot messaging (Service Account)
63
+ nworks login
64
+
65
+ # Check auth status
66
+ nworks whoami
67
+
68
+ # Logout
69
+ nworks logout
70
+ ```
71
+
72
+ > `nworks login --user` only requires CLIENT_ID + CLIENT_SECRET. Values already set via environment variables or existing config won't be asked again.
73
+
74
+ > **Developer Console**: To use User OAuth, register `http://localhost:9876/callback` as a Redirect URL in the [Developer Console](https://dev.worksmobile.com/en/).
75
+
76
+ ---
77
+
78
+ ## AI Agent Integration (MCP Server)
79
+
80
+ Works with Claude Desktop, Cursor, and other MCP-compatible clients.
81
+
82
+ ### Setup
83
+
84
+ Login first:
85
+
86
+ ```bash
87
+ nworks login --user --scope "calendar calendar.read file file.read mail mail.read task task.read board board.read user.read"
88
+ ```
89
+
90
+ Then add to your MCP config (`~/.config/claude/claude_desktop_config.json`):
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "nworks": {
96
+ "command": "nworks",
97
+ "args": ["mcp"]
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ One login enables all 28 tools. No extra env setup needed.
104
+
105
+ > Without CLI login, an AI agent can call `nworks_setup` β†’ `nworks_login_user` to authenticate via browser directly. Client Secret and Private Key path must be pre-configured via MCP config `env` field or system environment variables.
106
+
107
+ ### MCP Tools (28)
108
+
109
+ | Tool | Description | Auth |
110
+ |------|-------------|------|
111
+ | **Setup / Auth** | | |
112
+ | `nworks_setup` | Configure API credentials (Client ID, etc.). Client Secret is set via env | β€” |
113
+ | `nworks_login_user` | User OAuth browser login (all scopes included) | β€” |
114
+ | `nworks_logout` | Delete credentials and tokens | β€” |
115
+ | `nworks_whoami` | Check auth status | β€” |
116
+ | `nworks_doctor` | Diagnose connection (auth, tokens, API health) | β€” |
117
+ | **Messages** | | |
118
+ | `nworks_message_send` | Send message to user/channel | Service Account |
119
+ | `nworks_message_members` | List channel members | Service Account |
120
+ | `nworks_directory_members` | List organization members | Service Account |
121
+ | **Calendar** | | |
122
+ | `nworks_calendar_list` | List calendar events across all calendars | User OAuth (calendar.read) |
123
+ | `nworks_calendar_calendars` | List the user's calendars and their IDs | User OAuth (calendar.read) |
124
+ | `nworks_calendar_create` | Create calendar event | User OAuth (calendar + calendar.read) |
125
+ | `nworks_calendar_update` | Update calendar event | User OAuth (calendar + calendar.read) |
126
+ | `nworks_calendar_delete` | Delete calendar event | User OAuth (calendar + calendar.read) |
127
+ | **Drive** | | |
128
+ | `nworks_drive_list` | List drive files/folders | User OAuth (file.read) |
129
+ | `nworks_drive_upload` | Upload file to drive | User OAuth (file) |
130
+ | `nworks_drive_download` | Download file (saves locally if >5MB) | User OAuth (file.read) |
131
+ | **Mail** | | |
132
+ | `nworks_mail_send` | Send mail | User OAuth (mail) |
133
+ | `nworks_mail_list` | List mailbox | User OAuth (mail.read) |
134
+ | `nworks_mail_read` | Read mail detail (body cleaned to plain text) | User OAuth (mail.read) |
135
+ | `nworks_mail_attachment` | Read a mail attachment's text (txt/csv/json/html…) | User OAuth (mail.read) |
136
+ | **Tasks** | | |
137
+ | `nworks_task_list` | List tasks | User OAuth (task.read) |
138
+ | `nworks_task_create` | Create task | User OAuth (task + user.read) |
139
+ | `nworks_task_update` | Update/complete task | User OAuth (task + user.read) |
140
+ | `nworks_task_delete` | Delete task | User OAuth (task + user.read) |
141
+ | **Boards** | | |
142
+ | `nworks_board_list` | List boards | User OAuth (board.read) |
143
+ | `nworks_board_posts` | List board posts | User OAuth (board.read) |
144
+ | `nworks_board_read` | Read board post detail | User OAuth (board.read) |
145
+ | `nworks_board_create` | Create board post | User OAuth (board) |
146
+
147
+ ### AI Agent Usage Example
148
+
149
+ ```
150
+ User: Schedule a meeting tomorrow at 2pm and notify the team channel
151
+
152
+ Claude β†’ nworks_calendar_create
153
+ { "summary": "Meeting", "start": "2026-03-15T14:00:00", "end": "2026-03-15T15:00:00" }
154
+ β†’ Event created
155
+
156
+ Claude β†’ nworks_message_send
157
+ { "channel": "C001", "text": "Meeting scheduled tomorrow at 14:00" }
158
+ β†’ Message sent
159
+
160
+ User: Check my unread emails and summarize them
161
+
162
+ Claude β†’ nworks_mail_list (unread)
163
+ β†’ 3 unread emails
164
+ Claude β†’ nworks_mail_read (each)
165
+ β†’ "3 unread: 1) Deploy approval from CTO, 2) Meeting invite for Friday, 3) Weekly report reminder"
166
+ ```
167
+
168
+ ---
169
+
170
+ ## CLI Usage
171
+
172
+ > All commands support `--json` for pipe/script/agent parsing. `message send`, `mail send`, and `drive upload` support `--dry-run` for testing without sending.
173
+
174
+ ### Messages (Bot API)
175
+
176
+ ```bash
177
+ # Send text to user
178
+ nworks message send --to <userId> --text "Hello"
179
+
180
+ # Send text to channel
181
+ nworks message send --channel <channelId> --text "Announcement"
182
+
183
+ # Button message
184
+ nworks message send --to <userId> --type button --text "PR review request" \
185
+ --actions '[{"type":"message","label":"Approve","postback":"approve"}]'
186
+
187
+ # List message
188
+ nworks message send --to <userId> --type list --text "Today's tasks" \
189
+ --elements '[{"title":"Code review","subtitle":"PR #382"}]'
190
+
191
+ # List channel members
192
+ nworks message members --channel <channelId>
193
+ ```
194
+
195
+ ### Directory
196
+
197
+ ```bash
198
+ nworks directory members # List organization members
199
+ ```
200
+
201
+ ### Calendar (User OAuth)
202
+
203
+ ```bash
204
+ # List today's events (aggregated across all calendars)
205
+ nworks calendar list
206
+
207
+ # List the user's calendars and their IDs
208
+ nworks calendar calendars
209
+
210
+ # Specify date range
211
+ nworks calendar list --from "2026-03-14T00:00:00+09:00" --until "2026-03-14T23:59:59+09:00"
212
+
213
+ # Only a specific calendar
214
+ nworks calendar list --calendar "<calendarId>"
215
+
216
+ # Create event
217
+ nworks calendar create --title "Meeting" --start "2026-03-14T14:00+09:00" --end "2026-03-14T15:00+09:00"
218
+
219
+ # With location/description
220
+ nworks calendar create --title "Lunch" --start "2026-03-14T12:00+09:00" --end "2026-03-14T13:00+09:00" \
221
+ --location "Conference Room" --description "Quarterly review"
222
+
223
+ # With attendees + notification
224
+ nworks calendar create --title "Team meeting" --start "2026-03-14T10:00+09:00" --end "2026-03-14T11:00+09:00" \
225
+ --attendees "user1@example.com,user2@example.com" --notify
226
+
227
+ # Update event
228
+ nworks calendar update --id <eventId> --title "Updated title"
229
+
230
+ # Delete event
231
+ nworks calendar delete --id <eventId>
232
+ ```
233
+
234
+ ### Drive (User OAuth)
235
+
236
+ ```bash
237
+ # List files/folders
238
+ nworks drive list
239
+
240
+ # Upload file
241
+ nworks drive upload --file ./report.pdf
242
+
243
+ # Upload to specific folder
244
+ nworks drive upload --file ./report.pdf --folder <folderId>
245
+
246
+ # Download file
247
+ nworks drive download --file-id <fileId>
248
+
249
+ # Specify output path/name
250
+ nworks drive download --file-id <fileId> --out ./downloads --name report.pdf
251
+ ```
252
+
253
+ ### Mail (User OAuth)
254
+
255
+ ```bash
256
+ # Send mail
257
+ nworks mail send --to "user@example.com" --subject "Subject" --body "Body"
258
+
259
+ # With CC/BCC
260
+ nworks mail send --to "user@example.com" --cc "cc@example.com" --subject "Subject" --body "Body"
261
+
262
+ # List inbox
263
+ nworks mail list
264
+
265
+ # Unread only
266
+ nworks mail list --unread
267
+
268
+ # Read mail detail (body is cleaned to plain text by default)
269
+ nworks mail read --id <mailId>
270
+
271
+ # Keep the raw HTML body instead
272
+ nworks mail read --id <mailId> --html
273
+
274
+ # Read an attachment's text (txt/csv/json/html/ics…); attachmentId comes from `mail read`
275
+ nworks mail attachment --id <mailId> --attachment <attachmentId>
276
+
277
+ # Save a binary attachment (PDF, images, Office docs) to disk instead
278
+ nworks mail attachment --id <mailId> --attachment <attachmentId> --out ./downloads
279
+ ```
280
+
281
+ > The mail body is HTML-stripped to readable plain text by default (great for AI summaries).
282
+ > Use `--html` (CLI) or `format: "html" | "both"` (MCP `nworks_mail_read`) to get the original HTML.
283
+ >
284
+ > `mail attachment` returns text-based attachments inline (HTML is cleaned too). Binary types
285
+ > (PDF, Office, images) can't be text-extracted β€” use `--out` to save them.
286
+
287
+ ### Tasks (User OAuth)
288
+
289
+ ```bash
290
+ # List tasks
291
+ nworks task list
292
+
293
+ # Incomplete only
294
+ nworks task list --status TODO
295
+
296
+ # Create task
297
+ nworks task create --title "Code review" --body "Review PR #382"
298
+
299
+ # With due date
300
+ nworks task create --title "Deploy" --due 2026-03-20
301
+
302
+ # Mark as done
303
+ nworks task update --id <taskId> --status done
304
+
305
+ # Delete task
306
+ nworks task delete --id <taskId>
307
+ ```
308
+
309
+ ### Boards (User OAuth)
310
+
311
+ ```bash
312
+ # List boards
313
+ nworks board list
314
+
315
+ # List posts
316
+ nworks board posts --board <boardId>
317
+
318
+ # Read post detail
319
+ nworks board read --board <boardId> --post <postId>
320
+
321
+ # Create post
322
+ nworks board create --board <boardId> --title "Announcement" --body "Content"
323
+
324
+ # With notification + disable comments
325
+ nworks board create --board <boardId> --title "Notice" --body "Content" --notify --no-comment
326
+ ```
327
+
328
+ ### CI/CD Deploy Notification
329
+
330
+ ```bash
331
+ # Notify team channel after deployment in GitHub Actions
332
+ nworks message send --channel $CHANNEL_ID --text "v${VERSION} deployed"
333
+ ```
334
+
335
+ ### Team Automation Script
336
+
337
+ ```bash
338
+ # Send daily standup reminder to all members
339
+ for userId in $(nworks directory members --json | jq -r '.users[].userId'); do
340
+ nworks message send --to "$userId" --text "Standup at 10:00 today"
341
+ done
342
+ ```
343
+
344
+ ---
345
+
346
+ ## OAuth Scopes
347
+
348
+ Add the required scopes in the [LINE WORKS Developer Console](https://dev.worksmobile.com/en/).
349
+
350
+ | Scope | Purpose | Auth | Required For |
351
+ |-------|---------|------|-------------|
352
+ | `bot` | Bot messaging | Service Account | `message send` |
353
+ | `bot.read` | Bot channel/member read | Service Account | `message members` |
354
+ | `calendar` | Calendar write | User OAuth | `calendar create/update/delete` (requires calendar.read) |
355
+ | `calendar.read` | Calendar read | User OAuth | `calendar list`, also needed for calendar write |
356
+ | `file` | Drive read/write | User OAuth | `drive list/upload/download` |
357
+ | `file.read` | Drive read-only | User OAuth | `drive list/download` |
358
+ | `mail` | Mail read/write | User OAuth | `mail send/list/read` |
359
+ | `mail.read` | Mail read-only | User OAuth | `mail list/read` |
360
+ | `task` | Tasks read/write | User OAuth | `task create/update/delete` (requires user.read) |
361
+ | `task.read` | Tasks read-only | User OAuth | `task list` |
362
+ | `user.read` | User info read | Service Account / User OAuth | `directory members`, also needed for task write |
363
+ | `board` | Boards read/write | User OAuth | `board list/posts/read/create` |
364
+ | `board.read` | Boards read-only | User OAuth | `board list/posts/read` |
365
+
366
+ > **Tip**: After changing scopes, reissue your token:
367
+ > ```bash
368
+ > nworks logout && nworks login --user --scope "..."
369
+ > ```
370
+
371
+ ---
372
+
373
+ ## Environment Variables
374
+
375
+ Set environment variables to use nworks without `nworks login` (useful for CI/agents).
376
+
377
+ ```bash
378
+ # Required
379
+ NWORKS_CLIENT_ID=
380
+ NWORKS_CLIENT_SECRET=
381
+
382
+ # Bot messaging only (not needed for User OAuth)
383
+ NWORKS_SERVICE_ACCOUNT=
384
+ NWORKS_PRIVATE_KEY_PATH=
385
+ NWORKS_BOT_ID=
386
+
387
+ # Optional
388
+ NWORKS_DOMAIN_ID=
389
+ NWORKS_SCOPE= # default: bot bot.read user.read
390
+ NWORKS_VERBOSE=1 # debug logging
391
+ ```
392
+
393
+ ### MCP Server with Environment Variables
394
+
395
+ Sensitive values (Client Secret, Private Key path) must be set via MCP config `env` field. Non-sensitive values like Client ID can be configured by the AI agent through the `nworks_setup` tool.
396
+
397
+ ```json
398
+ {
399
+ "mcpServers": {
400
+ "nworks": {
401
+ "command": "npx",
402
+ "args": ["-y", "nworks", "mcp"],
403
+ "env": {
404
+ "NWORKS_CLIENT_SECRET": "<Client Secret>",
405
+ "NWORKS_PRIVATE_KEY_PATH": "<Private Key file absolute path (for Service Account)>"
406
+ }
407
+ }
408
+ }
409
+ }
410
+ ```
411
+
412
+ ---
413
+
414
+ ## License
415
+
416
+ Apache-2.0
@@ -0,0 +1,2 @@
1
+
2
+ export { }