saga-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SAGA_DB | No | One firm database (path as the Firebird server sees it). | |
| SAGA_ROOT | No | SAGA folder to scan for */cont_baza.fdb (must be readable from this computer). | |
| SAGA_FIRMS | No | Several firms in the form CODE=PATH;CODE=PATH. | |
| ISC_PASSWORD | No | Alternative to SAGA_FB_PASSWORD: Firebird password. | |
| SAGA_FB_HOST | No | Firebird server host. | 127.0.0.1 |
| SAGA_FB_PORT | No | Firebird server port. | 3050 |
| SAGA_FB_USER | No | Firebird user. | SYSDBA |
| SAGA_MAX_ROWS | No | Row cap per call (max 5000). | 500 |
| SAGA_BACKUP_DIR | No | Where backups before writes go (a folder on the database server). Defaults to the firm folder. | |
| SAGA_FB_PASSWORD | No | Firebird password (required; alternatively use ISC_PASSWORD). | |
| SAGA_DEFAULT_FIRM | No | Firm used when a tool call names none. Defaults to the first firm. | |
| SAGA_FB_WIRECRYPT | No | Set to 0 to disable Firebird wire encryption. | on |
| SAGA_ALLOW_PAYROLL | No | Set to 1 to allow payroll tables in saga_query (off by default). | |
| SAGA_MCP_ENABLE_WRITES | No | Set to 1 to enable the experimental write tools (off by default). | |
| SAGA_SHOW_PERSONAL_IDS | No | Set to 1 to disable CNP masking (off by default). | |
| SAGA_FB_CONNECT_TIMEOUT_MS | No | Connection timeout in milliseconds. | 10000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Unofficial tools for SAGA C. accounting databases (Romania). Amounts are in RON unless stated. Start with saga_list_firms and saga_firm_info. Read tools never change data. Write tools are disabled on this server.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| saga_list_firmsA | Lists the SAGA firm databases this server can open (code and database path). |
| saga_firm_infoA | Overview of one firm: last closed period, VAT settings, ledger date range, record counts, Firebird version. |
| saga_list_accountsA | Accounts from the chart of accounts (planul de conturi), optionally filtered by prefix or by text in the name. |
| saga_trial_balanceA | Trial balance for a period: opening balance at 1 January, previous turnover, period turnover, totals and closing balance per account. level: synthetic (default; e.g. 401), analytic (as stored, e.g. 401.00012) or group3 (first 3 digits). |
| saga_account_ledgerA | All entries of one account in a period with opening balance, running balance and closing balance. match=account (default) includes analytic sub-accounts ("401" -> 401, 401.x); match=prefix takes every account starting with the text. |
| saga_journalA | Ledger entries (REGISTRU) in a period, filterable by source (FEL_D: Intrari, Iesiri, Casa, Banca, Inchidere, Salarii, ...), account, partner code, note id, document number or text. |
| saga_journal_sourcesB | Which kinds of ledger entries (FEL_D values) exist and their date ranges. |
| saga_partnersB | Search suppliers or customers by name or fiscal code. Personal numeric codes (CNP) are masked. |
| saga_open_invoicesA | Unpaid supplier invoices (kind=suppliers) or customer invoices (kind=customers), with due dates and days overdue. Foreign-currency invoices are included with currency and unpaid_currency. as_of (YYYY-MM-DD) gives the situation at a past date. |
| saga_partner_balancesB | Per supplier or customer: unpaid and overdue totals from open invoices, plus the general-ledger balance of the partner account for reconciliation. |
| saga_documentsA | Purchase (intrari) or sales (iesiri) documents in a period with totals. currency=true lists the foreign-currency ones instead (SAGA keeps them apart: purchases in INTRD, sales in EXPORT). |
| saga_documentA | One purchase or sales document: header, lines, the ledger entries it produced and the payments linked to it. |
| saga_stockC | Stock quantities (and an estimated value at cost) per warehouse (gestiune) and article at a date. |
| saga_stock_movementsB | Movements of one article (optionally one warehouse) in a period with running quantity. |
| saga_cash_bank_balancesA | Balances of all cash (531x) and bank (512x) accounts at a date. |
| saga_cash_bank_registerA | Register of one cash or bank account (e.g. 5311, 5121.1): opening balance, entries with running balance, closing balance. |
| saga_vat_summaryA | VAT accounts turnover (4426, 4427, 4428, 4423, 4424) and sales/purchases net and VAT by rate for a period. Not a D300 return. |
| saga_saft_checkA | Basic checks before D406: accounts used but missing from the chart or SAF-T mapping, partners without fiscal codes, unposted documents. |
| saga_list_tablesB | Tables in the SAGA database (about 195), optionally with row counts. Payroll tables are flagged. |
| saga_describe_tableA | Columns (name, type, default) and primary key of one table. Shows structure only, no data. |
| saga_queryA | Runs one SELECT (Firebird 3 SQL dialect) inside a READ ONLY transaction. Use FIRST/ROWS for limits, ? for parameters. Text columns are padded with spaces; compare with = (trailing blanks ignored) or TRIM(). Payroll tables are blocked unless the server owner enabled them. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 21 tools
Each tool targets a fairly distinct accounting artifact (trial balance, account ledger, journal, documents, stock, cash/bank, VAT, SAF-T checks), and descriptions explicitly clarify boundary cases like match=account vs match=prefix and balances vs register. Some genuine overlap remains between saga_journal and saga_account_ledger, and between saga_open_invoices and saga_partner_balances, which could cause occasional misselection.
All names are snake_case with a consistent 'saga_' prefix, and most are resource-oriented nouns (saga_partner_balances, saga_cash_bank_register). There are minor deviations in verb usage: some resources use explicit verbs (saga_list_firms, saga_list_accounts, saga_describe_table, saga_query) while comparable ones do not (saga_partners, saga_documents).
21 tools is on the heavy side, but the domain is a full accounting ERP and nearly every tool maps to a distinct report or artifact (trial balance, ledger, journal, invoices, stock, cash/bank, VAT, SAF-T, raw SQL access). It is slightly over-scoped rather than padded with redundant tools.
As a read-only reporting/inspection server it covers the main workflows well: firm discovery, chart of accounts, trial balance, ledgers, documents, partners, stock, cash/bank, VAT and SAF-T pre-checks, plus a generic SELECT escape hatch. Gaps are minor: no master lists for articles/warehouses (only date-based stock views), no payroll coverage beyond flagging, and no write operations by design.