Clarify Windows setup for Claude Desktop

This commit is contained in:
latinogino
2025-10-12 15:23:05 +02:00
parent a83d70c2b5
commit aca9aa642c
58 changed files with 671 additions and 6277 deletions

10
docs/README.md Normal file
View File

@@ -0,0 +1,10 @@
# Documentation
The Dolibarr MCP repository mirrors the documentation layout of the
`prestashop-mcp` project. Start with the quickstart and branch into specialised
guides as needed:
- [Quickstart](quickstart.md) installation and first run instructions for Linux, macOS and Windows
- [Configuration](configuration.md) environment variables consumed by the server
- [Development](development.md) running tests, optional Docker assets and contributor workflow
- [API Coverage](api-reference.md) overview of the Dolibarr REST resources exposed via MCP tools

83
docs/api-reference.md Normal file
View File

@@ -0,0 +1,83 @@
# Dolibarr API Coverage
This server wraps the Dolibarr REST API v21.0.1 that is exposed by an instance at
`https://db.ginos.cloud/api/index.php`. The MCP tools use the following REST
resources, mirroring the scope that the sibling `prestashop-mcp` project
implements for PrestaShop.
## Authentication and Conventions
- **Header** send the `DOLAPIKEY` header with the personal access token that is
configured for your Dolibarr user.
- **Content Type** every request uses `application/json` payloads and
responses.
- **Pagination** list endpoints accept the `limit`, `sortfield`, `sortorder`
and `sqlfilters` query parameters.
- **Identifiers** Dolibarr returns both `id` (numeric) and `ref` (business
reference) for most entities. The MCP tools expose both values to the client.
## Supported Resources
| Resource | Endpoint(s) | Tool group |
| --------------- | --------------------------- | --------------------------------------- |
| Status | `GET /status` | `get_status`, `test_connection` |
| Users | `/users` | CRUD helpers under the *Users* group |
| Third parties | `/thirdparties` | Customer CRUD operations |
| Products | `/products` | Product CRUD operations |
| Invoices | `/invoices` | Invoice CRUD operations |
| Orders | `/orders` | Order CRUD operations |
| Contacts | `/contacts` | Contact CRUD operations |
| Raw passthrough | Any relative path | `dolibarr_raw_api` tool for quick tests |
Every endpoint supports create, read, update and delete operations unless noted
otherwise. The Dolibarr instance that informed this reference currently contains
live data for users, third parties and contacts; other modules respond with
empty lists until records are created.
## Response Examples
### Status
```json
{
"success": {
"code": 200,
"dolibarr_version": "21.0.1",
"access_locked": "0"
}
}
```
### Third Party
```json
{
"id": "1",
"ref": "1",
"name": "Test Customer MCP",
"status": "1",
"address": "123 Test Street",
"zip": "12345",
"town": "Test City",
"email": "test@mcp-dolibarr.com",
"phone": "+1-555-0123",
"date_creation": 1752005684,
"user_creation_id": "4",
"array_options": {}
}
```
### Common Error Shape
```json
{
"error": {
"code": 404,
"message": "Not found"
}
}
```
Dolibarr communicates detailed failure information in the `error` object. The
client wrapper turns these payloads into Python exceptions with the same
metadata so MCP hosts can display friendly error messages.

33
docs/configuration.md Normal file
View File

@@ -0,0 +1,33 @@
# Configuration
The Dolibarr MCP server reads configuration from environment variables. Use a
`.env` file during development or configure the variables directly in the MCP
host application that will launch the server.
| Variable | Description |
| ------------------- | -------------------------------------------------------------- |
| `DOLIBARR_URL` | Base API URL, e.g. `https://your-dolibarr.example.com/api/index.php` (legacy configs that still export `DOLIBARR_BASE_URL` are also honoured) |
| `DOLIBARR_API_KEY` | Personal Dolibarr API token assigned to your user |
| `LOG_LEVEL` | Optional logging level (`INFO`, `DEBUG`, `WARNING`, …) |
## Example `.env`
```env
DOLIBARR_URL=https://your-dolibarr.example.com/api/index.php
DOLIBARR_API_KEY=your_api_key
LOG_LEVEL=INFO
```
The [`Config` class](../src/dolibarr_mcp/config.py) is built with
`pydantic-settings`. It validates the values on load, applies alias support for
legacy variable names and raises a descriptive error if placeholder credentials
are detected.
## Testing credentials
Use the CLI helper to verify that the credentials are accepted by Dolibarr
before wiring the server into your MCP host:
```bash
python -m dolibarr_mcp.cli test --url https://your-dolibarr.example.com/api/index.php --api-key YOUR_KEY
```

48
docs/development.md Normal file
View File

@@ -0,0 +1,48 @@
# Development
This project uses the same lightweight tooling philosophy as `prestashop-mcp`.
The code lives under `src/`, tests under `tests/` and optional Docker assets are
kept separate in `docker/`.
## Install development dependencies
```bash
pip install -e '.[dev]'
```
### Windows PowerShell
```powershell
pip install -e .`[dev`]
```
## Run the test suite
```bash
pytest
```
To gather coverage metrics:
```bash
pytest --cov=src/dolibarr_mcp --cov-report=term-missing
```
## Formatting and linting
The project intentionally avoids heavy linting dependencies. Follow the coding
style already present in the repository and run the test-suite before opening a
pull request.
## Docker tooling
Container assets live in `docker/`:
- `Dockerfile` production-ready image for the MCP server
- `docker-compose.yml` local stack that spins up Dolibarr together with the MCP server
Build and run the container locally with:
```bash
docker compose -f docker/docker-compose.yml up --build
```

64
docs/quickstart.md Normal file
View File

@@ -0,0 +1,64 @@
# Quickstart
Follow these steps to install and run the Dolibarr MCP server. The process
mirrors the streamlined developer experience of the `prestashop-mcp` project.
## 1. Clone the repository
```bash
git clone https://github.com/latinogino/dolibarr-mcp.git
cd dolibarr-mcp
```
## 2. Create a virtual environment
### Linux / macOS
```bash
python3 -m venv .venv
source .venv/bin/activate
```
### Windows (Visual Studio Developer PowerShell)
```powershell
vsenv
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
where python # copy this path for Claude Desktop
```
## 3. Install the package
```bash
pip install -e .
```
For development and testing utilities add the optional extras:
```bash
pip install -e '.[dev]'
```
On Windows escape the brackets inside PowerShell:
```powershell
pip install -e .`[dev`]
```
## 4. Configure credentials
Create a `.env` file in the project root (see [`configuration.md`](configuration.md))
or export the variables within your MCP host application.
## 5. Run the server
```bash
python -m dolibarr_mcp.cli serve
```
The command starts the STDIO based MCP server that Claude Desktop and other
clients can communicate with. When wiring the server into Claude Desktop, set
`command` to the path returned by `where python` (Windows) or `which python`
(Linux/macOS) while the virtual environment is activated, and use the arguments
`-m dolibarr_mcp.cli serve`.