Activity Log: Surface MCP client attribution#47429
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Backup plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Boost plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Search plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Starter Plugin plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Videopress plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
There was a problem hiding this comment.
Pull request overview
This PR surfaces MCP client attribution for rewindable “Activity Log” events in Jetpack’s backup undo UI and the My Jetpack Backup card, so users can see when an MCP client acted on their behalf.
Changes:
- Extend Jetpack At-a-Glance backup undo event state with MCP attribution fields from the activity actor.
- Update Jetpack Backup Undo card UI to show “via [client] (MCP)” when the actor is an MCP agent.
- Update My Jetpack Backup card summary to append a small MCP “via [client] (MCP)” badge, plus styling, and add changelog entries across affected projects.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/plugins/videopress/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/starter-plugin/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/social/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/search/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/protect/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/jetpack/changelog/mcp-activity-log | Add Jetpack changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/boost/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/backup/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/packages/my-jetpack/changelog/mcp-activity-log | Add changelog entry for MCP client attribution in activity log UI. |
| projects/plugins/jetpack/_inc/client/state/at-a-glance/reducer.js | Persist MCP attribution fields from the last rewindable event actor into Redux state. |
| projects/plugins/jetpack/_inc/client/at-a-glance/backups.jsx | Display “via [client] (MCP)” in the backup undo card when the actor is an MCP agent. |
| projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx | Append MCP attribution badge to the Backup card activity summary when applicable. |
| projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/style.module.scss | Style the MCP attribution badge (smaller, muted text). |
Comments suppressed due to low confidence (4)
projects/plugins/jetpack/_inc/client/state/at-a-glance/reducer.js:176
- The UI is reading the MCP client name from
activity.actor.mcp_client, but the actor metadata produced in this repo usesmcp_client_name(andmcp_client_version) when populating MCP attribution. If the Activity/rewindable endpoints pass those fields through, this will fall back to the generic label and never show the real client name. Consider falling back toactivity.actor.mcp_client_name(and/or combining name+version) whenmcp_clientis missing.
isMcpAgent: activity.actor?.is_mcp_agent ?? false,
mcpClient: activity.actor?.mcp_client ?? '',
projects/plugins/jetpack/_inc/client/at-a-glance/backups.jsx:452
mcpClientis sourced fromactivity.actor.mcp_client, but elsewhere in the codebase MCP attribution is recorded asmcp_client_name/mcp_client_version. If the API response uses those keys, this will always display the generic fallback. Consider readingmcp_client_nameas a fallback whenmcpClientis empty.
{ isMcpAgent
? ' - ' +
sprintf(
/* translators: %s: The name of the MCP client application. */
__( 'via %s (MCP)', 'jetpack' ),
mcpClient || __( 'MCP client', 'jetpack' )
)
: actorRole && ' - ' + actorRole }
projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx:233
- The MCP client string is being read from
lastRewindableEvent.actor.mcp_client, but the MCP actor fields produced in this repo are namedmcp_client_name/mcp_client_version. If the rewindable activity endpoint passes those through, the UI will never show the real client name. Consider falling back toactor.mcp_client_namewhenactor.mcp_clientis missing.
{ lastRewindableEvent.actor?.is_mcp_agent && (
<span className={ styles.mcp_badge }>
{ sprintf(
/* translators: %s: The name of the MCP client application. */
__( 'via %s (MCP)', 'jetpack-my-jetpack' ),
lastRewindableEvent.actor?.mcp_client || __( 'MCP client', 'jetpack-my-jetpack' )
) }
projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/style.module.scss:51
- This introduces a new CSS module class name
mcp_badgeusing an underscore, while other locally-referenced classes in this module use dot-access-friendly naming (e.g.,.backupWarning,.backupErrorContainer,.summary). To keep naming consistent and avoid accidental loader convention issues, consider renaming the class to camelCase (e.g.,.mcpBadge) and updating the JSX accordingly.
.mcp_badge {
margin-inline-start: 0.25rem;
font-size: var(--font-body-extra-small);
color: var(--jp-gray-50);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
...ects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/style.module.scss
Outdated
Show resolved
Hide resolved
When an activity is performed by an MCP client on a user's behalf, display the MCP client name instead of the actor's role in the Jetpack backup undo card and My Jetpack backup card.
- Fall back to actor.mcp_client_name when actor.mcp_client is absent in the reducer and My Jetpack backup card. - Rename .mcp_badge to .mcpBadge for consistency with existing camelCase CSS module class names.
ea6f593 to
e97c9fc
Compare
…tion/backup-card/style.module.scss Move to MCP client to new line Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Significance: minor | ||
| Type: added | ||
|
|
||
| Display MCP client actor in activity log |
There was a problem hiding this comment.
This changelogger entry adds a release note for Search, but this PR doesn’t appear to change any Search code. Please remove this change file unless there are corresponding Search changes; otherwise it will generate an incorrect changelog entry for that project.
| Significance: minor | |
| Type: added | |
| Display MCP client actor in activity log | |
| # This changelog entry was removed because this PR does not include | |
| # corresponding Search plugin code changes. Keeping this file as | |
| # comments prevents it from generating an incorrect Search release note. | |
| # | |
| # (Intentionally left without a valid changelog entry.) |
| Significance: minor | ||
| Type: added | ||
|
|
||
| Display MCP client actor in activity log |
There was a problem hiding this comment.
This changelogger entry adds a release note for Protect, but this PR doesn’t appear to change any Protect code. Please remove this change file unless there are corresponding Protect changes; otherwise it will generate an incorrect changelog entry for that project.
| Significance: minor | |
| Type: added | |
| Display MCP client actor in activity log |
| Significance: minor | ||
| Type: added | ||
|
|
||
| Display MCP client actor in activity log |
There was a problem hiding this comment.
This changelogger entry adds a release note for Boost, but this PR doesn’t appear to change any Boost code. Please remove this change file unless there are corresponding Boost changes; otherwise it will generate an incorrect changelog entry for that project.
| Significance: minor | ||
| Type: added | ||
|
|
||
| Display MCP client actor in activity log |
There was a problem hiding this comment.
This changelogger entry adds a release note for Backup, but this PR doesn’t appear to change any Backup plugin code (the code changes here are in the Jetpack plugin / My Jetpack package). Please remove this change file unless there are corresponding Backup plugin changes; otherwise it will generate an incorrect changelog entry for that project.
| Significance: minor | |
| Type: added | |
| Display MCP client actor in activity log |
projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx
Outdated
Show resolved
Hide resolved
| Significance: minor | ||
| Type: added | ||
|
|
||
| Display MCP client actor in activity log |
There was a problem hiding this comment.
This changelogger entry adds a release note for the VideoPress plugin, but this PR doesn’t appear to change any VideoPress code. Please remove this change file unless there are corresponding VideoPress changes; otherwise it will generate an incorrect changelog entry for that project.
| Significance: minor | |
| Type: added | |
| Display MCP client actor in activity log | |
| # (intentionally left blank; removed invalid VideoPress changelog entry) |
|
I can remove |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx
Outdated
Show resolved
Hide resolved
…tion/backup-card/index.jsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sergeymitr
left a comment
There was a problem hiding this comment.
Works great, thanks for adding this!
Related to https://linear.app/a8c/project/mcp-via-jetpack-activity-log-0c2051df314a/overview
When an activity is performed by an MCP client on a user's behalf, display the MCP client name instead of the actor's role in the Jetpack backup undo card and My Jetpack backup card.
Summary:
is_mcp_agentandmcp_clientfrom the Activity Streams API actor in the Jetpack admin UI.reducer.js-- ExtractisMcpAgentandmcpClientfrom the activity actor into backup undo event state.backups.jsx-- Show "via [client name] (MCP)" instead of the actor role whenisMcpAgentis true.backup-card/index.jsx-- Append an MCP badge to the event summary when the actor is an MCP agent.backup-card/style.module.scss-- Style the MCP badge as smaller, muted text.Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Changelog