Repository navigation
feat(mcp): expose the Action Center through the MCP server - #902
Merged
Merged
Conversation
An agent connected over MCP could read a brand's visibility but not what the product thinks should be done about it, or whether past work helped. Read tools: - list_actions: actions with category, kind, impact, status, outcome, assignee, due date and task progress; filter by status or category. - get_action: one action in full, with payload, triggering signals, tasks (including each task's mode and permission) and event trail. - list_signals: detected signals with previous, current and change values; filter by status or kind. - list_action_history: completed or dismissed actions with their outcome and the before/after values the validation sweep measured. Write tool: - update_task_status: in_progress, completed, skipped (reason required) or failed. It checks ownership before writing, logs a task_status event under the API key's user and bumps the action's updated stamp, the same as the dashboard. It records progress and never carries a task out. Each tool has a REST mirror under /api/mcp/, and the docs table lists the new tools. Closes #832
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An agent connected over MCP could read a brand's visibility, but not what the product thinks should be done about it, or whether past work helped. This adds the Action Center to the MCP server: four read tools and one narrowly scoped write.
list_actionsget_actionlist_signalslist_action_historyupdate_task_statusin_progress,completed,skipped(withskip_reason) orfailed.Details
lib/mcp/data.tsthat checks the brand or action belongs to the API key's org;registerToolcall inlib/mcp/server.ts;/api/mcp/(actions,actions/[id],signals,action-history,action-tasks/[id]/status).kindis returned as an opaque string, as the issue asks.update_task_statusfollows the same rules as the dashboard:task_statusevent under the key's user.updated_atmoves.get_actionreturns it. Signal payloads are small (p95 ≈ 0.5 KB), solist_signalsincludes them.modeandpermissionare returned exactly as stored. The issue described them asmanual/agentandnone/approval, but the live constraints aresystem | agent | human | human_or_agentandread | write | execute. Theget_actiondescription uses the real values.!innerownership filter onaction_tasks → actions → brandswas checked read-only against the live database: it finds a task for the owning org and returns null for any other.docs/guides/mcp-server.mdxlists the five new tools.Related issue
Closes #832
Type of change
feat— New featureHow to test
With an
ans_API key from Settings:Or connect Claude Desktop or Claude Code and ask for a brand's open actions.
lib/mcp/action-center.test.tscoversupdate_task_status:skip_reasonis cleared for other statuses.Checklist
yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)yarn test(377 passed) andyarn buildpass🤖 Generated with Claude Code