feat(core): add byline management MCP tools#1564
Open
ascorbic wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: bc7c63d The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | bc7c63d | Jun 21 2026, 07:23 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | bc7c63d | Jun 21 2026, 07:23 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | bc7c63d | Jun 21 2026, 07:24 AM |
Add byline_list, byline_get, byline_create, byline_update, byline_delete, and byline_translations tools to the MCP server, and a `bylines` argument on content_create so credits can be attached at creation (previously only content_update accepted them). Reads gate on content:read; writes on content:write + EDITOR role, matching the bylines:manage permission floor. Write tools invalidate the byline cache on success, mirroring the REST routes.
e34ca5d to
bc7c63d
Compare
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
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.
What does this PR do?
Adds byline (author/contributor credit) management to the MCP server, and lets
content_createattach bylines at creation time.New tools (mirroring the taxonomy tool pattern and the REST
/api/admin/bylinesroutes):byline_list— paginated, filter by search / isGuest / userId / localebyline_get— fetch one by idbyline_create/byline_update/byline_deletebyline_translations— locale variants via the shared translation groupcontent_createnow acceptsbylines— previously onlycontent_updatedid, so creating a credited item over MCP took two calls. The handler already supported it; the tool just wasn't forwarding it (and theEmDashHandlerscreate type was missing the field).Authorization: reads gate on
content:read(consistent withcontent_list/taxonomy_list); writes oncontent:write+requireRole(EDITOR), which matches thebylines:managepermission floor and the established menus/taxonomies scope-grant pattern (there is no dedicated byline token scope). Write tools callinvalidateBylineCache()on success, mirroring the REST routes — without it, MCP byline edits would serve stale credits.Input validation reuses the REST zod schemas (
bylineCreateBody/bylineUpdateBody), preserving thehttpUrlguard onwebsiteUrl(rejectsjavascript:/data:URLs).Closes #
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
New
bylines.test.tscovers CRUD round-trips,httpUrlrejection, AUTHOR-denied (INSUFFICIENT_PERMISSIONS),byline_translations, andcontent_createbyline attach on both the draft and publish paths.Try this PR
Open a fresh playground →
A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.
Tracks
feat/mcp-byline-tools. Updated automatically when the playground redeploys.