Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Dot-segment usernames can redirect requests to global activity, and lockdown mode exposes embedded content without verifying authors’ repository access.
3 open issues
What changed in this PR
Adds list_user_events to the GitHub MCP Server’s users toolset, enabling paginated retrieval of recent user activity through GET /users/{username}/events and addressing #2420.
Changes:
- Adds a read-only tool with typed schemas, structured results, and legacy JSON compatibility.
- Preserves event payloads and exact numeric IDs, sanitizes payload strings, and derives confidentiality labels from event visibility.
- Adds validation and protocol tests, schema snapshots, documentation, and a skill coverage exemption.
| File | Description |
|---|---|
README.md |
Documents the new tool and its parameters. |
pkg/skills/catalog/availability_test.go |
Records the tool’s skill coverage exemption. |
pkg/github/users.go |
Implements activity retrieval, pagination, payload handling, and visibility labels. |
pkg/github/users_test.go |
Tests responses, validation, visibility labels, and protocol compatibility. |
pkg/github/tools.go |
Registers the tool in the inventory. |
pkg/github/__toolsnaps__/list_user_events.snap |
Captures the tool’s input schema and metadata. |
pkg/github/__toolsnaps__/list_user_events_output.snap |
Captures the typed event output schema. |
Review effort: Max (adaptive)
| if input.Username == "" { | ||
| return utils.NewToolResultError("missing required parameter: username"), nil, nil | ||
| } |
| if err := decoder.Decode(&payload); err != nil { | ||
| return utils.NewToolResultErrorFromErr("failed to decode event payload", err), nil, nil | ||
| } | ||
| payload = sanitizeUserEventPayload(payload) |
| case map[string]any: | ||
| for key, item := range value { | ||
| value[key] = sanitizeUserEventPayload(item) | ||
| } | ||
| return value |
|
I addressed the three Copilot findings in The regression tests, full race test suite, lint, and live GitHub checks passed. Could a maintainer review the lockdown behavior and approve the workflow runs for this revision when you have a chance? |


Summary
Add a read-only
list_user_eventstool in the users toolset so agents can retrieve a user's recent GitHub activity with pagination.Why
Fixes #2420. Query
GET /users/{username}/eventsas requested by the issue. GitHub returns public events for other users and may include private events when querying the authenticated user's own activity, subject to the token's permissions.What changed
MCP impact
list_user_events(username, page?, perPage?)joins the default users toolset. There is no publicOnly option; event visibility follows GitHub's endpoint and the current credentials.Prompts tested (tool changes only)
Representative workflow: "Summarize kaii9's recent GitHub activity." Validation uses equivalent direct MCP requests rather than an LLM prompt run: activity queries, explicit pagination, missing/invalid arguments, legacy JSON, modern JSON, and modern CSV. Live event metadata is compared with an independent call to the same GitHub Events endpoint.
Security / limits
The tool follows the existing repository public-read scope policy; GitHub remains responsible for access checks and fine-grained private Events permissions. Private events are retained when the API returns them, and result confidentiality is derived from returned event visibility. Missing visibility is conservatively private. Payload content remains untrusted. The tool description documents the feed's 300-event, 30-day history limit and possible latency; callers control page size.
Tool renaming
Lint & tests
./script/lint— 0 issues.Also built the binary, regenerated docs, ran CI-mode feature/schema checks without test cache, and validated live read-only MCP calls. Private-event retention and mixed-page confidentiality are covered with simulated GitHub responses; the account's current live sample contained public events.
Docs
Generated README tool documentation and schema snapshots.
Skills
User activity history is outside the scope of the bundled account identity and team membership skill. The catalog coverage check records this exemption.
On November 18, 2026, this branch was synced with upstream main at
4e6e6c0. The full race test suite, lint, build, and skill catalog coverage check passed with Go 1.27.3. Live MCP checks against the Events API passed for legacy JSON, modern JSON, and modern CSV.Review follow-up
Commit
f6abc1brejects dot-only usernames before obtaining a GitHub client and removes HTML from payload titles and names while preserving body formatting. In lockdown mode, the tool returns event metadata and visibility. It omits payloads because the feed may embed content from several authors and repositories and does not establish the origin of every field.Regression tests cover all three changes. The full race test suite, lint, and build passed. A live comparison against GitHub returned the same two events with and without lockdown, with payloads present in normal mode and omitted under lockdown.