@pathmode/mcp-server 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +196 -1
- package/dist/api-client.d.ts +102 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/index.js +237 -2
- 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/dist/api-client.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface PathmodeConfig {
|
|
|
10
10
|
export interface ApiIntent {
|
|
11
11
|
id: string;
|
|
12
12
|
workspaceId: string;
|
|
13
|
+
productId?: string;
|
|
13
14
|
journeyId?: string;
|
|
14
15
|
stageId?: string;
|
|
15
16
|
stageName?: string;
|
|
@@ -26,6 +27,7 @@ export interface ApiIntent {
|
|
|
26
27
|
constraints: string[];
|
|
27
28
|
verification: Record<string, any>;
|
|
28
29
|
externalLinks: any[];
|
|
30
|
+
evidenceAnchors: Record<string, string[]>;
|
|
29
31
|
createdAt: string;
|
|
30
32
|
updatedAt: string;
|
|
31
33
|
shippedAt?: string;
|
|
@@ -41,6 +43,92 @@ export interface ApiIntent {
|
|
|
41
43
|
type: string;
|
|
42
44
|
}[];
|
|
43
45
|
}
|
|
46
|
+
export interface CreateIntentInput {
|
|
47
|
+
title: string;
|
|
48
|
+
objective: string;
|
|
49
|
+
productId: string;
|
|
50
|
+
outcomes?: string[];
|
|
51
|
+
constraints?: string[];
|
|
52
|
+
healthMetrics?: string[];
|
|
53
|
+
edgeCases?: {
|
|
54
|
+
scenario: string;
|
|
55
|
+
expectedBehavior: string;
|
|
56
|
+
}[];
|
|
57
|
+
verification?: {
|
|
58
|
+
manualChecks?: string[];
|
|
59
|
+
unitTests?: string[];
|
|
60
|
+
e2eTests?: string[];
|
|
61
|
+
};
|
|
62
|
+
problemSeverity?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface UpdateIntentInput {
|
|
65
|
+
title?: string;
|
|
66
|
+
objective?: string;
|
|
67
|
+
outcomes?: string[];
|
|
68
|
+
constraints?: string[];
|
|
69
|
+
healthMetrics?: string[];
|
|
70
|
+
edgeCases?: {
|
|
71
|
+
scenario: string;
|
|
72
|
+
expectedBehavior: string;
|
|
73
|
+
}[];
|
|
74
|
+
verification?: {
|
|
75
|
+
manualChecks?: string[];
|
|
76
|
+
unitTests?: string[];
|
|
77
|
+
e2eTests?: string[];
|
|
78
|
+
};
|
|
79
|
+
problemSeverity?: string;
|
|
80
|
+
evidenceAnchors?: Record<string, string[]>;
|
|
81
|
+
}
|
|
82
|
+
export interface EvidenceQuery {
|
|
83
|
+
productId?: string;
|
|
84
|
+
type?: string;
|
|
85
|
+
severity?: string;
|
|
86
|
+
tags?: string;
|
|
87
|
+
search?: string;
|
|
88
|
+
limit?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface CreateEvidenceInput {
|
|
91
|
+
content: string;
|
|
92
|
+
type: string;
|
|
93
|
+
productId: string;
|
|
94
|
+
source?: string;
|
|
95
|
+
sourceUrl?: string;
|
|
96
|
+
severity?: string;
|
|
97
|
+
sentiment?: string;
|
|
98
|
+
tags?: string[];
|
|
99
|
+
stage?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface LinkEvidenceInput {
|
|
102
|
+
link?: string[];
|
|
103
|
+
unlink?: string[];
|
|
104
|
+
}
|
|
105
|
+
export interface ApiVerificationResult {
|
|
106
|
+
pass: boolean;
|
|
107
|
+
score: number;
|
|
108
|
+
results: {
|
|
109
|
+
item: string;
|
|
110
|
+
category: string;
|
|
111
|
+
status: string;
|
|
112
|
+
reasoning: string;
|
|
113
|
+
}[];
|
|
114
|
+
summary: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ApiEvidence {
|
|
117
|
+
id: string;
|
|
118
|
+
productId: string;
|
|
119
|
+
workspaceId: string;
|
|
120
|
+
type: string;
|
|
121
|
+
content: string;
|
|
122
|
+
source?: string;
|
|
123
|
+
sourceUrl?: string;
|
|
124
|
+
severity?: string;
|
|
125
|
+
sentiment?: string;
|
|
126
|
+
tags: string[];
|
|
127
|
+
stage?: string;
|
|
128
|
+
linkedIntentIds: string[];
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
}
|
|
44
132
|
export interface ApiWorkspace {
|
|
45
133
|
id: string;
|
|
46
134
|
name: string;
|
|
@@ -90,4 +178,18 @@ export declare class PathmodeClient {
|
|
|
90
178
|
getConstitution(): Promise<any>;
|
|
91
179
|
exportClaudeMd(): Promise<string>;
|
|
92
180
|
exportContext(format: 'claude-md' | 'cursorrules' | 'intent-md', intentId?: string): Promise<string>;
|
|
181
|
+
createIntent(input: CreateIntentInput): Promise<ApiIntent>;
|
|
182
|
+
updateIntent(id: string, updates: UpdateIntentInput): Promise<ApiIntent>;
|
|
183
|
+
queryEvidence(filters?: EvidenceQuery): Promise<{
|
|
184
|
+
evidence: ApiEvidence[];
|
|
185
|
+
count: number;
|
|
186
|
+
}>;
|
|
187
|
+
createEvidence(input: CreateEvidenceInput): Promise<ApiEvidence>;
|
|
188
|
+
linkEvidence(intentId: string, body: LinkEvidenceInput): Promise<{
|
|
189
|
+
intentId: string;
|
|
190
|
+
evidenceIds: string[];
|
|
191
|
+
linked: number;
|
|
192
|
+
unlinked: number;
|
|
193
|
+
}>;
|
|
194
|
+
verifyImplementation(intentId: string, summary: string, codeChanges?: string): Promise<ApiVerificationResult>;
|
|
93
195
|
}
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,SAAS,EAA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WAAW,CAAC;IAQhE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ/I,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAOtH"}
|
package/dist/index.js
CHANGED
|
@@ -11403,6 +11403,7 @@ class PathmodeClient {
|
|
|
11403
11403
|
}
|
|
11404
11404
|
async fetch(path, options = {}) {
|
|
11405
11405
|
const url = `${this.apiUrl}/api/v1${path}`;
|
|
11406
|
+
console.error(`[pathmode-mcp] fetch: ${url}, key prefix: ${this.apiKey.substring(0, 16)}`);
|
|
11406
11407
|
const response = await fetch(url, {
|
|
11407
11408
|
...options,
|
|
11408
11409
|
headers: {
|
|
@@ -11413,6 +11414,7 @@ class PathmodeClient {
|
|
|
11413
11414
|
});
|
|
11414
11415
|
if (!response.ok) {
|
|
11415
11416
|
const body = await response.json().catch(() => ({ error: response.statusText }));
|
|
11417
|
+
console.error(`[pathmode-mcp] ${response.status}: ${JSON.stringify(body)}, key length: ${this.apiKey.length}`);
|
|
11416
11418
|
throw new Error(`API error (${response.status}): ${body.error || response.statusText}`);
|
|
11417
11419
|
}
|
|
11418
11420
|
return response;
|
|
@@ -11464,6 +11466,52 @@ class PathmodeClient {
|
|
|
11464
11466
|
const res = await this.fetch(`/export?${params.toString()}`);
|
|
11465
11467
|
return res.text();
|
|
11466
11468
|
}
|
|
11469
|
+
// --- Write operations (v1.3.0) ---
|
|
11470
|
+
async createIntent(input) {
|
|
11471
|
+
const res = await this.fetch('/intents', {
|
|
11472
|
+
method: 'POST',
|
|
11473
|
+
body: JSON.stringify(input),
|
|
11474
|
+
});
|
|
11475
|
+
return res.json();
|
|
11476
|
+
}
|
|
11477
|
+
async updateIntent(id, updates) {
|
|
11478
|
+
const res = await this.fetch(`/intents/${id}`, {
|
|
11479
|
+
method: 'PATCH',
|
|
11480
|
+
body: JSON.stringify(updates),
|
|
11481
|
+
});
|
|
11482
|
+
return res.json();
|
|
11483
|
+
}
|
|
11484
|
+
async queryEvidence(filters = {}) {
|
|
11485
|
+
const params = new URLSearchParams();
|
|
11486
|
+
for (const [key, val] of Object.entries(filters)) {
|
|
11487
|
+
if (val !== undefined && val !== null)
|
|
11488
|
+
params.set(key, String(val));
|
|
11489
|
+
}
|
|
11490
|
+
const qs = params.toString();
|
|
11491
|
+
const res = await this.fetch(`/evidence${qs ? `?${qs}` : ''}`);
|
|
11492
|
+
return res.json();
|
|
11493
|
+
}
|
|
11494
|
+
async createEvidence(input) {
|
|
11495
|
+
const res = await this.fetch('/evidence', {
|
|
11496
|
+
method: 'POST',
|
|
11497
|
+
body: JSON.stringify(input),
|
|
11498
|
+
});
|
|
11499
|
+
return res.json();
|
|
11500
|
+
}
|
|
11501
|
+
async linkEvidence(intentId, body) {
|
|
11502
|
+
const res = await this.fetch(`/intents/${intentId}/evidence`, {
|
|
11503
|
+
method: 'POST',
|
|
11504
|
+
body: JSON.stringify(body),
|
|
11505
|
+
});
|
|
11506
|
+
return res.json();
|
|
11507
|
+
}
|
|
11508
|
+
async verifyImplementation(intentId, summary, codeChanges) {
|
|
11509
|
+
const res = await this.fetch(`/intents/${intentId}/verify`, {
|
|
11510
|
+
method: 'POST',
|
|
11511
|
+
body: JSON.stringify({ summary, codeChanges }),
|
|
11512
|
+
});
|
|
11513
|
+
return res.json();
|
|
11514
|
+
}
|
|
11467
11515
|
}
|
|
11468
11516
|
exports.PathmodeClient = PathmodeClient;
|
|
11469
11517
|
|
|
@@ -39709,6 +39757,7 @@ const isLocalMode = process.argv.includes('--local');
|
|
|
39709
39757
|
let client = null;
|
|
39710
39758
|
if (!isLocalMode) {
|
|
39711
39759
|
const config = (0, api_client_1.loadConfig)();
|
|
39760
|
+
console.error(`[pathmode-mcp] API key present: ${!!config?.apiKey}, prefix: ${config?.apiKey?.substring(0, 16) || 'none'}, url: ${config?.apiUrl || 'none'}`);
|
|
39712
39761
|
if (config) {
|
|
39713
39762
|
client = new api_client_1.PathmodeClient(config);
|
|
39714
39763
|
}
|
|
@@ -39719,7 +39768,7 @@ if (!isLocalMode) {
|
|
|
39719
39768
|
// ============================================================
|
|
39720
39769
|
const server = new mcp_js_1.McpServer({
|
|
39721
39770
|
name: 'pathmode',
|
|
39722
|
-
version: '1.
|
|
39771
|
+
version: '1.3.0',
|
|
39723
39772
|
});
|
|
39724
39773
|
// Annotation presets
|
|
39725
39774
|
const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
|
|
@@ -40164,6 +40213,179 @@ server.registerTool('log_implementation_note', {
|
|
|
40164
40213
|
}]
|
|
40165
40214
|
};
|
|
40166
40215
|
});
|
|
40216
|
+
server.registerTool('create_intent', {
|
|
40217
|
+
title: 'Create Intent',
|
|
40218
|
+
description: 'Create a new intent spec in the workspace. Requires at minimum a title, objective, and productId. Returns the created intent with its ID. Use list_intents first to see existing intents and avoid duplicates.',
|
|
40219
|
+
inputSchema: {
|
|
40220
|
+
title: zod_1.z.string().describe('Short name for the intent (e.g., "Improve onboarding flow")'),
|
|
40221
|
+
objective: zod_1.z.string().describe('Why this matters — the problem and who has it'),
|
|
40222
|
+
productId: zod_1.z.string().describe('Product (Space) ID this intent belongs to. Use get_workspace to find product IDs.'),
|
|
40223
|
+
outcomes: zod_1.z.array(zod_1.z.string()).optional().describe('Observable, testable state changes'),
|
|
40224
|
+
constraints: zod_1.z.array(zod_1.z.string()).optional().describe('Hard limits the implementation must respect'),
|
|
40225
|
+
healthMetrics: zod_1.z.array(zod_1.z.string()).optional().describe('What to monitor after shipping'),
|
|
40226
|
+
edgeCases: zod_1.z.array(zod_1.z.object({
|
|
40227
|
+
scenario: zod_1.z.string(),
|
|
40228
|
+
expectedBehavior: zod_1.z.string(),
|
|
40229
|
+
})).optional().describe('Failure modes and boundary conditions'),
|
|
40230
|
+
verification: zod_1.z.object({
|
|
40231
|
+
manualChecks: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40232
|
+
unitTests: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40233
|
+
e2eTests: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40234
|
+
}).optional().describe('How to confirm it works'),
|
|
40235
|
+
problemSeverity: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional().describe('How severe the problem is'),
|
|
40236
|
+
},
|
|
40237
|
+
annotations: WRITE_OP,
|
|
40238
|
+
}, async ({ productId, ...rest }) => {
|
|
40239
|
+
if (isLocalMode) {
|
|
40240
|
+
return { content: [{ type: 'text', text: 'Creating intents requires cloud mode. Use PATHMODE_API_KEY to connect.' }] };
|
|
40241
|
+
}
|
|
40242
|
+
const result = await client.createIntent({ productId, ...rest });
|
|
40243
|
+
return {
|
|
40244
|
+
content: [{
|
|
40245
|
+
type: 'text',
|
|
40246
|
+
text: `Intent created: ${result.id}\nTitle: "${result.title}"\nStatus: ${result.status}\nProduct: ${result.productId || productId}`
|
|
40247
|
+
}]
|
|
40248
|
+
};
|
|
40249
|
+
});
|
|
40250
|
+
server.registerTool('update_intent', {
|
|
40251
|
+
title: 'Update Intent',
|
|
40252
|
+
description: "Update an existing intent's content. Provide only the fields you want to change. Does NOT change intent status (use update_intent_status for that).",
|
|
40253
|
+
inputSchema: {
|
|
40254
|
+
intentId: zod_1.z.string().describe('The intent ID to update'),
|
|
40255
|
+
title: zod_1.z.string().optional().describe('New title'),
|
|
40256
|
+
objective: zod_1.z.string().optional().describe('Updated objective'),
|
|
40257
|
+
outcomes: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all outcomes'),
|
|
40258
|
+
constraints: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all constraints'),
|
|
40259
|
+
healthMetrics: zod_1.z.array(zod_1.z.string()).optional().describe('Replace all health metrics'),
|
|
40260
|
+
edgeCases: zod_1.z.array(zod_1.z.object({
|
|
40261
|
+
scenario: zod_1.z.string(),
|
|
40262
|
+
expectedBehavior: zod_1.z.string(),
|
|
40263
|
+
})).optional().describe('Replace all edge cases'),
|
|
40264
|
+
verification: zod_1.z.object({
|
|
40265
|
+
manualChecks: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40266
|
+
unitTests: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40267
|
+
e2eTests: zod_1.z.array(zod_1.z.string()).optional(),
|
|
40268
|
+
}).optional().describe('Replace verification plan'),
|
|
40269
|
+
problemSeverity: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional(),
|
|
40270
|
+
},
|
|
40271
|
+
annotations: { ...WRITE_OP, idempotentHint: true },
|
|
40272
|
+
}, async ({ intentId, ...updates }) => {
|
|
40273
|
+
if (isLocalMode) {
|
|
40274
|
+
return { content: [{ type: 'text', text: 'Updating intents requires cloud mode.' }] };
|
|
40275
|
+
}
|
|
40276
|
+
const result = await client.updateIntent(intentId, updates);
|
|
40277
|
+
const changedFields = Object.keys(updates).filter(k => updates[k] !== undefined);
|
|
40278
|
+
return {
|
|
40279
|
+
content: [{
|
|
40280
|
+
type: 'text',
|
|
40281
|
+
text: `Intent ${intentId} updated. Fields changed: ${changedFields.join(', ')}`
|
|
40282
|
+
}]
|
|
40283
|
+
};
|
|
40284
|
+
});
|
|
40285
|
+
server.registerTool('query_evidence', {
|
|
40286
|
+
title: 'Query Evidence',
|
|
40287
|
+
description: 'Search evidence items (friction points, user quotes, observations, metrics, feature requests) by product, type, severity, or text. Returns matching evidence with IDs that can be linked to intents.',
|
|
40288
|
+
inputSchema: {
|
|
40289
|
+
productId: zod_1.z.string().optional().describe('Filter by product (Space) ID'),
|
|
40290
|
+
type: zod_1.z.enum(['friction', 'quote', 'observation', 'metric', 'request']).optional().describe('Filter by evidence type'),
|
|
40291
|
+
severity: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Filter by severity'),
|
|
40292
|
+
search: zod_1.z.string().optional().describe('Text search across evidence content'),
|
|
40293
|
+
tags: zod_1.z.string().optional().describe('Comma-separated tags to filter by'),
|
|
40294
|
+
limit: zod_1.z.number().optional().describe('Max results (default 50, max 200)'),
|
|
40295
|
+
},
|
|
40296
|
+
annotations: READ_ONLY,
|
|
40297
|
+
}, async (filters) => {
|
|
40298
|
+
if (isLocalMode) {
|
|
40299
|
+
return { content: [{ type: 'text', text: 'Evidence queries require cloud mode.' }] };
|
|
40300
|
+
}
|
|
40301
|
+
const result = await client.queryEvidence(filters);
|
|
40302
|
+
return {
|
|
40303
|
+
content: [{
|
|
40304
|
+
type: 'text',
|
|
40305
|
+
text: JSON.stringify(result, null, 2)
|
|
40306
|
+
}]
|
|
40307
|
+
};
|
|
40308
|
+
});
|
|
40309
|
+
server.registerTool('create_evidence', {
|
|
40310
|
+
title: 'Create Evidence',
|
|
40311
|
+
description: 'Create a new evidence item (e.g., a discovered bug, user feedback quote, behavioral observation, or feature request). Evidence can later be linked to intents to support prioritization.',
|
|
40312
|
+
inputSchema: {
|
|
40313
|
+
content: zod_1.z.string().describe('The evidence content — a finding, quote, or observation'),
|
|
40314
|
+
type: zod_1.z.enum(['friction', 'quote', 'observation', 'metric', 'request']).describe('Type of evidence'),
|
|
40315
|
+
productId: zod_1.z.string().describe('Product (Space) ID this evidence belongs to'),
|
|
40316
|
+
source: zod_1.z.string().optional().describe('Where this evidence came from (e.g., "User interview", "Bug report", "Support ticket")'),
|
|
40317
|
+
sourceUrl: zod_1.z.string().optional().describe('URL to the original source'),
|
|
40318
|
+
severity: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Severity level (required for friction type)'),
|
|
40319
|
+
sentiment: zod_1.z.enum(['positive', 'negative', 'neutral', 'mixed']).optional().describe('Emotional sentiment'),
|
|
40320
|
+
tags: zod_1.z.array(zod_1.z.string()).optional().describe('Category tags (e.g., ["Onboarding", "Performance"])'),
|
|
40321
|
+
stage: zod_1.z.string().optional().describe('User journey stage (e.g., "Discovery", "Checkout")'),
|
|
40322
|
+
},
|
|
40323
|
+
annotations: WRITE_OP,
|
|
40324
|
+
}, async ({ productId, ...rest }) => {
|
|
40325
|
+
if (isLocalMode) {
|
|
40326
|
+
return { content: [{ type: 'text', text: 'Creating evidence requires cloud mode.' }] };
|
|
40327
|
+
}
|
|
40328
|
+
const result = await client.createEvidence({ productId, ...rest });
|
|
40329
|
+
return {
|
|
40330
|
+
content: [{
|
|
40331
|
+
type: 'text',
|
|
40332
|
+
text: `Evidence created: ${result.id}\nType: ${result.type}\nContent: "${(result.content || '').slice(0, 80)}${(result.content || '').length > 80 ? '...' : ''}"`
|
|
40333
|
+
}]
|
|
40334
|
+
};
|
|
40335
|
+
});
|
|
40336
|
+
server.registerTool('link_evidence', {
|
|
40337
|
+
title: 'Link Evidence to Intent',
|
|
40338
|
+
description: 'Link or unlink evidence items to/from an intent. Linking evidence to intents establishes traceability between user problems and planned solutions.',
|
|
40339
|
+
inputSchema: {
|
|
40340
|
+
intentId: zod_1.z.string().describe('The intent ID to link evidence to'),
|
|
40341
|
+
link: zod_1.z.array(zod_1.z.string()).optional().describe('Evidence IDs to link to this intent'),
|
|
40342
|
+
unlink: zod_1.z.array(zod_1.z.string()).optional().describe('Evidence IDs to unlink from this intent'),
|
|
40343
|
+
},
|
|
40344
|
+
annotations: WRITE_OP,
|
|
40345
|
+
}, async ({ intentId, link, unlink }) => {
|
|
40346
|
+
if (isLocalMode) {
|
|
40347
|
+
return { content: [{ type: 'text', text: 'Evidence linking requires cloud mode.' }] };
|
|
40348
|
+
}
|
|
40349
|
+
const result = await client.linkEvidence(intentId, { link, unlink });
|
|
40350
|
+
const actions = [];
|
|
40351
|
+
if (link && link.length > 0)
|
|
40352
|
+
actions.push(`linked ${result.linked} evidence items`);
|
|
40353
|
+
if (unlink && unlink.length > 0)
|
|
40354
|
+
actions.push(`unlinked ${result.unlinked} evidence items`);
|
|
40355
|
+
return {
|
|
40356
|
+
content: [{
|
|
40357
|
+
type: 'text',
|
|
40358
|
+
text: `Intent ${intentId}: ${actions.join(', ')}. Total evidence linked: ${result.evidenceIds.length}`
|
|
40359
|
+
}]
|
|
40360
|
+
};
|
|
40361
|
+
});
|
|
40362
|
+
server.registerTool('verify_implementation', {
|
|
40363
|
+
title: 'Verify Implementation',
|
|
40364
|
+
description: 'AI-grade your implementation against the intent spec. Checks each outcome, constraint, constitution rule, and edge case. Returns pass/fail per item with reasoning and an overall score. Also logs the result as an implementation note.',
|
|
40365
|
+
inputSchema: {
|
|
40366
|
+
intentId: zod_1.z.string().describe('The intent ID to verify against'),
|
|
40367
|
+
summary: zod_1.z.string().describe('Description of what was implemented and how'),
|
|
40368
|
+
codeChanges: zod_1.z.string().optional().describe('Summary of code changes (file list, key modifications)'),
|
|
40369
|
+
},
|
|
40370
|
+
annotations: WRITE_OP,
|
|
40371
|
+
}, async ({ intentId, summary, codeChanges }) => {
|
|
40372
|
+
if (isLocalMode) {
|
|
40373
|
+
return { content: [{ type: 'text', text: 'Verification requires cloud mode.' }] };
|
|
40374
|
+
}
|
|
40375
|
+
try {
|
|
40376
|
+
const result = await client.verifyImplementation(intentId, summary, codeChanges);
|
|
40377
|
+
let text = `Verification ${result.pass ? 'PASSED' : 'FAILED'} (score: ${result.score}/100)\n\n`;
|
|
40378
|
+
text += `${result.summary}\n\n`;
|
|
40379
|
+
for (const r of result.results) {
|
|
40380
|
+
const icon = r.status === 'pass' ? '[PASS]' : r.status === 'fail' ? '[FAIL]' : '[????]';
|
|
40381
|
+
text += `${icon} [${r.category}] ${r.item}\n ${r.reasoning}\n`;
|
|
40382
|
+
}
|
|
40383
|
+
return { content: [{ type: 'text', text }] };
|
|
40384
|
+
}
|
|
40385
|
+
catch (e) {
|
|
40386
|
+
return { content: [{ type: 'text', text: `Verification failed: ${e.message}` }] };
|
|
40387
|
+
}
|
|
40388
|
+
});
|
|
40167
40389
|
// ============================================================
|
|
40168
40390
|
// Prompts
|
|
40169
40391
|
// ============================================================
|
|
@@ -40175,7 +40397,7 @@ server.prompt('implement-intent', 'Get full implementation context for a specifi
|
|
|
40175
40397
|
role: 'user',
|
|
40176
40398
|
content: {
|
|
40177
40399
|
type: 'text',
|
|
40178
|
-
text: `I need to implement intent ${intentId}. Please:\n1. Use the get_agent_prompt tool to fetch the full execution prompt for this intent\n2. Use get_constitution to check for workspace constraints I must respect\n3. Review the intent details and create an implementation plan\n4. After implementation, use update_intent_status to mark it as "shipped"\
|
|
40400
|
+
text: `I need to implement intent ${intentId}. Please:\n1. Use the get_agent_prompt tool to fetch the full execution prompt for this intent\n2. Use get_constitution to check for workspace constraints I must respect\n3. Review the intent details and create an implementation plan\n4. After implementation, use verify_implementation to AI-grade your work against the spec\n5. If verification passes, use update_intent_status to mark it as "shipped"\n6. Use log_implementation_note to document key technical decisions`,
|
|
40179
40401
|
},
|
|
40180
40402
|
}],
|
|
40181
40403
|
};
|
|
@@ -40202,6 +40424,19 @@ server.prompt('what-next', 'Suggest the highest-priority intent to work on next,
|
|
|
40202
40424
|
}],
|
|
40203
40425
|
};
|
|
40204
40426
|
});
|
|
40427
|
+
server.prompt('create-from-evidence', 'Search for evidence items, identify patterns, and create an intent based on the strongest evidence cluster.', {
|
|
40428
|
+
productId: zod_1.z.string().describe('The product ID to search evidence for'),
|
|
40429
|
+
}, async ({ productId }) => {
|
|
40430
|
+
return {
|
|
40431
|
+
messages: [{
|
|
40432
|
+
role: 'user',
|
|
40433
|
+
content: {
|
|
40434
|
+
type: 'text',
|
|
40435
|
+
text: `Help me create a new intent from evidence:\n1. Use query_evidence with productId "${productId}" to see what evidence exists\n2. Look for patterns — multiple friction points about the same issue, or high-severity items\n3. Propose an intent based on the strongest evidence cluster\n4. Use create_intent to create the intent\n5. Use link_evidence to link the relevant evidence items to the new intent`,
|
|
40436
|
+
},
|
|
40437
|
+
}],
|
|
40438
|
+
};
|
|
40439
|
+
});
|
|
40205
40440
|
// ============================================================
|
|
40206
40441
|
// Intent Compiler — Zero-config tools (no API key needed)
|
|
40207
40442
|
// ============================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pathmode/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"mcpName": "io.github.pathmodeio/mcp-server",
|
|
4
5
|
"description": "Pathmode MCP Server — Build structured intent specs through Socratic AI conversation (zero-config), or connect to your Intent Layer for strategic context, dependency graphs, and implementation prompts.",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"bin": {
|
|
@@ -53,4 +54,4 @@
|
|
|
53
54
|
"ts-node": "^10.9.2",
|
|
54
55
|
"typescript": "^5.9.3"
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|