refactor: use environment variables for Tryton credentials

This commit is contained in:
2026-03-07 23:13:41 -05:00
parent 2c12a8ec10
commit d1b0c16d03
4 changed files with 76 additions and 37 deletions

View File

@@ -66,17 +66,24 @@ fastmcp run tryton_mcp.server
## Configuration
Edit `TRYTON_CREDENTIALS` in `server.py:12-17` to change connection settings:
Credentials are loaded from environment variables (with sensible defaults):
```python
TRYTON_CREDENTIALS = {
"hostname": 'dev.naliia.co',
"database": 'capacitacion',
"username": 'admin',
"password": 'admin'
}
```bash
export TRYTON_HOSTNAME=dev.naliia.co
export TRYTON_DATABASE=capacitacion
export TRYTON_USERNAME=admin
export TRYTON_PASSWORD=admin
export TRYTON_PORT=8000
```
Or copy `.env.example` to `.env` and adjust values:
```bash
cp .env.example .env
```
Note: `.env` is gitignored to protect credentials.
## Testing RPC Calls
Use `test_rpc.py` to test Tryton RPC calls independently: