Skip to content

Commit f9c79bd

Browse files
Merge pull request #20 from connor4312/connor4312/twoslash
use two slashes for mcp resources
2 parents b6513d6 + 22f0c35 commit f9c79bd

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)