GitHub Stars
205
User Rating
Not Rated
Favorites
0
Views
28
Forks
92
Issues
13
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Python 3.6以上Odoo 14.0以上Installation
Installation
Prerequisites
Please specify required software and versions:Python: 3.6 or higher
Odoo: 14.0 or higher
Installation Steps
1. Clone Repository
bash
git clone https://github.com/tuanle96/mcp-odoo.git
cd mcp-odoo
2. Install Dependencies
bash
pip install -r requirements.txt
3. Create Configuration File
Createodoo_config.json and fill in your Odoo connection details.
4. Start Server
bash
python server.py
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Python version and reinstall dependencies. Issue: Unable to connect to Odoo Solution: Verify the contents of the configuration file.Configuration
Configuration
Odoo Connection Setup
1Create a configuration file named
odoo_config.json:json
{
"url": "https://your-odoo-instance.com",
"db": "your-database-name",
"username": "your-username",
"password": "your-password-or-api-key"
}
2Alternatively, use environment variables:
* ODOO_URL: Your Odoo server URL
* ODOO_DB: Database name
* ODOO_USERNAME: Login username
* ODOO_PASSWORD: Password or API key
* ODOO_TIMEOUT: Connection timeout in seconds
Security Settings
Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels
Examples
Examples
Basic Usage
Execute Method on Odoo Model
python
import requests
url = 'http://localhost:5000/mcp/execute_method'
payload = {
'model': 'res.partner',
'method': 'search',
'args': [],
'kwargs': {'limit': 10}
}
response = requests.post(url, json=payload)
print(response.json())
Search for Employees
python
import requests
url = 'http://localhost:5000/mcp/search_employee'
payload = {
'name': 'John',
'limit': 5
}
response = requests.post(url, json=payload)
print(response.json())
Use Cases
An AI assistant searches Odoo's customer data and retrieves specific customer information.
Searching for specific employee holiday information based on Odoo employee data.
Creating a script to automatically update product information via the Odoo API.
An AI assistant analyzes sales data from Odoo and generates reports.