odoo-devtools-mcp
v0.0.2
Published
Model Context Protocol (MCP) server for Odoo development - code generation, analysis tools, security patterns, and workflow automation
Maintainers
Readme

odoo-devtools-mcp
Model Context Protocol (MCP) server for Odoo development
Connect AI assistants directly to your Odoo instance for model introspection, field analysis, and development assistance.
Features
- 🔌 Easy Connection - Connect to any Odoo 16+ instance via JSON-RPC
- 🔍 Model Discovery - Search and explore available models
- 📊 Field Introspection - Get detailed field definitions and relationships
- 🏗️ Code Generation - Generate Python models and XML views
- 🔄 Inheritance Explorer - Visualize model inheritance hierarchies
- 🎯 Field Usage Tracking - Find where fields are used across the codebase
- ⚠️ Anti-Pattern Detection - Identify code quality issues and security risks
- 📚 Knowledge Resources - Access comprehensive Odoo development patterns
- 🤖 Workflow Prompts - Guided workflows for common development tasks
- 🔑 Secure - Support for API key authentication
- 🚀 Zero Config - Works with environment variables
Quick Start
1. Install
npx -y odoo-devtools-mcp@latest2. Configure Your MCP Client
Add to your MCP client configuration:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"odoo-devtools": {
"command": "npx",
"args": ["-y", "odoo-devtools-mcp@latest"],
"env": {
"ODOO_URL": "https://your-instance.odoo.com",
"ODOO_DB": "your-database",
"ODOO_USERNAME": "admin",
"ODOO_TOKEN": "your-api-key"
}
}
}
}VS Code Copilot (.vscode/settings.json):
{
"github.copilot.chat.mcp.enabled": true,
"github.copilot.chat.mcp.servers": {
"odoo-devtools": {
"command": "npx",
"args": ["-y", "odoo-devtools-mcp@latest"],
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_DB": "mydb",
"ODOO_TOKEN": "your-api-key"
}
}
}
}📚 More configuration examples: docs/MCP_CONFIG_EXAMPLES.md
3. Get Your API Key
- Log into Odoo → Settings → Users → Your user
- Account Security tab → New API Key
- Copy the generated key
4. Start Using
Restart your MCP client and try:
Connect to my Odoo instance and show me all sales modelsAvailable Tools
Core Tools
| Tool | Description |
| ------------------------- | ------------------------------------------------------ |
| init | Connect to Odoo instance and establish session |
| search_models | Search and list models with filters |
| get_model_fields | Get detailed field definitions and metadata |
| detect_odoo_version | Detect Odoo version and edition (Community/Enterprise) |
Code Generation
| Tool | Description |
| ------------------------- | ------------------------------------------------------------- |
| generate_model_code | Generate complete Python model classes with fields |
| generate_view_xml | Generate XML views (form, tree, search) with smart formatting |
Analysis Tools
| Tool | Description |
| --------------------------- | ------------------------------------------------------------------- |
| inheritance_explorer | Explore model inheritance hierarchies (ancestors & descendants) |
| field_usage_explorer | Find where fields are used in views and code |
| anti_pattern_detector | Detect security issues, performance problems, and ORM anti-patterns |
Available Resources
Access comprehensive Odoo development knowledge:
| Resource | Description |
| ------------------------------ | ----------------------------------------------------------- |
| odoo://model-patterns | Python model development patterns and best practices |
| odoo://view-patterns | XML view patterns for form, tree, kanban, search views |
| odoo://security-patterns | Security implementation guide (access rights, record rules) |
| odoo://anti-patterns | Common mistakes and anti-patterns to avoid |
Available Prompts
Interactive guided workflows for common tasks:
| Prompt | Description |
| --------------------------- | ---------------------------------------------- |
| create-custom-module | Step-by-step guide to create a new Odoo module |
| add-field-to-model | Workflow for adding fields to existing models |
| create-security-rules | Setup access rights and record rules |
Example Usage
Model Discovery:
What fields are in the res.partner model?
Show me all models related to invoicing
Get the structure of sale.order modelCode Generation:
Generate a Python model for a library management system
Create XML views for the product.template modelAnalysis:
Show me the inheritance hierarchy of sale.order
Where is the 'priority' field used in project.task?
Check this code for anti-patterns: [paste code]Guided Workflows:
Help me create a custom module for inventory tracking
Guide me through adding a new field to res.partner
Show me how to setup security for my custom modelEnvironment Variables
| Variable | Description | Required |
| --------------- | --------------------------- | -------- |
| ODOO_URL | Odoo instance URL | ✅ |
| ODOO_DB | Database name | ✅ |
| ODOO_TOKEN | API key or password | ✅ |
| ODOO_USERNAME | Username (default: admin) | |
Note: Also supports
ODOO_PASSWORDandODOO_API_KEYas alternatives toODOO_TOKEN
Supported Versions
- ✅ Odoo 16+ (JSON-RPC)
- ❌ Odoo 8-15 (not yet supported)
Documentation
Troubleshooting
Connection Failed
- ✅ Verify
ODOO_URLis correct and accessible - ✅ Check database name matches your Odoo instance
- ✅ Ensure API key/token is valid
- ✅ Restart your MCP client after config changes
Tool Not Working
- ✅ Run
inittool first to establish connection - ✅ Check user has access rights to the model
- ✅ Verify model exists using
search_models
Development
# Clone and install
git clone https://github.com/HeliconiaIO/odoo-devtools-mcp.git
cd odoo-devtools-mcp
pnpm install
# Build
pnpm build
# Test
pnpm test:serverSee CONTRIBUTING.md for development guidelines.
Roadmap
v0.0.3 (Planned):
- Record search and data queries
- Create/update/delete operations
- Module dependency analyzer
- Database migration helpers
Future:
- View introspection and manipulation
- Automated testing helpers
- Performance profiling tools
- Multi-instance management
License
MIT © 2026 Heliconia Solutions
