title: PrestaShop MCP Server
emoji: π§
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 8081
pinned: false
license: mit
tags:
- mcp
- prestashop
- ecommerce
- api
- tools
short_description: Model Context Protocol server for PrestaShop integration
PrestaShop MCP Server
A Model Context Protocol (MCP) server that provides tools for accessing PrestaShop data. This server exposes PrestaShop functionality through standardized MCP tools that can be used by AI assistants and other MCP clients.
π Features
- Standard MCP Protocol: Implements Model Context Protocol specification
- PrestaShop Integration: Direct access to PrestaShop product data
- HTTP API: RESTful interface for easy integration
- Multiple Tools: Product details, features, images, and search
- Type Safety: Full type validation with Pydantic
- Error Handling: Comprehensive error management
π§ Available Tools
get_product_details
Get detailed information about a PrestaShop product.
Parameters:
product_id(integer, required): Product IDlang_id(integer, optional): Language ID (default: 1)
get_product_features
Get product features from PrestaShop.
Parameters:
product_id(integer, required): Product ID
get_product_images
Get product images from PrestaShop.
Parameters:
product_id(integer, required): Product ID
search_products
Search for products in PrestaShop catalog.
Parameters:
query(string, required): Search querylimit(integer, optional): Max results (default: 10)
π‘ API Endpoints
MCP Endpoints
POST /
Main MCP JSON-RPC endpoint
Tools List Request:
{
"jsonrpc": "2.0",
"method": "tools/list",
"id": "1"
}
Tool Call Request:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_product_details",
"arguments": {"product_id": 123}
},
"id": "2"
}
GET /health
Health check endpoint
{
"status": "healthy",
"service": "prestashop-mcp-server"
}
π οΈ Usage
Direct HTTP Calls
# List available tools
curl -X POST https://your-space.hf.space/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "tools/list", "id": "1"}'
# Get product details
curl -X POST https://your-space.hf.space/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_product_details",
"arguments": {"product_id": 123}
},
"id": "2"
}'
MCP Client Integration
This server can be used with any MCP-compatible client:
import requests
# Configure MCP client to use this server
mcp_server_url = "https://your-space.hf.space/"
# List tools
response = requests.post(mcp_server_url, json={
"jsonrpc": "2.0",
"method": "tools/list",
"id": "1"
})
π PrestaShop Configuration
The server connects to PrestaShop via the ambaiagent API module. Configure your PrestaShop installation:
- Install the ambaiagent module
- Configure API endpoints in the module settings
- Ensure proper permissions for API access
π Performance
- Response Time: 1-5 seconds (depending on PrestaShop response)
- Concurrent Requests: Supports multiple simultaneous requests
- Error Handling: Graceful degradation with proper error messages
- Caching: Can be configured for improved performance
π Deployment
Hugging Face Spaces
This server is designed to run on Hugging Face Spaces:
- Create a new Space with Docker SDK
- Upload all files from the
mcp_serverdirectory - Set app_port to 8081
- Deploy and access via the Space URL
Local Development
# Install dependencies
pip install -r requirements.txt
# Start the server
python run_server.py --host 0.0.0.0 --port 8081
# Test the server
curl http://localhost:8081/health
π§ Architecture
MCP Client β HTTP Request β MCP Server β PrestaShop API β Response
- MCP Client sends JSON-RPC request
- MCP Server validates and processes request
- PrestaShop API provides product data
- Response formatted as MCP standard
π License
MIT License - Feel free to use and modify for your projects.
π Ready for Production: This MCP server is production-ready for e-commerce applications.