tascan-mcp 1.0.0 → 2.0.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 +196 -1
- package/README.md +36 -15
- package/index.js +199 -1
- package/package.json +3 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,193 @@
|
|
|
1
|
+
The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
|
|
2
|
+
|
|
3
|
+
Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License.
|
|
4
|
+
|
|
5
|
+
No rights beyond those granted by the applicable original license are conveyed for such contributions.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Apache License
|
|
10
|
+
Version 2.0, January 2004
|
|
11
|
+
http://www.apache.org/licenses/
|
|
12
|
+
|
|
13
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
14
|
+
|
|
15
|
+
1. Definitions.
|
|
16
|
+
|
|
17
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
18
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
19
|
+
|
|
20
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
21
|
+
the copyright owner that is granting the License.
|
|
22
|
+
|
|
23
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
24
|
+
other entities that control, are controlled by, or are under common
|
|
25
|
+
control with that entity. For the purposes of this definition,
|
|
26
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
27
|
+
direction or management of such entity, whether by contract or
|
|
28
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
29
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
30
|
+
|
|
31
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
32
|
+
exercising permissions granted by this License.
|
|
33
|
+
|
|
34
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
35
|
+
including but not limited to software source code, documentation
|
|
36
|
+
source, and configuration files.
|
|
37
|
+
|
|
38
|
+
"Object" form shall mean any form resulting from mechanical
|
|
39
|
+
transformation or translation of a Source form, including but
|
|
40
|
+
not limited to compiled object code, generated documentation,
|
|
41
|
+
and conversions to other media types.
|
|
42
|
+
|
|
43
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
44
|
+
Object form, made available under the License, as indicated by a
|
|
45
|
+
copyright notice that is included in or attached to the work
|
|
46
|
+
(an example is provided in the Appendix below).
|
|
47
|
+
|
|
48
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
49
|
+
form, that is based on (or derived from) the Work and for which the
|
|
50
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
51
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
52
|
+
of this License, Derivative Works shall not include works that remain
|
|
53
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
54
|
+
the Work and Derivative Works thereof.
|
|
55
|
+
|
|
56
|
+
"Contribution" shall mean any work of authorship, including
|
|
57
|
+
the original version of the Work and any modifications or additions
|
|
58
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
59
|
+
submitted to the Licensor for inclusion in the Work by the copyright
|
|
60
|
+
owner or by an individual or Legal Entity authorized to submit on behalf
|
|
61
|
+
of the copyright owner. For the purposes of this definition, "submitted"
|
|
62
|
+
means any form of electronic, verbal, or written communication sent
|
|
63
|
+
to the Licensor or its representatives, including but not limited to
|
|
64
|
+
communication on electronic mailing lists, source code control systems,
|
|
65
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
66
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
67
|
+
excluding communication that is conspicuously marked or otherwise
|
|
68
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
69
|
+
|
|
70
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
71
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
72
|
+
subsequently incorporated within the Work.
|
|
73
|
+
|
|
74
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
78
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
79
|
+
Work and such Derivative Works in Source or Object form.
|
|
80
|
+
|
|
81
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
82
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
83
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
84
|
+
(except as stated in this section) patent license to make, have made,
|
|
85
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
86
|
+
where such license applies only to those patent claims licensable
|
|
87
|
+
by such Contributor that are necessarily infringed by their
|
|
88
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
89
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
90
|
+
institute patent litigation against any entity (including a
|
|
91
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
92
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
93
|
+
or contributory patent infringement, then any patent licenses
|
|
94
|
+
granted to You under this License for that Work shall terminate
|
|
95
|
+
as of the date such litigation is filed.
|
|
96
|
+
|
|
97
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
98
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
99
|
+
modifications, and in Source or Object form, provided that You
|
|
100
|
+
meet the following conditions:
|
|
101
|
+
|
|
102
|
+
(a) You must give any other recipients of the Work or
|
|
103
|
+
Derivative Works a copy of this License; and
|
|
104
|
+
|
|
105
|
+
(b) You must cause any modified files to carry prominent notices
|
|
106
|
+
stating that You changed the files; and
|
|
107
|
+
|
|
108
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
109
|
+
that You distribute, all copyright, patent, trademark, and
|
|
110
|
+
attribution notices from the Source form of the Work,
|
|
111
|
+
excluding those notices that do not pertain to any part of
|
|
112
|
+
the Derivative Works; and
|
|
113
|
+
|
|
114
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
115
|
+
distribution, then any Derivative Works that You distribute must
|
|
116
|
+
include a readable copy of the attribution notices contained
|
|
117
|
+
within such NOTICE file, excluding those notices that do not
|
|
118
|
+
pertain to any part of the Derivative Works, in at least one
|
|
119
|
+
of the following places: within a NOTICE text file distributed
|
|
120
|
+
as part of the Derivative Works; within the Source form or
|
|
121
|
+
documentation, if provided along with the Derivative Works; or,
|
|
122
|
+
within a display generated by the Derivative Works, if and
|
|
123
|
+
wherever such third-party notices normally appear. The contents
|
|
124
|
+
of the NOTICE file are for informational purposes only and
|
|
125
|
+
do not modify the License. You may add Your own attribution
|
|
126
|
+
notices within Derivative Works that You distribute, alongside
|
|
127
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
128
|
+
that such additional attribution notices cannot be construed
|
|
129
|
+
as modifying the License.
|
|
130
|
+
|
|
131
|
+
You may add Your own copyright statement to Your modifications and
|
|
132
|
+
may provide additional or different license terms and conditions
|
|
133
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
134
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
135
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
136
|
+
the conditions stated in this License.
|
|
137
|
+
|
|
138
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
139
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
140
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
141
|
+
this License, without any additional terms or conditions.
|
|
142
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
143
|
+
the terms of any separate license agreement you may have executed
|
|
144
|
+
with Licensor regarding such Contributions.
|
|
145
|
+
|
|
146
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
147
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
148
|
+
except as required for reasonable and customary use in describing the
|
|
149
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
150
|
+
|
|
151
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
152
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
153
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
154
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
155
|
+
implied, including, without limitation, any warranties or conditions
|
|
156
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
157
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
158
|
+
appropriateness of using or redistributing the Work and assume any
|
|
159
|
+
risks associated with Your exercise of permissions under this License.
|
|
160
|
+
|
|
161
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
162
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
163
|
+
unless required by applicable law (such as deliberate and grossly
|
|
164
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
165
|
+
liable to You for damages, including any direct, indirect, special,
|
|
166
|
+
incidental, or consequential damages of any character arising as a
|
|
167
|
+
result of this License or out of the use or inability to use the
|
|
168
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
169
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
170
|
+
other commercial damages or losses), even if such Contributor
|
|
171
|
+
has been advised of the possibility of such damages.
|
|
172
|
+
|
|
173
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
174
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
175
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
176
|
+
or other liability obligations and/or rights consistent with this
|
|
177
|
+
License. However, in accepting such obligations, You may act only
|
|
178
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
179
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
180
|
+
defend, and hold each Contributor harmless for any liability
|
|
181
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
182
|
+
of your accepting any such warranty or additional liability.
|
|
183
|
+
|
|
184
|
+
END OF TERMS AND CONDITIONS
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
1
188
|
MIT License
|
|
2
189
|
|
|
3
|
-
Copyright (c)
|
|
190
|
+
Copyright (c) 2024-2025 Model Context Protocol a Series of LF Projects, LLC.
|
|
4
191
|
|
|
5
192
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
193
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -19,3 +206,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
206
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
207
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
208
|
SOFTWARE.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
Creative Commons Attribution 4.0 International (CC-BY-4.0)
|
|
213
|
+
|
|
214
|
+
Documentation in this project (excluding specifications) is licensed under
|
|
215
|
+
CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
|
|
216
|
+
the full license text.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TaScan MCP Server
|
|
2
2
|
|
|
3
|
-
AI agent integration for [TaScan](https://tascan.io) — the
|
|
3
|
+
AI agent integration for [TaScan](https://tascan.io) — the closed-loop autonomous operations protocol. Manage projects, events, tasks, workers, QR codes, templates, completion reports, and AI-powered issue resolution through Claude, GitHub Copilot, or any MCP-compatible AI client.
|
|
4
4
|
|
|
5
5
|
**Scan. Task. Done.**
|
|
6
6
|
|
|
@@ -8,8 +8,12 @@ AI agent integration for [TaScan](https://tascan.io) — the universal task prot
|
|
|
8
8
|
|
|
9
9
|
TaScan is a zero-download task assignment and verification platform for physical-world work. Workers scan a QR code, complete tasks with photo verification, and managers get real-time completion reports — no app download, no login, no training required.
|
|
10
10
|
|
|
11
|
+
When something breaks, AI analyzes the issue, generates fix instructions, and dispatches them to the right worker — closing the loop autonomously in under 10 seconds.
|
|
12
|
+
|
|
11
13
|
Industries: live events, construction, hospitality, warehousing, property management, healthcare, aviation, FEMA disaster response, and more.
|
|
12
14
|
|
|
15
|
+
**Patent Pending** — USPTO #63/995,189 & #63/996,023
|
|
16
|
+
|
|
13
17
|
## Installation
|
|
14
18
|
|
|
15
19
|
```bash
|
|
@@ -57,7 +61,17 @@ claude mcp add tascan -- npx -y tascan-mcp
|
|
|
57
61
|
|
|
58
62
|
Then set your API key in the environment.
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
### Remote (claude.ai / Streamable HTTP)
|
|
65
|
+
|
|
66
|
+
TaScan MCP is also available as a remote server at:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
https://tascan-live-event.netlify.app/mcp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Uses OAuth 2.0 with PKCE for authentication. No local installation required.
|
|
73
|
+
|
|
74
|
+
## Tools (27)
|
|
61
75
|
|
|
62
76
|
### Projects
|
|
63
77
|
| Tool | Description | Type |
|
|
@@ -101,6 +115,15 @@ Then set your API key in the environment.
|
|
|
101
115
|
| `tascan_list_templates` | List available task templates | Read |
|
|
102
116
|
| `tascan_get_report` | Get completion report for an event | Read |
|
|
103
117
|
|
|
118
|
+
### Closed-Loop Autonomous Operations (Patent Pending)
|
|
119
|
+
| Tool | Description | Type |
|
|
120
|
+
|------|-------------|------|
|
|
121
|
+
| `tascan_list_issues` | List field-reported issues with filtering by status, category, severity | Read |
|
|
122
|
+
| `tascan_analyze_issue` | AI classifies issue severity, identifies root cause, and scores urgency | AI |
|
|
123
|
+
| `tascan_recommend_fix` | AI generates ranked remediation tasks with step-by-step instructions | AI |
|
|
124
|
+
| `tascan_dispatch_instruction` | Multi-channel delivery of fix instructions to workers (SMS, push, QR) | Create |
|
|
125
|
+
| `tascan_auto_resolve` | Full closed loop in ONE call — issue in, AI analyzes, fix dispatched, loop closes | AI |
|
|
126
|
+
|
|
104
127
|
## Usage Examples
|
|
105
128
|
|
|
106
129
|
### Example 1: Set up a construction site inspection
|
|
@@ -115,16 +138,15 @@ Claude will:
|
|
|
115
138
|
4. Call tascan_generate_qr to create a scannable QR code for the foreman
|
|
116
139
|
```
|
|
117
140
|
|
|
118
|
-
### Example 2:
|
|
141
|
+
### Example 2: AI-powered autonomous issue resolution
|
|
119
142
|
|
|
120
143
|
```
|
|
121
|
-
User:
|
|
144
|
+
User: Check if there are any open issues on the Marriott load-in and have TaScan fix them automatically.
|
|
122
145
|
|
|
123
146
|
Claude will:
|
|
124
|
-
1. Call
|
|
125
|
-
2. Call
|
|
126
|
-
3.
|
|
127
|
-
4. Summarize which tasks are incomplete and which workers are assigned
|
|
147
|
+
1. Call tascan_list_issues to find open issues
|
|
148
|
+
2. Call tascan_auto_resolve for each issue — AI analyzes root cause, generates fix tasks, and dispatches instructions to the nearest qualified worker via SMS
|
|
149
|
+
3. Report back with resolution status and confidence scores
|
|
128
150
|
```
|
|
129
151
|
|
|
130
152
|
### Example 3: Use templates to quickly deploy an event
|
|
@@ -140,16 +162,15 @@ Claude will:
|
|
|
140
162
|
5. Call tascan_generate_qr for the receiving dock crew
|
|
141
163
|
```
|
|
142
164
|
|
|
143
|
-
### Example 4:
|
|
165
|
+
### Example 4: Analyze and triage field issues
|
|
144
166
|
|
|
145
167
|
```
|
|
146
|
-
User:
|
|
168
|
+
User: We have 5 open issues on the concert setup. Analyze them all and tell me which ones are most urgent.
|
|
147
169
|
|
|
148
170
|
Claude will:
|
|
149
|
-
1. Call
|
|
150
|
-
2. Call
|
|
151
|
-
3.
|
|
152
|
-
4. Analyze completion data and flag underperforming workers
|
|
171
|
+
1. Call tascan_list_issues to get all open issues
|
|
172
|
+
2. Call tascan_analyze_issue for each one — AI classifies severity, root cause probability, and urgency score
|
|
173
|
+
3. Rank by urgency and recommend which to auto-resolve vs which need human attention
|
|
153
174
|
```
|
|
154
175
|
|
|
155
176
|
## Task Types
|
|
@@ -184,7 +205,7 @@ API keys are scoped to your organization and support rate limiting (60 requests/
|
|
|
184
205
|
|
|
185
206
|
TaScan collects and processes task completion data, worker information (name, phone, email), GPS coordinates (with consent), and photos uploaded during task completion. Data is stored securely in Supabase with row-level security policies. API access is authenticated and rate-limited.
|
|
186
207
|
|
|
187
|
-
For the full privacy policy, visit: https://tascan.io/
|
|
208
|
+
For the full privacy policy, visit: https://tascan.io/faq.html
|
|
188
209
|
|
|
189
210
|
For data deletion requests or privacy inquiries, contact: Michael@TaScan.io
|
|
190
211
|
|
package/index.js
CHANGED
|
@@ -46,7 +46,7 @@ async function apiCall(method, path, body) {
|
|
|
46
46
|
// ─── Server Setup ──────────────────────────────────────────
|
|
47
47
|
const server = new McpServer({
|
|
48
48
|
name: 'tascan',
|
|
49
|
-
version: '
|
|
49
|
+
version: '2.0.0'
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
|
|
@@ -662,6 +662,204 @@ server.registerTool(
|
|
|
662
662
|
);
|
|
663
663
|
|
|
664
664
|
|
|
665
|
+
// ─── Closed-Loop Autonomous Operations Protocol ───────────
|
|
666
|
+
|
|
667
|
+
// Tool 23: List Issues (discover issues for analysis)
|
|
668
|
+
server.registerTool(
|
|
669
|
+
'tascan_list_issues',
|
|
670
|
+
{
|
|
671
|
+
title: 'List Issues',
|
|
672
|
+
description: 'List all issues for a task list (event). Returns open, acknowledged, and resolved issues. Use to discover issues for AI analysis via tascan_analyze_issue.',
|
|
673
|
+
inputSchema: {
|
|
674
|
+
list_id: z.string().describe('Task list (event) ID')
|
|
675
|
+
},
|
|
676
|
+
annotations: {
|
|
677
|
+
readOnlyHint: true,
|
|
678
|
+
destructiveHint: false
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
async ({ list_id }) => {
|
|
682
|
+
const result = await apiCall('GET', `/lists/${list_id}/issues`);
|
|
683
|
+
const issues = result.data;
|
|
684
|
+
if (!issues.length) return { content: [{ type: 'text', text: 'No issues reported for this task list.' }] };
|
|
685
|
+
let text = `${issues.length} issue(s) found:\n\n`;
|
|
686
|
+
issues.forEach((iss, i) => {
|
|
687
|
+
text += `${i+1}. [${iss.status.toUpperCase()}] ${iss.title}\n`;
|
|
688
|
+
text += ` ID: ${iss.id} | Type: ${iss.type} | Category: ${iss.category} | Severity: ${iss.severity || 'unset'}\n`;
|
|
689
|
+
if (iss.tasks) text += ` Task: ${iss.tasks.title}\n`;
|
|
690
|
+
text += ` Reported: ${iss.created_at}\n\n`;
|
|
691
|
+
});
|
|
692
|
+
return { content: [{ type: 'text', text }] };
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
|
|
696
|
+
// Tool 24: Analyze Issue (Step 1 of Closed-Loop — read issue with full context + optional server AI)
|
|
697
|
+
server.registerTool(
|
|
698
|
+
'tascan_analyze_issue',
|
|
699
|
+
{
|
|
700
|
+
title: 'Analyze Issue',
|
|
701
|
+
description: 'Step 1 of the Closed-Loop Autonomous Operations Protocol. Returns full issue context including worker info, message thread, project history, and recent similar issues for AI reasoning. Supports optional server-side AI analysis via Anthropic API.',
|
|
702
|
+
inputSchema: {
|
|
703
|
+
issue_id: z.string().describe('Issue ID to analyze'),
|
|
704
|
+
server_side_ai: z.boolean().optional().describe('If true, server calls Anthropic API for analysis (default: false)')
|
|
705
|
+
},
|
|
706
|
+
annotations: {
|
|
707
|
+
readOnlyHint: false,
|
|
708
|
+
destructiveHint: false
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
async ({ issue_id, server_side_ai }) => {
|
|
712
|
+
if (server_side_ai) {
|
|
713
|
+
const result = await apiCall('POST', `/issues/${issue_id}/analyze`);
|
|
714
|
+
const d = result.data;
|
|
715
|
+
let text = `=== AI ANALYSIS (Server-Side) ===\n`;
|
|
716
|
+
text += `Issue: ${d.issue_title} (${d.issue_id})\nAnalyzed: ${d.analyzed_at}\n\n`;
|
|
717
|
+
text += JSON.stringify(d.analysis, null, 2);
|
|
718
|
+
return { content: [{ type: 'text', text }] };
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
const result = await apiCall('GET', `/issues/${issue_id}`);
|
|
722
|
+
const d = result.data;
|
|
723
|
+
let text = `=== ISSUE CONTEXT FOR ANALYSIS ===\n`;
|
|
724
|
+
text += `Issue: ${d.title}\n`;
|
|
725
|
+
text += `Type: ${d.type} | Category: ${d.category} | Severity: ${d.severity || 'unset'} | Status: ${d.status}\n`;
|
|
726
|
+
text += `Description: ${d.description || 'none'}\n`;
|
|
727
|
+
if (d.tasks) text += `Task: ${d.tasks.title} (${d.tasks.response_type || 'checkbox'})\nTask Description: ${d.tasks.description || 'none'}\n`;
|
|
728
|
+
if (d.worker) text += `Worker: ${d.worker.name} (ID: ${d.worker.id})\n`;
|
|
729
|
+
if (d.project) text += `Project: ${d.project.name} | Location: ${d.project.location || 'unknown'}\n`;
|
|
730
|
+
if (d.injury_data) text += `Injury Data: ${JSON.stringify(d.injury_data)}\n`;
|
|
731
|
+
text += `Reported: ${d.created_at}\n`;
|
|
732
|
+
if (d.ai_analysis) text += `\n--- PREVIOUS AI ANALYSIS ---\n${JSON.stringify(d.ai_analysis, null, 2)}\n`;
|
|
733
|
+
if (d.messages && d.messages.length) {
|
|
734
|
+
text += `\n--- Message Thread (${d.messages.length}) ---\n`;
|
|
735
|
+
d.messages.forEach(m => { text += `[${m.sender_type}/${m.sender_name}] ${m.message}\n`; });
|
|
736
|
+
}
|
|
737
|
+
if (d.recent_issues && d.recent_issues.length) {
|
|
738
|
+
text += `\n--- Recent Issues on Same Project (${d.recent_issues.length}) ---\n`;
|
|
739
|
+
d.recent_issues.forEach(ri => { text += `- [${ri.severity}/${ri.category}] ${(ri.description || '').substring(0, 80)} (${ri.status})\n`; });
|
|
740
|
+
}
|
|
741
|
+
return { content: [{ type: 'text', text }] };
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
|
|
745
|
+
// Tool 25: Recommend Fix (Step 2 — post recommendation + optional structured tasks)
|
|
746
|
+
server.registerTool(
|
|
747
|
+
'tascan_recommend_fix',
|
|
748
|
+
{
|
|
749
|
+
title: 'Recommend Fix',
|
|
750
|
+
description: 'Step 2 of the Closed-Loop. Post AI recommendation to issue thread. Accepts optional structured_recommendation with task definitions for auto-dispatch. Persisted in AI audit trail.',
|
|
751
|
+
inputSchema: {
|
|
752
|
+
issue_id: z.string().describe('Issue ID to recommend a fix for'),
|
|
753
|
+
recommendation: z.string().describe('AI recommendation text (clear, actionable instructions)'),
|
|
754
|
+
structured_recommendation: z.any().optional().describe('Structured recommendation object with tasks for dispatch'),
|
|
755
|
+
ai_agent: z.string().optional().describe('AI agent name (default: TaScan AI)')
|
|
756
|
+
},
|
|
757
|
+
annotations: {
|
|
758
|
+
readOnlyHint: false,
|
|
759
|
+
destructiveHint: false
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
async ({ issue_id, recommendation, structured_recommendation, ai_agent }) => {
|
|
763
|
+
const body = { recommendation };
|
|
764
|
+
if (structured_recommendation) body.structured_recommendation = structured_recommendation;
|
|
765
|
+
if (ai_agent) body.ai_agent = ai_agent;
|
|
766
|
+
const result = await apiCall('POST', `/issues/${issue_id}/recommend`, body);
|
|
767
|
+
const d = result.data;
|
|
768
|
+
let text = `Recommendation posted to issue "${d.issue_title}":\n`;
|
|
769
|
+
text += `Project: ${d.project_name} | List: ${d.list_name}\n`;
|
|
770
|
+
text += `Message ID: ${d.message_id}\n\nRecommendation:\n${d.recommendation}`;
|
|
771
|
+
if (d.structured_recommendation?.tasks) {
|
|
772
|
+
text += `\n\nStructured Tasks (${d.structured_recommendation.tasks.length}):`;
|
|
773
|
+
d.structured_recommendation.tasks.forEach((t, i) => { text += `\n ${i+1}. ${t.title}`; });
|
|
774
|
+
}
|
|
775
|
+
return { content: [{ type: 'text', text }] };
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
|
|
779
|
+
// Tool 26: Dispatch Instruction (Step 3 — multi-channel delivery + task list creation)
|
|
780
|
+
server.registerTool(
|
|
781
|
+
'tascan_dispatch_instruction',
|
|
782
|
+
{
|
|
783
|
+
title: 'Dispatch Instruction',
|
|
784
|
+
description: 'Step 3 of the Closed-Loop. Multi-channel dispatch: issue thread, in-app message, progress feed, SMS, and optional remediation task list. Closes the loop from AI analysis to physical worker execution.',
|
|
785
|
+
inputSchema: {
|
|
786
|
+
issue_id: z.string().describe('Issue ID'),
|
|
787
|
+
instruction: z.string().describe('Actionable instruction for the worker'),
|
|
788
|
+
worker_id: z.string().optional().describe('Target worker ID (defaults to issue reporter)'),
|
|
789
|
+
remediation_tasks: z.array(z.any()).optional().describe('Tasks to create as remediation task list'),
|
|
790
|
+
recommendation_summary: z.string().optional().describe('Summary for task list description'),
|
|
791
|
+
send_sms: z.boolean().optional().describe('Send SMS (default: true if phone on file)'),
|
|
792
|
+
ai_agent: z.string().optional().describe('AI agent name (default: TaScan AI)')
|
|
793
|
+
},
|
|
794
|
+
annotations: {
|
|
795
|
+
readOnlyHint: false,
|
|
796
|
+
destructiveHint: false
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
async ({ issue_id, instruction, worker_id, remediation_tasks, recommendation_summary, send_sms, ai_agent }) => {
|
|
800
|
+
const body = { instruction };
|
|
801
|
+
if (worker_id) body.worker_id = worker_id;
|
|
802
|
+
if (remediation_tasks) body.remediation_tasks = remediation_tasks;
|
|
803
|
+
if (recommendation_summary) body.recommendation_summary = recommendation_summary;
|
|
804
|
+
if (send_sms !== undefined) body.send_sms = send_sms;
|
|
805
|
+
if (ai_agent) body.ai_agent = ai_agent;
|
|
806
|
+
const result = await apiCall('POST', `/issues/${issue_id}/dispatch`, body);
|
|
807
|
+
const d = result.data;
|
|
808
|
+
let text = `Dispatched via ${d.channels.length} channels: ${d.channels.join(', ')}\n`;
|
|
809
|
+
text += `Worker: ${d.worker_id} | Issue: ${d.issue_id} (${d.issue_status})\n`;
|
|
810
|
+
text += `SMS: ${d.sms_status}\n`;
|
|
811
|
+
if (d.remediation_task_list_id) {
|
|
812
|
+
text += `Task List: ${d.remediation_task_list_id}\nWorker URL: ${d.worker_url}\nTasks: ${d.tasks_created}\n`;
|
|
813
|
+
}
|
|
814
|
+
text += `\nInstruction:\n${d.instruction}`;
|
|
815
|
+
return { content: [{ type: 'text', text }] };
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
|
|
819
|
+
// Tool 27: Auto-Resolve (Full Closed-Loop in one call — Patent Claim 7)
|
|
820
|
+
server.registerTool(
|
|
821
|
+
'tascan_auto_resolve',
|
|
822
|
+
{
|
|
823
|
+
title: 'Auto-Resolve Issue',
|
|
824
|
+
description: 'FULL Closed-Loop Autonomous Operations Protocol in one call. Server-side AI analyzes issue, generates remediation tasks, creates task list, dispatches to worker via multi-channel delivery — all without human intervention. Patent Claim 7.',
|
|
825
|
+
inputSchema: {
|
|
826
|
+
issue_id: z.string().describe('Issue ID to auto-resolve')
|
|
827
|
+
},
|
|
828
|
+
annotations: {
|
|
829
|
+
readOnlyHint: false,
|
|
830
|
+
destructiveHint: false,
|
|
831
|
+
openWorldHint: true
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
async ({ issue_id }) => {
|
|
835
|
+
const result = await apiCall('POST', `/issues/${issue_id}/auto-resolve`);
|
|
836
|
+
const d = result.data;
|
|
837
|
+
let text = `=== CLOSED-LOOP AUTONOMOUS OPERATIONS PROTOCOL ===\n`;
|
|
838
|
+
text += `Issue: ${d.issue_id}\n\n`;
|
|
839
|
+
text += `--- ANALYSIS ---\n`;
|
|
840
|
+
text += `Summary: ${d.analysis?.summary || 'N/A'}\n`;
|
|
841
|
+
text += `Classification: ${d.analysis?.classification?.type || 'N/A'} (${d.analysis?.classification?.severity || 'N/A'})\n`;
|
|
842
|
+
text += `Urgency: ${d.analysis?.urgency_score || 'N/A'}/10\n`;
|
|
843
|
+
if (d.analysis?.root_cause_hypotheses?.length) {
|
|
844
|
+
d.analysis.root_cause_hypotheses.forEach((h, i) => {
|
|
845
|
+
text += ` ${i+1}. ${h.hypothesis} (${Math.round(h.confidence * 100)}%)\n`;
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
text += `\n--- RECOMMENDATION ---\n`;
|
|
849
|
+
text += `Fix: ${d.recommendation?.recommendation_summary || 'N/A'}\n`;
|
|
850
|
+
text += `Tasks: ${d.recommendation?.tasks?.length || 0}\n`;
|
|
851
|
+
text += `Duration: ${d.recommendation?.estimated_duration_minutes || 'N/A'} min\n`;
|
|
852
|
+
text += `\n--- DISPATCH ---\n`;
|
|
853
|
+
text += `Channels: ${d.dispatch?.channels?.join(', ') || 'none'}\n`;
|
|
854
|
+
text += `SMS: ${d.dispatch?.sms_status || 'N/A'}\n`;
|
|
855
|
+
if (d.dispatch?.worker_url) text += `Worker URL: ${d.dispatch.worker_url}\n`;
|
|
856
|
+
if (d.dispatch?.remediation_task_list_id) text += `Task List: ${d.dispatch.remediation_task_list_id}\n`;
|
|
857
|
+
text += `\nTimestamps: analyzed ${d.timestamps?.analyzed_at} | recommended ${d.timestamps?.recommended_at} | dispatched ${d.timestamps?.dispatched_at}`;
|
|
858
|
+
return { content: [{ type: 'text', text }] };
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
|
|
862
|
+
|
|
665
863
|
// ─── Start Server ──────────────────────────────────────────
|
|
666
864
|
async function main() {
|
|
667
865
|
const transport = new StdioServerTransport();
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tascan-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"mcpName": "io.github.snowbikemike/tascan-mcp",
|
|
5
|
+
"description": "TaScan MCP Server — Closed-loop autonomous operations protocol. 27 tools for projects, tasks, workers, QR codes, AI issue analysis, and autonomous remediation dispatch. Patent pending. Scan. Task. Done.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "index.js",
|
|
7
8
|
"bin": {
|