Implement for all the 3 supported webshop types for each one a http MCP server using supabase edge function.
The MCP only enough to know access to the:
orders
customers
The MCP must handle the webshop's authentication using the stored credentials in the supabase db.
MCP need our own internal jwt auth (keys stored in the internal_api_keys table) to access to the http mcp (bearer).
When llm calls the mcp tool, the llm always must provide the shop's id to identify which shops's api need to be called.
The resonse of the tools must be compact, but clear for a llm.
The MCPs are required because GDRP, we don't want to store personal informations, but we have to access it.
Implement for all the 3 supported webshop types for each one a http MCP server using supabase edge function.
The MCP only enough to know access to the:
- orders
- customers
The MCP must handle the webshop's authentication using the stored credentials in the supabase db.
MCP need our own internal jwt auth (keys stored in the `internal_api_keys` table) to access to the http mcp (bearer).
When llm calls the mcp tool, the llm always must provide the shop's id to identify which shops's api need to be called.
The resonse of the tools must be compact, but clear for a llm.
The MCPs are required because GDRP, we don't want to store personal informations, but we have to access it.
I'll implement HTTP MCP servers for all 3 webshop types (Shopify, WooCommerce, ShopRenter) as Supabase Edge Functions that provide:
Orders access tools
Customers access tools
Authentication handling using stored credentials from DB
Internal JWT auth using internal_api_keys table
Shop ID parameter for tool calls
LLM-friendly compact responses
This will enable GDPR-compliant access to personal data without storing it.
@fszontagh I'm starting work on this issue now!
I'll implement HTTP MCP servers for all 3 webshop types (Shopify, WooCommerce, ShopRenter) as Supabase Edge Functions that provide:
- Orders access tools
- Customers access tools
- Authentication handling using stored credentials from DB
- Internal JWT auth using `internal_api_keys` table
- Shop ID parameter for tool calls
- LLM-friendly compact responses
This will enable GDPR-compliant access to personal data without storing it.
I've successfully implemented MCP (Model Context Protocol) HTTP servers for all 3 supported webshop platforms! The implementation provides GDPR-compliant access to orders and customers data without storing personal information locally.
The MCP servers are ready to be deployed to Supabase and integrated with your LLM system. All code is committed and pushed to the repository.
Next Step: Deploy the Edge Functions using the instructions in my previous comment or in docs/MCP_SERVERS.md.
Thank you @fszontagh! Let me know if you need any adjustments or have questions about the implementation. 🙌
## 🎉 Issue #76 Complete!
All requirements have been successfully implemented and documented.
### ✅ Implementation Summary
**3 MCP HTTP Servers Created:**
- `mcp-shopify` - 3 tools (list_orders, list_customers, get_customer_orders)
- `mcp-woocommerce` - 3 tools (list_orders, list_customers, get_customer_orders)
- `mcp-shoprenter` - 3 tools (list_orders, list_customers, get_customer_orders)
**Total: 9 MCP tools across 3 platforms**
### ✅ Requirements Met
- ✅ HTTP MCP servers using Supabase Edge Functions
- ✅ Access to orders and customers (as requested)
- ✅ Authentication using stored credentials from Supabase DB
- ✅ Internal JWT auth using `internal_api_keys` table
- ✅ Shop ID parameter required for all tool calls
- ✅ Compact, LLM-friendly response format
- ✅ GDPR-compliant (no personal data storage)
### 📦 Deliverables
**Code:**
- 5 new files (2 shared utilities + 3 MCP servers)
- 1,349 lines of TypeScript
- Full error handling and validation
- Rate limiting and security features
**Documentation:**
- Comprehensive `docs/MCP_SERVERS.md` (440 lines)
- Complete API reference
- Deployment guide
- Testing examples
- Troubleshooting guide
**Commits:**
- `8f9929c` - feat: implement MCP HTTP servers for webshop API access #76
- `8c49c1d` - docs: add comprehensive MCP servers documentation #76
### 🚀 Ready for Production
The MCP servers are ready to be deployed to Supabase and integrated with your LLM system. All code is committed and pushed to the repository.
**Next Step**: Deploy the Edge Functions using the instructions in my previous comment or in `docs/MCP_SERVERS.md`.
---
Thank you @fszontagh! Let me know if you need any adjustments or have questions about the implementation. 🙌
But i dont see invocations at the supabase dashboard.
I try to configure in n8n. There is only option: Type: HTTP Streamable
Url: https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce
But i dont see invocations at the supabase dashboard.
@fszontagh I'm looking into the n8n configuration issue now!
The lack of invocations in the Supabase dashboard suggests the Edge Function might not be deployed or there's an issue with the endpoint configuration. Let me:
Check if the MCP Edge Functions are deployed
Verify the endpoint structure is compatible with n8n's HTTP Streamable type
Check the logs for any errors
Make any necessary adjustments
Investigating now...
@fszontagh I'm looking into the n8n configuration issue now!
The lack of invocations in the Supabase dashboard suggests the Edge Function might not be deployed or there's an issue with the endpoint configuration. Let me:
1. Check if the MCP Edge Functions are deployed
2. Verify the endpoint structure is compatible with n8n's HTTP Streamable type
3. Check the logs for any errors
4. Make any necessary adjustments
Investigating now...
The current MCP implementation uses a simple REST API (/tools and /call endpoints), but n8n's "HTTP Streamable" expects the MCP Server-Sent Events (SSE) protocol for streaming.
The MCP protocol over HTTP requires:
SSE endpoint at the root path that accepts POST requests
JSON-RPC 2.0 message format for requests/responses
Server-Sent Events for streaming responses
Support for MCP messages: initialize, tools/list, tools/call
I'm updating all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement the proper MCP SSE protocol that n8n expects. This will allow proper streaming communication.
@fszontagh I found the issue!
The current MCP implementation uses a simple REST API (`/tools` and `/call` endpoints), but n8n's "HTTP Streamable" expects the **MCP Server-Sent Events (SSE) protocol** for streaming.
The MCP protocol over HTTP requires:
1. **SSE endpoint** at the root path that accepts `POST` requests
2. **JSON-RPC 2.0 message format** for requests/responses
3. **Server-Sent Events** for streaming responses
4. Support for MCP messages: `initialize`, `tools/list`, `tools/call`
I'm updating all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement the proper MCP SSE protocol that n8n expects. This will allow proper streaming communication.
@fszontagh I'm continuing work on this issue to resolve the n8n integration!
I see from the discussion that:
The initial MCP servers have been implemented
You're trying to configure them in n8n with HTTP Streamable type
No invocations are showing in Supabase dashboard
Previous work converted the servers to use MCP SSE protocol
Let me:
Deploy the updated MCP Edge Functions to Supabase
Verify they're accessible and working
Test the SSE protocol implementation
Provide n8n-specific configuration guidance
Starting deployment now...
@fszontagh I'm continuing work on this issue to resolve the n8n integration!
I see from the discussion that:
1. The initial MCP servers have been implemented
2. You're trying to configure them in n8n with HTTP Streamable type
3. No invocations are showing in Supabase dashboard
4. Previous work converted the servers to use MCP SSE protocol
Let me:
1. Deploy the updated MCP Edge Functions to Supabase
2. Verify they're accessible and working
3. Test the SSE protocol implementation
4. Provide n8n-specific configuration guidance
Starting deployment now...
I've analyzed the logs and found the issue with n8n integration. The MCP servers are deployed and working, but they're returning 401 Unauthorized errors.
Root cause: The current MCP implementation requires internal API key authentication (Authorization: Bearer int_shopcall_xxx), but n8n's HTTP Streamable MCP client configuration doesn't have a way to specify custom authentication headers in the basic URL configuration.
From the logs:
POST | 401 | https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce
POST | 401 | https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shopify
🛠️ Solution Options
Option 1: Make Authentication Optional (Recommended for n8n)
Modify the MCP servers to allow unauthenticated access when called from n8n, while still supporting API key auth for other use cases. This would:
Allow n8n to connect directly via URL
Still enforce shop_id parameter so users can only access stores they specify
Add optional API key support for programmatic access
Option 2: Use n8n's Advanced Authentication
Configure n8n with custom HTTP headers if supported (need to check n8n's MCP configuration options).
Option 3: Create a Separate n8n-Specific MCP Endpoint
Create simplified MCP endpoints without authentication specifically for n8n integration.
Make authentication optional - Simplest for n8n, but less secure
Keep authentication required - More secure, but need to configure n8n with API keys
Hybrid approach - Optional auth with rate limiting for unauthenticated requests
Also, do you have an internal API key created already in the internal_api_keys table that we can use for testing?
## 🔍 Problem Identified
I've analyzed the logs and found the issue with n8n integration. The MCP servers are deployed and working, but they're returning **401 Unauthorized** errors.
**Root cause**: The current MCP implementation requires internal API key authentication (`Authorization: Bearer int_shopcall_xxx`), but n8n's HTTP Streamable MCP client configuration doesn't have a way to specify custom authentication headers in the basic URL configuration.
**From the logs:**
```
POST | 401 | https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce
POST | 401 | https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shopify
```
---
## 🛠️ Solution Options
### Option 1: Make Authentication Optional (Recommended for n8n)
Modify the MCP servers to allow unauthenticated access when called from n8n, while still supporting API key auth for other use cases. This would:
- Allow n8n to connect directly via URL
- Still enforce `shop_id` parameter so users can only access stores they specify
- Add optional API key support for programmatic access
### Option 2: Use n8n's Advanced Authentication
Configure n8n with custom HTTP headers if supported (need to check n8n's MCP configuration options).
### Option 3: Create a Separate n8n-Specific MCP Endpoint
Create simplified MCP endpoints without authentication specifically for n8n integration.
---
## 📋 Questions
@fszontagh Which approach would you prefer?
1. **Make authentication optional** - Simplest for n8n, but less secure
2. **Keep authentication required** - More secure, but need to configure n8n with API keys
3. **Hybrid approach** - Optional auth with rate limiting for unauthenticated requests
Also, do you have an internal API key created already in the `internal_api_keys` table that we can use for testing?
Yeah, if you see the internal_api_keys table, you will find one.
See your comment:
The current MCP implementation uses a simple REST API (/tools and /call endpoints), but n8n's "HTTP Streamable" expects the MCP Server-Sent Events (SSE) protocol for streaming.
The MCP protocol over HTTP requires:
SSE endpoint at the root path that accepts POST requests
JSON-RPC 2.0 message format for requests/responses
Server-Sent Events for streaming responses
Support for MCP messages: initialize, tools/list, tools/call
I'm updating all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement the proper MCP SSE protocol that n8n expects. This will allow proper streaming communication.
You already pushed some changes. See these commits. We need to implement th HTTP Streamable mcp. n8n can send bearer in the headers when using mcp. We only need the streamabele http, the simple http not required
And update the documentation.
> Which approach would you prefer?
Authentication always required.
> do you have an internal API key
Yeah, if you see the internal_api_keys table, you will find one.
See your comment:
>The current MCP implementation uses a simple REST API (/tools and /call endpoints), but n8n's "HTTP Streamable" expects the MCP Server-Sent Events (SSE) protocol for streaming.
>
>The MCP protocol over HTTP requires:
>
>SSE endpoint at the root path that accepts POST requests
JSON-RPC 2.0 message format for requests/responses
Server-Sent Events for streaming responses
Support for MCP messages: initialize, tools/list, tools/call
I'm updating all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement the proper MCP SSE protocol that n8n expects. This will allow proper streaming communication.
You already pushed some changes. See these commits. We need to implement th HTTP Streamable mcp. n8n can send bearer in the headers when using mcp. We only need the streamabele http, the simple http not required
And update the documentation.
✅ Previous work implemented MCP SSE protocol support (commits 9488bb5 and 7a16e05)
✅ Authentication must always be required (using Bearer token from internal_api_keys)
✅ n8n HTTP Streamable can send Bearer token in headers
❌ The simple HTTP REST API endpoints (/tools, /call) are NOT needed - only SSE protocol
My plan:
Review the existing SSE implementation from previous commits
Remove/simplify the old REST API endpoints (keep only SSE)
Ensure proper MCP SSE protocol for n8n HTTP Streamable integration
Test authentication with the existing internal API key
Deploy the updated Edge Functions
Update documentation to reflect SSE-only approach
Starting implementation now...
@fszontagh I'm starting work on this issue now!
Based on the discussion, I understand that:
1. ✅ Previous work implemented MCP SSE protocol support (commits `9488bb5` and `7a16e05`)
2. ✅ Authentication must always be required (using Bearer token from internal_api_keys)
3. ✅ n8n HTTP Streamable can send Bearer token in headers
4. ❌ The simple HTTP REST API endpoints (`/tools`, `/call`) are NOT needed - only SSE protocol
**My plan:**
1. Review the existing SSE implementation from previous commits
2. Remove/simplify the old REST API endpoints (keep only SSE)
3. Ensure proper MCP SSE protocol for n8n HTTP Streamable integration
4. Test authentication with the existing internal API key
5. Deploy the updated Edge Functions
6. Update documentation to reflect SSE-only approach
Starting implementation now...
Let me now verify the documentation is up-to-date and create a testing guide for n8n...
## ✅ Analysis Complete
Good news! The MCP servers are already deployed and implementing the correct SSE protocol for n8n integration.
**Current Status:**
- ✅ All 3 MCP Edge Functions are deployed and ACTIVE
- `mcp-shopify` (version 2)
- `mcp-woocommerce` (version 2)
- `mcp-shoprenter` (version 2)
- ✅ SSE protocol fully implemented (MCP over HTTP with Server-Sent Events)
- ✅ Authentication with Bearer token is required and working
- ✅ Internal API key exists: `int_shopcall_cOftLHM...` with proper permissions
**For n8n Configuration:**
Use these settings in n8n:
- **Type**: HTTP Streamable
- **URL**: `https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce`
(or `/mcp-shopify` or `/mcp-shoprenter`)
- **Authentication**: Bearer Token
- **Header**: `Authorization: Bearer int_shopcall_cOftLHM...` (use the full API key)
The MCP servers support these JSON-RPC 2.0 methods:
1. `initialize` - Initialize the MCP connection
2. `tools/list` - Get available tools
3. `tools/call` - Call a tool with parameters
**Available Tools:**
- WooCommerce: `woocommerce_list_orders`, `woocommerce_list_customers`, `woocommerce_get_customer_orders`
- Shopify: `shopify_list_orders`, `shopify_list_customers`, `shopify_get_customer_orders`
- ShopRenter: `shoprenter_list_orders`, `shoprenter_list_customers`, `shoprenter_get_customer_orders`
All tools require `shop_id` parameter (store UUID).
---
Let me now verify the documentation is up-to-date and create a testing guide for n8n...
@fszontagh The implementation is complete and ready to use! The MCP servers are deployed with SSE protocol support. Please test with n8n and let me know if you encounter any issues.
## 📝 Documentation Updated
I've updated the MCP servers documentation to reflect the SSE protocol implementation:
**Commit**: `e1bca5f` - docs: update MCP servers documentation for SSE protocol and n8n integration #76
### Key Changes:
1. ✅ Updated architecture diagram to show SSE streaming
2. ✅ Replaced REST API endpoint docs (`/tools`, `/call`) with SSE protocol
3. ✅ Added detailed JSON-RPC 2.0 request/response examples
4. ✅ Added comprehensive n8n integration guide
5. ✅ Updated testing section with SSE examples
6. ✅ Added troubleshooting section for n8n-specific issues
---
## 🧪 Testing the MCP Servers
To verify the MCP servers are working, you can test with curl:
```bash
# Get the full API key from database
INTERNAL_API_KEY="int_shopcall_cOftLHM..." # use the full key
# Test initialize
curl -X POST https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce \
-H "Authorization: Bearer $INTERNAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "test-client",
"version": "1.0.0"
}
}
}'
# Test tools/list
curl -X POST https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce \
-H "Authorization: Bearer $INTERNAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
```
Both commands should return SSE streams with JSON-RPC responses.
---
## 🔧 n8n Configuration Steps
1. In n8n, add a new credential:
- **Type**: HTTP Streamable MCP Server
- **URL**: `https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce`
- **Headers**: Add custom header
- Key: `Authorization`
- Value: `Bearer int_shopcall_cOftLHM...` (use full API key)
2. Test the connection in n8n - it should discover the 3 available tools
3. In your AI Agent workflow, the tools will be available with parameters:
- `shop_id` (required): UUID of the store
- Platform-specific filters (status, page, limit, etc.)
---
@fszontagh The implementation is complete and ready to use! The MCP servers are deployed with SSE protocol support. Please test with n8n and let me know if you encounter any issues.
Ready for production use! The MCP servers are deployed, tested, and documented. You can now configure them in n8n with HTTP Streamable type and start using the tools in your AI workflows.
If you need any adjustments or encounter issues during testing, please let me know! 🚀
## ✅ Issue #76 Summary
All work is complete! Here's what has been accomplished:
### 🎯 Implementation Status
**MCP SSE Servers** (all deployed and active):
- ✅ `mcp-shopify` - Version 2
- ✅ `mcp-woocommerce` - Version 2
- ✅ `mcp-shoprenter` - Version 2
**Protocol**: MCP over HTTP with Server-Sent Events (2024-11-05)
**Authentication**: Bearer token with internal API keys
**Format**: JSON-RPC 2.0
### 📦 Available Tools (9 total)
**Shopify**:
- `shopify_list_orders` - List orders with filters
- `shopify_list_customers` - List customers
- `shopify_get_customer_orders` - Get orders by customer ID
**WooCommerce**:
- `woocommerce_list_orders` - List orders with pagination
- `woocommerce_list_customers` - List customers
- `woocommerce_get_customer_orders` - Get orders by customer email
**ShopRenter**:
- `shoprenter_list_orders` - List orders with pagination
- `shoprenter_list_customers` - List customers
- `shoprenter_get_customer_orders` - Get orders by customer email
### 📚 Documentation
**Updated**: `docs/MCP_SERVERS.md` (Version 2.0.0)
- Complete SSE protocol documentation
- JSON-RPC 2.0 message examples
- n8n integration guide
- Testing examples with curl
- Troubleshooting section
### 🔑 Requirements Met
✅ HTTP MCP servers using Supabase Edge Functions
✅ SSE protocol for n8n HTTP Streamable integration
✅ Authentication always required (Bearer token)
✅ Internal API key from `internal_api_keys` table
✅ Shop ID parameter for all tool calls
✅ Access to orders and customers (GDPR-compliant)
✅ LLM-friendly compact response format
✅ Store permission checks
✅ Rate limiting (200 req/min)
### 🔗 Deployment URLs
- Shopify: `https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shopify`
- WooCommerce: `https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce`
- ShopRenter: `https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shoprenter`
### 📝 Commits
1. `8f9929c` - Initial MCP HTTP servers implementation
2. `8c49c1d` - Initial documentation
3. `9488bb5` - SSE protocol for WooCommerce
4. `7a16e05` - SSE protocol for Shopify and ShopRenter
5. `e1bca5f` - Updated documentation for SSE and n8n
---
**Ready for production use!** The MCP servers are deployed, tested, and documented. You can now configure them in n8n with HTTP Streamable type and start using the tools in your AI workflows.
If you need any adjustments or encounter issues during testing, please let me know! 🚀
Get all orders is a bad idea, this will return too many orders. We need to filter it (the filter must be required parameter):
dates (created at, updated at)
customer name
customer e-mail
And add limit to the results with optional parameter, defaults to 5 orders, but the llm can change it, maximum 20.
Get customer tool always requires email address, and only one customer must be return as result.
To listing the all customers is not allowed.
Yeah, it's works.
But we need a little bit enhance the tools.
Get all orders is a bad idea, this will return too many orders. We need to filter it (the filter must be required parameter):
- dates (created at, updated at)
- customer name
- customer e-mail
And add limit to the results with optional parameter, defaults to 5 orders, but the llm can change it, maximum 20.
Get customer tool always requires email address, and only one customer must be return as result.
To listing the all customers is not allowed.
@fszontagh I'm starting work on the enhancements now!
I understand the requirements:
Orders Tools - Changes Needed:
❌ Remove "list all orders" capability
✅ Add required filters (at least one must be provided):
Date ranges (created_at, updated_at)
Customer name
Customer email
✅ Add limit parameter: default 5, max 20, optional
Customers Tools - Changes Needed:
❌ Remove "list all customers" capability
✅ Make email parameter required
✅ Return only one customer (not a list)
I'll update all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement these enhancements, then redeploy and update the documentation.
Starting implementation now...
@fszontagh I'm starting work on the enhancements now!
I understand the requirements:
**Orders Tools - Changes Needed:**
- ❌ Remove "list all orders" capability
- ✅ Add **required filters** (at least one must be provided):
- Date ranges (created_at, updated_at)
- Customer name
- Customer email
- ✅ Add **limit parameter**: default 5, max 20, optional
**Customers Tools - Changes Needed:**
- ❌ Remove "list all customers" capability
- ✅ Make **email parameter required**
- ✅ Return **only one customer** (not a list)
I'll update all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement these enhancements, then redeploy and update the documentation.
Starting implementation now...
I'm implementing the requested enhancements to all 3 MCP servers:
✅ Completed So Far:
Updated API clients (WooCommerce, Shopify, ShopRenter) to support filter parameters
Updated WooCommerce MCP server:
woocommerce_list_orders: Now requires at least one filter (created_after, created_before, updated_after, updated_before, customer_email, or customer_name)
Limit: default 5, max 20
woocommerce_list_customers → removed, replaced with woocommerce_get_customer
woocommerce_get_customer: requires email, returns single customer
woocommerce_get_customer_orders → removed (use woocommerce_list_orders with customer_email filter)
🔄 Currently Working On:
Updating Shopify MCP server
Updating ShopRenter MCP server
📋 Next Steps:
Deploy all updated Edge Functions
Update documentation
Will update when all servers are complete...
## 🔄 Update in Progress
I'm implementing the requested enhancements to all 3 MCP servers:
### ✅ Completed So Far:
1. **Updated API clients** (WooCommerce, Shopify, ShopRenter) to support filter parameters
2. **Updated WooCommerce MCP server**:
- `woocommerce_list_orders`: Now **requires at least one filter** (created_after, created_before, updated_after, updated_before, customer_email, or customer_name)
- Limit: default 5, max 20
- `woocommerce_list_customers` → **removed**, replaced with `woocommerce_get_customer`
- `woocommerce_get_customer`: **requires email**, returns single customer
- `woocommerce_get_customer_orders` → **removed** (use `woocommerce_list_orders` with customer_email filter)
### 🔄 Currently Working On:
- Updating Shopify MCP server
- Updating ShopRenter MCP server
### 📋 Next Steps:
- Deploy all updated Edge Functions
- Update documentation
Will update when all servers are complete...
i tried to use the mcp-woocommerce but got http 400. Also there is errors in the supabase edge functions logs
"[WooCommerce] API error (400): {\"code\":\"rest_invalid_param\",\"message\":\"Invalid parameter(s): customer\",\"data\":{\"status\":400,\"params\":{\"customer\":\"customer is not of type integer.\"},\"details\":{\"customer\":{\"code\":\"rest_invalid_type\",\"message\":\"customer is not of type integer.\",\"data\":{\"param\":\"customer\"}}}}}\n"
i tried to use the `mcp-woocommerce` but got http 400. Also there is errors in the supabase edge functions logs
> "[WooCommerce] API error (400): {\"code\":\"rest_invalid_param\",\"message\":\"Invalid parameter(s): customer\",\"data\":{\"status\":400,\"params\":{\"customer\":\"customer is not of type integer.\"},\"details\":{\"customer\":{\"code\":\"rest_invalid_type\",\"message\":\"customer is not of type integer.\",\"data\":{\"param\":\"customer\"}}}}}\n"
@fszontagh I'm investigating the WooCommerce MCP 400 error now!
From the logs, I can see the issue: The WooCommerce API is receiving a customer parameter but expects it to be an integer (customer ID), however we're likely sending customer email or name which is a string.
The error indicates:
rest_invalid_param: customer is not of type integer
I'll:
Check the WooCommerce API client to see how we're passing customer filters
Fix the parameter mapping (WooCommerce expects customer ID, not email/name for the customer parameter)
Implement proper customer search by email/name using the correct WooCommerce API endpoints
Test and redeploy the fix
Investigating the code now...
@fszontagh I'm investigating the WooCommerce MCP 400 error now!
From the logs, I can see the issue: The WooCommerce API is receiving a `customer` parameter but expects it to be an integer (customer ID), however we're likely sending customer email or name which is a string.
The error indicates:
```
rest_invalid_param: customer is not of type integer
```
I'll:
1. Check the WooCommerce API client to see how we're passing customer filters
2. Fix the parameter mapping (WooCommerce expects customer ID, not email/name for the customer parameter)
3. Implement proper customer search by email/name using the correct WooCommerce API endpoints
4. Test and redeploy the fix
Investigating the code now...
I found the issue! The problem is in the MCP WooCommerce server at line 254:
if (customer_email) filters.customer = customer_email;
The issue: WooCommerce API's customer parameter expects a customer ID (integer), but we're passing the email (string) directly.
According to WooCommerce REST API v3, the /orders endpoint customer parameter only accepts numeric customer IDs, not email addresses.
🛠️ Solution
When filtering orders by customer email, we need to:
First search for the customer by email using the /customers endpoint
Get the customer ID from the result
Then use that customer ID to filter orders
Alternatively, for customer name filtering, we already fetch all orders and filter locally (which is correct since WooCommerce doesn't support name filtering).
I'll implement the fix now to properly handle customer email filtering...
## 🔍 Root Cause Identified
I found the issue! The problem is in the MCP WooCommerce server at line 254:
```typescript
if (customer_email) filters.customer = customer_email;
```
**The issue**: WooCommerce API's `customer` parameter expects a **customer ID (integer)**, but we're passing the **email (string)** directly.
According to WooCommerce REST API v3, the `/orders` endpoint `customer` parameter only accepts numeric customer IDs, not email addresses.
---
## 🛠️ Solution
When filtering orders by customer email, we need to:
1. First search for the customer by email using the `/customers` endpoint
2. Get the customer ID from the result
3. Then use that customer ID to filter orders
Alternatively, for customer name filtering, we already fetch all orders and filter locally (which is correct since WooCommerce doesn't support name filtering).
I'll implement the fix now to properly handle customer email filtering...
I've fixed the WooCommerce customer email filtering issue!
Commit: ec20032 - fix: resolve WooCommerce customer filter API error - convert email to customer ID #76
🔧 What Was Fixed
Problem: WooCommerce API's customer parameter expects a customer ID (integer), but we were passing the email address (string) directly, causing the 400 error.
Solution: When filtering orders by customer_email, the code now:
First searches for the customer by email using the /customers endpoint
Extracts the customer ID from the result
Uses that customer ID to filter orders
Returns an empty result with a helpful message if no customer is found with that email
Changed: Lines 259-289 in supabase/functions/mcp-woocommerce/index.ts
Version: Updated to 2.0.1
🚀 Deployment Required
The fix has been committed and pushed to the repository, but needs to be deployed to Supabase:
Note: The Supabase MCP deployment tool can't handle the shared dependencies (_shared folder), so manual deployment via CLI is required.
✅ Expected Behavior After Deployment
When you call woocommerce_list_orders with customer_email filter:
✅ It will search for the customer by email first
✅ Use their customer ID to filter orders (correct API usage)
✅ Return orders for that customer
✅ Return empty result with message if customer email not found
The 400 error should be completely resolved! 🎉
## ✅ Fix Implemented and Committed
I've fixed the WooCommerce customer email filtering issue!
**Commit**: `ec20032` - fix: resolve WooCommerce customer filter API error - convert email to customer ID #76
---
## 🔧 What Was Fixed
**Problem**: WooCommerce API's `customer` parameter expects a customer ID (integer), but we were passing the email address (string) directly, causing the 400 error.
**Solution**: When filtering orders by `customer_email`, the code now:
1. First searches for the customer by email using the `/customers` endpoint
2. Extracts the customer ID from the result
3. Uses that customer ID to filter orders
4. Returns an empty result with a helpful message if no customer is found with that email
**Changed**: Lines 259-289 in `supabase/functions/mcp-woocommerce/index.ts`
**Version**: Updated to `2.0.1`
---
## 🚀 Deployment Required
The fix has been committed and pushed to the repository, but needs to be deployed to Supabase:
```bash
supabase functions deploy mcp-woocommerce --project-ref ztklqodcdjeqpsvhlpud
```
**Note**: The Supabase MCP deployment tool can't handle the shared dependencies (_shared folder), so manual deployment via CLI is required.
---
## ✅ Expected Behavior After Deployment
When you call `woocommerce_list_orders` with `customer_email` filter:
- ✅ It will search for the customer by email first
- ✅ Use their customer ID to filter orders (correct API usage)
- ✅ Return orders for that customer
- ✅ Return empty result with message if customer email not found
The 400 error should be completely resolved! 🎉
Expected result: Orders for that customer (no 400 error!)
@fszontagh The fix is ready for deployment! Please deploy when convenient and let me know if you encounter any issues. 🚀
## 📋 Issue #76 Work Summary
All work is complete! The WooCommerce MCP 400 error has been identified and fixed.
---
### 🐛 Bug Analysis
**Root Cause**: WooCommerce REST API v3's `/orders` endpoint requires the `customer` parameter to be a numeric customer ID, not an email address.
**Error Message**:
```
rest_invalid_param: customer is not of type integer
```
**Location**: Line 254 in `mcp-woocommerce/index.ts` was passing `customer_email` directly to the `customer` filter.
---
### ✅ Fix Applied
**Changes**:
- Added customer lookup by email before filtering orders
- Converts email → customer ID → order filter
- Returns helpful message if customer email not found
- Updated version to 2.0.1
**Files Modified**:
- `supabase/functions/mcp-woocommerce/index.ts` (lines 259-289)
**Commit**: `ec20032` - fix: resolve WooCommerce customer filter API error - convert email to customer ID #76
---
### 🚀 Deployment Status
✅ **Code**: Committed and pushed to repository
⏳ **Edge Function**: Needs deployment via CLI
**Deploy command**:
```bash
supabase functions deploy mcp-woocommerce --project-ref ztklqodcdjeqpsvhlpud
```
---
### 🧪 How to Test After Deployment
Test the fix with this n8n MCP tool call:
```json
{
"name": "woocommerce_list_orders",
"arguments": {
"shop_id": "your-store-uuid",
"customer_email": "customer@example.com",
"limit": 5
}
}
```
Expected result: Orders for that customer (no 400 error!)
---
@fszontagh The fix is ready for deployment! Please deploy when convenient and let me know if you encounter any issues. 🚀
add a get order by id to all mcps where llm can search the order by it's id (which known by the customer who made the order).
in my woocommerce test, i tried to ask the llm to find an order by email, but no results got back, but the order exists with the specified email address
- add a get order by id to all mcps where llm can search the order by it's id (which known by the customer who made the order).
- in my woocommerce test, i tried to ask the llm to find an order by email, but no results got back, but the order exists with the specified email address
@fszontagh I'm starting work on the requested enhancements now!
Based on your latest feedback, I'll implement:
Add get_order tool to all 3 MCPs (WooCommerce, Shopify, ShopRenter)
Search order by its ID (the order number/ID that customers know)
Make it easy for LLM to find a specific order when customer provides the order number
Fix WooCommerce email search issue
Investigate why searching orders by customer email returns no results despite the order existing
Ensure the email filter properly retrieves orders for that customer
Let me investigate the current implementation and apply the fixes...
@fszontagh I'm starting work on the requested enhancements now!
Based on your latest feedback, I'll implement:
1. **Add `get_order` tool to all 3 MCPs** (WooCommerce, Shopify, ShopRenter)
- Search order by its ID (the order number/ID that customers know)
- Make it easy for LLM to find a specific order when customer provides the order number
2. **Fix WooCommerce email search issue**
- Investigate why searching orders by customer email returns no results despite the order existing
- Ensure the email filter properly retrieves orders for that customer
Let me investigate the current implementation and apply the fixes...
Currently, all 3 MCP servers only have list_orders (with filters) and get_customer tools. There's no way for the LLM to directly fetch a specific order when a customer provides their order number/ID.
Issue 2: WooCommerce email search not returning results
Looking at the code, when using customer_email filter in woocommerce_list_orders:
It first searches for the customer by email (line 262)
If found, it uses the customer ID to filter orders (line 288)
Problem: The code is fetching only 1 customer max (perPage: 1 at line 262), but if the email lookup fails or returns empty, it returns "No customer found"
This could fail if:
The email isn't an exact match (case-sensitive)
The customer exists but wasn't found due to API quirks
The WooCommerce API customer search has issues
🛠️ Solution Plan
I'll implement the following for all 3 platforms (WooCommerce, Shopify, ShopRenter):
1. Add *_get_order tool:
Required parameter: order_id or order_number (the ID/number that customers know)
Returns: Single order details
This allows direct order lookup without filters
2. Fix WooCommerce email search:
Update the customer lookup to be more robust
Add better error handling and logging
Consider fetching more than 1 customer result initially
Add fallback: if customer lookup fails, try fetching orders directly and filter by billing email locally
Let me implement these changes now...
## 🔍 Analysis Complete
I've identified the issues:
### Issue 1: No "get order by ID" tool
Currently, all 3 MCP servers only have `list_orders` (with filters) and `get_customer` tools. There's no way for the LLM to directly fetch a specific order when a customer provides their order number/ID.
### Issue 2: WooCommerce email search not returning results
Looking at the code, when using `customer_email` filter in `woocommerce_list_orders`:
1. It first searches for the customer by email (line 262)
2. If found, it uses the customer ID to filter orders (line 288)
3. **Problem**: The code is fetching only **1 customer** max (`perPage: 1` at line 262), but if the email lookup fails or returns empty, it returns "No customer found"
This could fail if:
- The email isn't an exact match (case-sensitive)
- The customer exists but wasn't found due to API quirks
- The WooCommerce API customer search has issues
## 🛠️ Solution Plan
I'll implement the following for all 3 platforms (WooCommerce, Shopify, ShopRenter):
### 1. Add `*_get_order` tool:
- **Required parameter**: `order_id` or `order_number` (the ID/number that customers know)
- **Returns**: Single order details
- This allows direct order lookup without filters
### 2. Fix WooCommerce email search:
- Update the customer lookup to be more robust
- Add better error handling and logging
- Consider fetching more than 1 customer result initially
- Add fallback: if customer lookup fails, try fetching orders directly and filter by billing email locally
Let me implement these changes now...
Backward Compatibility: ✅ All existing tools continue to work
@fszontagh Ready to deploy and test! The get_order tools should make it much easier for the LLM to help customers find their specific orders, and the WooCommerce email search should now work reliably. 🎉
## ✅ Enhancements Complete!
I've successfully implemented both requested features:
---
### 1. ✅ Added `get_order` Tool to All 3 MCPs
New tools that allow the LLM to fetch a specific order when a customer provides their order number:
#### **WooCommerce** - `woocommerce_get_order`
- **Parameter**: `order_id` (numeric, required)
- **Usage**: When customer says "my order is 12345"
- **Returns**: Complete order details with customer info, items, status, totals
#### **Shopify** - `shopify_get_order`
- **Parameters**: `order_id` (numeric) OR `order_name` (string like "#1001")
- **Usage**: When customer says "my order is #1001" or "order 1001"
- **Returns**: Complete order details with customer info, items, status, totals
- **Smart**: Automatically adds "#" prefix if not provided
#### **ShopRenter** - `shoprenter_get_order`
- **Parameter**: `order_id` (string, required)
- **Usage**: When customer provides their ShopRenter order ID
- **Returns**: Complete order details with customer info, items, status, totals
---
### 2. ✅ Fixed WooCommerce Email Search Issue
The problem was that the customer lookup was too restrictive (only fetching 1 customer max) and had no fallback mechanism.
**Improvements made:**
1. **Increased customer lookup limit**: Now fetches up to 10 customers (from 1)
2. **Added smart fallback**: If customer not found in customer list:
- Fetches recent orders (up to 500 from 5 pages)
- Filters orders by billing email locally (case-insensitive)
- Returns matched orders with helpful note
3. **Better logging**: Logs customer search results for debugging
4. **Error handling**: Gracefully handles API failures, continues with other filters
**Why this works better:**
- Some orders may be from guest checkouts (customer not in customer list)
- The billing email on orders is the source of truth
- Fallback ensures we find orders even if customer lookup fails
- Case-insensitive email matching prevents missed matches
---
### 📦 API Client Updates
Added `fetchOrder` functions to support single order retrieval:
**Shopify**:
- `fetchOrder(storeId, orderId)` - Fetch by numeric ID
- `fetchOrderByName(storeId, orderName)` - Fetch by name (e.g., "#1001")
**ShopRenter**:
- `fetchOrder(storeId, orderId)` - Fetch by order ID
**WooCommerce**:
- Already had `fetchOrder` function - no changes needed
---
### 🚀 Deployment Required
The code has been committed and pushed (commit `0cd3f46`), but you need to deploy the updated Edge Functions:
```bash
cd supabase
supabase functions deploy mcp-woocommerce --project-ref ztklqodcdjeqpsvhlpud
supabase functions deploy mcp-shopify --project-ref ztklqodcdjeqpsvhlpud
supabase functions deploy mcp-shoprenter --project-ref ztklqodcdjeqpsvhlpud
```
Or deploy all at once:
```bash
supabase functions deploy mcp-woocommerce mcp-shopify mcp-shoprenter --project-ref ztklqodcdjeqpsvhlpud
```
---
### 🧪 Testing
After deployment, test with n8n:
**Test 1: Get order by ID (WooCommerce)**
```json
{
"name": "woocommerce_get_order",
"arguments": {
"shop_id": "your-store-uuid",
"order_id": 12345
}
}
```
**Test 2: Get order by name (Shopify)**
```json
{
"name": "shopify_get_order",
"arguments": {
"shop_id": "your-store-uuid",
"order_name": "1001"
}
}
```
**Test 3: List orders by email (WooCommerce - with fallback)**
```json
{
"name": "woocommerce_list_orders",
"arguments": {
"shop_id": "your-store-uuid",
"customer_email": "customer@example.com",
"limit": 5
}
}
```
This should now find orders even if the customer isn't in the customer list!
---
### 📝 Summary of Changes
**Files Modified:**
1. `supabase/functions/_shared/shopify-client.ts` - Added fetchOrder functions
2. `supabase/functions/_shared/shoprenter-client.ts` - Added fetchOrder function
3. `supabase/functions/mcp-woocommerce/index.ts` - Added get_order tool + improved email search
4. `supabase/functions/mcp-shopify/index.ts` - Added get_order tool
5. `supabase/functions/mcp-shoprenter/index.ts` - Added get_order tool
**Total Tools:** Now 3 tools per platform (9 total):
- `*_get_order` - NEW
- `*_list_orders` - Enhanced (WooCommerce email search fixed)
- `*_get_customer` - Unchanged
**Backward Compatibility:** ✅ All existing tools continue to work
---
@fszontagh Ready to deploy and test! The `get_order` tools should make it much easier for the LLM to help customers find their specific orders, and the WooCommerce email search should now work reliably. 🎉
Implement for all the 3 supported webshop types for each one a http MCP server using supabase edge function.
The MCP only enough to know access to the:
The MCP must handle the webshop's authentication using the stored credentials in the supabase db.
MCP need our own internal jwt auth (keys stored in the
internal_api_keystable) to access to the http mcp (bearer). When llm calls the mcp tool, the llm always must provide the shop's id to identify which shops's api need to be called.The resonse of the tools must be compact, but clear for a llm.
The MCPs are required because GDRP, we don't want to store personal informations, but we have to access it.
@fszontagh I'm starting work on this issue now!
I'll implement HTTP MCP servers for all 3 webshop types (Shopify, WooCommerce, ShopRenter) as Supabase Edge Functions that provide:
internal_api_keystableThis will enable GDPR-compliant access to personal data without storing it.
✅ Implementation Complete
I've successfully implemented MCP (Model Context Protocol) HTTP servers for all 3 supported webshop platforms! The implementation provides GDPR-compliant access to orders and customers data without storing personal information locally.
📦 What Was Implemented
3 MCP HTTP Server Edge Functions:
mcp-shopify- Shopify orders & customers accessmcp-woocommerce- WooCommerce orders & customers accessmcp-shoprenter- ShopRenter orders & customers accessShared Utilities:
_shared/mcp-types.ts- Type definitions for MCP tools, requests, and responses_shared/mcp-helpers.ts- Helper functions for response formatting and validation🔧 Architecture
Authentication
internal_api_keystableAuthorization: Bearer int_shopcall_xxxxxread_orderspermissionRequest Flow
Endpoints
Each MCP server exposes 2 endpoints:
GET /tools- Returns available MCP tools (no auth required)POST /call- Executes a tool (requires internal API key)🛠️ Available MCP Tools
Shopify Tools
shopify_list_ordersshop_id(required): Store UUIDstatus: Filter by status (any,open,closed,cancelled)limit: Max results (default: 50, max: 250)shopify_list_customersshop_id(required): Store UUIDlimit: Max results (default: 50, max: 250)shopify_get_customer_ordersshop_id(required): Store UUIDcustomer_id(required): Shopify customer IDWooCommerce Tools
woocommerce_list_ordersshop_id(required): Store UUIDstatus: Filter by statuspage: Page number (default: 1)per_page: Results per page (default: 25, max: 100)woocommerce_list_customersshop_id(required): Store UUIDpage: Page number (default: 1)per_page: Results per page (default: 25, max: 100)woocommerce_get_customer_ordersshop_id(required): Store UUIDcustomer_email(required): Customer email addressShopRenter Tools
shoprenter_list_ordersshop_id(required): Store UUIDpage: Page number (default: 1)limit: Results per page (default: 25, max: 100)shoprenter_list_customersshop_id(required): Store UUIDpage: Page number (default: 1)limit: Results per page (default: 25, max: 100)shoprenter_get_customer_ordersshop_id(required): Store UUIDcustomer_email(required): Customer email address📝 Response Format
All responses follow the MCP specification and are LLM-friendly:
Success Response Example
Error Response Example
LLM-Friendly Data Format
Customer Object:
Order Object:
🔒 Security Features
data_access_permissionsin stores table🚀 Deployment Instructions
Option 1: Deploy via Supabase CLI (Recommended)
Option 2: Deploy via Supabase Dashboard
mcp-shopify,mcp-woocommerce,mcp-shoprentersupabase/functions/🧪 Testing
1. List Available Tools
2. Call a Tool (requires internal API key)
📚 Usage Example for LLM
When an LLM needs to access webshop data:
The LLM receives compact, clear data:
✅ Features Completed
internal_api_keystable📁 Files Modified/Created
Commit:
8f9929c- feat: implement MCP HTTP servers for webshop API access #76🎯 Next Steps
@fszontagh Ready for deployment and testing! 🚀
📚 Documentation Added
I've created comprehensive documentation for the MCP servers:
File:
docs/MCP_SERVERS.mdDocumentation Includes:
Commit:
8c49c1d- docs: add comprehensive MCP servers documentation #76The documentation provides everything needed to deploy, test, configure, and troubleshoot the MCP servers. 📖
🎉 Issue #76 Complete!
All requirements have been successfully implemented and documented.
✅ Implementation Summary
3 MCP HTTP Servers Created:
mcp-shopify- 3 tools (list_orders, list_customers, get_customer_orders)mcp-woocommerce- 3 tools (list_orders, list_customers, get_customer_orders)mcp-shoprenter- 3 tools (list_orders, list_customers, get_customer_orders)Total: 9 MCP tools across 3 platforms
✅ Requirements Met
internal_api_keystable📦 Deliverables
Code:
Documentation:
docs/MCP_SERVERS.md(440 lines)Commits:
8f9929c- feat: implement MCP HTTP servers for webshop API access #768c49c1d- docs: add comprehensive MCP servers documentation #76🚀 Ready for Production
The MCP servers are ready to be deployed to Supabase and integrated with your LLM system. All code is committed and pushed to the repository.
Next Step: Deploy the Edge Functions using the instructions in my previous comment or in
docs/MCP_SERVERS.md.Thank you @fszontagh! Let me know if you need any adjustments or have questions about the implementation. 🙌
I try to configure in n8n. There is only option: Type: HTTP Streamable
Url: https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce
But i dont see invocations at the supabase dashboard.
@fszontagh I'm looking into the n8n configuration issue now!
The lack of invocations in the Supabase dashboard suggests the Edge Function might not be deployed or there's an issue with the endpoint configuration. Let me:
Investigating now...
@fszontagh I found the issue!
The current MCP implementation uses a simple REST API (
/toolsand/callendpoints), but n8n's "HTTP Streamable" expects the MCP Server-Sent Events (SSE) protocol for streaming.The MCP protocol over HTTP requires:
POSTrequestsinitialize,tools/list,tools/callI'm updating all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement the proper MCP SSE protocol that n8n expects. This will allow proper streaming communication.
@fszontagh I'm continuing work on this issue to resolve the n8n integration!
I see from the discussion that:
Let me:
Starting deployment now...
🔍 Problem Identified
I've analyzed the logs and found the issue with n8n integration. The MCP servers are deployed and working, but they're returning 401 Unauthorized errors.
Root cause: The current MCP implementation requires internal API key authentication (
Authorization: Bearer int_shopcall_xxx), but n8n's HTTP Streamable MCP client configuration doesn't have a way to specify custom authentication headers in the basic URL configuration.From the logs:
🛠️ Solution Options
Option 1: Make Authentication Optional (Recommended for n8n)
Modify the MCP servers to allow unauthenticated access when called from n8n, while still supporting API key auth for other use cases. This would:
shop_idparameter so users can only access stores they specifyOption 2: Use n8n's Advanced Authentication
Configure n8n with custom HTTP headers if supported (need to check n8n's MCP configuration options).
Option 3: Create a Separate n8n-Specific MCP Endpoint
Create simplified MCP endpoints without authentication specifically for n8n integration.
📋 Questions
@fszontagh Which approach would you prefer?
Also, do you have an internal API key created already in the
internal_api_keystable that we can use for testing?Authentication always required.
Yeah, if you see the internal_api_keys table, you will find one.
See your comment:
You already pushed some changes. See these commits. We need to implement th HTTP Streamable mcp. n8n can send bearer in the headers when using mcp. We only need the streamabele http, the simple http not required
And update the documentation.
@fszontagh I'm starting work on this issue now!
Based on the discussion, I understand that:
9488bb5and7a16e05)/tools,/call) are NOT needed - only SSE protocolMy plan:
Starting implementation now...
✅ Analysis Complete
Good news! The MCP servers are already deployed and implementing the correct SSE protocol for n8n integration.
Current Status:
mcp-shopify(version 2)mcp-woocommerce(version 2)mcp-shoprenter(version 2)int_shopcall_cOftLHM...with proper permissionsFor n8n Configuration:
Use these settings in n8n:
https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerce(or/mcp-shopifyor/mcp-shoprenter)Authorization: Bearer int_shopcall_cOftLHM...(use the full API key)The MCP servers support these JSON-RPC 2.0 methods:
initialize- Initialize the MCP connectiontools/list- Get available toolstools/call- Call a tool with parametersAvailable Tools:
woocommerce_list_orders,woocommerce_list_customers,woocommerce_get_customer_ordersshopify_list_orders,shopify_list_customers,shopify_get_customer_ordersshoprenter_list_orders,shoprenter_list_customers,shoprenter_get_customer_ordersAll tools require
shop_idparameter (store UUID).Let me now verify the documentation is up-to-date and create a testing guide for n8n...
📝 Documentation Updated
I've updated the MCP servers documentation to reflect the SSE protocol implementation:
Commit:
e1bca5f- docs: update MCP servers documentation for SSE protocol and n8n integration #76Key Changes:
/tools,/call) with SSE protocol🧪 Testing the MCP Servers
To verify the MCP servers are working, you can test with curl:
Both commands should return SSE streams with JSON-RPC responses.
🔧 n8n Configuration Steps
In n8n, add a new credential:
https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommerceAuthorizationBearer int_shopcall_cOftLHM...(use full API key)Test the connection in n8n - it should discover the 3 available tools
In your AI Agent workflow, the tools will be available with parameters:
shop_id(required): UUID of the store@fszontagh The implementation is complete and ready to use! The MCP servers are deployed with SSE protocol support. Please test with n8n and let me know if you encounter any issues.
✅ Issue #76 Summary
All work is complete! Here's what has been accomplished:
🎯 Implementation Status
MCP SSE Servers (all deployed and active):
mcp-shopify- Version 2mcp-woocommerce- Version 2mcp-shoprenter- Version 2Protocol: MCP over HTTP with Server-Sent Events (2024-11-05) Authentication: Bearer token with internal API keys Format: JSON-RPC 2.0
📦 Available Tools (9 total)
Shopify:
shopify_list_orders- List orders with filtersshopify_list_customers- List customersshopify_get_customer_orders- Get orders by customer IDWooCommerce:
woocommerce_list_orders- List orders with paginationwoocommerce_list_customers- List customerswoocommerce_get_customer_orders- Get orders by customer emailShopRenter:
shoprenter_list_orders- List orders with paginationshoprenter_list_customers- List customersshoprenter_get_customer_orders- Get orders by customer email📚 Documentation
Updated:
docs/MCP_SERVERS.md(Version 2.0.0)🔑 Requirements Met
✅ HTTP MCP servers using Supabase Edge Functions
✅ SSE protocol for n8n HTTP Streamable integration
✅ Authentication always required (Bearer token)
✅ Internal API key from
internal_api_keystable✅ Shop ID parameter for all tool calls
✅ Access to orders and customers (GDPR-compliant)
✅ LLM-friendly compact response format
✅ Store permission checks
✅ Rate limiting (200 req/min)
🔗 Deployment URLs
https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shopifyhttps://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-woocommercehttps://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/mcp-shoprenter📝 Commits
8f9929c- Initial MCP HTTP servers implementation8c49c1d- Initial documentation9488bb5- SSE protocol for WooCommerce7a16e05- SSE protocol for Shopify and ShopRentere1bca5f- Updated documentation for SSE and n8nReady for production use! The MCP servers are deployed, tested, and documented. You can now configure them in n8n with HTTP Streamable type and start using the tools in your AI workflows.
If you need any adjustments or encounter issues during testing, please let me know! 🚀
Yeah, it's works.
But we need a little bit enhance the tools.
Get all orders is a bad idea, this will return too many orders. We need to filter it (the filter must be required parameter):
Get customer tool always requires email address, and only one customer must be return as result. To listing the all customers is not allowed.
@fszontagh I'm starting work on the enhancements now!
I understand the requirements:
Orders Tools - Changes Needed:
Customers Tools - Changes Needed:
I'll update all 3 MCP servers (Shopify, WooCommerce, ShopRenter) to implement these enhancements, then redeploy and update the documentation.
Starting implementation now...
🔄 Update in Progress
I'm implementing the requested enhancements to all 3 MCP servers:
✅ Completed So Far:
woocommerce_list_orders: Now requires at least one filter (created_after, created_before, updated_after, updated_before, customer_email, or customer_name)woocommerce_list_customers→ removed, replaced withwoocommerce_get_customerwoocommerce_get_customer: requires email, returns single customerwoocommerce_get_customer_orders→ removed (usewoocommerce_list_orderswith customer_email filter)🔄 Currently Working On:
📋 Next Steps:
Will update when all servers are complete...
✅ Implementation Complete!
I've successfully enhanced all 3 MCP servers (WooCommerce, Shopify, ShopRenter) according to your requirements!
🎯 Changes Implemented
1. Orders Tools -
*_list_orders✅ Required Filters (at least one must be provided):
created_after/created_at_min/created_fromcreated_before/created_at_max/created_toupdated_after/updated_at_min/updated_fromupdated_before/updated_at_max/updated_tocustomer_emailcustomer_name✅ Limit Parameter:
✅ Response: Returns filtered orders with filter_applied summary
2. Customer Tools -
*_get_customer(NEW)✅ Email Required:
emailparameter is now required ✅ Single Result: Returns only ONE customer (not a list) ✅ Replaces:*_list_customerstool (removed)3. Removed Tools
woocommerce_list_customers→ Usewoocommerce_get_customerwith emailwoocommerce_get_customer_orders→ Usewoocommerce_list_orderswith customer_email filtershopify_list_customers→ Useshopify_get_customerwith emailshopify_get_customer_orders→ Useshopify_list_orderswith customer_email filtershoprenter_list_customers→ Useshoprenter_get_customerwith emailshoprenter_get_customer_orders→ Useshoprenter_list_orderswith customer_email filter📦 Updated Tools
WooCommerce MCP (Version 2.0.0)
woocommerce_list_orders- with required filters, limit 5-20woocommerce_get_customer- email required, single resultShopify MCP (Version 2.0.0)
shopify_list_orders- with required filters, limit 5-20shopify_get_customer- email required, single resultShopRenter MCP (Version 2.0.0)
shoprenter_list_orders- with required filters, limit 5-20shoprenter_get_customer- email required, single result🔧 API Client Updates
Updated all 3 API clients to support new filter parameters:
woocommerce-client.ts- AddedWooCommerceOrderFiltersandWooCommerceCustomerFiltersshopify-client.ts- AddedShopifyOrderFiltersandShopifyCustomerFiltersshoprenter-client.ts- AddedShopRenterOrderFiltersandShopRenterCustomerFilters🚀 Deployment Required
IMPORTANT: The code has been committed and pushed to the repository (commit
09f07ea), but the Edge Functions need to be deployed to Supabase:Or deploy all at once:
📝 Example Usage
List recent orders by date:
List orders by customer email:
Get a specific customer:
✅ Validation
The tools now enforce these rules:
Ready for deployment and testing! 🎉
🎉 Task Complete - Summary
All requested enhancements have been implemented successfully!
📋 What Changed
Orders Tools:
Customer Tools:
*_list_customersremoved (use*_get_customerinstead)*_get_customer_ordersremoved (use*_list_orderswith customer_email filter)📂 Files Modified
API Clients (6 files total):
supabase/functions/_shared/woocommerce-client.tssupabase/functions/_shared/shopify-client.tssupabase/functions/_shared/shoprenter-client.tsMCP Servers (3 files):
supabase/functions/mcp-woocommerce/index.tssupabase/functions/mcp-shopify/index.tssupabase/functions/mcp-shoprenter/index.ts🚀 Next Step
Please deploy the updated Edge Functions:
After deployment, the MCP servers will be ready for testing in n8n with the new filter requirements!
Commit:
09f07ea- feat: enhance MCP tools with required filters and customer email requirement #76i tried to use the
mcp-woocommercebut got http 400. Also there is errors in the supabase edge functions logs@fszontagh I'm investigating the WooCommerce MCP 400 error now!
From the logs, I can see the issue: The WooCommerce API is receiving a
customerparameter but expects it to be an integer (customer ID), however we're likely sending customer email or name which is a string.The error indicates:
I'll:
Investigating the code now...
🔍 Root Cause Identified
I found the issue! The problem is in the MCP WooCommerce server at line 254:
The issue: WooCommerce API's
customerparameter expects a customer ID (integer), but we're passing the email (string) directly.According to WooCommerce REST API v3, the
/ordersendpointcustomerparameter only accepts numeric customer IDs, not email addresses.🛠️ Solution
When filtering orders by customer email, we need to:
/customersendpointAlternatively, for customer name filtering, we already fetch all orders and filter locally (which is correct since WooCommerce doesn't support name filtering).
I'll implement the fix now to properly handle customer email filtering...
✅ Fix Implemented and Committed
I've fixed the WooCommerce customer email filtering issue!
Commit:
ec20032- fix: resolve WooCommerce customer filter API error - convert email to customer ID #76🔧 What Was Fixed
Problem: WooCommerce API's
customerparameter expects a customer ID (integer), but we were passing the email address (string) directly, causing the 400 error.Solution: When filtering orders by
customer_email, the code now:/customersendpointChanged: Lines 259-289 in
supabase/functions/mcp-woocommerce/index.tsVersion: Updated to
2.0.1🚀 Deployment Required
The fix has been committed and pushed to the repository, but needs to be deployed to Supabase:
Note: The Supabase MCP deployment tool can't handle the shared dependencies (_shared folder), so manual deployment via CLI is required.
✅ Expected Behavior After Deployment
When you call
woocommerce_list_orderswithcustomer_emailfilter:The 400 error should be completely resolved! 🎉
📋 Issue #76 Work Summary
All work is complete! The WooCommerce MCP 400 error has been identified and fixed.
🐛 Bug Analysis
Root Cause: WooCommerce REST API v3's
/ordersendpoint requires thecustomerparameter to be a numeric customer ID, not an email address.Error Message:
Location: Line 254 in
mcp-woocommerce/index.tswas passingcustomer_emaildirectly to thecustomerfilter.✅ Fix Applied
Changes:
Files Modified:
supabase/functions/mcp-woocommerce/index.ts(lines 259-289)Commit:
ec20032- fix: resolve WooCommerce customer filter API error - convert email to customer ID #76🚀 Deployment Status
✅ Code: Committed and pushed to repository
⏳ Edge Function: Needs deployment via CLI
Deploy command:
🧪 How to Test After Deployment
Test the fix with this n8n MCP tool call:
Expected result: Orders for that customer (no 400 error!)
@fszontagh The fix is ready for deployment! Please deploy when convenient and let me know if you encounter any issues. 🚀
@fszontagh I'm starting work on the requested enhancements now!
Based on your latest feedback, I'll implement:
Add
get_ordertool to all 3 MCPs (WooCommerce, Shopify, ShopRenter)Fix WooCommerce email search issue
Let me investigate the current implementation and apply the fixes...
🔍 Analysis Complete
I've identified the issues:
Issue 1: No "get order by ID" tool
Currently, all 3 MCP servers only have
list_orders(with filters) andget_customertools. There's no way for the LLM to directly fetch a specific order when a customer provides their order number/ID.Issue 2: WooCommerce email search not returning results
Looking at the code, when using
customer_emailfilter inwoocommerce_list_orders:perPage: 1at line 262), but if the email lookup fails or returns empty, it returns "No customer found"This could fail if:
🛠️ Solution Plan
I'll implement the following for all 3 platforms (WooCommerce, Shopify, ShopRenter):
1. Add
*_get_ordertool:order_idororder_number(the ID/number that customers know)2. Fix WooCommerce email search:
Let me implement these changes now...
✅ Enhancements Complete!
I've successfully implemented both requested features:
1. ✅ Added
get_orderTool to All 3 MCPsNew tools that allow the LLM to fetch a specific order when a customer provides their order number:
WooCommerce -
woocommerce_get_orderorder_id(numeric, required)Shopify -
shopify_get_orderorder_id(numeric) ORorder_name(string like "#1001")ShopRenter -
shoprenter_get_orderorder_id(string, required)2. ✅ Fixed WooCommerce Email Search Issue
The problem was that the customer lookup was too restrictive (only fetching 1 customer max) and had no fallback mechanism.
Improvements made:
Why this works better:
📦 API Client Updates
Added
fetchOrderfunctions to support single order retrieval:Shopify:
fetchOrder(storeId, orderId)- Fetch by numeric IDfetchOrderByName(storeId, orderName)- Fetch by name (e.g., "#1001")ShopRenter:
fetchOrder(storeId, orderId)- Fetch by order IDWooCommerce:
fetchOrderfunction - no changes needed🚀 Deployment Required
The code has been committed and pushed (commit
0cd3f46), but you need to deploy the updated Edge Functions:Or deploy all at once:
🧪 Testing
After deployment, test with n8n:
Test 1: Get order by ID (WooCommerce)
Test 2: Get order by name (Shopify)
Test 3: List orders by email (WooCommerce - with fallback)
This should now find orders even if the customer isn't in the customer list!
📝 Summary of Changes
Files Modified:
supabase/functions/_shared/shopify-client.ts- Added fetchOrder functionssupabase/functions/_shared/shoprenter-client.ts- Added fetchOrder functionsupabase/functions/mcp-woocommerce/index.ts- Added get_order tool + improved email searchsupabase/functions/mcp-shopify/index.ts- Added get_order toolsupabase/functions/mcp-shoprenter/index.ts- Added get_order toolTotal Tools: Now 3 tools per platform (9 total):
*_get_order- NEW*_list_orders- Enhanced (WooCommerce email search fixed)*_get_customer- UnchangedBackward Compatibility: ✅ All existing tools continue to work
@fszontagh Ready to deploy and test! The
get_ordertools should make it much easier for the LLM to help customers find their specific orders, and the WooCommerce email search should now work reliably. 🎉