Skip to content

refactor: an operation module brings the MCP tools of its operations - #126

Open
endrix wants to merge 3 commits into
mainfrom
refactor/mcp-tools-from-toolkit
Open

endrix wants to merge 3 commits into
mainfrom
refactor/mcp-tools-from-toolkit

Conversation

@endrix

@endrix endrix commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Phase 5 of the declutter plan, first step: the pieces of the agent surface that are a product's, not the platform's, and need no product repo change. Cut from main; independent of the other open PRs (only CHANGELOG.md can conflict).

The seam

DiagramOperationModule (diagram-server operation-modules.ts) gains an optional, add-only configureMcpTools(binding: McpToolBinding). DiagramMcpModule takes the profile's EditStrategy (server-module.ts hands it options.edits) and narrows it once: on 'read-only' it drops the platform's mutating tools (create-nodes, create-edges, modify-nodes, modify-edges, delete-elements, save-model), since no writing operation handler exists to serve them; otherwise, after the platform's own tools, each operation module adds the MCP tools of the operations it handles. The hardcoded binding.add(CreateTaskTypeMcpToolHandler) is gone from the platform, and so is the handler: create-task-type-mcp-tool-handler.ts and its test now live in the sidecar toolkit beside create-task-type-handler.ts (the toolkit already imports @eclipse-glsp/server and inversify the same hoisted way). Every sidecar product therefore offers create-task-type exactly as before; a library-mode consumer that registers no such handler, and a read-only profile, no longer advertise a tool that could only fail.

The prose

  • acp-client.ts sent, to any product whose profile named no chat.skill, a fallback that listed wfpy's tools (list_task_types, validate_workflow, "edit the generated @task class"). Every in-tree consumer names a skill, so this was dead for them and wrong for anyone else. A profile without a skill now gets the framing sentence alone.
  • The diagram-tool hint in chat-runtime.ts said "scaffolding a brand-new task type ... create-task-type"; it now names the platform's tools and "whatever further diagram tools are listed", promising no tool a product may not have (the review's point). The two context builders append the skill through one withSkill.
  • Two comments calling the source "the .py file" say "the source file".

Tests

create-task-type-mcp-tool.test.ts (now in the toolkit): a bare DiagramMcpModule offers no create-task-type; one given the sidecar operation modules does; a read-only one offers neither it nor any mutating platform tool, and still offers query-elements. operation-modules.test.ts: the toolkit's module brings exactly that tool. extension-core suite green (no test pinned the fallback prose).

Typecheck 5/5, neutrality 5/5, the extension build (CI's npm run build) green locally.

Next steps of phase 5 need the products first and are listed in the plan: wfpy and streamblocks declaring their palette rows and navigation explicitly before the platform drops its defaults; a run block on the profile before the run driver becomes opt-in; the agent-node stack behind a property-section seam.

https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv

Phase 5, first step: the product-specific agent surface leaves the
core. DiagramOperationModule.configureMcpTools is the seam; the diagram
MCP module binds what the profile's modules offer instead of naming
create-task-type itself, and the sidecar toolkit's module brings that
tool with the handler that serves it. A library-mode consumer without
the handler no longer advertises a tool it cannot run.

The chat's fallback "skill" (wfpy's tool list and nouns, sent to the
agent of any product whose profile named no skill) is gone: such a
profile gets the framing alone. The diagram-tool hint and two comments
no longer speak of task types and `.py` files as the platform's own.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The scaffold tool lives in the toolkit beside the handler that serves
it; the platform package ships no product tool. The seam is add-only
and typed, the MCP module narrows the edit strategy once, and a
read-only diagram offers no mutating tool at all, since nothing handles
one there. The diagram-tool hint names the platform's tools and
"whatever further diagram tools are listed", promising no scaffold the
product may not have; the chat's two context builders append the skill
through one helper.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The MCP DI test counted create-task-type among a bare server module's
tools; it now comes with the product's operation module.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
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