@@ -204,7 +204,7 @@ function createServer() {
204204 async ( ) => {
205205 const result = await $fetch ( '/api/mcp/list-components' )
206206 return {
207- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
207+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
208208 }
209209 }
210210 )
@@ -218,7 +218,7 @@ function createServer() {
218218 async ( ) => {
219219 const result = await $fetch ( '/api/mcp/list-composables' )
220220 return {
221- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
221+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
222222 }
223223 }
224224 )
@@ -233,10 +233,10 @@ function createServer() {
233233 componentName : z . string ( ) . describe ( 'The name of the component (PascalCase)' )
234234 }
235235 } ,
236- async ( params ) => {
236+ async ( params : { componentName : string } ) => {
237237 const result = await $fetch ( '/api/mcp/get-component' , { query : params } )
238238 return {
239- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
239+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
240240 }
241241 }
242242 )
@@ -251,10 +251,10 @@ function createServer() {
251251 componentName : z . string ( ) . describe ( 'The name of the component (PascalCase)' )
252252 }
253253 } ,
254- async ( params ) => {
254+ async ( params : { componentName : string } ) => {
255255 const result = await $fetch ( '/api/mcp/get-component-metadata' , { query : params } )
256256 return {
257- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
257+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
258258 }
259259 }
260260 )
@@ -269,10 +269,10 @@ function createServer() {
269269 category : z . string ( ) . optional ( ) . describe ( 'Filter templates by category' )
270270 }
271271 } ,
272- async ( params ) => {
272+ async ( params : { category ?: string } ) => {
273273 const result = await $fetch ( '/api/mcp/list-templates' , { query : params } )
274274 return {
275- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ] ,
275+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ] ,
276276 structuredContent : result as any
277277 }
278278 }
@@ -288,10 +288,10 @@ function createServer() {
288288 templateName : z . string ( ) . describe ( 'The name of the template' )
289289 }
290290 } ,
291- async ( params ) => {
291+ async ( params : { templateName : string } ) => {
292292 const result = await $fetch ( '/api/mcp/get-template' , { query : params } )
293293 return {
294- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ] ,
294+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ] ,
295295 structuredContent : result as any
296296 }
297297 }
@@ -307,10 +307,10 @@ function createServer() {
307307 path : z . string ( ) . describe ( 'The path to the content page (e.g., /docs/components/button)' )
308308 }
309309 } ,
310- async ( params ) => {
310+ async ( params : { path : string } ) => {
311311 const result = await $fetch < string > ( `/raw${ params . path } .md` )
312312 return {
313- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
313+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
314314 }
315315 }
316316 )
@@ -324,7 +324,7 @@ function createServer() {
324324 async ( ) => {
325325 const result = await $fetch ( '/api/mcp/list-documentation-pages' )
326326 return {
327- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
327+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
328328 }
329329 }
330330 )
@@ -338,7 +338,7 @@ function createServer() {
338338 async ( ) => {
339339 const result = await $fetch ( '/api/mcp/list-getting-started-guides' )
340340 return {
341- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
341+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
342342 }
343343 }
344344 )
@@ -353,10 +353,10 @@ function createServer() {
353353 version : z . enum ( [ 'v3' , 'v4' ] ) . describe ( 'The migration version (e.g., v4, v3)' )
354354 }
355355 } ,
356- async ( params ) => {
356+ async ( params : { version : 'v3' | 'v4' } ) => {
357357 const result = await $fetch ( '/api/mcp/get-migration-guide' , { query : params } )
358358 return {
359- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
359+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
360360 }
361361 }
362362 )
@@ -370,7 +370,7 @@ function createServer() {
370370 async ( ) => {
371371 const result = await $fetch ( '/api/mcp/list-examples' )
372372 return {
373- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
373+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
374374 }
375375 }
376376 )
@@ -385,10 +385,10 @@ function createServer() {
385385 exampleName : z . string ( ) . describe ( 'The name of the example (PascalCase)' )
386386 }
387387 } ,
388- async ( { exampleName } ) => {
388+ async ( { exampleName } : { exampleName : string } ) => {
389389 const result = await $fetch ( `/api/component-example/${ exampleName } .json` )
390390 return {
391- content : [ { type : 'text' , text : result . code } ]
391+ content : [ { type : 'text' as const , text : result . code } ]
392392 }
393393 }
394394 )
@@ -405,10 +405,10 @@ function createServer() {
405405 search : z . string ( ) . optional ( ) . describe ( 'Search term to filter components by name or description' )
406406 }
407407 } ,
408- async ( params ) => {
408+ async ( params : { category ?: string , search ?: string } ) => {
409409 const result = await $fetch ( '/api/mcp/search-components-by-category' , { query : params } )
410410 return {
411- content : [ { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ]
411+ content : [ { type : 'text' as const , text : JSON . stringify ( result , null , 2 ) } ]
412412 }
413413 }
414414 )
0 commit comments