Model Context Protocol server for Odoo module development with version-aware documentation and code generation tools
Project description
Odoo Development MCP Server
A Model Context Protocol (MCP) server for Odoo module development with AI assistance. Provides version-aware documentation access (17.0, 18.0, 19.0), intelligent code generation, and development workflow automation.
๐ Quick Start | ๐ OpenCode Setup | ๐ง Troubleshooting | ๐ Changelog
Features
- ๐ Documentation Access: 302+ Odoo documentation files searchable across all versions
- ๐ง Version-Aware Code Generation: All generated code includes version info and relevant documentation links
- ๐ Integrated Development Guidelines: Built-in Odoo coding standards and best practices enforcement
- ๐ก Smart Prompts: Guided workflows with rules-aware feature development, debugging, and upgrades
- ๐ฏ Automatic Context: Generated code includes references to official Odoo documentation and development rules
Installation
Prerequisites
# Ensure Python 3.12+ is installed
python --version
# Install MCP CLI (if not already installed)
pip install "mcp[cli]"
For Claude Desktop
-
Quick Install (Recommended):
mcp install odoo_mcp_server.py --name "Odoo Dev"
-
Manual Install:
Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{ "mcpServers": { "odoo-dev": { "command": "python", "args": ["/absolute/path/to/odoo-dev-mcp/odoo_mcp_server.py"] } } }
- macOS:
-
Restart Claude Desktop
For OpenCode
๐ Complete OpenCode Setup Guide โ
Quick setup - add to ~/.opencode/config.jsonc:
Option 1: Using uv (Recommended)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"odoo-dev": {
"type": "local",
"command": ["uv", "run", "/absolute/path/to/odoo-dev-mcp/odoo_mcp_server.py"],
"enabled": true,
"environment": {
"PATH": "/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin"
}
}
}
}
First, install dependencies:
cd /path/to/odoo-dev-mcp
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
Option 2: Using Python directly
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"odoo-dev": {
"type": "local",
"command": ["python3", "/absolute/path/to/odoo-dev-mcp/odoo_mcp_server.py"],
"enabled": true,
"environment": {
"PYTHONPATH": "/absolute/path/to/odoo-dev-mcp"
}
}
}
}
Note: Requires pip install mcp first.
Then use in OpenCode:
Search Odoo documentation for "fields.Command"
Set Odoo version to 19.0
Create model library.book with fields: name, author
Get development guidelines
See OPENCODE_SETUP.md for complete guide with examples, troubleshooting, and workflows.
Quick Start
1. Test the Server
python test_server.py
You should see all tests pass with โ marks.
2. Basic Usage in Claude/OpenCode
# Set your Odoo version
Set Odoo version to 19.0
# Create a module
Create an Odoo module called "library_management" with display name "Library Management"
# Create a model
Create a model library.book with fields: name (char), author_id (many2one to res.partner), isbn (char)
# Generate views
Create a form view for library.book with fields: name, author_id, isbn
# Add security
Create security rules for library.book in module library_management
# Search documentation
Search Odoo documentation for "computed fields"
Available Tools
Version Management
set_odoo_version(version)- Switch between 17.0, 18.0, 19.0get_current_version()- Check current version
Documentation & Guidelines
search_documentation(query, version)- Full-text search across docsget_development_guidelines(context)- Get context-specific coding guidelines- Contexts:
general,models,views,security,all
- Contexts:
Code Generation (Version-Aware)
create_odoo_module(name, display_name, description, ...)- Generate module structure with version-specific manifestcreate_odoo_model(model_name, description, fields, inherit)- Create Python models with ORM documentation linkscreate_odoo_view(model_name, view_type, fields_to_display)- Generate XML views with architecture referencescreate_security_rules(model_name, module_name, groups)- Create security config with security documentation
Development Prompts
develop_odoo_feature(description)- Guided feature developmentdebug_odoo_error(error, context)- Error debugging assistanceupgrade_odoo_module(module, from_version, to_version)- Migration guidancereview_odoo_code(code)- Code review with best practices
Resources
Access Odoo documentation and development rules:
Documentation:
odoo://docs/19.0/index- Documentation indexodoo://docs/19.0/reference/backend/orm- ORM referenceodoo://docs/18.0/howtos/create_reports- How-to guides
Development Rules:
odoo://rules/all- All development guidelinesodoo://rules/clean-code- Clean code principlesodoo://rules/odoo-development- Odoo-specific conventions
Examples
Complete Module Creation
# In Claude/OpenCode:
1. Set Odoo version to 19.0
2. Create module "task_manager" with display name "Task Manager"
3. Create model task.task with fields:
- name (char, required)
- description (text)
- priority (selection: low, medium, high)
- assigned_to (many2one: res.users)
- deadline (date)
4. Create form view for task.task
5. Create tree view for task.task
6. Create security rules for task.task
Field Types Examples
All Odoo field types are supported:
fields = [
{"name": "name", "type": "Char", "required": True},
{"name": "description", "type": "Text"},
{"name": "amount", "type": "Float"},
{"name": "quantity", "type": "Integer"},
{"name": "active", "type": "Boolean"},
{"name": "date", "type": "Date"},
{"name": "partner_id", "type": "Many2one", "comodel_name": "res.partner"},
{"name": "line_ids", "type": "One2many", "comodel_name": "model.line", "inverse_name": "parent_id"},
{"name": "tag_ids", "type": "Many2many", "comodel_name": "model.tag"},
{"name": "state", "type": "Selection", "selection": "[('draft', 'Draft'), ('done', 'Done')]"}
]
Development
Run Tests
python test_server.py
Test with MCP Inspector
mcp dev odoo_mcp_server.py
Architecture
odoo_mcp_server.py
โโโ Resources (Documentation)
โ โโโ 302 RST files indexed
โ โโโ Version-specific content
โ โโโ Full-text search
โโโ Tools (Code Generation)
โ โโโ Module scaffolding
โ โโโ Model definitions
โ โโโ View generation
โ โโโ Security rules
โโโ Prompts (Workflows)
โโโ Feature development
โโโ Error debugging
โโโ Module upgrades
โโโ Code review
Development Guidelines
The server includes comprehensive Odoo development guidelines that are automatically applied:
Built-in Rules
- Clean Code Principles - General software engineering best practices
- Odoo Conventions - Odoo-specific naming, structure, and coding standards
- Module structure and naming
- Model and field naming conventions
- View architecture standards
- Security rules patterns
- ORM best practices
- Performance optimization tips
Rules Integration
All code generation tools automatically include:
- โ ๏ธ Naming convention warnings
- ๐ Context-specific guidelines
- ๐ Links to relevant rules sections
- โ Best practice recommendations
Access Guidelines
# Get general guidelines
get_development_guidelines("general")
# Get model-specific rules
get_development_guidelines("models")
# Access all rules
View resource: odoo://rules/all
Documentation Structure
The server provides access to Odoo documentation organized by version:
docs/
โโโ 17.0/ (102 files)
โโโ 18.0/ (100 files)
โโโ 19.0/ (100 files)
rules/
โโโ clean-code.mdc
โโโ odoo-development.mdc
docs/ โโโ 17.0/ (102 files) โโโ 18.0/ (100 files) โโโ 19.0/ (100 files)
## Supported Platforms
- โ
Windows, macOS, Linux
- โ
Claude Desktop
- โ
OpenCode (VS Code extension)
- โ
Any MCP-compatible client
## Requirements
- Python 3.12+
- MCP SDK 1.4.1+
- FastMCP
## Troubleshooting
### Server not showing in Claude?
1. Check config file is valid JSON
2. Verify absolute paths
3. Restart Claude Desktop completely
### Import errors?
```bash
pip install "mcp[cli]"
Documentation not found?
Ensure docs/ directory exists with version folders (17.0, 18.0, 19.0)
Tips
- Always set the Odoo version first - All code generation adapts to the selected version
- Review development guidelines - Use
get_development_guidelines()for context-specific rules - Follow naming conventions - Generated code includes rules warnings for common mistakes
- Use descriptive model names - e.g.,
library.book(with dots), notlib_b(with underscores) - Check rules in generated code - Each tool output includes relevant naming and coding rules
- Search before asking - Use
search_documentation()for specific questions - Test incrementally - module โ models โ views โ security
- Review code against rules - Use the
review_odoo_codeprompt for rule compliance checks
License
MIT License
Contributing
Contributions welcome! This server follows clean code principles and Odoo best practices.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_mart337i_odoo_dev_mcp-1.0.0.tar.gz.
File metadata
- Download URL: iflow_mcp_mart337i_odoo_dev_mcp-1.0.0.tar.gz
- Upload date:
- Size: 8.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8294611d19b7aa05f660fb71795fdfd46d568bcc83038ce1ad532d24725d74b0
|
|
| MD5 |
dd7fc01bb2072477e57253894ae2386f
|
|
| BLAKE2b-256 |
91e48808c52b3c08b6761070d8125c6c554255003be1555071869da3c059e1d9
|
File details
Details for the file iflow_mcp_mart337i_odoo_dev_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_mart337i_odoo_dev_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
085c35745fa6991855e4b603ca4cda984bf20d319b436058fc406e2bd251aadd
|
|
| MD5 |
486b281fa021b4f1ad640ec2a6e561b5
|
|
| BLAKE2b-256 |
5b2dc104d9b868031596528203a1dcb9f68850b6d2fda9d22f73789888ed4a65
|