Skip to content

plugin: wrap .mcp.json in mcpServers and document Grok Build install - #1100

Merged
Zach Dunn (zachdunn) merged 2 commits into
mainfrom
cursor/plugin-grok-marketplace-compat-a08d
Oct 8, 2026
Merged

Zach Dunn (zachdunn) merged 2 commits into
mainfrom
cursor/plugin-grok-marketplace-compat-a08d

Conversation

@zachdunn

@zachdunn Zach Dunn (zachdunn) commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Prep for listing the uploads plugin in the xAI plugin marketplace (Grok Build). This is step 1, in this repo only. After it merges, a catalog PR to xai-org/plugin-marketplace pins the commit SHA. That catalog change is not in this pull request.

What it does

  • Wraps plugins/claude/uploads/.mcp.json in mcpServers. xAI's catalog scanner reads that key and reports zero MCP servers for the flat form. Claude Code loads both shapes. The server is still https://agents.uploads.sh/mcp.
  • Resolves the pre-PR screenshot hook from ${GROK_PLUGIN_ROOT:-${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}, so Grok Build, Codex, and Claude Code each find the plugin root. Matcher Bash, PreToolUse, the 15s timeout, and the status message stay. pre-pr-screenshot.sh is unchanged: if uploads is on PATH it runs uploads hook pre-pr-screenshot, otherwise it exits 0.
  • Rewrites the plugin README for a coding agent: Claude Code and Grok Build install sections (Grok worded as submitted, as uploads), an Apache-2.0 license section, and a direct description of what the hook does.

What it is not

  • Not a catalog entry. Nothing in xai-org/plugin-marketplace changes here.
  • Not a hook removal. The PreToolUse reminder and the Claude Code staged-media mod (hooks/register.tsx) both stay.
  • Not a Codex directory listing. Codex plugins with lifecycle hooks are desktop/manual only. This change only prefers Codex's PLUGIN_ROOT in the path cascade.
  • Not an npm publish. No changeset. The plugin version stays 0.4.0.

Hooks, on purpose

The Bash matcher can only key the tool name, so the hook starts before Bash commands. The filter is inside the CLI: the script acts only on gh pr create. It runs the local uploads CLI and does nothing if the CLI is missing or not signed in. UPLOADS_HOOK_DISABLE=1 turns it off.

The plugin root cascade is GROK_PLUGIN_ROOT, then Codex-native PLUGIN_ROOT, then CLAUDE_PLUGIN_ROOT. Codex also aliases CLAUDE_PLUGIN_ROOT, so the previous form already ran there. Preferring PLUGIN_ROOT keeps the path on Codex's own variable.

hooks/register.tsx is a Claude Code mod (the band above the prompt). It needs Claude Code 2.1.287 or later. It is not the portable hooks contract Grok Build runs.

Other plugins already listed in the xAI marketplace ship hooks. Railway uses this same PreToolUse + Bash pattern. Vercel ships SessionStart, PostToolUse, and SessionEnd. Superpowers ships SessionStart.

The path sits in the shell command, not an args array. Claude Code treats a present args array as exec form and does not run a shell, so ${VAR:-fallback} would be a literal filename there. Grok Build reads command only and runs it with sh -c, which expands the fallback. Railway's marketplace hook uses that same shell form.

How to try it

From a checkout of this branch, in Claude Code:

claude --plugin-dir plugins/claude/uploads

The uploads HTTP server should show up in claude mcp list. Claude Code is not installed in the environment that prepared this branch, so that check is still open.

Test plan

  • .mcp.json parses, and mcpServers.uploads is the HTTP server at https://agents.uploads.sh/mcp
  • The hook command expands to GROK_PLUGIN_ROOT, then PLUGIN_ROOT, then CLAUDE_PLUGIN_ROOT
  • pre-pr-screenshot.sh exits 0 when uploads is not on PATH, and execs uploads hook pre-pr-screenshot when a stub CLI is
  • claude plugin validate plugins/claude/uploads (a missing version-pin warning is expected and fine)
  • After merge, the catalog PR pins this SHA
Open in Web Open in Cursor 

Prepare the agent plugin for the xAI catalog scanner. Nest the hosted
MCP server under mcpServers, resolve the pre-PR hook from
GROK_PLUGIN_ROOT with a Claude Code fallback, and document the Grok
Build install plus the hook's security contract.

Co-authored-by: Zach Dunn <zachdunn@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2fe9ecc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e84e2960-16ac-4c47-9d91-eb449bf8e82d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zachdunn
Zach Dunn (zachdunn) marked this pull request as ready for review October 8, 2026 15:02
Resolve the pre-PR screenshot script from GROK_PLUGIN_ROOT, then
PLUGIN_ROOT, then CLAUDE_PLUGIN_ROOT, still as a shell command so the
fallback expands.

Co-authored-by: Zach Dunn <zachdunn@users.noreply.github.com>
@zachdunn
Zach Dunn (zachdunn) merged commit a6f424c into main Oct 8, 2026
3 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the cursor/plugin-grok-marketplace-compat-a08d branch October 8, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants