An intelligent Multi-Agent Orchestration System for managing your Shopify store using natural language. Built with FastMCP, Streamlit, and powered by Groq LLM (Llama 3.3 70B).
CFO Agent is an AI assistant that lets you manage your Shopify store through a conversational interface. Instead of navigating complex admin panels, simply tell the agent what you need:
- "Show me the store dashboard"
- "Create a new product called Summer Hat priced at $29.99"
- "What are my recent orders?"
- "Update the price of variant 123 to $19.99"
The system uses three specialized agents:
| Agent | Role | Capabilities |
|---|---|---|
| π― Triage | Orchestrator | Routes requests to the right specialist |
| ποΈ ShopifyManager | Write Operations | Create products, update prices, edit descriptions |
| π DataAnalyst | Read Operations | Dashboard, orders, products, abandoned checkouts |
Before you begin, ensure you have:
- Python 3.12+ installed
- uv - Fast Python package manager
- A Shopify Partner account with a custom app
- A Groq API key (free at console.groq.com)
- ngrok (for exposing local server to Shopify OAuth)
git clone https://github.com/yourusername/CFO.git
cd CFOUsing uv (recommended):
uv syncThis will create a virtual environment and install all dependencies from pyproject.toml.
- Go to Shopify Partners β Apps β Create app
- Choose Create app manually
- Note down:
- Client ID (API Key)
- Client Secret (API Secret Key)
- In App setup β URLs, configure:
- App URL:
https://your-ngrok-url.ngrok-free.app - Redirect URL:
https://your-ngrok-url.ngrok-free.app/oauth/callback
- App URL:
- In API access scopes, add:
read_products,write_productsread_ordersread_checkoutsread_analytics
- Visit console.groq.com
- Sign up / Log in
- Go to API Keys β Create API Key
- Copy your API key
Create a .env file in the project root:
SHOPIFY_CLIENT_ID=your_shopify_client_id
SHOPIFY_CLIENT_SECRET=your_shopify_client_secret
SHOPIFY_HOST_URL=https://your-ngrok-url.ngrok-free.app
GROQ_API_KEY=your_groq_api_keyOpen a terminal and run:
ngrok http 8000Copy the Forwarding URL (e.g., https://abc123.ngrok-free.app) and:
- Update
SHOPIFY_HOST_URLin your.envfile - Update your Shopify app URLs in the Partner Dashboard
In a new terminal:
uv run uvicorn mcp_servers.main:mcp.app --reload --port 8000The server will be running at http://localhost:8000.
- Open your browser and go to:
https://your-ngrok-url.ngrok-free.app/install?shop=your-store.myshopify.com - Authorize the app on Shopify
- After successful installation, a
tokens.jsonfile will be created
Alternative: If OAuth doesn't work, use the manual token setup:
uv run python set_token.pyEnter your shop domain and Admin API Access Token.
uv run streamlit run CFO_agent/app.pyThe app will open at http://localhost:8501.
- Enter your Shopify store domain (e.g.,
your-store.myshopify.com) - Click Connect
- Start chatting with your AI assistant!
CFO/
βββ CFO_agent/ # Multi-agent orchestration
β βββ agents.py # Agent definitions (Triage, ShopifyManager, DataAnalyst)
β βββ app.py # Streamlit frontend
β βββ config.py # Groq LLM configuration
β βββ mcp_client.py # MCP client for tool execution
β βββ orchestrator.py # Agent orchestration logic
β βββ main.py # CLI entry point
βββ mcp_servers/
β βββ main.py # FastMCP server with Shopify tools
βββ .env # Environment variables (create this)
βββ tokens.json # Shopify access tokens (auto-generated)
βββ set_token.py # Manual token setup script
βββ pyproject.toml # Project dependencies
βββ README.md # This file
| Tool | Description |
|---|---|
get_store_dashboard |
High-level store overview (orders, products, sales) |
get_recent_orders |
Fetch recent orders with customer details |
get_products |
Search products by keyword |
get_product_description |
Get a product's description |
get_abandoned_checkouts |
View incomplete checkouts |
| Tool | Description |
|---|---|
create_product |
Create a new product with price and stock |
update_price |
Update variant price |
update_product_description |
Update product description |
π Analytics
- "Show me the store dashboard"
- "What are my recent orders?"
- "Find products containing 'jacket'"
- "List abandoned checkouts"
ποΈ Management
- "Create a product called 'Winter Coat' priced at $149.99 with 50 in stock"
- "Update the price of variant 12345 to $99.99"
- "Change the description of product 67890 to 'Premium quality...'"
- Ensure you've installed the app on your store (Step 8)
- Check that
tokens.jsonexists and contains your shop's token - Try the manual token setup with
uv run python set_token.py
- Verify your ngrok URL is running and matches
.env - Ensure Shopify app URLs are correctly configured in Partner Dashboard
- Check that the redirect URL includes
/oauth/callback
- Confirm the server is running on port 8000
- Check terminal for any error messages
- Restart with
uv run uvicorn mcp_servers.main:mcp.app --reload --port 8000
MIT License - feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit a Pull Request.
Built with β€οΈ using FastMCP, Streamlit, and Groq