@cjavdev/believe-mcp 0.6.2 → 0.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/code-tool.d.mts +4 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +4 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +14 -1
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +14 -1
- package/code-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +2 -1
- package/http.js.map +1 -1
- package/http.mjs +2 -1
- package/http.mjs.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +485 -0
- package/methods.js.map +1 -0
- package/methods.mjs +481 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +3 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +3 -0
- package/options.d.ts.map +1 -1
- package/options.js +17 -0
- package/options.js.map +1 -1
- package/options.mjs +17 -0
- package/options.mjs.map +1 -1
- package/package.json +12 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +7 -2
- package/server.js.map +1 -1
- package/server.mjs +7 -2
- package/server.mjs.map +1 -1
- package/src/code-tool.ts +20 -1
- package/src/http.ts +3 -0
- package/src/index.ts +1 -1
- package/src/methods.ts +505 -0
- package/src/options.ts +23 -0
- package/src/server.ts +7 -2
- package/src/stdio.ts +3 -2
- package/stdio.d.mts +2 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +2 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +2 -2
- package/stdio.js.map +1 -1
- package/stdio.mjs +2 -2
- package/stdio.mjs.map +1 -1
package/src/methods.ts
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import { McpOptions } from './options';
|
|
2
|
+
|
|
3
|
+
export type SdkMethod = {
|
|
4
|
+
clientCallName: string;
|
|
5
|
+
fullyQualifiedName: string;
|
|
6
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
7
|
+
httpPath?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const sdkMethods: SdkMethod[] = [
|
|
11
|
+
{
|
|
12
|
+
clientCallName: 'client.getWelcome',
|
|
13
|
+
fullyQualifiedName: 'getWelcome',
|
|
14
|
+
httpMethod: 'get',
|
|
15
|
+
httpPath: '/',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
clientCallName: 'client.characters.create',
|
|
19
|
+
fullyQualifiedName: 'characters.create',
|
|
20
|
+
httpMethod: 'post',
|
|
21
|
+
httpPath: '/characters',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
clientCallName: 'client.characters.retrieve',
|
|
25
|
+
fullyQualifiedName: 'characters.retrieve',
|
|
26
|
+
httpMethod: 'get',
|
|
27
|
+
httpPath: '/characters/{character_id}',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
clientCallName: 'client.characters.update',
|
|
31
|
+
fullyQualifiedName: 'characters.update',
|
|
32
|
+
httpMethod: 'patch',
|
|
33
|
+
httpPath: '/characters/{character_id}',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
clientCallName: 'client.characters.list',
|
|
37
|
+
fullyQualifiedName: 'characters.list',
|
|
38
|
+
httpMethod: 'get',
|
|
39
|
+
httpPath: '/characters',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
clientCallName: 'client.characters.delete',
|
|
43
|
+
fullyQualifiedName: 'characters.delete',
|
|
44
|
+
httpMethod: 'delete',
|
|
45
|
+
httpPath: '/characters/{character_id}',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
clientCallName: 'client.characters.getQuotes',
|
|
49
|
+
fullyQualifiedName: 'characters.getQuotes',
|
|
50
|
+
httpMethod: 'get',
|
|
51
|
+
httpPath: '/characters/{character_id}/quotes',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
clientCallName: 'client.teams.create',
|
|
55
|
+
fullyQualifiedName: 'teams.create',
|
|
56
|
+
httpMethod: 'post',
|
|
57
|
+
httpPath: '/teams',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
clientCallName: 'client.teams.retrieve',
|
|
61
|
+
fullyQualifiedName: 'teams.retrieve',
|
|
62
|
+
httpMethod: 'get',
|
|
63
|
+
httpPath: '/teams/{team_id}',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
clientCallName: 'client.teams.update',
|
|
67
|
+
fullyQualifiedName: 'teams.update',
|
|
68
|
+
httpMethod: 'patch',
|
|
69
|
+
httpPath: '/teams/{team_id}',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
clientCallName: 'client.teams.list',
|
|
73
|
+
fullyQualifiedName: 'teams.list',
|
|
74
|
+
httpMethod: 'get',
|
|
75
|
+
httpPath: '/teams',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
clientCallName: 'client.teams.delete',
|
|
79
|
+
fullyQualifiedName: 'teams.delete',
|
|
80
|
+
httpMethod: 'delete',
|
|
81
|
+
httpPath: '/teams/{team_id}',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
clientCallName: 'client.teams.getCulture',
|
|
85
|
+
fullyQualifiedName: 'teams.getCulture',
|
|
86
|
+
httpMethod: 'get',
|
|
87
|
+
httpPath: '/teams/{team_id}/culture',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
clientCallName: 'client.teams.getRivals',
|
|
91
|
+
fullyQualifiedName: 'teams.getRivals',
|
|
92
|
+
httpMethod: 'get',
|
|
93
|
+
httpPath: '/teams/{team_id}/rivals',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
clientCallName: 'client.teams.listLogos',
|
|
97
|
+
fullyQualifiedName: 'teams.listLogos',
|
|
98
|
+
httpMethod: 'get',
|
|
99
|
+
httpPath: '/teams/{team_id}/logos',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
clientCallName: 'client.teams.logo.delete',
|
|
103
|
+
fullyQualifiedName: 'teams.logo.delete',
|
|
104
|
+
httpMethod: 'delete',
|
|
105
|
+
httpPath: '/teams/{team_id}/logo/{file_id}',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
clientCallName: 'client.teams.logo.download',
|
|
109
|
+
fullyQualifiedName: 'teams.logo.download',
|
|
110
|
+
httpMethod: 'get',
|
|
111
|
+
httpPath: '/teams/{team_id}/logo/{file_id}',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
clientCallName: 'client.teams.logo.upload',
|
|
115
|
+
fullyQualifiedName: 'teams.logo.upload',
|
|
116
|
+
httpMethod: 'post',
|
|
117
|
+
httpPath: '/teams/{team_id}/logo',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
clientCallName: 'client.matches.create',
|
|
121
|
+
fullyQualifiedName: 'matches.create',
|
|
122
|
+
httpMethod: 'post',
|
|
123
|
+
httpPath: '/matches',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
clientCallName: 'client.matches.retrieve',
|
|
127
|
+
fullyQualifiedName: 'matches.retrieve',
|
|
128
|
+
httpMethod: 'get',
|
|
129
|
+
httpPath: '/matches/{match_id}',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
clientCallName: 'client.matches.update',
|
|
133
|
+
fullyQualifiedName: 'matches.update',
|
|
134
|
+
httpMethod: 'patch',
|
|
135
|
+
httpPath: '/matches/{match_id}',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
clientCallName: 'client.matches.list',
|
|
139
|
+
fullyQualifiedName: 'matches.list',
|
|
140
|
+
httpMethod: 'get',
|
|
141
|
+
httpPath: '/matches',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
clientCallName: 'client.matches.delete',
|
|
145
|
+
fullyQualifiedName: 'matches.delete',
|
|
146
|
+
httpMethod: 'delete',
|
|
147
|
+
httpPath: '/matches/{match_id}',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
clientCallName: 'client.matches.getLesson',
|
|
151
|
+
fullyQualifiedName: 'matches.getLesson',
|
|
152
|
+
httpMethod: 'get',
|
|
153
|
+
httpPath: '/matches/{match_id}/lesson',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
clientCallName: 'client.matches.getTurningPoints',
|
|
157
|
+
fullyQualifiedName: 'matches.getTurningPoints',
|
|
158
|
+
httpMethod: 'get',
|
|
159
|
+
httpPath: '/matches/{match_id}/turning-points',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
clientCallName: 'client.matches.streamLive',
|
|
163
|
+
fullyQualifiedName: 'matches.streamLive',
|
|
164
|
+
httpMethod: 'get',
|
|
165
|
+
httpPath: '/matches/live',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
clientCallName: 'client.matches.commentary.stream',
|
|
169
|
+
fullyQualifiedName: 'matches.commentary.stream',
|
|
170
|
+
httpMethod: 'post',
|
|
171
|
+
httpPath: '/matches/{match_id}/commentary/stream',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
clientCallName: 'client.episodes.create',
|
|
175
|
+
fullyQualifiedName: 'episodes.create',
|
|
176
|
+
httpMethod: 'post',
|
|
177
|
+
httpPath: '/episodes',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
clientCallName: 'client.episodes.retrieve',
|
|
181
|
+
fullyQualifiedName: 'episodes.retrieve',
|
|
182
|
+
httpMethod: 'get',
|
|
183
|
+
httpPath: '/episodes/{episode_id}',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
clientCallName: 'client.episodes.update',
|
|
187
|
+
fullyQualifiedName: 'episodes.update',
|
|
188
|
+
httpMethod: 'patch',
|
|
189
|
+
httpPath: '/episodes/{episode_id}',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
clientCallName: 'client.episodes.list',
|
|
193
|
+
fullyQualifiedName: 'episodes.list',
|
|
194
|
+
httpMethod: 'get',
|
|
195
|
+
httpPath: '/episodes',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
clientCallName: 'client.episodes.delete',
|
|
199
|
+
fullyQualifiedName: 'episodes.delete',
|
|
200
|
+
httpMethod: 'delete',
|
|
201
|
+
httpPath: '/episodes/{episode_id}',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
clientCallName: 'client.episodes.getWisdom',
|
|
205
|
+
fullyQualifiedName: 'episodes.getWisdom',
|
|
206
|
+
httpMethod: 'get',
|
|
207
|
+
httpPath: '/episodes/{episode_id}/wisdom',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
clientCallName: 'client.episodes.listBySeason',
|
|
211
|
+
fullyQualifiedName: 'episodes.listBySeason',
|
|
212
|
+
httpMethod: 'get',
|
|
213
|
+
httpPath: '/episodes/seasons/{season_number}',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
clientCallName: 'client.quotes.create',
|
|
217
|
+
fullyQualifiedName: 'quotes.create',
|
|
218
|
+
httpMethod: 'post',
|
|
219
|
+
httpPath: '/quotes',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
clientCallName: 'client.quotes.retrieve',
|
|
223
|
+
fullyQualifiedName: 'quotes.retrieve',
|
|
224
|
+
httpMethod: 'get',
|
|
225
|
+
httpPath: '/quotes/{quote_id}',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
clientCallName: 'client.quotes.update',
|
|
229
|
+
fullyQualifiedName: 'quotes.update',
|
|
230
|
+
httpMethod: 'patch',
|
|
231
|
+
httpPath: '/quotes/{quote_id}',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
clientCallName: 'client.quotes.list',
|
|
235
|
+
fullyQualifiedName: 'quotes.list',
|
|
236
|
+
httpMethod: 'get',
|
|
237
|
+
httpPath: '/quotes',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
clientCallName: 'client.quotes.delete',
|
|
241
|
+
fullyQualifiedName: 'quotes.delete',
|
|
242
|
+
httpMethod: 'delete',
|
|
243
|
+
httpPath: '/quotes/{quote_id}',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
clientCallName: 'client.quotes.getRandom',
|
|
247
|
+
fullyQualifiedName: 'quotes.getRandom',
|
|
248
|
+
httpMethod: 'get',
|
|
249
|
+
httpPath: '/quotes/random',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
clientCallName: 'client.quotes.listByCharacter',
|
|
253
|
+
fullyQualifiedName: 'quotes.listByCharacter',
|
|
254
|
+
httpMethod: 'get',
|
|
255
|
+
httpPath: '/quotes/characters/{character_id}',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
clientCallName: 'client.quotes.listByTheme',
|
|
259
|
+
fullyQualifiedName: 'quotes.listByTheme',
|
|
260
|
+
httpMethod: 'get',
|
|
261
|
+
httpPath: '/quotes/themes/{theme}',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
clientCallName: 'client.believe.submit',
|
|
265
|
+
fullyQualifiedName: 'believe.submit',
|
|
266
|
+
httpMethod: 'post',
|
|
267
|
+
httpPath: '/believe',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
clientCallName: 'client.conflicts.resolve',
|
|
271
|
+
fullyQualifiedName: 'conflicts.resolve',
|
|
272
|
+
httpMethod: 'post',
|
|
273
|
+
httpPath: '/conflicts/resolve',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
clientCallName: 'client.reframe.transformNegativeThoughts',
|
|
277
|
+
fullyQualifiedName: 'reframe.transformNegativeThoughts',
|
|
278
|
+
httpMethod: 'post',
|
|
279
|
+
httpPath: '/reframe',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
clientCallName: 'client.press.simulate',
|
|
283
|
+
fullyQualifiedName: 'press.simulate',
|
|
284
|
+
httpMethod: 'post',
|
|
285
|
+
httpPath: '/press',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
clientCallName: 'client.coaching.principles.retrieve',
|
|
289
|
+
fullyQualifiedName: 'coaching.principles.retrieve',
|
|
290
|
+
httpMethod: 'get',
|
|
291
|
+
httpPath: '/coaching/principles/{principle_id}',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
clientCallName: 'client.coaching.principles.list',
|
|
295
|
+
fullyQualifiedName: 'coaching.principles.list',
|
|
296
|
+
httpMethod: 'get',
|
|
297
|
+
httpPath: '/coaching/principles',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
clientCallName: 'client.coaching.principles.getRandom',
|
|
301
|
+
fullyQualifiedName: 'coaching.principles.getRandom',
|
|
302
|
+
httpMethod: 'get',
|
|
303
|
+
httpPath: '/coaching/principles/random',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
clientCallName: 'client.biscuits.retrieve',
|
|
307
|
+
fullyQualifiedName: 'biscuits.retrieve',
|
|
308
|
+
httpMethod: 'get',
|
|
309
|
+
httpPath: '/biscuits/{biscuit_id}',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
clientCallName: 'client.biscuits.list',
|
|
313
|
+
fullyQualifiedName: 'biscuits.list',
|
|
314
|
+
httpMethod: 'get',
|
|
315
|
+
httpPath: '/biscuits',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
clientCallName: 'client.biscuits.getFresh',
|
|
319
|
+
fullyQualifiedName: 'biscuits.getFresh',
|
|
320
|
+
httpMethod: 'get',
|
|
321
|
+
httpPath: '/biscuits/fresh',
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
clientCallName: 'client.pepTalk.retrieve',
|
|
325
|
+
fullyQualifiedName: 'pepTalk.retrieve',
|
|
326
|
+
httpMethod: 'get',
|
|
327
|
+
httpPath: '/pep-talk',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
clientCallName: 'client.stream.testConnection',
|
|
331
|
+
fullyQualifiedName: 'stream.testConnection',
|
|
332
|
+
httpMethod: 'get',
|
|
333
|
+
httpPath: '/stream/test',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
clientCallName: 'client.teamMembers.create',
|
|
337
|
+
fullyQualifiedName: 'teamMembers.create',
|
|
338
|
+
httpMethod: 'post',
|
|
339
|
+
httpPath: '/team-members',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
clientCallName: 'client.teamMembers.retrieve',
|
|
343
|
+
fullyQualifiedName: 'teamMembers.retrieve',
|
|
344
|
+
httpMethod: 'get',
|
|
345
|
+
httpPath: '/team-members/{member_id}',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
clientCallName: 'client.teamMembers.update',
|
|
349
|
+
fullyQualifiedName: 'teamMembers.update',
|
|
350
|
+
httpMethod: 'patch',
|
|
351
|
+
httpPath: '/team-members/{member_id}',
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
clientCallName: 'client.teamMembers.list',
|
|
355
|
+
fullyQualifiedName: 'teamMembers.list',
|
|
356
|
+
httpMethod: 'get',
|
|
357
|
+
httpPath: '/team-members',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
clientCallName: 'client.teamMembers.delete',
|
|
361
|
+
fullyQualifiedName: 'teamMembers.delete',
|
|
362
|
+
httpMethod: 'delete',
|
|
363
|
+
httpPath: '/team-members/{member_id}',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
clientCallName: 'client.teamMembers.listCoaches',
|
|
367
|
+
fullyQualifiedName: 'teamMembers.listCoaches',
|
|
368
|
+
httpMethod: 'get',
|
|
369
|
+
httpPath: '/team-members/coaches/',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
clientCallName: 'client.teamMembers.listPlayers',
|
|
373
|
+
fullyQualifiedName: 'teamMembers.listPlayers',
|
|
374
|
+
httpMethod: 'get',
|
|
375
|
+
httpPath: '/team-members/players/',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
clientCallName: 'client.teamMembers.listStaff',
|
|
379
|
+
fullyQualifiedName: 'teamMembers.listStaff',
|
|
380
|
+
httpMethod: 'get',
|
|
381
|
+
httpPath: '/team-members/staff/',
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
clientCallName: 'client.webhooks.create',
|
|
385
|
+
fullyQualifiedName: 'webhooks.create',
|
|
386
|
+
httpMethod: 'post',
|
|
387
|
+
httpPath: '/webhooks',
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
clientCallName: 'client.webhooks.retrieve',
|
|
391
|
+
fullyQualifiedName: 'webhooks.retrieve',
|
|
392
|
+
httpMethod: 'get',
|
|
393
|
+
httpPath: '/webhooks/{webhook_id}',
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
clientCallName: 'client.webhooks.list',
|
|
397
|
+
fullyQualifiedName: 'webhooks.list',
|
|
398
|
+
httpMethod: 'get',
|
|
399
|
+
httpPath: '/webhooks',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
clientCallName: 'client.webhooks.delete',
|
|
403
|
+
fullyQualifiedName: 'webhooks.delete',
|
|
404
|
+
httpMethod: 'delete',
|
|
405
|
+
httpPath: '/webhooks/{webhook_id}',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
clientCallName: 'client.webhooks.triggerEvent',
|
|
409
|
+
fullyQualifiedName: 'webhooks.triggerEvent',
|
|
410
|
+
httpMethod: 'post',
|
|
411
|
+
httpPath: '/webhooks/trigger',
|
|
412
|
+
},
|
|
413
|
+
{ clientCallName: 'client.webhooks.unwrap', fullyQualifiedName: 'webhooks.unwrap' },
|
|
414
|
+
{
|
|
415
|
+
clientCallName: 'client.health.check',
|
|
416
|
+
fullyQualifiedName: 'health.check',
|
|
417
|
+
httpMethod: 'get',
|
|
418
|
+
httpPath: '/health',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
clientCallName: 'client.version.retrieve',
|
|
422
|
+
fullyQualifiedName: 'version.retrieve',
|
|
423
|
+
httpMethod: 'get',
|
|
424
|
+
httpPath: '/version',
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
clientCallName: 'client.client.ws.test',
|
|
428
|
+
fullyQualifiedName: 'client.ws.test',
|
|
429
|
+
httpMethod: 'get',
|
|
430
|
+
httpPath: '/ws/test',
|
|
431
|
+
},
|
|
432
|
+
];
|
|
433
|
+
|
|
434
|
+
function allowedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
|
|
435
|
+
if (!options) {
|
|
436
|
+
return undefined;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
let allowedMethods: SdkMethod[];
|
|
440
|
+
|
|
441
|
+
if (options.codeAllowHttpGets || options.codeAllowedMethods) {
|
|
442
|
+
// Start with nothing allowed and then add into it from options
|
|
443
|
+
let allowedMethodsSet = new Set<SdkMethod>();
|
|
444
|
+
|
|
445
|
+
if (options.codeAllowHttpGets) {
|
|
446
|
+
// Add all methods that map to an HTTP GET
|
|
447
|
+
sdkMethods
|
|
448
|
+
.filter((method) => method.httpMethod === 'get')
|
|
449
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (options.codeAllowedMethods) {
|
|
453
|
+
// Add all methods that match any of the allowed regexps
|
|
454
|
+
const allowedRegexps = options.codeAllowedMethods.map((pattern) => {
|
|
455
|
+
try {
|
|
456
|
+
return new RegExp(pattern);
|
|
457
|
+
} catch (e) {
|
|
458
|
+
throw new Error(
|
|
459
|
+
`Invalid regex pattern for allowed method: "${pattern}": ${e instanceof Error ? e.message : e}`,
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
sdkMethods
|
|
465
|
+
.filter((method) => allowedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)))
|
|
466
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
allowedMethods = Array.from(allowedMethodsSet);
|
|
470
|
+
} else {
|
|
471
|
+
// Start with everything allowed
|
|
472
|
+
allowedMethods = [...sdkMethods];
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (options.codeBlockedMethods) {
|
|
476
|
+
// Filter down based on blocked regexps
|
|
477
|
+
const blockedRegexps = options.codeBlockedMethods.map((pattern) => {
|
|
478
|
+
try {
|
|
479
|
+
return new RegExp(pattern);
|
|
480
|
+
} catch (e) {
|
|
481
|
+
throw new Error(
|
|
482
|
+
`Invalid regex pattern for blocked method: "${pattern}": ${e instanceof Error ? e.message : e}`,
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
allowedMethods = allowedMethods.filter(
|
|
488
|
+
(method) => !blockedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)),
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return allowedMethods;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
|
|
496
|
+
const allowedMethods = allowedMethodsForCodeTool(options);
|
|
497
|
+
if (!allowedMethods) {
|
|
498
|
+
return undefined;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const allowedSet = new Set(allowedMethods.map((method) => method.fullyQualifiedName));
|
|
502
|
+
|
|
503
|
+
// Return any methods that are not explicitly allowed
|
|
504
|
+
return sdkMethods.filter((method) => !allowedSet.has(method.fullyQualifiedName));
|
|
505
|
+
}
|
package/src/options.ts
CHANGED
|
@@ -12,10 +12,30 @@ export type CLIOptions = McpOptions & {
|
|
|
12
12
|
|
|
13
13
|
export type McpOptions = {
|
|
14
14
|
includeDocsTools?: boolean | undefined;
|
|
15
|
+
codeAllowHttpGets?: boolean | undefined;
|
|
16
|
+
codeAllowedMethods?: string[] | undefined;
|
|
17
|
+
codeBlockedMethods?: string[] | undefined;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
export function parseCLIOptions(): CLIOptions {
|
|
18
21
|
const opts = yargs(hideBin(process.argv))
|
|
22
|
+
.option('code-allow-http-gets', {
|
|
23
|
+
type: 'boolean',
|
|
24
|
+
description:
|
|
25
|
+
'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.',
|
|
26
|
+
})
|
|
27
|
+
.option('code-allowed-methods', {
|
|
28
|
+
type: 'string',
|
|
29
|
+
array: true,
|
|
30
|
+
description:
|
|
31
|
+
'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
32
|
+
})
|
|
33
|
+
.option('code-blocked-methods', {
|
|
34
|
+
type: 'string',
|
|
35
|
+
array: true,
|
|
36
|
+
description:
|
|
37
|
+
'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
38
|
+
})
|
|
19
39
|
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
20
40
|
.option('no-tools', {
|
|
21
41
|
type: 'string',
|
|
@@ -59,6 +79,9 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
59
79
|
return {
|
|
60
80
|
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
61
81
|
debug: !!argv.debug,
|
|
82
|
+
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
83
|
+
codeAllowedMethods: argv.codeAllowedMethods,
|
|
84
|
+
codeBlockedMethods: argv.codeBlockedMethods,
|
|
62
85
|
transport,
|
|
63
86
|
port: argv.port,
|
|
64
87
|
socket: argv.socket,
|
package/src/server.ts
CHANGED
|
@@ -12,6 +12,7 @@ import Believe from '@cjavdev/believe';
|
|
|
12
12
|
import { codeTool } from './code-tool';
|
|
13
13
|
import docsSearchTool from './docs-search-tool';
|
|
14
14
|
import { McpOptions } from './options';
|
|
15
|
+
import { blockedMethodsForCodeTool } from './methods';
|
|
15
16
|
import { HandlerFunction, McpTool } from './types';
|
|
16
17
|
|
|
17
18
|
export { McpOptions } from './options';
|
|
@@ -57,7 +58,7 @@ export const newMcpServer = async () =>
|
|
|
57
58
|
new McpServer(
|
|
58
59
|
{
|
|
59
60
|
name: 'cjavdev_believe_api',
|
|
60
|
-
version: '0.
|
|
61
|
+
version: '0.7.0',
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
instructions: await getInstructions(),
|
|
@@ -147,7 +148,11 @@ export async function initMcpServer(params: {
|
|
|
147
148
|
* Selects the tools to include in the MCP Server based on the provided options.
|
|
148
149
|
*/
|
|
149
150
|
export function selectTools(options?: McpOptions): McpTool[] {
|
|
150
|
-
const includedTools = [
|
|
151
|
+
const includedTools = [
|
|
152
|
+
codeTool({
|
|
153
|
+
blockedMethods: blockedMethodsForCodeTool(options),
|
|
154
|
+
}),
|
|
155
|
+
];
|
|
151
156
|
if (options?.includeDocsTools ?? true) {
|
|
152
157
|
includedTools.push(docsSearchTool);
|
|
153
158
|
}
|
package/src/stdio.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { McpOptions } from './options';
|
|
2
3
|
import { initMcpServer, newMcpServer } from './server';
|
|
3
4
|
|
|
4
|
-
export const launchStdioServer = async () => {
|
|
5
|
+
export const launchStdioServer = async (mcpOptions: McpOptions) => {
|
|
5
6
|
const server = await newMcpServer();
|
|
6
7
|
|
|
7
|
-
await initMcpServer({ server });
|
|
8
|
+
await initMcpServer({ server, mcpOptions });
|
|
8
9
|
|
|
9
10
|
const transport = new StdioServerTransport();
|
|
10
11
|
await server.connect(transport);
|
package/stdio.d.mts
CHANGED
package/stdio.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAGrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
|
package/stdio.d.ts
CHANGED
package/stdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAGrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAQ7D,CAAC"}
|
package/stdio.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.launchStdioServer = void 0;
|
|
4
4
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
5
|
const server_1 = require("./server.js");
|
|
6
|
-
const launchStdioServer = async () => {
|
|
6
|
+
const launchStdioServer = async (mcpOptions) => {
|
|
7
7
|
const server = await (0, server_1.newMcpServer)();
|
|
8
|
-
await (0, server_1.initMcpServer)({ server });
|
|
8
|
+
await (0, server_1.initMcpServer)({ server, mcpOptions });
|
|
9
9
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
10
10
|
await server.connect(transport);
|
|
11
11
|
console.error('MCP Server running on stdio');
|
package/stdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AAEjF,wCAAuD;AAEhD,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,GAAE,CAAC;IAEpC,MAAM,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
|
package/stdio.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
2
|
import { initMcpServer, newMcpServer } from "./server.mjs";
|
|
3
|
-
export const launchStdioServer = async () => {
|
|
3
|
+
export const launchStdioServer = async (mcpOptions) => {
|
|
4
4
|
const server = await newMcpServer();
|
|
5
|
-
await initMcpServer({ server });
|
|
5
|
+
await initMcpServer({ server, mcpOptions });
|
|
6
6
|
const transport = new StdioServerTransport();
|
|
7
7
|
await server.connect(transport);
|
|
8
8
|
console.error('MCP Server running on stdio');
|
package/stdio.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;
|
|
1
|
+
{"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OAEzE,EAAE,aAAa,EAAE,YAAY,EAAE;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;IAEpC,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC"}
|