feat: add Docker support with uv and update taskipy start command
- 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
This commit is contained in:
89
AGENTS.md
89
AGENTS.md
@@ -1,8 +1,66 @@
|
||||
# TrytonMCP Agent Specification
|
||||
|
||||
## Desarrollo
|
||||
|
||||
### Configuración inicial
|
||||
|
||||
```bash
|
||||
# Instalar dependencias con uv
|
||||
uv sync
|
||||
|
||||
# Copiar configuración de ejemplo
|
||||
cp .env.example .env
|
||||
|
||||
# Instalar dependencias de desarrollo y test
|
||||
uv pip install -e ".[test]"
|
||||
```
|
||||
|
||||
### Comandos frecuentes
|
||||
|
||||
```bash
|
||||
# Ejecutar servidor MCP (stdio)
|
||||
uv run fastmcp run src/tryton_mcp/server.py
|
||||
|
||||
# Ejecutar tests
|
||||
python -m pytest tests/ -v
|
||||
|
||||
# Verificar código
|
||||
ruff check src/ tests/
|
||||
ruff format src/ tests/
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
# Construir imagen
|
||||
docker compose build
|
||||
|
||||
# Iniciar contenedor
|
||||
docker compose up -d
|
||||
|
||||
# Ver logs
|
||||
docker compose logs -f
|
||||
|
||||
# Detener
|
||||
docker compose down
|
||||
```
|
||||
|
||||
### Agregar nueva herramienta
|
||||
|
||||
```python
|
||||
from tryton_mcp.services.base import TrytonService
|
||||
|
||||
class YourService(TrytonService):
|
||||
name = "your.model.method"
|
||||
|
||||
def execute(self, params: dict) -> List[dict]:
|
||||
# Implementar lógica
|
||||
pass
|
||||
```
|
||||
|
||||
## Overview
|
||||
|
||||
TrytonMCP is an MCP (Model Context Protocol) server that enables LLMs to interact with Tryton ERP functionality through RPC calls. It wraps the `sabatron-tryton_rpc_client` library and exposes Tryton models as callable tools.
|
||||
TrytonMCP es un servidor MCP (Model Context Protocol) que permite a los LLMs interactuar con Tryton ERP a través de llamadas RPC. Envuelve la librería `sabatron-tryton_rpc_client` y expone los modelos de Tryton como herramientas invocables.
|
||||
|
||||
## Project Structure
|
||||
|
||||
@@ -12,10 +70,23 @@ TrytonMCP/
|
||||
│ └── tryton_mcp/
|
||||
│ ├── __init__.py
|
||||
│ ├── config.py # Settings singleton with TrytonSettings
|
||||
│ └── server.py # Main MCP server with tool definitions
|
||||
├── test_rpc.py # Standalone RPC test script
|
||||
├── pyproject.toml # Project dependencies
|
||||
└── .env.example # Environment variables template
|
||||
│ ├── server.py # Main MCP server with tool definitions
|
||||
│ └── services/
|
||||
│ ├── base.py # TrytonService base class
|
||||
│ ├── party.py # Customer operations
|
||||
│ ├── product.py # Products/Services
|
||||
│ ├── schedule.py # Appointments
|
||||
│ └── service_center.py # Service centers
|
||||
├── tests/ # Test suite
|
||||
│ ├── conftest.py
|
||||
│ ├── test_customer.py
|
||||
│ └── test_server.py
|
||||
├── test_rpc.py # Standalone RPC test script
|
||||
├── Dockerfile # Docker container definition
|
||||
├── docker-compose.yaml # Docker Compose orchestration
|
||||
├── .dockerignore # Docker build exclusions
|
||||
├── pyproject.toml # Project dependencies
|
||||
└── .env.example # Environment variables template
|
||||
```
|
||||
|
||||
## Architecture
|
||||
@@ -56,14 +127,8 @@ def your_tool_name(param1: int, param2: str) -> List[dict]:
|
||||
## Running the Server
|
||||
|
||||
```bash
|
||||
# Activate virtual environment
|
||||
source .venv/bin/activate
|
||||
|
||||
# Run MCP server (stdio mode)
|
||||
python -m tryton_mcp.server
|
||||
|
||||
# Or use fastmcp CLI
|
||||
fastmcp run tryton_mcp.server
|
||||
uv run fastmcp run src/tryton_mcp/server.py
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Reference in New Issue
Block a user