You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mcp): improves docs accuracy and hardens validation
- Aligns fine-grained PAT permissions across all 4 doc surfaces
- Documents direct API mode limitations for failing/approved filters
- Adds owner/repo format note, scope default, GITHUB_TOKEN safety net
- Fixes needs_review filter in direct mode (review-requested: qualifier)
- Parallelizes dashboard summary API calls with Promise.allSettled
- Adds VALID_TRACKED_LOGIN regex validation to TrackedUserSchema
- Widens CSP connect-src to ws://127.0.0.1:* for configurable ports
- Improves publish workflow with job-level permissions (least privilege)
- Fixes relay snapshot effect to track lastRefreshedAt (excludes hot poll)
- Removes BUG/FIX/PERF/SEC/UI comment labels throughout MCP codebase
- Adds unit tests for octokit client and MCP resources
|`get_dashboard_summary`| Aggregated counts of open PRs, issues, failing CI|`scope` (involves_me\|all) |
172
+
|`get_dashboard_summary`| Aggregated counts of open PRs, issues, failing CI, PRs needing review, approved but unmerged |`scope?` (involves_me\|all, default: involves_me) |
169
173
|`get_open_prs`| Open PRs with check status and review decision |`repo?`, `status?` (all\|needs_review\|failing\|approved\|draft) |
170
174
|`get_open_issues`| Open issues across tracked repos |`repo?`|
171
175
|`get_failing_actions`| In-progress or recently failed workflow runs |`repo?`|
172
176
|`get_pr_details`| Detailed info about a specific PR |`repo`, `number`|
173
177
|`get_rate_limit`| Current GitHub API rate limit status | — |
174
178
179
+
`repo` parameters use `owner/repo` format (e.g., `octocat/hello-world`).
180
+
175
181
### Resources
176
182
177
183
-`tracker://config` — current dashboard configuration (selected repos, tracked users)
@@ -213,7 +219,7 @@ Add to `~/.claude.json` (global) or `.claude/settings.json` (project):
213
219
}
214
220
```
215
221
216
-
> **Security:** Don't commit `GITHUB_TOKEN` to source control. Fine-grained PATs with Contents (read) and Metadata (read) permissions are recommended for tighter security.
222
+
> **Security:** Don't commit `GITHUB_TOKEN` to source control. Classic PATs with `repo` and `read:org` scopes are recommended for full functionality. Fine-grained PATs also work (Actions, Contents, Issues, Metadata, Pull requests — all read) but skip scope validation at startup.
Copy file name to clipboardExpand all lines: docs/USER_GUIDE.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ GitHub Tracker is a dashboard that aggregates open issues, pull requests, and Gi
34
34
-[Notifications](#notifications)
35
35
-[Tracked Items](#tracked-items)
36
36
-[Repo Pinning](#repo-pinning)
37
+
-[MCP Server Integration](#mcp-server-integration)
37
38
-[Settings Reference](#settings-reference)
38
39
-[Troubleshooting](#troubleshooting)
39
40
@@ -54,7 +55,7 @@ If you prefer not to use OAuth, you can sign in with a GitHub Personal Access To
54
55
Two token formats are accepted:
55
56
56
57
-**Classic tokens** (starts with `ghp_`) — recommended. Works across all organizations you belong to. Required scopes: `repo`, `read:org` (under admin:org), `notifications`.
57
-
-**Fine-grained tokens** (starts with `github_pat_`) — also work, but have limitations: they only access one organization at a time, do not support the `notifications` scope, and therefore cannot use the background-poll optimization. Required permissions: Actions (read), Contents (read), Issues (read), Pull requests (read).
58
+
-**Fine-grained tokens** (starts with `github_pat_`) — also work, but have limitations: they only access one organization at a time, do not support the `notifications` scope, and therefore cannot use the background-poll optimization. Required permissions: Actions (read), Contents (read), Issues (read), Metadata (read), Pull requests (read).
58
59
59
60
The token is validated against the GitHub API before being stored. It is saved permanently in your browser's `localStorage` — you will not need to re-enter it on revisit.
60
61
@@ -359,6 +360,45 @@ Pin state is per-tab — a repo can be pinned on the Issues tab but not the Pull
359
360
360
361
---
361
362
363
+
## MCP Server Integration
364
+
365
+
The MCP (Model Context Protocol) server lets AI clients like Claude Code and Cursor query your dashboard data — open PRs, issues, failing CI — without leaving the editor.
366
+
367
+
### Standalone mode
368
+
369
+
Run the MCP server with a GitHub token for direct API access:
370
+
371
+
```bash
372
+
GITHUB_TOKEN=ghp_... npx github-tracker-mcp
373
+
```
374
+
375
+
This works without the dashboard open. The server fetches data directly from GitHub using the token. See the [MCP server README](https://github.com/gordon-code/github-tracker/tree/main/mcp) for Claude Code configuration and the full tool reference.
376
+
377
+
### WebSocket relay mode
378
+
379
+
For richer data without extra API calls, connect the MCP server to the running dashboard:
380
+
381
+
1. Open **Settings > MCP Server Relay**
382
+
2. Toggle **Enable relay** on
383
+
3. The status indicator shows "Connected" when the MCP server is running and linked
384
+
385
+
When connected, the MCP server receives live dashboard data over a local WebSocket connection (`ws://127.0.0.1:9876`). This provides the same enriched data you see in the dashboard — GraphQL-sourced review decisions, check statuses, and reviewer lists — without consuming additional API quota.
386
+
387
+
The relay falls back to direct GitHub API calls automatically when the dashboard is closed. Set `GITHUB_TOKEN` even when using the relay as a safety net — without it, all tool calls fail if the relay disconnects.
388
+
389
+
### Available tools
390
+
391
+
| Tool | What it returns |
392
+
|------|----------------|
393
+
|`get_dashboard_summary`| Counts: open PRs, open issues, failing CI, PRs needing review, approved but unmerged |
394
+
|`get_open_prs`| Open PRs with CI status, review decision, size, reviewers |
395
+
|`get_open_issues`| Open issues across tracked repos |
396
+
|`get_failing_actions`| In-progress or recently failed workflow runs |
397
+
|`get_pr_details`| Full details for a specific PR |
398
+
|`get_rate_limit`| Current GitHub API quota |
399
+
400
+
---
401
+
362
402
## Settings Reference
363
403
364
404
Settings are saved automatically to `localStorage` and persist across sessions. All settings can be exported as a JSON file via **Settings > Data > Export**.
@@ -382,6 +422,8 @@ Settings are saved automatically to `localStorage` and persist across sessions.
382
422
| Remember last tab | On | Return to the last active tab on revisit. |
383
423
| Enable tracked items | Off | Show the Tracked tab for pinning issues and PRs to a personal TODO list. |
384
424
| API Usage | — | Displays per-source API call counts, pool labels (Core/GraphQL), and last-called timestamps for the current rate limit window. Counts auto-reset when the rate limit window expires. Use "Reset counts" to clear manually. |
425
+
| MCP relay enabled | Off | Allow a local MCP server to receive live dashboard data over WebSocket. |
426
+
| MCP relay port | 9876 | Port for the WebSocket relay connection. Must match the MCP server's `MCP_WS_PORT`. |
385
427
386
428
### View State Settings
387
429
@@ -430,6 +472,18 @@ When a tab has been hidden for more than 2 minutes, a catch-up fetch fires autom
430
472
431
473
Go to **Settings > Repositories > Manage Repositories**, find the repo, and deselect it. If it was in the monitored list, it will be removed from monitoring automatically.
432
474
475
+
**MCP relay shows "Connecting..." but never connects.**
476
+
477
+
- Verify the MCP server is running (`GITHUB_TOKEN=ghp_... npx github-tracker-mcp` or `pnpm mcp:serve`)
478
+
- Check that the port in Settings matches the MCP server's port (default: 9876)
479
+
- The MCP server binds to `127.0.0.1` only — it must run on the same machine as your browser
480
+
481
+
**MCP tools return empty or stale data.**
482
+
483
+
- If the dashboard is open with the relay enabled, the MCP server uses live dashboard data. Navigate to the Dashboard tab to trigger a data load.
484
+
- If the dashboard is closed, the MCP server falls back to direct API calls using `GITHUB_TOKEN`. REST search lacks check status and review decision data, so PR filters like `failing` and `approved` may return empty results. Use the relay for full filter accuracy.
485
+
- The relay snapshot updates on each full refresh (every 5 minutes by default). Hot poll updates are not forwarded to the relay.
486
+
433
487
**How do I sign out or reset everything?**
434
488
435
489
-**Sign out**: Settings > Data > Sign out. This clears your auth token and returns you to the login page. Your config is preserved.
|`GITHUB_TOKEN`| Yes*| — |GitHub PAT or OAuth token. Fine-grained PATs with Contents (read) and Metadata (read) are sufficient. |
19
+
|`GITHUB_TOKEN`| Yes*| — |Classic PAT with `repo` and `read:org` scopes (recommended), or fine-grained PAT with Actions (read), Contents (read), Issues (read), Metadata (read), and Pull requests (read) permissions. Fine-grained PATs skip scope validation at startup. |
20
20
|`MCP_WS_PORT`| No |`9876`| WebSocket relay port for receiving live data from the dashboard SPA. |
21
21
22
22
*`GITHUB_TOKEN` is required for direct API mode. If the dashboard's WebSocket relay is connected, the server can serve data without it.
@@ -43,24 +43,36 @@ Add to `~/.claude.json` (global) or `.claude/settings.json` (project):
43
43
44
44
| Tool | Description | Parameters |
45
45
|------|-------------|------------|
46
-
|`get_dashboard_summary`| Aggregated counts of open PRs, issues, failing CI|`scope` (involves_me\|all) |
46
+
|`get_dashboard_summary`| Aggregated counts of open PRs, issues, failing CI, PRs needing review, approved but unmerged |`scope?` (involves_me\|all, default: involves_me) |
47
47
|`get_open_prs`| Open PRs with check status and review decision |`repo?`, `status?` (all\|needs_review\|failing\|approved\|draft) |
48
48
|`get_open_issues`| Open issues across tracked repos |`repo?`|
49
49
|`get_failing_actions`| In-progress or recently failed workflow runs |`repo?`|
50
50
|`get_pr_details`| Detailed info about a specific PR |`repo`, `number`|
51
51
|`get_rate_limit`| Current GitHub API rate limit status | — |
52
52
53
+
`repo` parameters use `owner/repo` format (e.g., `octocat/hello-world`).
54
+
53
55
## Resources
54
56
55
57
-`tracker://config` — current dashboard configuration (selected repos, tracked users)
56
58
-`tracker://repos` — list of tracked repositories
57
59
58
60
## WebSocket relay
59
61
60
-
Enable the WebSocket relay in the dashboard's Settings page to let the MCP server receive live data directly from the SPA. When connected, the server prefers relay data and falls back to direct GitHub API calls. This reduces API usage and gives the AI client real-time data without polling.
62
+
Enable the WebSocket relay in the dashboard's Settings page to let the MCP server receive live data directly from the SPA. When connected, the server prefers relay data and falls back to direct GitHub API calls. This reduces API usage and gives the AI client the same enriched data visible in the dashboard without separate polling.
61
63
62
64
The relay listens on `ws://127.0.0.1:9876` by default. Override with `MCP_WS_PORT`.
63
65
66
+
### Direct API mode limitations
67
+
68
+
Without the relay, the MCP server uses REST search which lacks some GraphQL-sourced fields. This affects:
69
+
70
+
-`get_open_prs` — `status=failing` and `status=approved` filters return empty results (REST search lacks check status and review decision data). `status=needs_review` works correctly via the `review-requested:` search qualifier.
71
+
-`get_dashboard_summary` — `approvedUnmergedCount` is always 0; `scope` parameter works as expected
72
+
-`get_dashboard_summary` — when the relay IS connected, `scope` is ignored (the relay always reflects the dashboard's current data set)
73
+
74
+
For full filter accuracy for `failing` and `approved` statuses, use the WebSocket relay.
75
+
64
76
## Full documentation
65
77
66
78
See the [GitHub Tracker repository](https://github.com/gordon-code/github-tracker) for deployment, contributing, and architecture details.
0 commit comments