Skip to content

feat(mcp): surface the 'author your own operator' posture to the LLM - #342

Open
jeffcrouse wants to merge 1 commit into
mainfrom
mcp-authoring-posture
Open

feat(mcp): surface the 'author your own operator' posture to the LLM#342
jeffcrouse wants to merge 1 commit into
mainfrom
mcp-authoring-posture

Conversation

@jeffcrouse

Copy link
Copy Markdown
Member

Problem

The MCP server already understands the operator library deeply and accurately — list_operators/find_operators/find_params read 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)

  1. 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.
  2. find_operators nudge — a no-match reply now carries an authoring_suggestion pointing at get_operator_authoring_guide + the scaffold tools (and the docstring says so).
  3. 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 on load_project; build failures now surface via get_health.errored_ops; WGSL smoothstep edge-order UB; relaunch if a project op renders black after churn).

Verification

test_mcp_parity + test_mcp_arg_parity PASS; the nudge fires only on count==0 (not when there are matches); the guide returns its six sections; FastMCP accepts instructions.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT

…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
jeffcrouse enabled auto-merge (squash) August 12, 2026 00:40
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.

1 participant