docs: add mcp tool copilot approval flow - #2524
D.Francos (dfrancos-hub) wants to merge 11 commits into
Conversation
Developer Docs healthcheckStatus: Completed with |
Co-authored-by: dfrancos-hub <98743463+dfrancos-hub@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The critical dryRun issue and several moderate documentation inaccuracies must be corrected.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a Shopware Copilot MCP tool approval-flow guide.
Changes:
- Documents discovery, grouping, and approval behavior.
- Adds plugin and app implementation guidance.
- Includes testing steps, limitations, and publishing guidance.
Review findings include one critical dryRun handling issue, multiple moderate plugin/app accuracy issues, and minor link, wording, and discoverability fixes.
File summaries
| File | Description |
|---|---|
products/tools/mcp-server/copilot-tool-approval.md |
New Copilot MCP approval-flow guide |
Review details
Suppressed comments (5)
products/tools/mcp-server/copilot-tool-approval.md:262
- This relative link has the same path problem as the prerequisite link above: it resolves one directory too high and will not reach
products/tools/mcp-server/index.md. Use./index.md.
Now that your tools follow the approval contract, see [MCP Support in Shopware](../index.md) for the full list of tool, resource, and prompt extension points the MCP server offers.
products/tools/mcp-server/copilot-tool-approval.md:8
- The MCP section's
intro.mdexplicitly lists every page in its “In this section” table, but this new guide is absent, so readers following the section overview cannot discover it. Add a row for this page to that table (and link it from the Copilot entry if desired).
# Making Your MCP Tools Work With Shopware Copilot
products/tools/mcp-server/copilot-tool-approval.md:220
- This privilege guidance applies plugin-only APIs to app tools as well.
requirePrivilege()andMcpToolRequiresare PHP plugin mechanisms; app tools declare<required-privileges>inmcp.xml, and external webhooks must enforce access themselves. Split the instructions so app authors are not told to use unavailable APIs.
* **Privileges are the merchant's** - Copilot acts with the permissions of the merchant who is chatting. Check the privilege your change needs with `requirePrivilege()` and declare it with `McpToolRequires` so that shop administrators can configure roles.
products/tools/mcp-server/copilot-tool-approval.md:48
McpToolGroupapplies to in-process plugin and bundle tools, but app tools cannot declare that PHP attribute; Shopware automatically groups all tools from an active app into a toolset named after the app's technical name (guides/plugins/apps/mcp-server.md:55-57). Because this guide targets apps as well as plugins, the current wording makes app authors look for a group setting that does not exist and omits the actual grouping rule.
* **Group name** - Tools that share a `McpToolGroup` become one toolset. Use a short, stable, product-specific name such as `b2b-quotes` rather than a generic one like `tools`.
products/tools/mcp-server/copilot-tool-approval.md:145
- The class is declared in
Vendor\MyExtension\Mcp\Tool, so the unqualifiedPromotionServicetype resolves toVendor\MyExtension\Mcp\Tool\PromotionService; no such service is imported or defined in this example. Unless the domain service is intentionally in that namespace, the advertised complete tool will not compile. Import the actual service class and use the same class in the DI registration.
public function __construct(
private readonly PromotionService $promotions,
private readonly McpContextProvider $contextProvider,
- Files reviewed: 1/1 changed files
- Comments generated: 8
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Update version information for Shopware Copilot functionality. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Clarified the description of the write tool example to specify its use in a plugin and adherence to Shopware's standards. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Update response size handling and clarify idempotent commits. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Clarified the limitations of the `dryRun` contract for tools that change data without meaningful previews. Updated guidance on publishing such tools without merchant approval. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Clarify handling of 'dryRun' property in webhook tools. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Adds a guide to make MCP tools recognized by Copilot and how to create approval flows.
Checklist
PageRefreferences where relevant..gitbook.yamlif pages were moved, renamed, or deleted..wordlist.txt(and sorted it) if spellcheck flags new legitimate terms.