Cover image
Shopify-Store-store-front-MCP-Server
Private

Shopify-Store-store-front-MCP-Server

Try Now
2025-04-14

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

Shopify Storefront MCP Server

This server provides access to the Shopify Storefront API via MCP, allowing AI assistants to query and interact with your Shopify store data.

Features

  • Access to product, collection, and inventory data
  • Cart creation and management
  • Support for GraphQL queries and mutations
  • Automatic token handling and validation
  • Easy integration with MCP-compatible AI assistants

Setup Instructions

  1. Clone this repository
  2. Install dependencies: pip install -r requirements.txt
  3. Copy .env.example to .env and configure your environment variables
  4. Generate a Storefront API token via Shopify Admin (see below)
  5. Run the server: python shopify_storefront_mcp_server.py

Environment Variables

Create a .env file using the provided .env.example as a template:

# Required
SHOPIFY_STOREFRONT_ACCESS_TOKEN=your_storefront_token
SHOPIFY_STORE_NAME=your-store-name

# Optional
SHOPIFY_API_VERSION=2025-04
SHOPIFY_BUYER_IP=127.0.0.1

Generating a Storefront API Token

  1. Log in to your Shopify admin
  2. Go to Apps and sales channels > Develop apps > Create an app
  3. Name your app (e.g., "MCP Storefront")
  4. Go to API credentials > Configure Storefront API scopes
  5. Select necessary scopes:
    • unauthenticated_read_product_listings
    • unauthenticated_read_product_inventory
    • unauthenticated_read_product_pricing
    • unauthenticated_write_checkouts
    • unauthenticated_read_content
  6. Save and copy the generated Storefront API access token
  7. Add the token to your .env file as SHOPIFY_STOREFRONT_ACCESS_TOKEN

Usage Examples

Running with the MCP server:

python shopify_storefront_mcp_server.py

The server exposes the following MCP tools:

  • storefront_execute_graphql: Execute GraphQL queries against the Storefront API
  • get_storefront_token_status: Check the status of your configured tokens

Troubleshooting

If you encounter authentication errors:

  1. Verify token format: Storefront API tokens should start with shpsa_ (newer) or shpat_ (older)
  2. Check store name: Ensure SHOPIFY_STORE_NAME is correct (without .myshopify.com)
  3. Check API version: Make sure the API version is supported
  4. Test token: Use cURL to test your token directly:
    curl -X POST \
      https://your-store.myshopify.com/api/2025-04/graphql.json \
      -H "Content-Type: application/json" \
      -H "X-Shopify-Storefront-Access-Token: your_token" \
      -d '{"query": "query { shop { name } }"}'
    
  5. Regenerate token: If issues persist, create a new token with proper scopes

Security Considerations

  • Never commit your .env file or any files containing API tokens
  • Use environment variables for all sensitive information
  • Consider setting up IP restrictions in your Shopify Admin
  • Review the permissions granted to your Storefront API token

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

    Reviews

    4 (1)
    Avatar
    user_FzXIHvRC
    2025-04-24

    As a dedicated user of the shopify-storefront-mcp-server by QuentinCody, I can confidently say this tool is essential for any e-commerce enthusiast. It seamlessly integrates with Shopify, enhancing the storefront capabilities and ensuring smooth server management. A must-have for efficient store operations!