sitebay_shopify_proxy
Proxy requests to Shopify Admin API for managing products, orders, and store data through the SiteBay MCP Server.
Instructions
Proxy requests to a Shopify Admin API.
Args: shop_name: Shopify shop name path: Shopify API path (e.g., "/admin/api/2024-04/products.json") query_params_json: Optional JSON string for payload or query params method: HTTP method (get, post, put, delete)
Returns: Shopify API response
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shop_name | Yes | ||
| path | No | /admin/api/2024-04 | |
| query_params_json | No | ||
| method | No | get |
Implementation Reference
- src/sitebay_mcp/server.py:416-452 (handler)Primary handler and registration for the 'sitebay_shopify_proxy' MCP tool. This async function handles the tool execution, logging, client initialization, parameter preparation, API proxy call, and response/error formatting. The @mcp.tool decorator registers it with FastMCP.@mcp.tool async def sitebay_shopify_proxy( ctx: Context, shop_name: str, path: str = "/admin/api/2024-04", query_params_json: str = "", method: str = "get", ) -> str: """ Proxy requests to a Shopify Admin API. Args: shop_name: Shopify shop name path: Shopify API path (e.g., "/admin/api/2024-04/products.json") query_params_json: Optional JSON string for payload or query params method: HTTP method (get, post, put, delete) Returns: Shopify API response """ try: await ctx.info(f"Shopify proxy request to {shop_name}{path or ''}") client = await initialize_client() proxy_data: dict[str, Any] = {"shop_name": shop_name, "method": method, "path": path} if query_params_json: proxy_data["query_params_json"] = query_params_json result = await client.shopify_proxy(proxy_data) return f"✅ Shopify API Response:\n```json\n{result}\n```" except SiteBayError as e: await ctx.error(f"Shopify proxy error: {str(e)}") return f"❌ Shopify Proxy Error: {str(e)}" except Exception as e: await ctx.error(f"Unexpected proxy error: {str(e)}") return f"❌ Unexpected error: {str(e)}"
- src/sitebay_mcp/client.py:327-329 (helper)Supporting helper method in SiteBayClient class that executes the HTTP POST request to the SiteBay backend's /shopify-proxy endpoint with the prepared proxy_data.async def shopify_proxy(self, proxy_data: Dict[str, Any]) -> Any: """Proxy request to Shopify API""" return await self.post("/shopify-proxy", json_data=proxy_data)