- Add Dockerfile using uv for dependency management - Add docker-compose.yaml for container orchestration - Add .dockerignore to optimize builds - Update taskipy start task with http transport and port 3001 - Update README.md and AGENTS.md with Docker documentation
91 lines
1.6 KiB
Markdown
91 lines
1.6 KiB
Markdown
# TrytonMCP
|
|
|
|
MCP server que permite a LLMs interactuar con Tryton ERP a través de llamadas RPC.
|
|
|
|
## Requisitos
|
|
|
|
- Python 3.14+
|
|
- uv (gestor de paquetes)
|
|
|
|
## Instalación
|
|
|
|
```bash
|
|
uv sync
|
|
cp .env.example .env
|
|
# Editar .env con las credenciales de Tryton
|
|
```
|
|
|
|
## Desarrollo
|
|
|
|
### Configuración del entorno
|
|
|
|
```bash
|
|
# Activar entorno virtual
|
|
source .venv/bin/activate
|
|
|
|
# Instalar dependencias de desarrollo
|
|
uv pip install -e ".[test]"
|
|
```
|
|
|
|
### Comandos disponibles
|
|
|
|
```bash
|
|
# Ejecutar servidor MCP
|
|
uv run fastmcp run src/tryton_mcp/server.py
|
|
|
|
# Ejecutar tests
|
|
python -m pytest tests/ -v
|
|
|
|
# Verificar código con ruff
|
|
ruff check src/ tests/
|
|
|
|
# Format código
|
|
ruff format src/ tests/
|
|
```
|
|
|
|
## Estructura del proyecto
|
|
|
|
```
|
|
src/tryton_mcp/
|
|
├── __init__.py
|
|
├── config.py # Configuración singleton
|
|
├── server.py # Servidor MCP principal
|
|
└── services/
|
|
├── base.py # TrytonService base
|
|
├── provider.py # Provider service
|
|
├── party.py # Customer/Party operations
|
|
├── product.py # Products/Services
|
|
├── schedule.py # Appointments
|
|
└── service_center.py # Service centers
|
|
```
|
|
|
|
## Uso con Docker
|
|
|
|
```bash
|
|
# Construir imagen
|
|
docker compose build
|
|
|
|
# Iniciar contenedor
|
|
docker compose up -d
|
|
|
|
# Ver logs
|
|
docker compose logs -f
|
|
|
|
# Detener
|
|
docker compose down
|
|
```
|
|
|
|
El servidor MCP estará disponible en `http://localhost:3001`.
|
|
|
|
## Testing
|
|
|
|
```bash
|
|
# Todos los tests
|
|
python -m pytest tests/ -v
|
|
|
|
# Tests específicos
|
|
python -m pytest tests/test_server.py -v
|
|
|
|
# Con coverage
|
|
python -m pytest tests/ --cov=src --cov-report=html
|
|
``` |