MCP Odoo Server

MCP Odoo Server

Enables conversational interaction with Odoo to manage timesheets, expenses, contacts, and invoices through an MCP-compatible assistant. It provides comprehensive tools for searching records, managing HR tasks, and tracking project costs via the Odoo API.

Category
Visit Server

README

MCP Odoo Server

Serveur MCP (Model Context Protocol) pour intégrer Odoo avec Claude et d'autres assistants IA compatibles MCP.

Fonctionnalités

Ce serveur MCP permet de gérer les données Odoo via une interface conversationnelle :

Gestion du temps (Timesheets)

  • list_projects - Lister les projets disponibles
  • list_tasks - Lister les tâches (filtrable par projet)
  • list_timesheets - Lister les pointages
  • get_timesheet_summary_by_employee - Résumé des heures par employé
  • create_timesheet - Créer un pointage
  • update_timesheet - Modifier un pointage
  • delete_timesheet - Supprimer un pointage

Notes de frais (Expenses)

  • list_expense_categories - Lister les catégories de dépenses
  • list_expenses - Lister les notes de frais
  • create_expense - Créer une note de frais
  • update_expense - Modifier une note de frais (avec support analytic_account_id)
  • delete_expense - Supprimer une note de frais
  • add_expense_attachment - Ajouter une pièce jointe
  • list_expense_attachments - Lister les pièces jointes

Contacts

  • list_contacts - Lister les contacts (clients/fournisseurs)
  • get_contact - Détails d'un contact
  • create_contact - Créer un contact

Facturation

  • list_invoices - Lister les factures
  • get_invoice - Détails d'une facture

Ventes

  • list_sale_orders - Lister les commandes/devis
  • get_sale_order - Détails d'une commande

Produits

  • list_products - Lister les produits
  • get_product - Détails d'un produit

Ressources humaines

  • list_employees - Lister les employés
  • get_employee - Détails d'un employé
  • list_departments - Lister les départements
  • list_leave_types - Types de congés disponibles
  • create_leave_allocation - Créer une allocation de congés
  • list_leave_allocations - Lister les allocations
  • approve_leave_allocation - Approuver une allocation
  • create_public_holiday - Créer un jour férié
  • list_public_holidays - Lister les jours fériés

Utilitaires

  • test_connection - Tester la connexion Odoo
  • search_records - Rechercher dans n'importe quel modèle Odoo
  • get_rd_project_costs - Coûts des projets R&D

Installation

Prérequis

  • Python 3.11+
  • Une instance Odoo avec accès API
  • Une clé API Odoo
  • Redis (optionnel, pour le cache)

Installation

# Cloner le repository
git clone https://github.com/industream/mcp-odoo.git
cd mcp-odoo

# Créer un environnement virtuel
python -m venv venv
source venv/bin/activate  # Linux/Mac
# ou: venv\Scripts\activate  # Windows

# Installation standard
pip install -e .

# Installation avec toutes les dépendances (dev + redis)
pip install -e ".[all]"

# Configurer les variables d'environnement
cp .env.example .env
# Éditer .env avec vos credentials Odoo

Configuration

Créez un fichier .env à partir de .env.example :

# URL de votre instance Odoo (sans slash final)
ODOO_URL=https://votre-instance.odoo.com

# Nom de la base de données Odoo
ODOO_DB=votre-instance

# Votre nom d'utilisateur (email)
ODOO_USERNAME=votre-email@example.com

# Votre clé API Odoo
ODOO_API_KEY=votre-cle-api

# Redis Cache (optionnel)
REDIS_ENABLED=true
REDIS_URL=redis://localhost:6379/0
REDIS_DEFAULT_TTL=300

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json  # ou "text" pour le développement

Obtenir une clé API Odoo

  1. Connectez-vous à votre instance Odoo
  2. Cliquez sur votre profil en haut à droite
  3. Allez dans Préférences
  4. Onglet Sécurité du compte
  5. Section Clés API > Nouvelle clé API
  6. Donnez un nom à la clé et copiez-la

Utilisation avec Claude Code

Ajoutez le serveur MCP dans votre configuration Claude Code (~/.config/claude-code/settings.json) :

{
  "mcpServers": {
    "odoo": {
      "type": "stdio",
      "command": "/chemin/vers/mcp-odoo/venv/bin/python",
      "args": ["-m", "mcp_odoo.server"],
      "cwd": "/chemin/vers/mcp-odoo/src"
    }
  }
}

Redémarrez Claude Code pour charger le serveur.

Exemples d'utilisation

Une fois configuré, vous pouvez demander à Claude :

  • "Liste mes pointages de cette semaine"
  • "Crée un pointage de 2h sur le projet X"
  • "Montre-moi le résumé des heures par employé pour novembre"
  • "Ajoute une note de frais de 50€ pour un repas client"
  • "Liste les factures en attente"

Développement

Commandes disponibles (Makefile)

# Installation
make install          # Installation production
make install-dev      # Installation développement (avec linting, tests, etc.)

# Qualité du code
make lint             # Vérifier le code (ruff)
make format           # Formater le code (ruff)
make typecheck        # Vérification des types (mypy)

# Tests
make test             # Tests unitaires
make test-cov         # Tests avec couverture
make test-integration # Tests d'intégration

# Build
make build            # Construire le package
make clean            # Nettoyer les artefacts

# Lancer le serveur
make run              # Mode production
make run-dev          # Mode debug (LOG_LEVEL=DEBUG)

# Docker
make docker-up        # Démarrer les services (Redis, etc.)
make docker-down      # Arrêter les services

Structure du projet

mcp-odoo/
├── src/
│   └── mcp_odoo/
│       ├── __init__.py
│       ├── server.py         # Serveur MCP principal
│       ├── client.py         # Client Odoo XML-RPC
│       ├── config.py         # Configuration (pydantic-settings)
│       ├── cache.py          # Cache Redis
│       ├── logging_config.py # Configuration logging
│       ├── validators.py     # Validation des données
│       ├── formatters.py     # Formatage des réponses
│       ├── decorators.py     # Décorateurs utilitaires
│       ├── exceptions.py     # Exceptions personnalisées
│       ├── constants.py      # Constantes
│       └── tools/            # Outils MCP par domaine
│           ├── contacts.py
│           ├── products.py
│           ├── sales.py
│           ├── invoices.py
│           ├── expenses.py
│           ├── projects.py
│           ├── timesheets.py
│           ├── hr.py
│           └── utilities.py
├── tests/
│   ├── unit/                 # Tests unitaires
│   └── integration/          # Tests d'intégration
├── server.py                 # Point d'entrée legacy
├── pyproject.toml            # Configuration du projet
├── Makefile                  # Commandes de développement
├── docker-compose.yml        # Services Docker (Redis, etc.)
└── .env.example              # Template de configuration

Docker

Le projet inclut un docker-compose.yml avec Redis pour le cache :

# Démarrer Redis
docker-compose up -d redis

# Vérifier le statut
docker-compose ps

Licence

MIT

Contributions

Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou une pull request.

Avant de contribuer, assurez-vous que :

make lint       # Pas d'erreurs de linting
make typecheck  # Pas d'erreurs de typage
make test       # Tous les tests passent

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured