Read-only AI in Magento 2: separating MCP permissions by Store View

4 min read

Silver lock separating access to two store views marked with mint and violet accents

An assistant analyzing the catalog for one store view needs a clearly defined role and data scope. Kowal MCP Server for Magento 2 can separate reading from write operations and restrict supported functions to permitted views. Acceptance testing should cover both a successful read and an attempted action outside the assigned scope.

Start with one task and a separate AI client

An example task is: “Inspect catalog data for the Polish Store View and list missing descriptions.” That task does not require access to orders, customer details, newsletters, or product writes. An administrator should select the tools and role permissions assigned to the AI client accordingly.

“Catalog PL” in this guide is a suggested organizational name, not a built-in profile. Choose your own name and record the permitted operations and views. A separate client lets you inspect and revoke its sessions independently of other integrations.

The earlier Kowal MCP Server guide covers editorial tasks and change verification. Here, the focus is the boundary of read access itself.

Separate operation permissions from Store View scope

A permission establishes whether a client may perform an operation. Scope establishes the view or other supported area in which it may do so. Reading one Store View’s catalog should not automatically provide write operations or access to the store’s other data.

Magento has a scope hierarchy and value inheritance. A shared SKU or a value inherited from default settings does not by itself establish a permission error. See the Magento and Adobe Commerce scope documentation. A Store View is not a separate copy of the complete store database.

Match restrictions to the specific MCP function. Media or category tools may require a folder or root restriction, while global data needs separate permissions. A language code in an AI prompt does not configure these server-side rules.

Before adding a tool to a role, confirm that its reads enforce the required scope. A filter selects data; an out-of-scope test verifies the access boundary. If the installed version does not provide the required restriction for a particular tool, leave that tool out of the role that needs this boundary.

Check the current tool contract before testing

The tools and actions available to a client depend on the module version, enabled components, and assigned role. Inspect them through the connection being used. The same parameter name may occupy different positions in different tools’ arguments.

For example, the verified get_products contract places the store view identifier in filters.store_id. These are example read arguments, using a fictional store number and a SKU to replace with test fixture data:

{
  "filters": {
    "sku": {"eq": "PUBLIC-SAMPLE-SKU"},
    "store_id": 10
  },
  "limit": 1
}

This illustrates tool arguments, rather than a complete authenticated request or a promise of the same schema in every version. Record the tool name, argument structure, and integration version used during acceptance testing. An invalid-arguments response identifies a contract problem; it does not by itself prove access restrictions work.

Test allowed reads and rejected actions

In a test environment, prepare a product with an easily recognized value in a Store View-scoped field. Give the two views different explicit values so the correct context can be distinguished from inheritance. The numbers 10 and 20 below are fictional. This matrix is an acceptance plan, not a report of tests performed on your store.

Example roleTestExpected result after configuration
Catalog PL: read view 10get_products for view 10Allowed read, with the fixture value for the correct view
Catalog PL: read view 10Request the same product for view 20Denied without exposing data from the prohibited scope
Catalog PL: no writesAttempt action prepare_description_updateDenied preparation of an operation requiring write permission
Catalog EN: read view 20get_products for view 20Allowed read within the second, separate role

Also test omitting the store view parameter. The result should follow the documented default-scope rule and the client’s permissions. You need explicit behavior that does not expand reads to all views. Verify global scope as a separate case if the tool supports it.

Perform write-related trials against test data as a check that a restricted role is denied. Role configuration and invocation results should describe the same boundary. Hiding an action in the interface does not replace server-side validation.

Keep an acceptance record and check a new session

Record the role, permitted operations, view identifier, test, and observed result. Include the recognized fixture value or the denial result. Leave out tokens, passwords, and authentication credentials. An administrator replaces the example store number; it should not be copied as your own store’s setting.

After changing a role, recheck tool discovery and access through a new client session. Test access revocation separately. A conversational instruction grants no additional permissions, and change-approval policy does not replace read restrictions.

Explore Kowal MCP Server for Magento 2 and start with a role whose boundary you can establish through one successful read and a clear denial outside it.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)