Skip to content

feat(mcp): media tools over an optional provider media facet + registry publish fix#75

Merged
ABB65 merged 1 commit into
mainfrom
feat/mcp-media-tools
Jul 13, 2026
Merged

feat(mcp): media tools over an optional provider media facet + registry publish fix#75
ABB65 merged 1 commit into
mainfrom
feat/mcp-media-tools

Conversation

@ABB65

@ABB65 ABB65 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Phase 3 of the MCP Cloud roadmap — the upstream half of the media stack: a MediaProvider capability contract in @contentrain/types and five contentrain_media_* tools in @contentrain/mcp, registered only when the provider exposes a media facet. Also fixes the release CI failure from the last train (MCP Registry rejected server.json's description: limit is 100 chars, ours was 139).

Four-package minor (changeset included): types, mcp, rules, skills.

The contract (@contentrain/types)

MediaProviderlist / get / ingest / update / delete — plus MediaAsset, MediaListOptions, MediaListResult, MediaIngestInput, MediaUpdateInput. RepoProvider gains media?: MediaProvider. Studio implements this in createStudioGitProvider by delegating to its media service layer; Local/GitHub/GitLab providers leave it absent.

The tools (@contentrain/mcp)

Tool Annotation highlights
contentrain_media_list read-only; search/tag/cursor pagination
contentrain_media_get read-only
contentrain_media_ingest URL-based (MCP has no binary channel); the only openWorldHint: true tool — provider owns SSRF/MIME/size policy
contentrain_media_update metadata only (alt/tags/filename), idempotent
contentrain_media_delete destructiveHint: true, requires confirm: true; content references are NOT rewritten
  • Capability-aware: new media requirement in TOOL_REQUIREMENTS gates on RepoProvider.media presence — local stdio servers still list exactly the 19 core tools, so nothing changes for existing users. Community Edition never sees media tools; no ee-boundary code needed.
  • Deterministic passthrough: agent decides, provider executes; MCP makes no content/media decisions.
  • Closes the discovery loop: media_list → pick media/... path → content_save (normalized to delivery URLs via mediaBaseUrl).

Release CI fix

The Publish to MCP Registry step failed on main: 422 — expected length <= 100 for body.description. Shortened to 93 chars, and added tests/registry-manifest.test.ts (description ≤ 100, mcpName parity, npm identifier parity) so the next violation fails in CI before merge, not at publish time. npm 1.9.0 published fine; the registry listing heals on this PR's release train.

Parity chain

  • @contentrain/rules: MCP_TOOLS → 24, essentials guardrails document the media flow (16/16)
  • @contentrain/skills: references/mcp-tools.md Media Tools section (85/85 incl. heading parity)
  • Docs: counts updated to “24 (19 core + 5 media)” across root README + docs site; one stale “17 tools” fixed

Testing

10 new media tool tests (facet passthrough, SSRF-policy error surfacing, schema-level url/confirm guards, absent-facet ⇒ not listed + unknown-tool error), availability tests extended for the facet, 3 manifest checks. Full MCP suite: 675 passed (one pre-existing branch-lifecycle 30s-timeout flake under full parallel load — passes in isolation, file untouched by this diff). oxlint 0/0; tsc clean in types/mcp; CLI compiles against the new types.

Studio follow-ups (their repo)

  • Implement media facet on the loopback provider (service layer, not HTTP round-trips through own REST)
  • Exclude contentrain_media_* from the brain-invalidation/automerge write set (media writes don't touch the content branch)
  • Scope model for MCP Cloud keys before advertising media:read/write

🤖 Generated with Claude Code

Close the media discovery loop for external agents: list assets, pick a
media/... path, reference it via contentrain_content_save.

- types: MediaProvider contract (list/get/ingest/update/delete) +
  MediaAsset/MediaListOptions/MediaListResult/MediaIngestInput/
  MediaUpdateInput; RepoProvider gains optional media?: MediaProvider
  facet (Studio MCP Cloud implements it; Local/GitHub/GitLab do not)
- mcp: 5 new tools (contentrain_media_list/get/ingest/update/delete) as
  deterministic passthrough in src/tools/media.ts; registered only when
  the facet is present via a new media requirement in TOOL_REQUIREMENTS —
  local stdio servers keep listing exactly the 19 core tools. Ingest is
  URL-based (no binary channel in MCP); the provider owns SSRF/MIME/size
  policy, and media_ingest is the only openWorldHint: true tool.
  media_delete is destructive and requires confirm: true.
- rules: MCP_TOOLS 19 -> 24, essentials document the media flow
- skills: Media Tools section in references/mcp-tools.md (parity-tested)
- docs: tool counts updated to 24 (19 core + 5 media) across README/docs
  site; stale '17 tools' mention fixed in embedding guide
- fix(release): shorten server.json description to 93 chars — the MCP
  Registry publish step failed on main with 'expected length <= 100';
  new tests/registry-manifest.test.ts pins the limit plus mcpName/npm
  identifier parity so this class of failure is caught pre-merge

Tests: 10 new media tool cases (passthrough, SSRF policy surfacing,
schema-level confirm/url guards, absent-facet behavior), availability
tests updated for the media facet, 3 registry-manifest checks. Full MCP
suite 675 passed (1 pre-existing branch-lifecycle timeout flake under
parallel load — passes in isolation); rules 16/16, skills 85/85,
oxlint 0/0, tsc clean in types/mcp, CLI compiles against new types.
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for contentrain-ai ready!

Name Link
🔨 Latest commit f5c70eb
🔍 Latest deploy log https://app.netlify.com/projects/contentrain-ai/deploys/6a54b5f3525bc6000879616e
😎 Deploy Preview https://deploy-preview-75--contentrain-ai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ABB65
ABB65 merged commit 11086b2 into main Jul 13, 2026
6 checks passed
@ABB65
ABB65 deleted the feat/mcp-media-tools branch July 13, 2026 10:00
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant