1.2.1 • Published 5 months ago

@pranavchavda/shopify-mcp-stdio-client v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Shopify MCP STDIO Client

A bridge that enables legacy STDIO-based MCP clients to connect to modern HTTP/SSE MCP servers. This tool provides seamless compatibility for tools and SDKs that only support the STDIO transport protocol.

Features

  • Universal Compatibility: Bridges STDIO clients to HTTP/SSE servers
  • Zero Dependencies: Self-contained bundle with no external dependencies
  • Bearer Token Security: Optional authentication for production deployments
  • Dual Transport: Supports both HTTP POST and Server-Sent Events modes
  • Production Ready: Connect to hosted Shopify MCP server instance
  • Zero Configuration: Works out of the box with sensible defaults
  • Full MCP Protocol: Complete JSON-RPC 2.0 MCP protocol support

Quick Start

Using npx (Recommended)

# Connect to production Shopify MCP server
npx @pranavchavda/shopify-mcp-stdio-client

# With authentication token
npx @pranavchavda/shopify-mcp-stdio-client --token=your-bearer-token

# Use Server-Sent Events mode for better performance
npx @pranavchavda/shopify-mcp-stdio-client --sse --token=your-token

# Connect to custom server
npx @pranavchavda/shopify-mcp-stdio-client --url=http://localhost:5000 --token=your-token

Local Installation

npm install -g @pranavchavda/shopify-mcp-stdio-client
shopify-mcp-stdio

Usage Examples

Basic STDIO Communication

# Send MCP requests via stdin
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1.0"}},"id":1}' | shopify-mcp-stdio

# List available tools
echo '{"jsonrpc":"2.0","method":"tools/list","id":2}' | shopify-mcp-stdio

Integration with MCP Clients

import subprocess
import json

# Start the STDIO bridge
process = subprocess.Popen(
    ['npx', '@pranavchavda/shopify-mcp-stdio-client'],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    text=True
)

# Send MCP request
request = {
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": 1
}

process.stdin.write(json.dumps(request) + '\n')
process.stdin.flush()

# Read response
response = process.stdout.readline()
result = json.loads(response)
print(f"Available tools: {len(result['result']['tools'])}")

Command Line Options

OptionDescriptionDefault
--sseUse Server-Sent Events transportHTTP POST
--url=URLCustom MCP server base URLhttps://webhook-listener-pranavchavda.replit.app
--token=TOKENBearer token for authenticationNone (uses env var)
--helpShow help message-

Environment Variables

VariableDescriptionExample
MCP_SERVER_URLDefault server URLhttps://your-server.com
MCP_BEARER_TOKENAuthentication tokenyour-secure-token

Available Shopify Tools

The STDIO client provides access to 15+ Shopify e-commerce tools:

  • Product Management: Create, search, and update products
  • Open Box Listings: Duplicate products with custom pricing
  • Pricing Updates: Modify variant prices and costs
  • Collection Management: Add products to collections
  • GraphQL Operations: Execute custom Shopify queries/mutations
  • Tag Management: Add/remove product tags
  • Metafield Operations: Set custom product metadata
  • SKU Vault Integration: Upload products to inventory systems

Transport Modes

HTTP POST Mode (Default)

  • Single request-response pattern
  • Lower latency for individual requests
  • Compatible with all network configurations

Server-Sent Events Mode (--sse)

  • Persistent connection with real-time capabilities
  • Better performance for multiple requests
  • Supports streaming responses

Error Handling

The STDIO client provides comprehensive error handling:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32603,
    "message": "Transport error",
    "data": "HTTP 500: Internal Server Error"
  }
}

Common error codes:

  • -32700: Parse error (invalid JSON)
  • -32600: Invalid request
  • -32603: Internal/transport error

Production Endpoints

  • HTTP: https://webhook-listener-pranavchavda.replit.app/mcp
  • SSE: https://webhook-listener-pranavchavda.replit.app/mcp/sse
  • Health: https://webhook-listener-pranavchavda.replit.app/mcp/health

Development

git clone https://github.com/pranavchavda/shopify-mcp-server
cd shopify-mcp-server/shopify-mcp-stdio-client
npm install
node index.js --url=http://localhost:5000

Testing

# Run test suite
npm test

# Run interactive demo
npm run demo

License

MIT License - see LICENSE file for details.

Support

1.2.1

5 months ago

1.2.0

5 months ago

1.1.1

5 months ago

1.0.0

5 months ago