Skip to content

Commit 22f0c35

Browse files
committed
use two slashes for mcp resources
Not sure if you want to take this since I'll get it fixed in vscode next week, but this makes things work
1 parent b3fc94b commit 22f0c35

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/resources/gists.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
mcpGist,
77
} from "../utils.js";
88

9-
const RESOURCE_PREFIX = "gist:///";
9+
const RESOURCE_PREFIX = "gist://";
1010

1111
export const resourceHandlers: ResourceHandlers = {
1212
listResourceTemplates: () => ({
@@ -53,11 +53,10 @@ export const resourceHandlers: ResourceHandlers = {
5353

5454
readResource: async (uri, context) => {
5555
const url = new URL(uri);
56-
const path = url.pathname.replace(/^\//, "");
56+
const path = url.host + (url.pathname ? '/' + url.pathname : '');
5757

5858
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`);
6160
return {
6261
contents: [
6362
{

0 commit comments

Comments
 (0)