Extending the MCP Server
You can add three capability types to the MCP server: tools, prompts, and resources. There are three ways to implement them: as an app (webhook-based, works in Shopware Cloud), a plugin (in-process PHP, full DAL access), or a Symfony bundle (in-process, always active, no install lifecycle).
Compatibility with earlier Shopware versions
This page describes Shopware 6.7.14.0 and later, where the feature flag is removed, the MCP server is always enabled, and tool groups and toolsets exist.
On a Shopware 6.7 version earlier than 6.7.14.0, enable the server by setting MCP_SERVER=1 in the environment. Those versions have no tool groups, so #[McpToolGroup] does not exist yet and every allowed tool is advertised directly.
Register extension capabilities normally in both cases. The flag controls the MCP server itself; extension services do not need a shopware.feature tag. See Configuration for the full version matrix.
This page is a quick reference. For step-by-step guides, see:
Working examples:
- shopwareLabs/SwagMcpAdminUsers: plugin with tools, prompts, and resources for admin user management
- shopwareLabs/McpHelloWorld: minimal app with tools, prompts, and resources
Tools
Tools let the AI agent call your code to take action or fetch data.
Prompts
Prompts give the AI context and instructions before tool calls start. Return an array of {role, content} message objects.
Resources
Resources expose read-only reference data via a URI without consuming the tool's call budget. Return {uri, mimeType, text}.
Summary
| App | Plugin | Bundle | |
|---|---|---|---|
| Tool | <mcp-tool> in mcp.xml + webhook handler | Attributes + shopware.mcp.tool service tag | Same as plugin |
| Prompt | <mcp-prompt> in mcp.xml + webhook returns message array | #[McpPrompt] class + shopware.mcp.prompt tag | Same as plugin |
| Resource | <mcp-resource> in mcp.xml + webhook returns {uri, mimeType, text} | #[McpResource] class + shopware.mcp.resource tag | Same as plugin |
| Context access | Via source.shopId in webhook body | McpContextProvider::getContext() | Same as plugin |
| DAL access | No (remote process) | Full | Full |
| Lifecycle | App install/update | Plugin install/activate | Always active |