File tree Expand file tree Collapse file tree 4 files changed +105
-79
lines changed Expand file tree Collapse file tree 4 files changed +105
-79
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/mcp ' : patch
3+ ---
4+
5+ feat: return ` mcp-ui ` resource from ` playground-link `
Original file line number Diff line number Diff line change 2020 "drizzle-orm" : " ^0.44.0"
2121 },
2222 "dependencies" : {
23+ "@mcp-ui/server" : " ^5.12.0" ,
2324 "@sveltejs/mcp-schema" : " workspace:^" ,
2425 "@tmcp/adapter-valibot" : " ^0.1.4" ,
2526 "@typescript-eslint/parser" : " ^8.44.0" ,
Original file line number Diff line number Diff line change 11import type { SvelteMcp } from '../../index.js' ;
22import * as v from 'valibot' ;
33import { icons } from '../../icons/index.js' ;
4+ import { createUIResource } from '@mcp-ui/server' ;
45
56async function compress_and_encode_text ( input : string ) {
67 const reader = new Blob ( [ input ] ) . stream ( ) . pipeThrough ( new CompressionStream ( 'gzip' ) ) . getReader ( ) ;
@@ -100,12 +101,23 @@ export function playground_link(server: SvelteMcp) {
100101 url : playground_base . toString ( ) ,
101102 } ;
102103
104+ // use the embed path to have a cleaner UI for mcp-ui
105+ playground_base . pathname = '/playground/embed' ;
106+
103107 return {
104108 content : [
105109 {
106110 type : 'text' ,
107111 text : JSON . stringify ( content ) ,
108112 } ,
113+ createUIResource ( {
114+ uri : 'ui://svelte/playground-link' ,
115+ content : {
116+ type : 'externalUrl' ,
117+ iframeUrl : playground_base . toString ( ) ,
118+ } ,
119+ encoding : 'text' ,
120+ } ) ,
109121 ] ,
110122 structuredContent : content ,
111123 } ;
You can’t perform that action at this time.
0 commit comments