Skip to main content

AI-First ERP Configuration Engine for Odoo 18 โ€” CLI toolkit + MCP server

Project description

๐Ÿ”จ OdooForge

AI-First ERP Configuration Engine for Odoo 18

Python 3.11+ MCP License: AGPL-3.0 Odoo 18

CLI toolkit + MCP server that gives AI assistants complete control over Odoo 18.
79 tools. Domain knowledge. Planning. Code generation. One-command workspace setup.

Getting Started ยท Tool Reference ยท Architecture ยท Contributing


โœจ What Can It Do?

"Start an Odoo instance and create a database called myshop"

"Install Sales, CRM, and Inventory modules"

"Add a custom loyalty tier field to res.partner as a selection"

"Create an automation that sends a welcome email for new contacts"

"Run the restaurant recipe to set up a full POS system"

"Show me the invoice report template and add a custom footer"

"Run a health check โ€” are there any issues?"

"Analyze my requirements: I run a bakery with 3 locations and need inventory and POS"

"Generate a custom addon for recipe management with ingredients tracking"

OdooForge turns natural language into Odoo operations. From spinning up Docker containers to generating complete custom addons โ€” with built-in domain knowledge that helps AI assistants make better decisions.

๐Ÿš€ Quick Start

1. Install

pip install odooforge

2. Initialize Workspace

odooforge init

This scaffolds everything you need in the current directory:

.
โ”œโ”€โ”€ CLAUDE.md                  # AI assistant context
โ”œโ”€โ”€ .env                       # Connection settings (fill in your details)
โ”œโ”€โ”€ .claude/skills/            # Claude Code skills (/odoo-brainstorm, /odoo-architect, /odoo-debug)
โ”œโ”€โ”€ docker/
โ”‚   โ”œโ”€โ”€ docker-compose.yml     # Odoo 18 + PostgreSQL 17
โ”‚   โ””โ”€โ”€ odoo.conf
โ”œโ”€โ”€ addons/                    # Your custom Odoo modules
โ”œโ”€โ”€ .cursor/mcp.json           # Cursor MCP config
โ”œโ”€โ”€ .windsurf/mcp.json         # Windsurf MCP config
โ””โ”€โ”€ .gitignore

3. Start Odoo

# Edit .env with your connection details, then:
cd docker && docker compose up -d

4. Start Coding

Open the workspace in your AI editor. The MCP configs are already set up โ€” your assistant has access to all 79 OdooForge tools.

Ask your AI assistant to run odoo_diagnostics_health_check to verify everything is connected.

Updating Your Workspace

After upgrading OdooForge (pip install --upgrade odooforge), update workspace template files to the latest versions:

odooforge init --update

This overwrites skills, configs, and Docker files with the latest versions. Your .env is never overwritten.

โš™๏ธ Configuration

OdooForge can be configured via environment variables. When running as an MCP server, pass these in your mcp.json or claude_desktop_config.json.

Variable Description Default
ODOO_URL URL of the Odoo instance http://localhost:8069
ODOO_DEFAULT_DB Database to connect to by default odoo
ODOO_ADMIN_USER Admin username (for RPC) admin
ODOO_ADMIN_PASSWORD Admin password admin
ODOO_MASTER_PASSWORD Master password (for DB creation) admin
POSTGRES_HOST PostgreSQL host localhost
POSTGRES_PORT PostgreSQL port 5432
POSTGRES_USER PostgreSQL user odoo
POSTGRES_PASSWORD PostgreSQL password odoo
DOCKER_COMPOSE_PATH Path to docker-compose.yml (optional) Auto-detected

MCP Client Config (mcp.json)

Option 1: Using uvx (Recommended)

This runs the latest published version of OdooForge isolated from your system.

{
  "mcpServers": {
    "odooforge": {
      "command": "uvx",
      "args": ["odooforge"],
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DEFAULT_DB": "odoo",
        "ODOO_ADMIN_USER": "admin",
        "ODOO_ADMIN_PASSWORD": "my_admin_password",
        "ODOO_MASTER_PASSWORD": "my_master_password",
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "odoo",
        "POSTGRES_PASSWORD": "my_postgres_password"
      }
    }
  }
}

Option 2: Using Local Project (Development)

If you have customized OdooForge in a local virtual environment:

{
  "mcpServers": {
    "odooforge": {
      "command": "/path/to/your/venv/bin/odooforge",
      "args": [],
      "env": {
        "ODOO_ADMIN_PASSWORD": "secure_password"
      }
    }
  }
}

๐Ÿ›  79 Tools Across 20 Categories

Category # Tools Docs
Instance 5 start ยท stop ยท restart ยท status ยท logs โ†’
Database 6 create ยท list ยท backup ยท restore ยท drop ยท run_sql โ†’
Records 6 search ยท read ยท create ยท update ยท delete ยท execute โ†’
Snapshots 4 create ยท list ยท restore ยท delete โ†’
Modules 6 list_available ยท list_installed ยท info ยท install ยท upgrade ยท uninstall โ†’
Models 3 list ยท fields ยท search_field โ†’
Schema 5 field_create ยท field_update ยท field_delete ยท model_create ยท list_custom โ†’
Views 5 list ยท get_arch ยท modify ยท reset ยท list_customizations โ†’
Reports 6 list ยท get_template ยท modify ยท preview ยท reset ยท layout_configure โ†’
Automation 5 list ยท create ยท update ยท delete ยท email_template_create โ†’
Network 3 expose ยท status ยท stop โ†’
Import 3 preview ยท execute ยท template โ†’
Email 4 configure_outgoing ยท configure_incoming ยท test ยท dns_guide โ†’
Settings 4 settings_get ยท settings_set ยท company_configure ยท users_manage โ†’
Knowledge 3 module_info ยท search ยท community_gaps โ†’
Recipes 2 list ยท execute โ†’
Diagnostics 1 health_check โ†’
Planning 3 analyze_requirements ยท design_solution ยท validate_plan โ†’
Workflows 4 setup_business ยท create_feature ยท create_dashboard ยท setup_integration โ†’
Code Generation 1 generate_addon โ†’

๐Ÿ“– Full Tool Reference โ†’

๐Ÿง  Domain Knowledge & AI Guidance

OdooForge includes built-in domain knowledge that helps AI assistants make informed decisions:

MCP Resources (6)

Structured knowledge accessible via odoo:// URIs:

Resource Description
odoo://knowledge/modules 35 Odoo 18 modules mapped to business language
odoo://knowledge/blueprints 9 industry blueprints (restaurant, ecommerce, etc.)
odoo://knowledge/dictionary Business terms โ†’ Odoo models/fields mapping
odoo://knowledge/best-practices Naming conventions, field design, security patterns
odoo://knowledge/patterns Common customization patterns (trackable models, workflows)
odoo://knowledge/blueprints/{industry} Detailed blueprint for a specific industry

MCP Prompts (4)

Guided workflows that provide step-by-step instructions:

Prompt Description
business-setup Full business deployment from requirements
feature-builder Custom feature creation with validation
module-generator Complete addon scaffolding
troubleshooter Systematic issue diagnosis and resolution

Claude Code Skills (3)

Slash-command skills for Claude Code users (installed to .claude/skills/ by odooforge init):

Skill Description
/odoo-brainstorm Explore customization ideas, discover modules, match blueprints
/odoo-architect Design data models with naming conventions and security
/odoo-debug Diagnose issues with error mapping and snapshot rollback

๐Ÿณ Industry Recipes

One-command setup for common business types:

Recipe Modules What It Sets Up
๐Ÿ• Restaurant POS, Kitchen, Inventory, HR Table management, kitchen printing, food categories
๐Ÿ›’ eCommerce Website, Payments, Delivery, CRM Online shop, cart, checkout, wishlists
๐Ÿญ Manufacturing MRP, Quality, Maintenance Work centers, BoM, production planning
๐Ÿ’ผ Services Project, Timesheets, CRM, Sales Billable projects, task stages, invoicing
๐Ÿช Retail POS, Inventory, Loyalty Barcode scanning, stock alerts, loyalty programs
"Run the restaurant recipe in dry-run mode first, then execute it"

๐Ÿ— Architecture

graph TB
    AI[AI Assistant<br/>Claude / Cursor / etc.] -->|MCP Protocol| MCP[OdooForge MCP Server<br/>79 tools ยท 6 resources ยท 4 prompts]

    MCP --> Planning[Planning Layer]
    MCP --> Workflows[Workflow Layer]
    MCP --> Tools[Core Tool Layer]
    MCP --> Knowledge[Knowledge Layer]

    subgraph Planning[Layer 3: Planning]
        direction LR
        P1[Requirement Analysis]
        P2[Solution Design]
        P3[Plan Validation]
    end

    subgraph Workflows[Layer 2: Workflows]
        direction LR
        W1[Business Setup]
        W2[Feature Builder]
        W3[Dashboard]
        W4[Integration]
    end

    subgraph Tools[Layer 0: Core Tools]
        direction LR
        T1[Records]
        T2[Modules]
        T3[Schema]
        T4[Views]
        T5[+ 13 more]
    end

    subgraph Knowledge[Layer 1: Domain Knowledge]
        direction LR
        K1[Module KB]
        K2[Blueprints]
        K3[Patterns]
    end

    subgraph Codegen[Code Generation]
        direction LR
        C1[Model Gen]
        C2[View Gen]
        C3[Security Gen]
    end

    Workflows --> Codegen
    Tools --> Conn[Connections]

    subgraph Conn[Connections]
        direction LR
        RPC[XML-RPC]
        Docker[Docker]
        PG[PostgreSQL]
    end

    Conn --> Odoo[Odoo 18<br/>Docker Container]
    Conn --> DB[(PostgreSQL 17<br/>Docker Container)]

    style AI fill:#5A67D8,color:#fff
    style MCP fill:#714B67,color:#fff
    style Odoo fill:#714B67,color:#fff
    style DB fill:#336791,color:#fff
src/odooforge/
โ”œโ”€โ”€ cli.py                    # CLI entry point โ€” server, init, init --update
โ”œโ”€โ”€ init.py                   # Workspace initializer โ€” scaffolds configs, skills, Docker
โ”œโ”€โ”€ server.py                 # MCP server โ€” 79 tools, 6 resources, 4 prompts
โ”œโ”€โ”€ config.py                 # Environment configuration
โ”œโ”€โ”€ connections/
โ”‚   โ”œโ”€โ”€ docker_client.py      # Docker Compose management
โ”‚   โ”œโ”€โ”€ xmlrpc_client.py      # Odoo XML-RPC interface
โ”‚   โ””โ”€โ”€ pg_client.py          # PostgreSQL direct connection
โ”œโ”€โ”€ tools/                    # One file per tool category (20 files)
โ”‚   โ”œโ”€โ”€ records.py            # CRUD operations
โ”‚   โ”œโ”€โ”€ modules.py            # Module lifecycle
โ”‚   โ”œโ”€โ”€ schema.py             # Custom fields & models
โ”‚   โ”œโ”€โ”€ views.py              # View inheritance & XPath
โ”‚   โ”œโ”€โ”€ reports.py            # QWeb report templates
โ”‚   โ”œโ”€โ”€ automation.py         # Automated actions
โ”‚   โ”œโ”€โ”€ planning.py           # Requirements analysis & solution design
โ”‚   โ”œโ”€โ”€ workflows.py          # Business setup & feature creation
โ”‚   โ”œโ”€โ”€ codegen.py            # Addon code generation
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ knowledge/                # Domain knowledge (Layer 1)
โ”‚   โ”œโ”€โ”€ knowledge_base.py     # Singleton KB with modules, blueprints, patterns
โ”‚   โ””โ”€โ”€ data/                 # Structured knowledge data
โ”œโ”€โ”€ planning/                 # Planning engine (Layer 3)
โ”‚   โ”œโ”€โ”€ requirement_parser.py # NL โ†’ structured requirements
โ”‚   โ””โ”€โ”€ solution_designer.py  # Requirements โ†’ implementation plan
โ”œโ”€โ”€ workflows/                # Workflow orchestration (Layer 2)
โ”‚   โ”œโ”€โ”€ setup_business.py     # Full business deployment plans
โ”‚   โ”œโ”€โ”€ create_feature.py     # Custom feature step plans
โ”‚   โ”œโ”€โ”€ create_dashboard.py   # Dashboard creation plans
โ”‚   โ””โ”€โ”€ setup_integration.py  # Integration setup plans
โ”œโ”€โ”€ codegen/                  # Code generation engine
โ”‚   โ”œโ”€โ”€ addon_builder.py      # Orchestrates full addon generation
โ”‚   โ”œโ”€โ”€ manifest_gen.py       # __manifest__.py generation
โ”‚   โ”œโ”€โ”€ model_gen.py          # Python model file generation
โ”‚   โ”œโ”€โ”€ view_gen.py           # XML view generation
โ”‚   โ””โ”€โ”€ security_gen.py       # Access rules & security groups
โ”œโ”€โ”€ utils/                    # Shared utilities
โ”‚   โ”œโ”€โ”€ validators.py         # Input validation
โ”‚   โ”œโ”€โ”€ errors.py             # Custom error hierarchy
โ”‚   โ”œโ”€โ”€ xpath_builder.py      # XPath expression builder
โ”‚   โ”œโ”€โ”€ qweb_builder.py       # QWeb template helpers
โ”‚   โ””โ”€โ”€ response_formatter.py # Consistent response formatting
โ””โ”€โ”€ verification/             # Post-operation verification
    โ”œโ”€โ”€ state_cache.py        # Live model/field cache
    โ””โ”€โ”€ verify_*.py           # Category-specific verifiers

๐Ÿ”’ Safety Features

OdooForge is designed to be safe for AI-driven operations:

  • ๐Ÿ”„ Snapshots โ€” Create backups before risky operations. Restore instantly.
  • โœ… Confirmation guards โ€” Destructive actions (delete, drop, uninstall) require confirm=true.
  • ๐Ÿท Namespace enforcement โ€” Custom fields must start with x_, custom models with x_. No accidental core modifications.
  • ๐Ÿ” Post-operation verification โ€” Module installs, field creation, and view modifications are verified after execution.
  • ๐Ÿ‘ Dry-run modes โ€” Recipes and imports can be previewed before execution.
  • ๐Ÿ“‹ Input validation โ€” Model names, field names, SQL queries, and domains are validated before execution.

๐Ÿงช Development

# Clone and install
git clone https://github.com/hamzatrq/odoo-forge.git
cd odooforge
uv sync --group dev

# Run tests (564 tests)
uv run pytest tests/ -v

# Run the server locally
uv run odooforge

See CONTRIBUTING.md for detailed development guidelines.

๐Ÿ“š Documentation

Document Description
Getting Started Installation, first run, connecting to MCP
Configuration Environment variables, Docker setup
Tool Reference All 79 tools with parameters and examples
Planning Tools Requirement analysis and solution design
Workflow Tools Business setup, features, dashboards
Code Generation Custom addon scaffolding
Architecture System design and data flow
Industry Recipes Pre-built setup recipes
Contributing Development setup and guidelines
Changelog Version history

๐Ÿ“„ License

AGPL-3.0 โ€” use it however you want.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odooforge-0.2.2.tar.gz (197.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odooforge-0.2.2-py3-none-any.whl (148.8 kB view details)

Uploaded Python 3

File details

Details for the file odooforge-0.2.2.tar.gz.

File metadata

  • Download URL: odooforge-0.2.2.tar.gz
  • Upload date:
  • Size: 197.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odooforge-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c1a07c3a277d6783eaa10f9b51def5ac7b1c39bf1ec0873e2a5e278905ea2631
MD5 628c3b6daee629d64834580be5182eed
BLAKE2b-256 a7b29c0f86c53f2e2099f834702ac992b4c6c19a1ea4ffcba5b53d2b68ecbc41

See more details on using hashes here.

File details

Details for the file odooforge-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: odooforge-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 148.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odooforge-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0773a76eeac36382cd813b2c47f4d1531d8ec79d7c4a7e8fb86c429d5f4fa077
MD5 229ef1c52dbbe10c85b75bd3db18b98f
BLAKE2b-256 994865ebb2924a84d90b7faeb80faf9f422fe922fa69bc0a326d8cc8d8461636

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page