feat(mcp): surface the 'author your own operator' posture to the LLM - #342
Open
jeffcrouse wants to merge 1 commit into
Open
feat(mcp): surface the 'author your own operator' posture to the LLM#342jeffcrouse wants to merge 1 commit into
jeffcrouse wants to merge 1 commit into
Conversation
…ing LLM The MCP already gives a deep, accurate, LIVE view of the operator library (list_operators/find_operators + per-param semantic hints) and has the full authoring loop (scaffold/build/reload). What it did NOT do was tell the client LLM WHEN to author — so an agent that couldn't find a fitting built-in would force-fit one instead of writing a new op, exactly counter to Vivid's north star (built-ins are examples; the plumbing to author your own is the product). Three additions, all in the bridge (pure Python, no control-server change, parity unaffected): - FastMCP `instructions=`: server-level posture — authoring is first-class and the encouraged default when a built-in doesn't match the intent; the discover -> author -> compose -> verify workflow. - find_operators: a no-match reply now carries an `authoring_suggestion` pointing at get_operator_authoring_guide + the scaffold tools (docstring too). - get_operator_authoring_guide(): a new guide — when to author vs reuse, the two op kinds (C++/GPU vs WGSL/GLSL shader), the scaffold->build->reload loop, and the real gotchas (project ops ship with the project + compile on load_project; build failures now surface via get_health.errored_ops; WGSL smoothstep UB; relaunch if a project op renders black after churn). Verified: MCP + arg parity PASS; the nudge fires only on count==0; the guide returns its six sections. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT
jeffcrouse
enabled auto-merge (squash)
August 12, 2026 00:40
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.
Problem
The MCP server already understands the operator library deeply and accurately —
list_operators/find_operators/find_paramsread the live registry with per-param semantic hints (intent/tag/unit), and the full authoring loop exists (scaffold_operator_package,scaffold_project_shader_operator,build_/reload_operator_package,clone_operator). What was missing: it never told the driving LLM when to author. So an agent that couldn't find a fitting built-in would force-fit one — the opposite of Vivid's north star (built-ins are teaching examples; the plumbing to author your own is the product).Change (bridge-only, pure Python — no control-server change, parity unaffected)
FastMCP(instructions=…)— server-level posture the client sees up front: authoring is first-class and the encouraged default when a built-in doesn't match intent; the discover → author → compose → verify workflow.find_operatorsnudge — a no-match reply now carries anauthoring_suggestionpointing atget_operator_authoring_guide+ the scaffold tools (and the docstring says so).get_operator_authoring_guide()— a new guide: when to author vs reuse, the two op kinds (C++/GPU vs WGSL/GLSL shader), the scaffold→build→reload loop, and the real gotchas (project ops ship with the project and compile onload_project; build failures now surface viaget_health.errored_ops; WGSLsmoothstepedge-order UB; relaunch if a project op renders black after churn).Verification
test_mcp_parity+test_mcp_arg_parityPASS; the nudge fires only oncount==0(not when there are matches); the guide returns its six sections;FastMCPacceptsinstructions.🤖 Generated with Claude Code
https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT