refactor: improve development workflow and code quality

- Add Spanish documentation for AGENTS.md and README.md
- Add pytest to main dependencies and taskipy for dev tasks
- Clean up unused imports across codebase
- Fix default config values for local development
- Update test fixtures to use standard pytest
This commit is contained in:
2026-03-17 18:15:10 -05:00
parent 861f5030f4
commit 1a9efc93da
11 changed files with 238 additions and 24 deletions

View File

@@ -1,8 +1,50 @@
# 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/
```
### 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 +54,20 @@ 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
├── pyproject.toml # Project dependencies
└── .env.example # Environment variables template
```
## Architecture
@@ -56,14 +108,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