Add repository traffic/insights tools (views, clones, referrers, paths)
還沒有人認領這個 Issue。
評估
研究方向
先閱讀 repos 工具集中的現有工具,以及固定版本 go-github 中的 ListTrafficViews、ListTrafficClones、ListTrafficReferrers 和 ListTrafficPaths 方法。新增這四個唯讀工具,並使用所述參數和儲存庫範圍要求;然後驗證 views 和 clones 接受按日或按週的細分,而 referrers 和 paths 不接受。
由索引模型根據 Issue 內容生成。
描述
Describe the feature or problem you'd like to solve
The server has no way to read a repository's traffic/insights data. There are no tools wrapping the four traffic endpoints:
| Proposed tool | GitHub endpoint | Returns |
|---|---|---|
get_traffic_views |
GET /repos/{owner}/{repo}/traffic/views |
Page views + unique visitors (14-day, daily or weekly) |
get_traffic_clones |
GET /repos/{owner}/{repo}/traffic/clones |
Git clones + unique cloners (14-day, daily or weekly) |
get_traffic_referrers |
GET /repos/{owner}/{repo}/traffic/popular/referrers |
Top 10 referring sites |
get_traffic_paths |
GET /repos/{owner}/{repo}/traffic/popular/paths |
Top 10 most-visited paths |
Today an agent can read stars and forks but has no view into whether a repo is actually being visited or cloned, which is the primary signal for measuring adoption and reach of a project. This is a read-only capability.
Proposed solution
Add the four tools above under the existing repos toolset, each ReadOnlyHint: true.
The implementation is thin because the pinned go-github client already exposes all four methods (RepositoriesService.ListTrafficViews, ListTrafficClones, ListTrafficReferrers, ListTrafficPaths), so no new HTTP plumbing is needed. The views/clones tools take an optional per parameter (day | week) mapping to TrafficBreakdownOptions; referrers/paths take just owner/repo.
One note on access: GitHub gates these endpoints behind push access to the repo (for GitHub Apps, the repository Administration: Read permission), so the tools should be annotated to require the repo scope rather than treated as public-read, even though the endpoints exist on public repos.
I'm happy to open a PR for this if the capability is something you'd accept.
Example prompts or workflows (for tools/toolsets only)
- "How many unique visitors and clones did
owner/repoget in the last two weeks?" - "Where is traffic to my repo coming from? Show me the top referrers."
- "Which pages/paths in
owner/repoare people actually viewing?" - "Compare views vs. clones week over week for
owner/repoand tell me if adoption is trending up." - "Build me a weekly adoption report for my repo: stars, forks, views, unique visitors, and clones." (traffic is the missing piece today; stars/forks are already covered)
Additional context
Traffic data has a 14-day rolling retention window on GitHub's side, so these tools are especially useful to agents that snapshot the data on a schedule for longer-term trend tracking.
- 主要語言
- Go
- 星號
- 33.1k
- 分支
- 5k
- 平均合併
- 2 天 3 小時
- 30 天內合併 PR
- 18
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 90/100
-
enhancement
難度 2/5 1-3 小時 新手友好度 65/100
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
santhosh-tekuri/jsonschema#276 ·