mirror of
https://github.com/latinogino/dolibarr-mcp.git
synced 2026-04-12 05:45:35 +02:00
Dolibarr API Documentation - Complete Analysis
Instance Information: db.ginos.cloud
Dolibarr Version: 21.0.1
API Base URL: https://db.ginos.cloud/api/index.php
Authentication: DOLAPIKEY header
Response Format: JSON
✅ Confirmed Working Endpoints
1. Status Endpoint
- URL:
/status - Method: GET
- Purpose: API health check and version info
- Response:
{
"success": {
"code": 200,
"dolibarr_version": "21.0.1",
"access_locked": "0"
}
}
2. Users Endpoint
- URL:
/users - Method: GET, POST, PUT, DELETE
- Purpose: User management
- Parameters: limit, sortfield, sortorder
- Response: Array of user objects with complete profile data
- Fields Include: id, login, lastname, firstname, email, admin, status, etc.
- Status: ✅ Fully functional with 4 users found
3. Third Parties Endpoint (Customers/Suppliers)
- URL:
/thirdparties - Method: GET, POST, PUT, DELETE
- Purpose: Customer/supplier management
- Parameters: limit, sortfield, sortorder, sqlfilters
- Response: Array of third party objects
- Fields Include: id, name, address, phone, email, status, type (client/supplier)
- Status: ✅ Fully functional with 1 test customer found
4. Products Endpoint
- URL:
/products - Method: GET, POST, PUT, DELETE
- Purpose: Product catalog management
- Parameters: limit, sortfield, sortorder
- Response: Array of product objects
- Status: ✅ Accessible but currently empty
5. Invoices Endpoint
- URL:
/invoices - Method: GET, POST, PUT, DELETE
- Purpose: Invoice management
- Parameters: limit, status filtering
- Response: Array of invoice objects
- Status: ✅ Accessible but currently empty
6. Orders Endpoint
- URL:
/orders - Method: GET, POST, PUT, DELETE
- Purpose: Order management
- Parameters: limit, status filtering
- Response: Array of order objects
- Status: ✅ Accessible but currently empty
7. Contacts Endpoint
- URL:
/contacts - Method: GET, POST, PUT, DELETE
- Purpose: Contact management
- Parameters: limit, thirdparty filtering
- Response: Array of contact objects
- Status: ✅ Accessible but currently empty
❌ Non-Working/Problematic Endpoints
1. Setup Endpoint
- URL:
/setup - Status: ❌ 404 Not Found
- Note: May require different path or parameters
2. Documents Endpoint
- URL:
/documents - Status: ❌ 400 Bad Request
- Note: Requires specific parameters (modulepart, filename, etc.)
🔍 API Patterns Identified
Standard Query Parameters
All list endpoints support these parameters:
limit: Number of records to return (default: 100)sortfield: Field to sort bysortorder: ASC or DESCsqlfilters: Advanced filtering using SQL-like syntax
Authentication
- Header:
DOLAPIKEY: your_api_key - Format: Token-based authentication
- Permission: Tied to user permissions in Dolibarr
Response Structure
- Success: Array of objects or single object
- Error: JSON with error details
- HTTP Status Codes: 200, 201, 400, 401, 403, 404, 500
Data Structure Pattern
All business objects share common fields:
id: Unique identifierref: Reference numberstatus/statut: Status codedate_creation: Creation timestampuser_creation_id: Creator user IDnote_public/note_private: Notesarray_options: Custom fields
🏗️ Recommended MCP Server Structure
Core Modules
-
Customer Management (
/thirdparties)- get_customers()
- get_customer_by_id()
- create_customer()
- update_customer()
- delete_customer()
-
Product Management (
/products)- get_products()
- get_product_by_id()
- create_product()
- update_product()
- delete_product()
-
Invoice Management (
/invoices)- get_invoices()
- get_invoice_by_id()
- create_invoice()
- update_invoice()
- delete_invoice()
-
Order Management (
/orders)- get_orders()
- get_order_by_id()
- create_order()
- update_order()
- delete_order()
-
Contact Management (
/contacts)- get_contacts()
- get_contact_by_id()
- create_contact()
- update_contact()
- delete_contact()
-
User Management (
/users)- get_users()
- get_user_by_id()
- create_user()
- update_user()
- delete_user()
Additional Endpoints to Explore
Based on Dolibarr source code, these endpoints likely exist:
/projects- Project management/suppliers- Supplier-specific operations/warehouses- Inventory management/categories- Category management/members- Membership management/expensereports- Expense reporting/tickets- Support tickets/events- Calendar events/proposals- Commercial proposals/contracts- Contract management/agenda- Agenda/calendar/actioncomm- Communication actions/shipments- Shipping management/receptions- Reception management/mrp- Manufacturing Resource Planning/boms- Bill of Materials/stockmovements- Stock movements/bankaccounts- Bank account management/payments- Payment management/leaverequest- Leave requests/salaries- Salary management
🔬 Testing Methodology Used
- Connection Test: Verified API accessibility with
/statusendpoint - Core Business Objects: Tested major CRUD endpoints
- Parameter Testing: Verified filtering and pagination
- Error Handling: Documented error responses
- Data Structure Analysis: Analyzed response formats
📝 Next Steps for MCP Development
-
Create Base MCP Server Structure
- Follow prestashop-mcp reference pattern
- Implement dolibarr_client.py with all discovered endpoints
- Create MCP server with proper tool definitions
-
Implement Core Functions
- Start with working endpoints (users, thirdparties, products, invoices, orders)
- Add comprehensive error handling
- Include proper parameter validation
-
Test and Expand
- Test all CRUD operations
- Discover additional endpoints through testing
- Add advanced features (filtering, pagination, etc.)
-
Documentation and Deployment
- Create comprehensive README
- Add Docker containerization
- Implement proper logging and monitoring
🎯 Immediate Development Priority
High Priority Endpoints (Confirmed Working):
- Users management
- Customer/Third party management
- Product management
- Invoice management
- Order management
Medium Priority (Need Parameter Research):
- Document management
- Contact management
- Project management
Low Priority (Discovery Required):
- Setup/configuration endpoints
- Advanced modules (MRP, BOM, etc.)
- Integration-specific endpoints