nworks 1.1.2 β 1.2.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/LICENSE +190 -190
- package/README.ja.md +393 -395
- package/README.ko.md +393 -395
- package/README.md +393 -395
- package/dist/index.js +28 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +28 -12
- package/dist/mcp.js.map +1 -1
- package/package.json +58 -58
package/README.md
CHANGED
|
@@ -1,395 +1,393 @@
|
|
|
1
|
-
# nworks
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/nworks)
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
[](https://www.npmjs.com/package/nworks)
|
|
6
|
-
[](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 β 26 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 26 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.
|
|
106
|
-
|
|
107
|
-
### MCP Tools (26)
|
|
108
|
-
|
|
109
|
-
| Tool | Description | Auth |
|
|
110
|
-
|------|-------------|------|
|
|
111
|
-
| **Setup / Auth** | | |
|
|
112
|
-
| `nworks_setup` | Configure API credentials (Client ID
|
|
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 | User OAuth (calendar.read) |
|
|
123
|
-
| `nworks_calendar_create` | Create calendar event | User OAuth (calendar + calendar.read) |
|
|
124
|
-
| `nworks_calendar_update` | Update calendar event | User OAuth (calendar + calendar.read) |
|
|
125
|
-
| `nworks_calendar_delete` | Delete calendar event | User OAuth (calendar + calendar.read) |
|
|
126
|
-
| **Drive** | | |
|
|
127
|
-
| `nworks_drive_list` | List drive files/folders | User OAuth (file.read) |
|
|
128
|
-
| `nworks_drive_upload` | Upload file to drive | User OAuth (file) |
|
|
129
|
-
| `nworks_drive_download` | Download file (saves locally if >5MB) | User OAuth (file.read) |
|
|
130
|
-
| **Mail** | | |
|
|
131
|
-
| `nworks_mail_send` | Send mail | User OAuth (mail) |
|
|
132
|
-
| `nworks_mail_list` | List mailbox | User OAuth (mail.read) |
|
|
133
|
-
| `nworks_mail_read` | Read mail detail | User OAuth (mail.read) |
|
|
134
|
-
| **Tasks** | | |
|
|
135
|
-
| `nworks_task_list` | List tasks | User OAuth (task.read) |
|
|
136
|
-
| `nworks_task_create` | Create task | User OAuth (task + user.read) |
|
|
137
|
-
| `nworks_task_update` | Update/complete task | User OAuth (task + user.read) |
|
|
138
|
-
| `nworks_task_delete` | Delete task | User OAuth (task + user.read) |
|
|
139
|
-
| **Boards** | | |
|
|
140
|
-
| `nworks_board_list` | List boards | User OAuth (board.read) |
|
|
141
|
-
| `nworks_board_posts` | List board posts | User OAuth (board.read) |
|
|
142
|
-
| `nworks_board_read` | Read board post detail | User OAuth (board.read) |
|
|
143
|
-
| `nworks_board_create` | Create board post | User OAuth (board) |
|
|
144
|
-
|
|
145
|
-
### AI Agent Usage Example
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
User: Schedule a meeting tomorrow at 2pm and notify the team channel
|
|
149
|
-
|
|
150
|
-
Claude β nworks_calendar_create
|
|
151
|
-
{ "summary": "Meeting", "start": "2026-03-15T14:00:00", "end": "2026-03-15T15:00:00" }
|
|
152
|
-
β Event created
|
|
153
|
-
|
|
154
|
-
Claude β nworks_message_send
|
|
155
|
-
{ "channel": "C001", "text": "Meeting scheduled tomorrow at 14:00" }
|
|
156
|
-
β Message sent
|
|
157
|
-
|
|
158
|
-
User: Check my unread emails and summarize them
|
|
159
|
-
|
|
160
|
-
Claude β nworks_mail_list (unread)
|
|
161
|
-
β 3 unread emails
|
|
162
|
-
Claude β nworks_mail_read (each)
|
|
163
|
-
β "3 unread: 1) Deploy approval from CTO, 2) Meeting invite for Friday, 3) Weekly report reminder"
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## CLI Usage
|
|
169
|
-
|
|
170
|
-
> All commands support `--json` for pipe/script/agent parsing. `message send`, `mail send`, and `drive upload` support `--dry-run` for testing without sending.
|
|
171
|
-
|
|
172
|
-
### Messages (Bot API)
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
# Send text to user
|
|
176
|
-
nworks message send --to <userId> --text "Hello"
|
|
177
|
-
|
|
178
|
-
# Send text to channel
|
|
179
|
-
nworks message send --channel <channelId> --text "Announcement"
|
|
180
|
-
|
|
181
|
-
# Button message
|
|
182
|
-
nworks message send --to <userId> --type button --text "PR review request" \
|
|
183
|
-
--actions '[{"type":"message","label":"Approve","postback":"approve"}]'
|
|
184
|
-
|
|
185
|
-
# List message
|
|
186
|
-
nworks message send --to <userId> --type list --text "Today's tasks" \
|
|
187
|
-
--elements '[{"title":"Code review","subtitle":"PR #382"}]'
|
|
188
|
-
|
|
189
|
-
# List channel members
|
|
190
|
-
nworks message members --channel <channelId>
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Directory
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
nworks directory members # List organization members
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Calendar (User OAuth)
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
# List today's events
|
|
203
|
-
nworks calendar list
|
|
204
|
-
|
|
205
|
-
# Specify date range
|
|
206
|
-
nworks calendar list --from "2026-03-14T00:00:00+09:00" --until "2026-03-14T23:59:59+09:00"
|
|
207
|
-
|
|
208
|
-
# Create event
|
|
209
|
-
nworks calendar create --title "Meeting" --start "2026-03-14T14:00+09:00" --end "2026-03-14T15:00+09:00"
|
|
210
|
-
|
|
211
|
-
# With location/description
|
|
212
|
-
nworks calendar create --title "Lunch" --start "2026-03-14T12:00+09:00" --end "2026-03-14T13:00+09:00" \
|
|
213
|
-
--location "Conference Room" --description "Quarterly review"
|
|
214
|
-
|
|
215
|
-
# With attendees + notification
|
|
216
|
-
nworks calendar create --title "Team meeting" --start "2026-03-14T10:00+09:00" --end "2026-03-14T11:00+09:00" \
|
|
217
|
-
--attendees "user1@example.com,user2@example.com" --notify
|
|
218
|
-
|
|
219
|
-
# Update event
|
|
220
|
-
nworks calendar update --id <eventId> --title "Updated title"
|
|
221
|
-
|
|
222
|
-
# Delete event
|
|
223
|
-
nworks calendar delete --id <eventId>
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Drive (User OAuth)
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
# List files/folders
|
|
230
|
-
nworks drive list
|
|
231
|
-
|
|
232
|
-
# Upload file
|
|
233
|
-
nworks drive upload --file ./report.pdf
|
|
234
|
-
|
|
235
|
-
# Upload to specific folder
|
|
236
|
-
nworks drive upload --file ./report.pdf --folder <folderId>
|
|
237
|
-
|
|
238
|
-
# Download file
|
|
239
|
-
nworks drive download --file-id <fileId>
|
|
240
|
-
|
|
241
|
-
# Specify output path/name
|
|
242
|
-
nworks drive download --file-id <fileId> --out ./downloads --name report.pdf
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Mail (User OAuth)
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
# Send mail
|
|
249
|
-
nworks mail send --to "user@example.com" --subject "Subject" --body "Body"
|
|
250
|
-
|
|
251
|
-
# With CC/BCC
|
|
252
|
-
nworks mail send --to "user@example.com" --cc "cc@example.com" --subject "Subject" --body "Body"
|
|
253
|
-
|
|
254
|
-
# List inbox
|
|
255
|
-
nworks mail list
|
|
256
|
-
|
|
257
|
-
# Unread only
|
|
258
|
-
nworks mail list --unread
|
|
259
|
-
|
|
260
|
-
# Read mail detail
|
|
261
|
-
nworks mail read --id <mailId>
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Tasks (User OAuth)
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
# List tasks
|
|
268
|
-
nworks task list
|
|
269
|
-
|
|
270
|
-
# Incomplete only
|
|
271
|
-
nworks task list --status TODO
|
|
272
|
-
|
|
273
|
-
# Create task
|
|
274
|
-
nworks task create --title "Code review" --body "Review PR #382"
|
|
275
|
-
|
|
276
|
-
# With due date
|
|
277
|
-
nworks task create --title "Deploy" --due 2026-03-20
|
|
278
|
-
|
|
279
|
-
# Mark as done
|
|
280
|
-
nworks task update --id <taskId> --status done
|
|
281
|
-
|
|
282
|
-
# Delete task
|
|
283
|
-
nworks task delete --id <taskId>
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### Boards (User OAuth)
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
# List boards
|
|
290
|
-
nworks board list
|
|
291
|
-
|
|
292
|
-
# List posts
|
|
293
|
-
nworks board posts --board <boardId>
|
|
294
|
-
|
|
295
|
-
# Read post detail
|
|
296
|
-
nworks board read --board <boardId> --post <postId>
|
|
297
|
-
|
|
298
|
-
# Create post
|
|
299
|
-
nworks board create --board <boardId> --title "Announcement" --body "Content"
|
|
300
|
-
|
|
301
|
-
# With notification + disable comments
|
|
302
|
-
nworks board create --board <boardId> --title "Notice" --body "Content" --notify --no-comment
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### CI/CD Deploy Notification
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
# Notify team channel after deployment in GitHub Actions
|
|
309
|
-
nworks message send --channel $CHANNEL_ID --text "v${VERSION} deployed"
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### Team Automation Script
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
# Send daily standup reminder to all members
|
|
316
|
-
for userId in $(nworks directory members --json | jq -r '.users[].userId'); do
|
|
317
|
-
nworks message send --to "$userId" --text "Standup at 10:00 today"
|
|
318
|
-
done
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## OAuth Scopes
|
|
324
|
-
|
|
325
|
-
Add the required scopes in the [LINE WORKS Developer Console](https://dev.worksmobile.com/en/).
|
|
326
|
-
|
|
327
|
-
| Scope | Purpose | Auth | Required For |
|
|
328
|
-
|-------|---------|------|-------------|
|
|
329
|
-
| `bot` | Bot messaging | Service Account | `message send` |
|
|
330
|
-
| `bot.read` | Bot channel/member read | Service Account | `message members` |
|
|
331
|
-
| `calendar` | Calendar write | User OAuth | `calendar create/update/delete` (requires calendar.read) |
|
|
332
|
-
| `calendar.read` | Calendar read | User OAuth | `calendar list`, also needed for calendar write |
|
|
333
|
-
| `file` | Drive read/write | User OAuth | `drive list/upload/download` |
|
|
334
|
-
| `file.read` | Drive read-only | User OAuth | `drive list/download` |
|
|
335
|
-
| `mail` | Mail read/write | User OAuth | `mail send/list/read` |
|
|
336
|
-
| `mail.read` | Mail read-only | User OAuth | `mail list/read` |
|
|
337
|
-
| `task` | Tasks read/write | User OAuth | `task create/update/delete` (requires user.read) |
|
|
338
|
-
| `task.read` | Tasks read-only | User OAuth | `task list` |
|
|
339
|
-
| `user.read` | User info read | Service Account / User OAuth | `directory members`, also needed for task write |
|
|
340
|
-
| `board` | Boards read/write | User OAuth | `board list/posts/read/create` |
|
|
341
|
-
| `board.read` | Boards read-only | User OAuth | `board list/posts/read` |
|
|
342
|
-
|
|
343
|
-
> **Tip**: After changing scopes, reissue your token:
|
|
344
|
-
> ```bash
|
|
345
|
-
> nworks logout && nworks login --user --scope "..."
|
|
346
|
-
> ```
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
## Environment Variables
|
|
351
|
-
|
|
352
|
-
Set environment variables to use nworks without `nworks login` (useful for CI/agents).
|
|
353
|
-
|
|
354
|
-
```bash
|
|
355
|
-
# Required
|
|
356
|
-
NWORKS_CLIENT_ID=
|
|
357
|
-
NWORKS_CLIENT_SECRET=
|
|
358
|
-
|
|
359
|
-
# Bot messaging only (not needed for User OAuth)
|
|
360
|
-
NWORKS_SERVICE_ACCOUNT=
|
|
361
|
-
NWORKS_PRIVATE_KEY_PATH=
|
|
362
|
-
NWORKS_BOT_ID=
|
|
363
|
-
|
|
364
|
-
# Optional
|
|
365
|
-
NWORKS_DOMAIN_ID=
|
|
366
|
-
NWORKS_SCOPE= # default: bot bot.read user.read
|
|
367
|
-
NWORKS_VERBOSE=1 # debug logging
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
### MCP Server with Environment Variables
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
```json
|
|
375
|
-
{
|
|
376
|
-
"mcpServers": {
|
|
377
|
-
"nworks": {
|
|
378
|
-
"command": "npx",
|
|
379
|
-
"args": ["-y", "nworks", "mcp"],
|
|
380
|
-
"env": {
|
|
381
|
-
"
|
|
382
|
-
"
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
Apache-2.0
|
|
1
|
+
# nworks
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/nworks)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/nworks)
|
|
6
|
+
[](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 β 26 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 26 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 (26)
|
|
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 | User OAuth (calendar.read) |
|
|
123
|
+
| `nworks_calendar_create` | Create calendar event | User OAuth (calendar + calendar.read) |
|
|
124
|
+
| `nworks_calendar_update` | Update calendar event | User OAuth (calendar + calendar.read) |
|
|
125
|
+
| `nworks_calendar_delete` | Delete calendar event | User OAuth (calendar + calendar.read) |
|
|
126
|
+
| **Drive** | | |
|
|
127
|
+
| `nworks_drive_list` | List drive files/folders | User OAuth (file.read) |
|
|
128
|
+
| `nworks_drive_upload` | Upload file to drive | User OAuth (file) |
|
|
129
|
+
| `nworks_drive_download` | Download file (saves locally if >5MB) | User OAuth (file.read) |
|
|
130
|
+
| **Mail** | | |
|
|
131
|
+
| `nworks_mail_send` | Send mail | User OAuth (mail) |
|
|
132
|
+
| `nworks_mail_list` | List mailbox | User OAuth (mail.read) |
|
|
133
|
+
| `nworks_mail_read` | Read mail detail | User OAuth (mail.read) |
|
|
134
|
+
| **Tasks** | | |
|
|
135
|
+
| `nworks_task_list` | List tasks | User OAuth (task.read) |
|
|
136
|
+
| `nworks_task_create` | Create task | User OAuth (task + user.read) |
|
|
137
|
+
| `nworks_task_update` | Update/complete task | User OAuth (task + user.read) |
|
|
138
|
+
| `nworks_task_delete` | Delete task | User OAuth (task + user.read) |
|
|
139
|
+
| **Boards** | | |
|
|
140
|
+
| `nworks_board_list` | List boards | User OAuth (board.read) |
|
|
141
|
+
| `nworks_board_posts` | List board posts | User OAuth (board.read) |
|
|
142
|
+
| `nworks_board_read` | Read board post detail | User OAuth (board.read) |
|
|
143
|
+
| `nworks_board_create` | Create board post | User OAuth (board) |
|
|
144
|
+
|
|
145
|
+
### AI Agent Usage Example
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
User: Schedule a meeting tomorrow at 2pm and notify the team channel
|
|
149
|
+
|
|
150
|
+
Claude β nworks_calendar_create
|
|
151
|
+
{ "summary": "Meeting", "start": "2026-03-15T14:00:00", "end": "2026-03-15T15:00:00" }
|
|
152
|
+
β Event created
|
|
153
|
+
|
|
154
|
+
Claude β nworks_message_send
|
|
155
|
+
{ "channel": "C001", "text": "Meeting scheduled tomorrow at 14:00" }
|
|
156
|
+
β Message sent
|
|
157
|
+
|
|
158
|
+
User: Check my unread emails and summarize them
|
|
159
|
+
|
|
160
|
+
Claude β nworks_mail_list (unread)
|
|
161
|
+
β 3 unread emails
|
|
162
|
+
Claude β nworks_mail_read (each)
|
|
163
|
+
β "3 unread: 1) Deploy approval from CTO, 2) Meeting invite for Friday, 3) Weekly report reminder"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## CLI Usage
|
|
169
|
+
|
|
170
|
+
> All commands support `--json` for pipe/script/agent parsing. `message send`, `mail send`, and `drive upload` support `--dry-run` for testing without sending.
|
|
171
|
+
|
|
172
|
+
### Messages (Bot API)
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Send text to user
|
|
176
|
+
nworks message send --to <userId> --text "Hello"
|
|
177
|
+
|
|
178
|
+
# Send text to channel
|
|
179
|
+
nworks message send --channel <channelId> --text "Announcement"
|
|
180
|
+
|
|
181
|
+
# Button message
|
|
182
|
+
nworks message send --to <userId> --type button --text "PR review request" \
|
|
183
|
+
--actions '[{"type":"message","label":"Approve","postback":"approve"}]'
|
|
184
|
+
|
|
185
|
+
# List message
|
|
186
|
+
nworks message send --to <userId> --type list --text "Today's tasks" \
|
|
187
|
+
--elements '[{"title":"Code review","subtitle":"PR #382"}]'
|
|
188
|
+
|
|
189
|
+
# List channel members
|
|
190
|
+
nworks message members --channel <channelId>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Directory
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
nworks directory members # List organization members
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Calendar (User OAuth)
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# List today's events
|
|
203
|
+
nworks calendar list
|
|
204
|
+
|
|
205
|
+
# Specify date range
|
|
206
|
+
nworks calendar list --from "2026-03-14T00:00:00+09:00" --until "2026-03-14T23:59:59+09:00"
|
|
207
|
+
|
|
208
|
+
# Create event
|
|
209
|
+
nworks calendar create --title "Meeting" --start "2026-03-14T14:00+09:00" --end "2026-03-14T15:00+09:00"
|
|
210
|
+
|
|
211
|
+
# With location/description
|
|
212
|
+
nworks calendar create --title "Lunch" --start "2026-03-14T12:00+09:00" --end "2026-03-14T13:00+09:00" \
|
|
213
|
+
--location "Conference Room" --description "Quarterly review"
|
|
214
|
+
|
|
215
|
+
# With attendees + notification
|
|
216
|
+
nworks calendar create --title "Team meeting" --start "2026-03-14T10:00+09:00" --end "2026-03-14T11:00+09:00" \
|
|
217
|
+
--attendees "user1@example.com,user2@example.com" --notify
|
|
218
|
+
|
|
219
|
+
# Update event
|
|
220
|
+
nworks calendar update --id <eventId> --title "Updated title"
|
|
221
|
+
|
|
222
|
+
# Delete event
|
|
223
|
+
nworks calendar delete --id <eventId>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Drive (User OAuth)
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# List files/folders
|
|
230
|
+
nworks drive list
|
|
231
|
+
|
|
232
|
+
# Upload file
|
|
233
|
+
nworks drive upload --file ./report.pdf
|
|
234
|
+
|
|
235
|
+
# Upload to specific folder
|
|
236
|
+
nworks drive upload --file ./report.pdf --folder <folderId>
|
|
237
|
+
|
|
238
|
+
# Download file
|
|
239
|
+
nworks drive download --file-id <fileId>
|
|
240
|
+
|
|
241
|
+
# Specify output path/name
|
|
242
|
+
nworks drive download --file-id <fileId> --out ./downloads --name report.pdf
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Mail (User OAuth)
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Send mail
|
|
249
|
+
nworks mail send --to "user@example.com" --subject "Subject" --body "Body"
|
|
250
|
+
|
|
251
|
+
# With CC/BCC
|
|
252
|
+
nworks mail send --to "user@example.com" --cc "cc@example.com" --subject "Subject" --body "Body"
|
|
253
|
+
|
|
254
|
+
# List inbox
|
|
255
|
+
nworks mail list
|
|
256
|
+
|
|
257
|
+
# Unread only
|
|
258
|
+
nworks mail list --unread
|
|
259
|
+
|
|
260
|
+
# Read mail detail
|
|
261
|
+
nworks mail read --id <mailId>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Tasks (User OAuth)
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# List tasks
|
|
268
|
+
nworks task list
|
|
269
|
+
|
|
270
|
+
# Incomplete only
|
|
271
|
+
nworks task list --status TODO
|
|
272
|
+
|
|
273
|
+
# Create task
|
|
274
|
+
nworks task create --title "Code review" --body "Review PR #382"
|
|
275
|
+
|
|
276
|
+
# With due date
|
|
277
|
+
nworks task create --title "Deploy" --due 2026-03-20
|
|
278
|
+
|
|
279
|
+
# Mark as done
|
|
280
|
+
nworks task update --id <taskId> --status done
|
|
281
|
+
|
|
282
|
+
# Delete task
|
|
283
|
+
nworks task delete --id <taskId>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Boards (User OAuth)
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# List boards
|
|
290
|
+
nworks board list
|
|
291
|
+
|
|
292
|
+
# List posts
|
|
293
|
+
nworks board posts --board <boardId>
|
|
294
|
+
|
|
295
|
+
# Read post detail
|
|
296
|
+
nworks board read --board <boardId> --post <postId>
|
|
297
|
+
|
|
298
|
+
# Create post
|
|
299
|
+
nworks board create --board <boardId> --title "Announcement" --body "Content"
|
|
300
|
+
|
|
301
|
+
# With notification + disable comments
|
|
302
|
+
nworks board create --board <boardId> --title "Notice" --body "Content" --notify --no-comment
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### CI/CD Deploy Notification
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Notify team channel after deployment in GitHub Actions
|
|
309
|
+
nworks message send --channel $CHANNEL_ID --text "v${VERSION} deployed"
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Team Automation Script
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Send daily standup reminder to all members
|
|
316
|
+
for userId in $(nworks directory members --json | jq -r '.users[].userId'); do
|
|
317
|
+
nworks message send --to "$userId" --text "Standup at 10:00 today"
|
|
318
|
+
done
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## OAuth Scopes
|
|
324
|
+
|
|
325
|
+
Add the required scopes in the [LINE WORKS Developer Console](https://dev.worksmobile.com/en/).
|
|
326
|
+
|
|
327
|
+
| Scope | Purpose | Auth | Required For |
|
|
328
|
+
|-------|---------|------|-------------|
|
|
329
|
+
| `bot` | Bot messaging | Service Account | `message send` |
|
|
330
|
+
| `bot.read` | Bot channel/member read | Service Account | `message members` |
|
|
331
|
+
| `calendar` | Calendar write | User OAuth | `calendar create/update/delete` (requires calendar.read) |
|
|
332
|
+
| `calendar.read` | Calendar read | User OAuth | `calendar list`, also needed for calendar write |
|
|
333
|
+
| `file` | Drive read/write | User OAuth | `drive list/upload/download` |
|
|
334
|
+
| `file.read` | Drive read-only | User OAuth | `drive list/download` |
|
|
335
|
+
| `mail` | Mail read/write | User OAuth | `mail send/list/read` |
|
|
336
|
+
| `mail.read` | Mail read-only | User OAuth | `mail list/read` |
|
|
337
|
+
| `task` | Tasks read/write | User OAuth | `task create/update/delete` (requires user.read) |
|
|
338
|
+
| `task.read` | Tasks read-only | User OAuth | `task list` |
|
|
339
|
+
| `user.read` | User info read | Service Account / User OAuth | `directory members`, also needed for task write |
|
|
340
|
+
| `board` | Boards read/write | User OAuth | `board list/posts/read/create` |
|
|
341
|
+
| `board.read` | Boards read-only | User OAuth | `board list/posts/read` |
|
|
342
|
+
|
|
343
|
+
> **Tip**: After changing scopes, reissue your token:
|
|
344
|
+
> ```bash
|
|
345
|
+
> nworks logout && nworks login --user --scope "..."
|
|
346
|
+
> ```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Environment Variables
|
|
351
|
+
|
|
352
|
+
Set environment variables to use nworks without `nworks login` (useful for CI/agents).
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# Required
|
|
356
|
+
NWORKS_CLIENT_ID=
|
|
357
|
+
NWORKS_CLIENT_SECRET=
|
|
358
|
+
|
|
359
|
+
# Bot messaging only (not needed for User OAuth)
|
|
360
|
+
NWORKS_SERVICE_ACCOUNT=
|
|
361
|
+
NWORKS_PRIVATE_KEY_PATH=
|
|
362
|
+
NWORKS_BOT_ID=
|
|
363
|
+
|
|
364
|
+
# Optional
|
|
365
|
+
NWORKS_DOMAIN_ID=
|
|
366
|
+
NWORKS_SCOPE= # default: bot bot.read user.read
|
|
367
|
+
NWORKS_VERBOSE=1 # debug logging
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### MCP Server with Environment Variables
|
|
371
|
+
|
|
372
|
+
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.
|
|
373
|
+
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"mcpServers": {
|
|
377
|
+
"nworks": {
|
|
378
|
+
"command": "npx",
|
|
379
|
+
"args": ["-y", "nworks", "mcp"],
|
|
380
|
+
"env": {
|
|
381
|
+
"NWORKS_CLIENT_SECRET": "<Client Secret>",
|
|
382
|
+
"NWORKS_PRIVATE_KEY_PATH": "<Private Key file absolute path (for Service Account)>"
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## License
|
|
392
|
+
|
|
393
|
+
Apache-2.0
|