Conversation
New `@shopify/mcp` package that exposes the Shopify Admin API to AI coding agents via the Model Context Protocol (MCP). Uses cli-kit's existing auth and GraphQL infrastructure. Tools: - shopify_auth_login: device auth flow for non-interactive MCP context - shopify_graphql: execute Admin API queries/mutations Install: claude mcp add shopify -- npx -y -p @shopify/mcp Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Coverage report
Test suite run success3785 tests passing in 1448 suites. Report generated by 🧪jest coverage report action from aea6854 |
|
🤖 Code Review · #projects-dev-ai for questions ✅ Complete - 1 findings 📋 History✅ 2 findings → ✅ No issues → ✅ 1 findings |
|
We have a separate package |
|
|
||
| const server = createServer() | ||
| const transport = new StdioServerTransport() | ||
| await server.connect(transport) |
There was a problem hiding this comment.
Unhandled startup failure can crash the MCP process (missing connect error handling)
await server.connect(transport) runs at top-level without try/catch. If connect() rejects (stdio issues, SDK incompatibility, permissions), Node will treat it as an unhandled rejection during module initialization and terminate the process, making the tool disappear in agent environments.
a990132 to
3bb8072
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationspackages/cli-kit/dist/public/node/mcp.d.tsimport type { AdminSession } from './session.js';
export interface DeviceCodeResponse {
deviceCode: string;
userCode: string;
verificationUri: string;
verificationUriComplete: string;
expiresIn: number;
interval: number;
}
/**
* Requests a device authorization code for MCP non-interactive auth.
*
* @returns The device code response with verification URL.
*/
export declare function requestDeviceCode(): Promise<DeviceCodeResponse>;
/**
* Completes device authorization by polling for approval and exchanging tokens.
*
* @param deviceCode - The device code from requestDeviceCode.
* @param interval - Polling interval in seconds.
* @param storeFqdn - The normalized store FQDN.
* @returns An admin session with token and store FQDN.
*/
export declare function completeDeviceAuth(deviceCode: string, interval: number, storeFqdn: string): Promise<AdminSession>;
Existing type declarationsWe found no diffs with existing type declarations |
Summary
@shopify/mcp, a standalone MCP server that exposes the Shopify Admin API to AI coding agents (Claude, Cursor, etc.)cli-kit/src/public/node/mcp.ts— non-interactive device auth API for MCP's stdio contextshopify_auth_login(device auth flow) andshopify_graphql(Admin API queries/mutations)Install:
How it works
shopify_auth_login→ gets device auth URLshopify_graphql→ background polling completes auth, executes queryKey decisions
@shopify/cli, published independently as@shopify/mcpallowMutations: trueparameterTest plan
Details
Quick overview
This PR adds @shopify/mcp — a standalone MCP server that lets AI coding agents (Claude, Cursor, etc.) query the Shopify Admin API. Two tools: shopify_auth_login
(device auth) and shopify_graphql (Admin API queries/mutations).
Setup
Run tests
Manual testing
Option 1: Test with Claude Code
Then in Claude: "List the products on my-store.myshopify.com"
The agent should:
Option 2: Test the server directly with MCP Inspector
This opens a web UI where you can call tools manually.
Option 3: Test server startup only
Should hang (waiting for stdio input). Ctrl+C to exit — should shut down cleanly.