Skip to content

Activity Log: Surface MCP client attribution#47429

Merged
eoigal merged 10 commits intotrunkfrom
add/mcp-agent-activity-log-attribution
Mar 16, 2026
Merged

Activity Log: Surface MCP client attribution#47429
eoigal merged 10 commits intotrunkfrom
add/mcp-agent-activity-log-attribution

Conversation

@eoigal
Copy link
Contributor

@eoigal eoigal commented Mar 3, 2026

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:

  • Surface is_mcp_agent and mcp_client from the Activity Streams API actor in the Jetpack admin UI.
  • When a site change was made by an MCP client, the backup undo card now shows "via [client name] (MCP)" instead of the user's role, making it clear that an AI/MCP tool acted on the user's behalf.
  • Adds a subtle MCP badge to the My Jetpack backup card summary when the last rewindable event was performed via an MCP client.
  1. reducer.js -- Extract isMcpAgent and mcpClient from the activity actor into backup undo event state.
  2. backups.jsx -- Show "via [client name] (MCP)" instead of the actor role when isMcpAgent is true.
  3. backup-card/index.jsx -- Append an MCP badge to the event summary when the actor is an MCP agent.
  4. backup-card/style.module.scss -- Style the MCP badge as smaller, muted text.

Proposed changes:

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Trigger an activity via an MCP client (e.g. create/update a post using Bruno or WordPress MCP Connector).
  • In Jetpack > At a Glance, verify the backup undo card shows "via [client name] (MCP)" next to the actor name.
  • In My Jetpack, verify the backup card shows a small "via [client name] (MCP)" badge after the event summary.
  • Perform a normal (non-MCP) activity and verify the actor role still displays as before.

Changelog

  • Generate changelog entries for this PR (using AI).

Copilot AI review requested due to automatic review settings March 3, 2026 14:03
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/mcp-agent-activity-log-attribution branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/mcp-agent-activity-log-attribution

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. Admin Page React-powered dashboard under the Jetpack menu labels Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: March 31, 2026
    • Code freeze: March 31, 2026

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.

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Mar 3, 2026
@eoigal eoigal changed the title Activity Log: Surface MCP client attribution in backup undo UI Activity Log: Surface MCP client attribution Mar 3, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 uses mcp_client_name (and mcp_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 to activity.actor.mcp_client_name (and/or combining name+version) when mcp_client is missing.
				isMcpAgent: activity.actor?.is_mcp_agent ?? false,
				mcpClient: activity.actor?.mcp_client ?? '',

projects/plugins/jetpack/_inc/client/at-a-glance/backups.jsx:452

  • mcpClient is sourced from activity.actor.mcp_client, but elsewhere in the codebase MCP attribution is recorded as mcp_client_name/mcp_client_version. If the API response uses those keys, this will always display the generic fallback. Consider reading mcp_client_name as a fallback when mcpClient is 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 named mcp_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 to actor.mcp_client_name when actor.mcp_client is 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_badge using 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.

@jp-launch-control
Copy link

jp-launch-control bot commented Mar 3, 2026

Code Coverage Summary

This 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. 🤷

Full summary · PHP report · JS report

eoigal added 3 commits March 7, 2026 09:28
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.
@eoigal eoigal force-pushed the add/mcp-agent-activity-log-attribution branch from ea6f593 to e97c9fc Compare March 7, 2026 09:30
Copilot AI review requested due to automatic review settings March 7, 2026 09:30
…tion/backup-card/style.module.scss


Move to MCP client to new line

Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com>
@eoigal eoigal requested a review from sergeymitr March 7, 2026 09:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1 to +4
Significance: minor
Type: added

Display MCP client actor in activity log
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.)

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
Significance: minor
Type: added

Display MCP client actor in activity log
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
Significance: minor
Type: added
Display MCP client actor in activity log

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
Significance: minor
Type: added

Display MCP client actor in activity log
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
Significance: minor
Type: added

Display MCP client actor in activity log
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
Significance: minor
Type: added
Display MCP client actor in activity log

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
Significance: minor
Type: added

Display MCP client actor in activity log
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
Significance: minor
Type: added
Display MCP client actor in activity log
# (intentionally left blank; removed invalid VideoPress changelog entry)

Copilot uses AI. Check for mistakes.
@eoigal
Copy link
Contributor Author

eoigal commented Mar 7, 2026

I can remove /at-a-glance/backup but figured might as well leave it in case it's ever introduced again?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 7, 2026 09:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

eoigal and others added 2 commits March 7, 2026 09:42
…tion/backup-card/index.jsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 7, 2026 09:45
eoigal and others added 2 commits March 7, 2026 09:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@sergeymitr sergeymitr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thanks for adding this!

@eoigal eoigal merged commit 394e930 into trunk Mar 16, 2026
90 checks passed
@eoigal eoigal deleted the add/mcp-agent-activity-log-attribution branch March 16, 2026 22:22
@github-actions github-actions bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] UI Changes Add this to PRs that change the UI so documentation can be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants