@vibetasks/mcp-server 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 +310 -0
- package/config/claude-code.json +38 -0
- package/dist/index.js +565 -0
- package/dist/session-end-6BUUHSB7.js +56 -0
- package/dist/session-start-OIAJ7YIL.js +49 -0
- package/package.json +29 -0
- package/scripts/install.js +119 -0
- package/scripts/install.sh +104 -0
- package/scripts/uninstall.js +107 -0
- package/src/hooks/session-end.ts +75 -0
- package/src/hooks/session-start.ts +74 -0
- package/src/index.ts +165 -0
- package/src/resources/index.ts +115 -0
- package/src/tools/index.ts +414 -0
- package/tsconfig.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# TaskFlow MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server for TaskFlow integration with Claude Code, Cursor, and other AI coding tools.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **8 MCP Tools** for full task management (create, read, update, delete, search, complete, batch create with subtasks, log sessions)
|
|
8
|
+
- **3 MCP Resources** for context-aware AI (active tasks, today's tasks, upcoming tasks)
|
|
9
|
+
- **Claude Code Hooks** for automatic session logging
|
|
10
|
+
- **TodoWrite Integration** for automatic task syncing from Claude's todo lists
|
|
11
|
+
- **STDIO Transport** for reliable communication
|
|
12
|
+
- **Direct Supabase Integration** with Row-Level Security
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
- Node.js 18+ installed
|
|
19
|
+
- TaskFlow CLI installed and configured (`taskflow login`)
|
|
20
|
+
- Claude Code or Cursor installed
|
|
21
|
+
|
|
22
|
+
### Quick Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# From the apps/mcp-server directory
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
bash scripts/install.sh
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The installation script will:
|
|
32
|
+
1. Build the MCP server
|
|
33
|
+
2. Create Claude Code configuration
|
|
34
|
+
3. Set up hooks for automatic session logging
|
|
35
|
+
|
|
36
|
+
### Manual Installation
|
|
37
|
+
|
|
38
|
+
1. **Build the server:**
|
|
39
|
+
```bash
|
|
40
|
+
npm run build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. **Get your Supabase anon key:**
|
|
44
|
+
- Go to https://supabase.com/dashboard/project/_/settings/api
|
|
45
|
+
- Copy the `anon` public key
|
|
46
|
+
|
|
47
|
+
3. **Configure Claude Code:**
|
|
48
|
+
|
|
49
|
+
Edit `~/.config/claude-code/config.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"taskflow": {
|
|
55
|
+
"command": "node",
|
|
56
|
+
"args": [
|
|
57
|
+
"/absolute/path/to/taskflow/apps/mcp-server/dist/index.js"
|
|
58
|
+
],
|
|
59
|
+
"env": {
|
|
60
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co",
|
|
61
|
+
"TASKFLOW_SUPABASE_KEY": "your_anon_key_here"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"hooks": {
|
|
66
|
+
"SessionStart": [
|
|
67
|
+
{
|
|
68
|
+
"type": "command",
|
|
69
|
+
"command": "node",
|
|
70
|
+
"args": ["/absolute/path/to/dist/index.js"],
|
|
71
|
+
"env": {
|
|
72
|
+
"CLAUDE_HOOK_TYPE": "SessionStart",
|
|
73
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"Stop": [
|
|
78
|
+
{
|
|
79
|
+
"type": "command",
|
|
80
|
+
"command": "node",
|
|
81
|
+
"args": ["/absolute/path/to/dist/index.js"],
|
|
82
|
+
"env": {
|
|
83
|
+
"CLAUDE_HOOK_TYPE": "SessionEnd",
|
|
84
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
4. **Restart Claude Code**
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
### MCP Tools
|
|
97
|
+
|
|
98
|
+
Access tools by typing `@` in Claude Code:
|
|
99
|
+
|
|
100
|
+
#### create_task
|
|
101
|
+
Create a new task:
|
|
102
|
+
```
|
|
103
|
+
@taskflow create_task
|
|
104
|
+
title: "Add authentication"
|
|
105
|
+
notes: "Implement OAuth with Supabase"
|
|
106
|
+
priority: "high"
|
|
107
|
+
due_date: "2026-01-15"
|
|
108
|
+
tags: ["backend", "security"]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### get_tasks
|
|
112
|
+
Get filtered tasks:
|
|
113
|
+
```
|
|
114
|
+
@taskflow get_tasks filter: "today"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Filters: `all`, `today`, `upcoming`, `completed`
|
|
118
|
+
|
|
119
|
+
#### complete_task
|
|
120
|
+
Mark a task complete:
|
|
121
|
+
```
|
|
122
|
+
@taskflow complete_task task_id: "abc-123..."
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### update_task
|
|
126
|
+
Update task properties:
|
|
127
|
+
```
|
|
128
|
+
@taskflow update_task
|
|
129
|
+
task_id: "abc-123..."
|
|
130
|
+
title: "Updated title"
|
|
131
|
+
priority: "medium"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### delete_task
|
|
135
|
+
Delete a task:
|
|
136
|
+
```
|
|
137
|
+
@taskflow delete_task task_id: "abc-123..."
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### search_tasks
|
|
141
|
+
Search by title:
|
|
142
|
+
```
|
|
143
|
+
@taskflow search_tasks query: "authentication" limit: 10
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### create_task_with_subtasks
|
|
147
|
+
Create a parent task with subtasks in one call (perfect for TodoWrite integration):
|
|
148
|
+
```
|
|
149
|
+
@taskflow create_task_with_subtasks
|
|
150
|
+
title: "Implement user authentication"
|
|
151
|
+
subtasks: ["Create login form", "Add API endpoints", "Implement JWT handling"]
|
|
152
|
+
priority: "high"
|
|
153
|
+
due_date: "2026-01-15"
|
|
154
|
+
tags: ["backend", "auth"]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Use case:** When using Claude's TodoWrite feature, automatically mirror your todo list to TaskFlow for persistent tracking beyond the session.
|
|
158
|
+
|
|
159
|
+
#### log_ai_session
|
|
160
|
+
Manually log a session:
|
|
161
|
+
```
|
|
162
|
+
@taskflow log_ai_session
|
|
163
|
+
summary: "Implemented user authentication"
|
|
164
|
+
files: ["auth.ts", "login.tsx"]
|
|
165
|
+
duration_minutes: 45
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### MCP Resources
|
|
169
|
+
|
|
170
|
+
Resources provide automatic context to AI:
|
|
171
|
+
|
|
172
|
+
- `taskflow://tasks/active` - All incomplete tasks
|
|
173
|
+
- `taskflow://tasks/today` - Tasks due today
|
|
174
|
+
- `taskflow://tasks/upcoming` - Future tasks
|
|
175
|
+
|
|
176
|
+
The AI can access these without explicit tool calls.
|
|
177
|
+
|
|
178
|
+
### Automatic Session Logging
|
|
179
|
+
|
|
180
|
+
When Claude Code hooks are configured:
|
|
181
|
+
|
|
182
|
+
1. **SessionStart**: Loads today's tasks as context
|
|
183
|
+
2. **SessionEnd**: Automatically creates a completed task summarizing your work
|
|
184
|
+
|
|
185
|
+
No manual intervention required!
|
|
186
|
+
|
|
187
|
+
### TodoWrite Integration
|
|
188
|
+
|
|
189
|
+
When Claude uses its built-in TodoWrite feature for multi-step tasks, it can automatically sync to TaskFlow:
|
|
190
|
+
|
|
191
|
+
**How it works:**
|
|
192
|
+
1. Claude creates a TodoWrite list for planning (ephemeral, session-only)
|
|
193
|
+
2. Claude calls `create_task_with_subtasks` to mirror the list in TaskFlow
|
|
194
|
+
3. Each todo becomes a persistent subtask
|
|
195
|
+
4. As Claude completes todos, it marks TaskFlow subtasks complete
|
|
196
|
+
5. Your tasks survive beyond the session and sync across all platforms
|
|
197
|
+
|
|
198
|
+
**Example:**
|
|
199
|
+
```
|
|
200
|
+
User: "Implement user authentication"
|
|
201
|
+
|
|
202
|
+
Claude creates TodoWrite:
|
|
203
|
+
1. Create login form component
|
|
204
|
+
2. Add authentication API endpoints
|
|
205
|
+
3. Implement JWT token handling
|
|
206
|
+
4. Add protected route middleware
|
|
207
|
+
|
|
208
|
+
Claude also calls create_task_with_subtasks:
|
|
209
|
+
{
|
|
210
|
+
title: "Implement user authentication",
|
|
211
|
+
subtasks: [
|
|
212
|
+
"Create login form component",
|
|
213
|
+
"Add authentication API endpoints",
|
|
214
|
+
"Implement JWT token handling",
|
|
215
|
+
"Add protected route middleware"
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
Result: Session todos + persistent TaskFlow task with subtasks
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Development
|
|
223
|
+
|
|
224
|
+
### Running Locally
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm run dev
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Building
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npm run build
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Testing
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Test STDIO communication
|
|
240
|
+
echo '{"method":"list_tools"}' | node dist/index.js
|
|
241
|
+
|
|
242
|
+
# Test SessionStart hook
|
|
243
|
+
CLAUDE_HOOK_TYPE=SessionStart node dist/index.js
|
|
244
|
+
|
|
245
|
+
# Test SessionEnd hook
|
|
246
|
+
CLAUDE_HOOK_TYPE=SessionEnd node dist/index.js
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Troubleshooting
|
|
250
|
+
|
|
251
|
+
### Server Not Appearing in Claude Code
|
|
252
|
+
|
|
253
|
+
1. Check config file: `~/.config/claude-code/config.json`
|
|
254
|
+
2. Verify dist/index.js exists: `ls apps/mcp-server/dist/`
|
|
255
|
+
3. Check logs: Restart Claude Code with verbose logging
|
|
256
|
+
4. Verify authentication: `taskflow config`
|
|
257
|
+
|
|
258
|
+
### Authentication Errors
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Re-login to TaskFlow
|
|
262
|
+
taskflow login
|
|
263
|
+
|
|
264
|
+
# Verify tokens are stored
|
|
265
|
+
taskflow config
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Hooks Not Working
|
|
269
|
+
|
|
270
|
+
1. Check hook configuration in `config.json`
|
|
271
|
+
2. Verify file paths are absolute
|
|
272
|
+
3. Test hooks manually:
|
|
273
|
+
```bash
|
|
274
|
+
CLAUDE_HOOK_TYPE=SessionStart node dist/index.js
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Architecture
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
┌─────────────────┐
|
|
281
|
+
│ Claude Code │
|
|
282
|
+
│ or Cursor │
|
|
283
|
+
└────────┬────────┘
|
|
284
|
+
│ STDIO
|
|
285
|
+
│
|
|
286
|
+
┌────────▼────────┐
|
|
287
|
+
│ MCP Server │
|
|
288
|
+
│ - Tools │
|
|
289
|
+
│ - Resources │
|
|
290
|
+
│ - Hooks │
|
|
291
|
+
└────────┬────────┘
|
|
292
|
+
│
|
|
293
|
+
┌────────▼────────┐
|
|
294
|
+
│ @taskflow/ │
|
|
295
|
+
│ mcp-core │
|
|
296
|
+
└────────┬────────┘
|
|
297
|
+
│
|
|
298
|
+
┌────────▼────────┐
|
|
299
|
+
│ Supabase │
|
|
300
|
+
│ PostgreSQL │
|
|
301
|
+
└─────────────────┘
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Contributing
|
|
305
|
+
|
|
306
|
+
See [main README](../../README.md) for contribution guidelines.
|
|
307
|
+
|
|
308
|
+
## License
|
|
309
|
+
|
|
310
|
+
MIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"taskflow": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": [
|
|
6
|
+
"REPLACE_WITH_PATH_TO_DIST/index.js"
|
|
7
|
+
],
|
|
8
|
+
"env": {
|
|
9
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co",
|
|
10
|
+
"TASKFLOW_SUPABASE_KEY": "REPLACE_WITH_ANON_KEY"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"hooks": {
|
|
15
|
+
"SessionStart": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "node",
|
|
19
|
+
"args": ["REPLACE_WITH_PATH_TO_DIST/index.js"],
|
|
20
|
+
"env": {
|
|
21
|
+
"CLAUDE_HOOK_TYPE": "SessionStart",
|
|
22
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"Stop": [
|
|
27
|
+
{
|
|
28
|
+
"type": "command",
|
|
29
|
+
"command": "node",
|
|
30
|
+
"args": ["REPLACE_WITH_PATH_TO_DIST/index.js"],
|
|
31
|
+
"env": {
|
|
32
|
+
"CLAUDE_HOOK_TYPE": "SessionEnd",
|
|
33
|
+
"TASKFLOW_SUPABASE_URL": "https://cbkkztbcoitrfcleghfd.supabase.co"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|