From 8474614f51f15184a0ae3c777ee91ff744c6559d Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Fri, 18 Jul 2025 02:16:08 +0300 Subject: [PATCH 1/3] fix: temporarily turn off basge increments --- .../tools/repoHandlers/GenericRepoHandler.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/api/tools/repoHandlers/GenericRepoHandler.ts b/src/api/tools/repoHandlers/GenericRepoHandler.ts index 344bb26..30318da 100644 --- a/src/api/tools/repoHandlers/GenericRepoHandler.ts +++ b/src/api/tools/repoHandlers/GenericRepoHandler.ts @@ -54,15 +54,15 @@ class GenericRepoHandler implements RepoHandler { }; } - ctx.waitUntil( - incrementRepoViewCount( - env as CloudflareEnvironment, - repo.owner, - repo.repo, - ).catch((err) => { - console.error("Error incrementing repo view count:", err); - }), - ); + // ctx.waitUntil( + // incrementRepoViewCount( + // env as CloudflareEnvironment, + // repo.owner, + // repo.repo, + // ).catch((err) => { + // console.error("Error incrementing repo view count:", err); + // }), + // ); return { content: [ From 578dd59e1ea08007db6bc66a9f29a5072f949f6e Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Fri, 18 Jul 2025 02:19:53 +0300 Subject: [PATCH 2/3] allow mcp-ui --- .../tools/repoHandlers/GenericRepoHandler.ts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/api/tools/repoHandlers/GenericRepoHandler.ts b/src/api/tools/repoHandlers/GenericRepoHandler.ts index 30318da..519a114 100644 --- a/src/api/tools/repoHandlers/GenericRepoHandler.ts +++ b/src/api/tools/repoHandlers/GenericRepoHandler.ts @@ -9,6 +9,8 @@ import { import { incrementRepoViewCount } from "../../utils/badge.js"; import rawMapping from "./generic/static-mapping.json"; +const badgeCountAllowedRepos = ["mcp-ui"]; + class GenericRepoHandler implements RepoHandler { name = "generic"; getTools(_: RepoData, env: any, ctx: any): Array { @@ -54,15 +56,17 @@ class GenericRepoHandler implements RepoHandler { }; } - // ctx.waitUntil( - // incrementRepoViewCount( - // env as CloudflareEnvironment, - // repo.owner, - // repo.repo, - // ).catch((err) => { - // console.error("Error incrementing repo view count:", err); - // }), - // ); + if (badgeCountAllowedRepos.includes(repo.repo)) { + ctx.waitUntil( + incrementRepoViewCount( + env as CloudflareEnvironment, + repo.owner, + repo.repo, + ).catch((err) => { + console.error("Error incrementing repo view count:", err); + }), + ); + } return { content: [ From cdbb108fe46042d248b852eb688380b5f4e4a59f Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Fri, 18 Jul 2025 02:20:40 +0300 Subject: [PATCH 3/3] allow git-mcp --- src/api/tools/repoHandlers/GenericRepoHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/tools/repoHandlers/GenericRepoHandler.ts b/src/api/tools/repoHandlers/GenericRepoHandler.ts index 519a114..05a1c66 100644 --- a/src/api/tools/repoHandlers/GenericRepoHandler.ts +++ b/src/api/tools/repoHandlers/GenericRepoHandler.ts @@ -9,7 +9,7 @@ import { import { incrementRepoViewCount } from "../../utils/badge.js"; import rawMapping from "./generic/static-mapping.json"; -const badgeCountAllowedRepos = ["mcp-ui"]; +const badgeCountAllowedRepos = ["mcp-ui", "git-mcp"]; class GenericRepoHandler implements RepoHandler { name = "generic";