When to use this
Use the Inspector when an AI reports something vague like “Authorization failed” and you need to see why. It surfaces the real HTTP responses behind the OAuth handshake and lets you list and call tools with a token. Run the connection checker first — if endpoints are unreachable or redirecting, fix that before reaching for the Inspector.
It runs on your machine. The Inspector is a local web UI — your store address and any token stay on your computer and never reach a third party.
Before you start
- Node.js 22.7.5 or newer. Check with
node --version; the Inspector refuses older versions. - Your MCP server URL — the same
https://your-store.com/mcpyou'd give the AI. - For the OAuth flow: a Magento admin login. You'll register an OAuth client for the Inspector in step 1 below — no client is needed up front.
- For the bearer-token flow: a token minted for your admin user.
Launch the Inspector
From a terminal, run:
npx @modelcontextprotocol/inspector
It prints a local web UI address (usually http://localhost:6274) and opens it in your browser, with a one-time session token pre-filled.
Path A — Verify the OAuth sign-in
This is the same flow an AI like Claude (web) uses. The server doesn't register clients automatically, so you first create an OAuth client for the Inspector in your Magento admin, then hand its Client ID and Secret to the Inspector.
-
Register the Inspector as an OAuth client
In your Magento admin, go to System → MCP → OAuth Clients and click Add New Client. Give it a Name (e.g. MCP Inspector) and set Redirect URIs to the Inspector's callback — exactly this, one line, no trailing slash:
http://localhost:6274/oauth/callbackIt must match character-for-character (
http://localhostis allowed here precisely for local tools like this). Leave Auth Mode on Personal, open the Allowed Tools tab and grant some tools, then click Save Client. -
Copy the Client ID and Client Secret
After saving, copy the Client ID and the Client Secret. The secret is shown only once — if you lose it, use Rotate Secret to generate a new one (the Client ID stays the same).
-
Enter the credentials in the Inspector
Set Transport Type to Streamable HTTP and URL to your
https://your-store.com/mcpaddress. Expand Authentication and, under OAuth 2.0 Flow, paste the Client ID and Client Secret. Confirm Redirect URL readshttp://localhost:6274/oauth/callback— the Inspector's default, which must match what you registered. You can leave Scope blank (it defaults tomcp:read); the scope string only hints the consent screen — what the token can actually do is set by the tools you grant in Allowed Tools and the store's Allow Write Tools setting, not by this field. -
Connect and approve
Click Connect. You're sent to your store's consent screen — sign in with your Magento admin account if prompted, review the tools, and approve. You're redirected back, the connection turns green, and the Tools tab lists what the client can use. That confirms discovery, consent, the token exchange and the authenticated call all work.
If it fails here, the failure is visible. The Inspector shows the failing request and response — a redirect on the token exchange, a 401, or a wrong callback URL — instead of the generic message an AI app shows. Compare what you see against the table at the bottom of this page.
Path B — Verify a bearer token
Use this to confirm a token works and to see which tools it can reach, without the OAuth round-trip.
-
Mint a token
Create a token for your admin user. With CLI access to the store:
bin/magento magebit:mcp:token:create --admin-user=<your-username> --name=inspectorCopy the plaintext token from the output — it's shown only once.
-
Connect with the token
Set Transport Type to Streamable HTTP, enter your
/mcpURL, and paste the token into the Authentication field (the Inspector sends it asAuthorization: Bearer <token>). Click Connect. -
List and call tools
Open the Tools tab — it loads on connect. Pick a tool and run it with sample arguments to confirm an end-to-end call returns data. Every call is recorded in System → MCP → Audit Log.
A short tool list isn't a bug. The core module ships the system.* tools (cache, indexes, store info, config); domain tools — orders, catalog, customers, CMS — come from the add-on modules. The list reflects what you granted in Allowed Tools and what your admin role permits, so a narrow list means a narrow grant, not a broken connection.
Self-signed certificates (local / dev stores)
If your store uses a self-signed HTTPS certificate, the Inspector's Node proxy will refuse the connection. Disable certificate checking for that one process only:
NODE_TLS_REJECT_UNAUTHORIZED=0 npx @modelcontextprotocol/inspector
Dev only. This turns off all certificate validation in the Inspector's Node process. Never export it globally or use it in CI, and never against a production store.
Reading the failures
- Connect bounces or the token exchange shows a 3xx redirect
- A redirect (often a store-code or locale rewrite like
/de/…, or http→https) is sitting in front of the MCP endpoints. The MCP and OAuth paths must respond directly. Run the connection checker to pinpoint which endpoint redirects. - A "Basic" auth prompt appears, or the request lands on a login wall
- An HTTP Basic-auth gateway (common on staging) is intercepting requests before Magento. Exclude the
/mcpand/.well-known/oauth-*paths from it — and from any store-code redirect that would push them behind it. - 401 Unauthorized after entering a token
- The token is wrong, expired or revoked. Mint a fresh one and try again.
- "invalid_client" or a wrong redirect URI during OAuth
- The OAuth client doesn't exist, is disabled, or its allowed redirect URIs don't match. Check the client under System → MCP → OAuth Clients.
- "Server unavailable" or 503
- The server is turned off. Confirm Enable MCP Server is set to Yes under Stores → Configuration → Magebit → MCP Server.