viviscape-mcp 2.6.0 → 2.7.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 +253 -247
- package/dist/api-client.d.ts +13 -0
- package/dist/api-client.js +19 -0
- package/dist/index.js +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,247 +1,253 @@
|
|
|
1
|
-
# viviscape-mcp
|
|
2
|
-
|
|
3
|
-
MCP server for the [ViviScape](https://viviscape.io) API - exposes CRM, projects, companies, tasks, time tracking, notes, and insights as tools for Claude and other MCP clients.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
No install needed - run via `npx`:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx viviscape-mcp
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Or install globally:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g viviscape-mcp
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Sign in
|
|
20
|
-
|
|
21
|
-
Authentication is per-user, the same browser flow the ViviScape CLI uses - no
|
|
22
|
-
API keys. Sign in once:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npx viviscape-mcp login
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
A browser tab opens on ViviScape Work; confirm **Allow access** and the session
|
|
29
|
-
is stored in Windows Credential Manager (or `~/.viviscape/mcp-credentials.json`
|
|
30
|
-
on macOS/Linux). Every tool call then runs as *you*: your user id, account,
|
|
31
|
-
role, and plan come from the session, so tools see exactly the data you can see
|
|
32
|
-
in the app.
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npx viviscape-mcp status # who am I, which account, role, plan
|
|
36
|
-
npx viviscape-mcp logout # clear the stored session
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
If you already ran `vs auth login` with the [ViviScape CLI](https://viviscape.io),
|
|
40
|
-
that session is picked up automatically. Inside an MCP client you can also call
|
|
41
|
-
the `auth_login`, `auth_status`, and `auth_logout` tools. Sessions expire; when
|
|
42
|
-
one does, tools report it and you re-run `login`.
|
|
43
|
-
|
|
44
|
-
## Configuration
|
|
45
|
-
|
|
46
|
-
| Variable | Required | Default | Description |
|
|
47
|
-
|----------|----------|---------|-------------|
|
|
48
|
-
| `VIVISCAPE_BASE_URL` | no | `https://work.viviscape.io` | ViviScape Work base URL |
|
|
49
|
-
|
|
50
|
-
## Claude Desktop / Claude Code
|
|
51
|
-
|
|
52
|
-
Add to your MCP client config (e.g. `claude_desktop_config.json` or `.mcp.json`):
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"mcpServers": {
|
|
57
|
-
"viviscape": {
|
|
58
|
-
"command": "npx",
|
|
59
|
-
"args": ["-y", "viviscape-mcp"]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## OpenAI Codex CLI
|
|
66
|
-
|
|
67
|
-
Codex accepts stdio MCP servers directly. Add to `~/.codex/config.toml`:
|
|
68
|
-
|
|
69
|
-
```toml
|
|
70
|
-
[mcp_servers.viviscape]
|
|
71
|
-
command = "npx"
|
|
72
|
-
args = ["-y", "viviscape-mcp"]
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## ChatGPT (Developer Mode / Apps SDK)
|
|
76
|
-
|
|
77
|
-
ChatGPT only accepts **remote HTTP** MCP servers - it does not run local stdio
|
|
78
|
-
processes. Bridge this server to an HTTP endpoint with
|
|
79
|
-
[`mcp-remote`](https://www.npmjs.com/package/mcp-remote) or
|
|
80
|
-
[`supergateway`](https://www.npmjs.com/package/supergateway), then expose it
|
|
81
|
-
publicly (Cloudflare Tunnel, ngrok, or deploy to a host).
|
|
82
|
-
|
|
83
|
-
Example with `supergateway`:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npx viviscape-mcp login # once, on the host running the gateway
|
|
87
|
-
npx -y supergateway --stdio "npx -y viviscape-mcp" --port 8000
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The gateway shares the host's stored session, so everyone reaching that endpoint
|
|
91
|
-
acts as the signed-in user - put your own auth in front of it.
|
|
92
|
-
|
|
93
|
-
Expose `http://localhost:8000/sse` publicly, then in ChatGPT:
|
|
94
|
-
|
|
95
|
-
**Settings -> Connectors -> Create -> Custom MCP server**
|
|
96
|
-
- **URL:** `https://your-public-host/sse`
|
|
97
|
-
- **Auth:** none (or bearer, depending on your gateway)
|
|
98
|
-
|
|
99
|
-
## Tools
|
|
100
|
-
|
|
101
|
-
The server exposes tools across these domains:
|
|
102
|
-
|
|
103
|
-
- **Prospects** - `prospect_add`, `prospect_get`, `prospect_update`, `prospect_query`, follow-ups, notes
|
|
104
|
-
- **Clients** - `client_add`, `client_get`, `client_get_by_email`, `clients_by_company`
|
|
105
|
-
- **Companies** - `company_add`, `company_list`, `company_update`
|
|
106
|
-
- **Projects** - `project_get`, `project_list`, `project_list_active`, `project_staff`, `project_tasks`, `projects_by_company`
|
|
107
|
-
- **Tasks** - `task_add`, `task_get`, `task_update`, `tasks_open`, `tasks_pending`, `tasks_by_company`, `tasks_by_milestone`
|
|
108
|
-
- **Task comments** - `task_comments`, `task_comment_get`, `task_comment_add`, `task_comment_update`, `task_comment_remove`, `task_mark_read`
|
|
109
|
-
- **Task assignment** - `task_assignee_add`, `task_assignee_remove`, `task_set_leader`, `task_set_attention`, `task_delete`, `task_merge`
|
|
110
|
-
- **Task tags** - `task_tags` (list/add/remove), and a `tags` list on `task_add`
|
|
111
|
-
- **Task references** - `task_references` (list/add/remove), `task_search` (find a task by keyword or id)
|
|
112
|
-
- **Milestones** - `milestone_list`, `milestones_active`, `milestones_by_company`, `milestones_by_user`, `milestone_get`, `milestone_add`, `milestone_update`, `milestone_clone`, `milestone_remove`
|
|
113
|
-
- **Project writes** - `project_add`, `project_update`, `project_set_status`, `project_user_add`, `project_user_remove`
|
|
114
|
-
- **Reference** - `enums` (the status, priority, and group-type values the platform accepts)
|
|
115
|
-
- **Lookup** - `services` (resolve service_id to a name), `user_lookup` (id, email, team, groups)
|
|
116
|
-
- **Bulk** - `tasks_bulk_add` (many tasks in one request)
|
|
117
|
-
- **Time logs** - `timelog_add`, `timelog_update`
|
|
118
|
-
- **Notes** - `note_add`, `note_get`, `note_update`, `note_remove`, `notes_mine`, `notes_query`, `notes_account`, `note_revisions`
|
|
119
|
-
- **Note filing** - `note_companies`, `note_users`, `note_tags`, `note_attachments`, `notebook`, `notebook_users` (each takes an `action`)
|
|
120
|
-
- **Files** - `project_files` (list/upload/update/delete/download), `task_files`
|
|
121
|
-
- **Insights** - hours by person/service/project, AI summary, person stats, time totals
|
|
122
|
-
- **Account** - `account_info`, `account_services`, `account_users`
|
|
123
|
-
- **Auth** - `auth_login`, `auth_status`, `auth_logout`
|
|
124
|
-
|
|
125
|
-
### Status and priority values
|
|
126
|
-
|
|
127
|
-
Use the `enums` tool rather than guessing. The platform's vocabularies are:
|
|
128
|
-
|
|
129
|
-
| field | values |
|
|
130
|
-
|---|---|
|
|
131
|
-
| task status | backlog, new, research, discussion, inprogress, pendingreview, inreview, testing, waitingcustomer, waitingteammember, onhold, cancelled, completed |
|
|
132
|
-
| priority | low, moderate, important, urgent, critical |
|
|
133
|
-
| project status | new, inprogress, complete |
|
|
134
|
-
| prospect status | new, firstcontact, negotiation, pending, won, lost, spam |
|
|
135
|
-
|
|
136
|
-
Two traps: tasks complete as `completed` while projects complete as
|
|
137
|
-
`complete`, and priority is *not* low/medium/high. Task and project tools
|
|
138
|
-
validate these with `z.enum`, so an invalid value is rejected before it reaches
|
|
139
|
-
the API.
|
|
140
|
-
|
|
141
|
-
### Task tags
|
|
142
|
-
|
|
143
|
-
`task_tags` lists, adds, and removes the tags shown on the task board, and
|
|
144
|
-
`task_add` takes a `tags` list so a generated task lands already categorised
|
|
145
|
-
(handy for marking agent-written work).
|
|
146
|
-
|
|
147
|
-
Verified behaviour, so callers do not have to discover it:
|
|
148
|
-
|
|
149
|
-
- Labels are stored upper-case, and `add` is idempotent per label - re-adding
|
|
150
|
-
one returns the existing tag, not a duplicate.
|
|
151
|
-
- `add` returns the persisted tag with its `tag_id`; `remove` takes that
|
|
152
|
-
`tag_id`, not the label, and answers `true` (unlike `note_tags`, whose remove
|
|
153
|
-
answers `false` even on success).
|
|
154
|
-
- `color` is any hex string, defaulting to the board palette's first entry
|
|
155
|
-
(`#00325e`).
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
`
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
1
|
+
# viviscape-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for the [ViviScape](https://viviscape.io) API - exposes CRM, projects, companies, tasks, time tracking, notes, and insights as tools for Claude and other MCP clients.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
No install needed - run via `npx`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx viviscape-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g viviscape-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Sign in
|
|
20
|
+
|
|
21
|
+
Authentication is per-user, the same browser flow the ViviScape CLI uses - no
|
|
22
|
+
API keys. Sign in once:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx viviscape-mcp login
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
A browser tab opens on ViviScape Work; confirm **Allow access** and the session
|
|
29
|
+
is stored in Windows Credential Manager (or `~/.viviscape/mcp-credentials.json`
|
|
30
|
+
on macOS/Linux). Every tool call then runs as *you*: your user id, account,
|
|
31
|
+
role, and plan come from the session, so tools see exactly the data you can see
|
|
32
|
+
in the app.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx viviscape-mcp status # who am I, which account, role, plan
|
|
36
|
+
npx viviscape-mcp logout # clear the stored session
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you already ran `vs auth login` with the [ViviScape CLI](https://viviscape.io),
|
|
40
|
+
that session is picked up automatically. Inside an MCP client you can also call
|
|
41
|
+
the `auth_login`, `auth_status`, and `auth_logout` tools. Sessions expire; when
|
|
42
|
+
one does, tools report it and you re-run `login`.
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
| Variable | Required | Default | Description |
|
|
47
|
+
|----------|----------|---------|-------------|
|
|
48
|
+
| `VIVISCAPE_BASE_URL` | no | `https://work.viviscape.io` | ViviScape Work base URL |
|
|
49
|
+
|
|
50
|
+
## Claude Desktop / Claude Code
|
|
51
|
+
|
|
52
|
+
Add to your MCP client config (e.g. `claude_desktop_config.json` or `.mcp.json`):
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"viviscape": {
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "viviscape-mcp"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## OpenAI Codex CLI
|
|
66
|
+
|
|
67
|
+
Codex accepts stdio MCP servers directly. Add to `~/.codex/config.toml`:
|
|
68
|
+
|
|
69
|
+
```toml
|
|
70
|
+
[mcp_servers.viviscape]
|
|
71
|
+
command = "npx"
|
|
72
|
+
args = ["-y", "viviscape-mcp"]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## ChatGPT (Developer Mode / Apps SDK)
|
|
76
|
+
|
|
77
|
+
ChatGPT only accepts **remote HTTP** MCP servers - it does not run local stdio
|
|
78
|
+
processes. Bridge this server to an HTTP endpoint with
|
|
79
|
+
[`mcp-remote`](https://www.npmjs.com/package/mcp-remote) or
|
|
80
|
+
[`supergateway`](https://www.npmjs.com/package/supergateway), then expose it
|
|
81
|
+
publicly (Cloudflare Tunnel, ngrok, or deploy to a host).
|
|
82
|
+
|
|
83
|
+
Example with `supergateway`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx viviscape-mcp login # once, on the host running the gateway
|
|
87
|
+
npx -y supergateway --stdio "npx -y viviscape-mcp" --port 8000
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The gateway shares the host's stored session, so everyone reaching that endpoint
|
|
91
|
+
acts as the signed-in user - put your own auth in front of it.
|
|
92
|
+
|
|
93
|
+
Expose `http://localhost:8000/sse` publicly, then in ChatGPT:
|
|
94
|
+
|
|
95
|
+
**Settings -> Connectors -> Create -> Custom MCP server**
|
|
96
|
+
- **URL:** `https://your-public-host/sse`
|
|
97
|
+
- **Auth:** none (or bearer, depending on your gateway)
|
|
98
|
+
|
|
99
|
+
## Tools
|
|
100
|
+
|
|
101
|
+
The server exposes tools across these domains:
|
|
102
|
+
|
|
103
|
+
- **Prospects** - `prospect_add`, `prospect_get`, `prospect_update`, `prospect_query`, follow-ups, notes
|
|
104
|
+
- **Clients** - `client_add`, `client_get`, `client_get_by_email`, `clients_by_company`
|
|
105
|
+
- **Companies** - `company_add`, `company_list`, `company_update`
|
|
106
|
+
- **Projects** - `project_get`, `project_list`, `project_list_active`, `project_staff`, `project_tasks`, `projects_by_company`
|
|
107
|
+
- **Tasks** - `task_add`, `task_get`, `task_update`, `tasks_open`, `tasks_pending`, `tasks_by_company`, `tasks_by_milestone`
|
|
108
|
+
- **Task comments** - `task_comments`, `task_comment_get`, `task_comment_add`, `task_comment_update`, `task_comment_remove`, `task_mark_read`
|
|
109
|
+
- **Task assignment** - `task_assignee_add`, `task_assignee_remove`, `task_set_leader`, `task_set_attention`, `task_delete`, `task_merge`
|
|
110
|
+
- **Task tags** - `task_tags` (list/add/remove), `tasks_by_tag` (tasks carrying a label, or the account tag vocabulary), and a `tags` list on `task_add`
|
|
111
|
+
- **Task references** - `task_references` (list/add/remove), `task_search` (find a task by keyword or id)
|
|
112
|
+
- **Milestones** - `milestone_list`, `milestones_active`, `milestones_by_company`, `milestones_by_user`, `milestone_get`, `milestone_add`, `milestone_update`, `milestone_clone`, `milestone_remove`
|
|
113
|
+
- **Project writes** - `project_add`, `project_update`, `project_set_status`, `project_user_add`, `project_user_remove`
|
|
114
|
+
- **Reference** - `enums` (the status, priority, and group-type values the platform accepts)
|
|
115
|
+
- **Lookup** - `services` (resolve service_id to a name), `user_lookup` (id, email, team, groups)
|
|
116
|
+
- **Bulk** - `tasks_bulk_add` (many tasks in one request)
|
|
117
|
+
- **Time logs** - `timelog_add`, `timelog_update`
|
|
118
|
+
- **Notes** - `note_add`, `note_get`, `note_update`, `note_remove`, `notes_mine`, `notes_query`, `notes_account`, `note_revisions`
|
|
119
|
+
- **Note filing** - `note_companies`, `note_users`, `note_tags`, `note_attachments`, `notebook`, `notebook_users` (each takes an `action`)
|
|
120
|
+
- **Files** - `project_files` (list/upload/update/delete/download), `task_files`
|
|
121
|
+
- **Insights** - hours by person/service/project, AI summary, person stats, time totals
|
|
122
|
+
- **Account** - `account_info`, `account_services`, `account_users`
|
|
123
|
+
- **Auth** - `auth_login`, `auth_status`, `auth_logout`
|
|
124
|
+
|
|
125
|
+
### Status and priority values
|
|
126
|
+
|
|
127
|
+
Use the `enums` tool rather than guessing. The platform's vocabularies are:
|
|
128
|
+
|
|
129
|
+
| field | values |
|
|
130
|
+
|---|---|
|
|
131
|
+
| task status | backlog, new, research, discussion, inprogress, pendingreview, inreview, testing, waitingcustomer, waitingteammember, onhold, cancelled, completed |
|
|
132
|
+
| priority | low, moderate, important, urgent, critical |
|
|
133
|
+
| project status | new, inprogress, complete |
|
|
134
|
+
| prospect status | new, firstcontact, negotiation, pending, won, lost, spam |
|
|
135
|
+
|
|
136
|
+
Two traps: tasks complete as `completed` while projects complete as
|
|
137
|
+
`complete`, and priority is *not* low/medium/high. Task and project tools
|
|
138
|
+
validate these with `z.enum`, so an invalid value is rejected before it reaches
|
|
139
|
+
the API.
|
|
140
|
+
|
|
141
|
+
### Task tags
|
|
142
|
+
|
|
143
|
+
`task_tags` lists, adds, and removes the tags shown on the task board, and
|
|
144
|
+
`task_add` takes a `tags` list so a generated task lands already categorised
|
|
145
|
+
(handy for marking agent-written work).
|
|
146
|
+
|
|
147
|
+
Verified behaviour, so callers do not have to discover it:
|
|
148
|
+
|
|
149
|
+
- Labels are stored upper-case, and `add` is idempotent per label - re-adding
|
|
150
|
+
one returns the existing tag, not a duplicate.
|
|
151
|
+
- `add` returns the persisted tag with its `tag_id`; `remove` takes that
|
|
152
|
+
`tag_id`, not the label, and answers `true` (unlike `note_tags`, whose remove
|
|
153
|
+
answers `false` even on success).
|
|
154
|
+
- `color` is any hex string, defaulting to the board palette's first entry
|
|
155
|
+
(`#00325e`).
|
|
156
|
+
- `task_tags` is per task, and list rows from `tasks_open` / `project_tasks`
|
|
157
|
+
carry `tags: null`, so read one task's tags with `task_tags` or `task_get`.
|
|
158
|
+
- `tasks_by_tag` goes the other way, from a label to the tasks carrying it.
|
|
159
|
+
Labels match trimmed and case insensitively; `match: "any"` (default) returns
|
|
160
|
+
a task carrying at least one label, `match: "all"` only tasks carrying every
|
|
161
|
+
one. An optional `status` list narrows further. Hits are light rows that
|
|
162
|
+
carry the task's whole tag set, so the other labels arrive with the hit.
|
|
163
|
+
Called with no `tags`, it returns the account's tag vocabulary instead -
|
|
164
|
+
every distinct label with the number of tasks using it.
|
|
165
|
+
- A tag failure inside `task_add` never fails the create: the task is returned
|
|
166
|
+
with the per-tag error recorded in its `tags` array.
|
|
167
|
+
|
|
168
|
+
### Task references
|
|
169
|
+
|
|
170
|
+
`task_references` links related tasks to each other - a duplicate, a blocker,
|
|
171
|
+
the ticket a task came from - and `task_search` finds the id to link when only
|
|
172
|
+
a keyword is known.
|
|
173
|
+
|
|
174
|
+
Verified behaviour:
|
|
175
|
+
|
|
176
|
+
- Links are **symmetric**. Adding A to B makes the pair visible from both
|
|
177
|
+
tasks, so link once; mirroring it by hand just returns the same row.
|
|
178
|
+
- `list` rows describe the *other* task: `related_task_id` plus its title,
|
|
179
|
+
status, project and company, so a reference list needs no follow-up
|
|
180
|
+
`task_get`.
|
|
181
|
+
- `add` is idempotent per pair (in either direction) and returns the persisted
|
|
182
|
+
link with its `reference_id`; `remove` takes that `reference_id`, not a task
|
|
183
|
+
id, and answers `true`.
|
|
184
|
+
- Both tasks must belong to the signed-in account; a cross-account id comes
|
|
185
|
+
back as an empty link rather than an error.
|
|
186
|
+
- `task_search` matches the task title, the description, and - for a numeric
|
|
187
|
+
query - the task id itself. It covers tickets too, so it is the one keyword
|
|
188
|
+
route that reaches ticket rows `tasks_open` never returns.
|
|
189
|
+
|
|
190
|
+
### Task notes
|
|
191
|
+
|
|
192
|
+
`task_update` takes a `notes` field: the free-form working notes on the task's
|
|
193
|
+
Overview tab, stored as HTML by the rich-text editor. It **replaces** the field
|
|
194
|
+
outright, so read the current value with `task_get` and send the merged text
|
|
195
|
+
rather than only the new lines.
|
|
196
|
+
|
|
197
|
+
### Repeat-safe creates
|
|
198
|
+
|
|
199
|
+
No create route accepts an idempotency key, so a retried agent step silently
|
|
200
|
+
creates a second record. `task_add`, `note_add`, `timelog_add`,
|
|
201
|
+
`prospect_add`, and `tasks_bulk_add` accept an optional
|
|
202
|
+
`idempotency_key`: calling again with the same key replays the first result
|
|
203
|
+
instead of writing again.
|
|
204
|
+
|
|
205
|
+
The record is local (`~/.viviscape/mcp-idempotency.json`, 7-day expiry), so it
|
|
206
|
+
stops the common case -- the same agent retrying the same step -- and does not
|
|
207
|
+
make the server idempotent. Two machines running the same plan will still
|
|
208
|
+
duplicate.
|
|
209
|
+
|
|
210
|
+
### Delta queries
|
|
211
|
+
|
|
212
|
+
List tools accept `updated_since` (ISO 8601) and return only rows touched at
|
|
213
|
+
or after that time, so a recurring agent does not re-read the whole working set.
|
|
214
|
+
It is filtered in-process (no list route supports a modified-since filter), and
|
|
215
|
+
rows carrying no usable timestamp are kept rather than dropped.
|
|
216
|
+
|
|
217
|
+
### Paging and field selection
|
|
218
|
+
|
|
219
|
+
List tools (`tasks_open`, `project_list_active`, `project_tasks`, and the rest)
|
|
220
|
+
return a page of trimmed rows rather than every column of every row. A task row
|
|
221
|
+
carries ~94 columns and a project row 87, most of them irrelevant to project
|
|
222
|
+
work, so each list tool accepts:
|
|
223
|
+
|
|
224
|
+
- `fields` - columns to return; omit for a curated default, or pass `["all"]`
|
|
225
|
+
- `limit` / `offset` - page window, default 50 rows
|
|
226
|
+
|
|
227
|
+
Task rows also carry computed `due_date`, `due_in_days` (negative when
|
|
228
|
+
overdue), and `overdue`, derived from the task's `end` date. Read those rather
|
|
229
|
+
than the API's `deadline` string, which does not track the due date -- it
|
|
230
|
+
reported "In 2 Days" for a task 39 days overdue. `deadline` is excluded from the
|
|
231
|
+
default field set; ask for it explicitly if you need to see what the UI shows.
|
|
232
|
+
|
|
233
|
+
Responses are wrapped as `{ total, returned, offset, next_offset, fields, items }`
|
|
234
|
+
so a caller can tell when more rows exist. Task lists also accept
|
|
235
|
+
`company_id`, `project_id`, `assignee_id`, `status`, `priority`,
|
|
236
|
+
`due_before`, `due_after`, and `search`; `tasks_open` pushes `company_id`
|
|
237
|
+
and `only_mine` to the server and filters the rest in-process.
|
|
238
|
+
|
|
239
|
+
In practice this took `tasks_open` from 97 KB to 6.4 KB and
|
|
240
|
+
`project_list_active` from 375 KB to 19 KB.
|
|
241
|
+
|
|
242
|
+
## Development
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npm install
|
|
246
|
+
npm run dev # run with tsx, hot reload
|
|
247
|
+
npm run build # compile to dist/
|
|
248
|
+
npm start # run compiled
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
MIT
|
package/dist/api-client.d.ts
CHANGED
|
@@ -162,6 +162,19 @@ export declare class ViviScapeClient {
|
|
|
162
162
|
addTaskTag(taskId: number, tag: string, color?: string): Promise<unknown>;
|
|
163
163
|
/** Takes the tag_id from getTaskTags, not the label. */
|
|
164
164
|
removeTaskTag(tagId: string): Promise<unknown>;
|
|
165
|
+
/**
|
|
166
|
+
* Tasks carrying one or more tags. Labels are matched trimmed and case
|
|
167
|
+
* insensitively; match 'all' narrows to tasks carrying every label, 'any'
|
|
168
|
+
* (the default) returns tasks carrying at least one. Each hit carries its
|
|
169
|
+
* whole tag set, so a task's other labels come back with it.
|
|
170
|
+
*/
|
|
171
|
+
searchTasksByTags(tags: string[], opts?: {
|
|
172
|
+
match?: 'any' | 'all';
|
|
173
|
+
status?: string[];
|
|
174
|
+
max?: number;
|
|
175
|
+
}): Promise<unknown>;
|
|
176
|
+
/** Every distinct task tag on the account, with the task count per label. */
|
|
177
|
+
getAccountTaskTags(): Promise<unknown>;
|
|
165
178
|
/**
|
|
166
179
|
* Cross references between tasks. The link is symmetric: adding A -> B makes
|
|
167
180
|
* the pair visible from both tasks, and each row describes the OTHER task
|
package/dist/api-client.js
CHANGED
|
@@ -654,6 +654,25 @@ export class ViviScapeClient {
|
|
|
654
654
|
async removeTaskTag(tagId) {
|
|
655
655
|
return this.get(`grouptask/tag/remove/${tagId}`);
|
|
656
656
|
}
|
|
657
|
+
/**
|
|
658
|
+
* Tasks carrying one or more tags. Labels are matched trimmed and case
|
|
659
|
+
* insensitively; match 'all' narrows to tasks carrying every label, 'any'
|
|
660
|
+
* (the default) returns tasks carrying at least one. Each hit carries its
|
|
661
|
+
* whole tag set, so a task's other labels come back with it.
|
|
662
|
+
*/
|
|
663
|
+
async searchTasksByTags(tags, opts = {}) {
|
|
664
|
+
const params = new URLSearchParams({
|
|
665
|
+
tags: tags.map((t) => t.trim()).filter(Boolean).join(','),
|
|
666
|
+
match: opts.match ?? 'any',
|
|
667
|
+
status: (opts.status ?? []).map((s) => s.trim()).filter(Boolean).join(','),
|
|
668
|
+
max: String(opts.max ?? 25),
|
|
669
|
+
});
|
|
670
|
+
return this.get(`grouptask/tags/search?${params.toString()}`);
|
|
671
|
+
}
|
|
672
|
+
/** Every distinct task tag on the account, with the task count per label. */
|
|
673
|
+
async getAccountTaskTags() {
|
|
674
|
+
return this.get('grouptask/tags/all');
|
|
675
|
+
}
|
|
657
676
|
// -- Task references ----------------------------------------
|
|
658
677
|
/**
|
|
659
678
|
* Cross references between tasks. The link is symmetric: adding A -> B makes
|
package/dist/index.js
CHANGED
|
@@ -433,7 +433,7 @@ server.tool('task_get', 'Get a single task by ID', { task_id: z.number().describ
|
|
|
433
433
|
const result = await requireClient().getTask(task_id);
|
|
434
434
|
return { content: [{ type: 'text', text: json(result) }] };
|
|
435
435
|
});
|
|
436
|
-
server.tool('task_tags', 'List, add, or remove tags on a task -- the categorisation primitive of the task board, and the way to mark work an agent created or touched. Labels are stored upper-case, and add is idempotent per label: re-adding one returns the existing tag rather than a duplicate. add returns the persisted tag including its tag_id; remove takes that tag_id, not the label, and answers true.
|
|
436
|
+
server.tool('task_tags', 'List, add, or remove tags on a task -- the categorisation primitive of the task board, and the way to mark work an agent created or touched. Labels are stored upper-case, and add is idempotent per label: re-adding one returns the existing tag rather than a duplicate. add returns the persisted tag including its tag_id; remove takes that tag_id, not the label, and answers true. This tool is per task -- list rows from tasks_open / project_tasks carry tags: null, so read a task tag set here or with task_get. To go the other way, from a label to the tasks carrying it, use tasks_by_tag.', {
|
|
437
437
|
action: z.enum(['list', 'add', 'remove']).describe('What to do'),
|
|
438
438
|
task_id: z.number().optional().describe('Task ID (list, add)'),
|
|
439
439
|
tag: z.string().optional().describe('Tag label (add). Stored upper-case.'),
|
|
@@ -467,6 +467,19 @@ server.tool('task_search', 'Keyword search over the account tasks and tickets --
|
|
|
467
467
|
const result = await requireClient().searchTasks(query, { exclude_task_id, max });
|
|
468
468
|
return { content: [{ type: 'text', text: json(result) }] };
|
|
469
469
|
});
|
|
470
|
+
server.tool('tasks_by_tag', 'Find the account tasks carrying given tags -- the reverse of task_tags, and the way a tag-driven queue is read (every task an agent marked, everything labelled RELEASE-BLOCKER, and so on). Labels match trimmed and case insensitively, so DEVOPS, devops and " DevOps " are the same tag. match "any" (default) returns a task carrying at least one label; match "all" narrows to tasks carrying every one. Rows are light (task_id, title, status, project, company) and carry the task whole tag set, so the other labels come back with the hit -- no follow-up task_tags call. Pass no tags to list instead the account tag vocabulary: every distinct label with the number of tasks using it, which is how to discover what is worth filtering on.', {
|
|
471
|
+
tags: z.array(z.string()).optional().describe('Tag labels to match. Omit or leave empty to list the account tag vocabulary instead.'),
|
|
472
|
+
match: z.enum(['any', 'all']).optional().describe('any = tasks carrying at least one of the tags (default); all = tasks carrying every one'),
|
|
473
|
+
status: z.array(z.enum(TASK_STATUSES)).optional().describe('Optional status filter, e.g. ["new","inprogress"]. Omit to include every status, completed and cancelled included.'),
|
|
474
|
+
max: z.number().optional().describe('Maximum rows to return (default 25, cap 100)'),
|
|
475
|
+
}, async ({ tags, match, status, max }) => {
|
|
476
|
+
const c = requireClient();
|
|
477
|
+
const labels = (tags ?? []).map((t) => t.trim()).filter(Boolean);
|
|
478
|
+
const result = labels.length
|
|
479
|
+
? await c.searchTasksByTags(labels, { match, status, max })
|
|
480
|
+
: await c.getAccountTaskTags();
|
|
481
|
+
return { content: [{ type: 'text', text: json(result) }] };
|
|
482
|
+
});
|
|
470
483
|
server.tool('tasks_pending', 'Get pending tasks for a user. Returns a page of trimmed rows; see fields/limit/offset.', {
|
|
471
484
|
user_id: z.number().describe('User ID'),
|
|
472
485
|
...pageArgs,
|
package/package.json
CHANGED