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
@@ -33,6 +33,7 @@ GitHub Tracker is a dashboard that aggregates open issues, pull requests, and Gi
33
33
-[Refresh and Polling](#refresh-and-polling)
34
34
-[Notifications](#notifications)
35
35
-[Repo Pinning](#repo-pinning)
36
+
-[MCP Server Integration](#mcp-server-integration)
36
37
-[Settings Reference](#settings-reference)
37
38
-[Troubleshooting](#troubleshooting)
38
39
@@ -53,7 +54,7 @@ If you prefer not to use OAuth, you can sign in with a GitHub Personal Access To
53
54
Two token formats are accepted:
54
55
55
56
-**Classic tokens** (starts with `ghp_`) — recommended. Works across all organizations you belong to. Required scopes: `repo`, `read:org` (under admin:org), `notifications`.
56
-
-**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).
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), Metadata (read), Pull requests (read).
57
58
58
59
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.
59
60
@@ -337,6 +338,45 @@ Pin state is per-tab — a repo can be pinned on the Issues tab but not the Pull
337
338
338
339
---
339
340
341
+
## MCP Server Integration
342
+
343
+
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.
344
+
345
+
### Standalone mode
346
+
347
+
Run the MCP server with a GitHub token for direct API access:
348
+
349
+
```bash
350
+
GITHUB_TOKEN=ghp_... npx github-tracker-mcp
351
+
```
352
+
353
+
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.
354
+
355
+
### WebSocket relay mode
356
+
357
+
For richer data without extra API calls, connect the MCP server to the running dashboard:
358
+
359
+
1. Open **Settings > MCP Server Relay**
360
+
2. Toggle **Enable relay** on
361
+
3. The status indicator shows "Connected" when the MCP server is running and linked
362
+
363
+
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.
364
+
365
+
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.
366
+
367
+
### Available tools
368
+
369
+
| Tool | What it returns |
370
+
|------|----------------|
371
+
|`get_dashboard_summary`| Counts: open PRs, open issues, failing CI, PRs needing review, approved but unmerged |
372
+
|`get_open_prs`| Open PRs with CI status, review decision, size, reviewers |
373
+
|`get_open_issues`| Open issues across tracked repos |
374
+
|`get_failing_actions`| In-progress or recently failed workflow runs |
375
+
|`get_pr_details`| Full details for a specific PR |
376
+
|`get_rate_limit`| Current GitHub API quota |
377
+
378
+
---
379
+
340
380
## Settings Reference
341
381
342
382
Settings are saved automatically to `localStorage` and persist across sessions. All settings can be exported as a JSON file via **Settings > Data > Export**.
@@ -358,6 +398,8 @@ Settings are saved automatically to `localStorage` and persist across sessions.
358
398
| Items per page | 25 | Number of items per page in each tab. Options: 10, 25, 50, 100. |
359
399
| Default tab | Issues | Tab shown when opening the dashboard fresh (without remembered last tab). |
360
400
| Remember last tab | On | Return to the last active tab on revisit. |
401
+
| MCP relay enabled | Off | Allow a local MCP server to receive live dashboard data over WebSocket. |
402
+
| MCP relay port | 9876 | Port for the WebSocket relay connection. Must match the MCP server's `MCP_WS_PORT`. |
361
403
362
404
### View State Settings
363
405
@@ -403,6 +445,18 @@ When a tab has been hidden for more than 2 minutes, a catch-up fetch fires autom
403
445
404
446
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.
405
447
448
+
**MCP relay shows "Connecting..." but never connects.**
449
+
450
+
- Verify the MCP server is running (`GITHUB_TOKEN=ghp_... npx github-tracker-mcp` or `pnpm mcp:serve`)
451
+
- Check that the port in Settings matches the MCP server's port (default: 9876)
452
+
- The MCP server binds to `127.0.0.1` only — it must run on the same machine as your browser
453
+
454
+
**MCP tools return empty or stale data.**
455
+
456
+
- 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.
457
+
- 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.
458
+
- The relay snapshot updates on each full refresh (every 5 minutes by default). Hot poll updates are not forwarded to the relay.
459
+
406
460
**How do I sign out or reset everything?**
407
461
408
462
-**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