Repository navigation
Publish every tool, command, filter and adjustment over MCP - #80
Merged
Merged
Conversation
The server exposed five generic invokers and a `describe` call that listed what they could be pointed at. That put a caller two round trips away from doing anything and left parameters undiscoverable: nothing in the tool list said `apply_filter` takes a `radius` of 0..250 for one id and a `cell_size` for another. The registry is already a catalog, so project it straight into MCP. One tool per canvas tool, menu command, filter and adjustment -- 254 of them -- each carrying the label, range, default, unit and choices the options bar or dialog would have shown. A third-party plugin is published the same way, because it comes through the same registry. Metadata the generated text could not invent was added where it was missing. `Command` gains a description: "Grow" is a menu label and says nothing to a caller that cannot see the menu around it. `ToolPlugin` gains one too, defaulted so plugins outside this repo still compile. Filters and adjustments needed no new fields -- `FilterParam` and `param_specs` already carry the ranges -- and adjustment flags are read and written through the serialized form, so an adjustment that grows a checkbox gets it published without further work. `describe` is gone with the invokers. Its codec list is now in the create_session and save descriptions, its blend modes are an enum on set_layer_props, and its Photoshop diagnostics are the photoshop_plugins tool: the plug-ins that loaded are filters now, so what is left to report is the ones that did not. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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
tools/listno longer advertises five generic invokers plus adescribecall to find out what they can be pointed at. Every installed feature is published as its own MCP tool, with its own typed, documented parameters, built from the same plugin registry the app assembles its menus from.filter_*tool_*cmd_*adjust_*paramsescape hatch for curve points / gradient stops / per-range tablesget_state,tool_stroke/tool_input, layer props,render,save/export,photoshop_pluginsSample of what a client now sees without a second call:
Structures extended
Commandgained adescription— a menu title ("Grow", "Similar") says nothing to a caller that cannot see the menu around it. All 34 core commands got one written.ToolPlugingained a defaulteddescription(), implemented for all 55 tools (per-mode text for the 14 paint modes, 3 lassos, 4 shapes…). Defaulted so plugins built outside this repo still compile.FilterParamandParams::param_specs()already carry ranges and defaults, and adjustment flags are read/written through the serialized form, so an adjustment that grows a checkbox is published without further work.Removed
describe,select_tool,set_tool_options,run_command,apply_filter,apply_adjustment. Nothingdescribereported is lost: codec extensions are in thecreate_session/savedescriptions, blend modes are an enum onset_layer_props, and the Photoshop diagnostics survive as thephotoshop_pluginstool (the plug-ins that loaded are filters now; what is left to report is the ones that did not).Notes for review
docs/mcp.mdrather than silently capped. The biggest single contributor istool_type'stype-familyenum, which is every installed font.filter_add_noise'smonochromepublishes asnumber [0..1]rather than a boolean, faithfully:FilterParamhas no toggle kind, so inferring one would be guesswork. Worth a follow-up if we want it typed.Verification
cargo build --workspace --all-targets— cleancargo test --workspace— passes, including 9 new tests (name uniqueness and validity, every published name dispatches, filter params published, choices reaching filters as indices, tool select+configure in one call, adjustment flags and sliders together, collision numbering)cargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --all --check— clean🤖 Generated with Claude Code