File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 6
6
mcpGist ,
7
7
} from "../utils.js" ;
8
8
9
- const RESOURCE_PREFIX = "gist:/// " ;
9
+ const RESOURCE_PREFIX = "gist://" ;
10
10
11
11
export const resourceHandlers : ResourceHandlers = {
12
12
listResourceTemplates : ( ) => ( {
@@ -53,11 +53,10 @@ export const resourceHandlers: ResourceHandlers = {
53
53
54
54
readResource : async ( uri , context ) => {
55
55
const url = new URL ( uri ) ;
56
- const path = url . pathname . replace ( / ^ \/ / , "" ) ;
56
+ const path = url . host + ( url . pathname ? '/' + url . pathname : '' ) ;
57
57
58
58
if ( path . endsWith ( "/comments" ) ) {
59
- const gistId = path . replace ( "/comments" , "" ) ;
60
- const response = await context . axiosInstance . get ( `/${ gistId } /comments` ) ;
59
+ const response = await context . axiosInstance . get ( `/${ url . host } /comments` ) ;
61
60
return {
62
61
contents : [
63
62
{
You can’t perform that action at this time.
0 commit comments