Public Documentation

MCP Integration

Netra MCP server reference and practical usage patterns.

This page shows how to connect an AI (like ChatGPT) to Netra so it can help you with everyday accounting tasks — safely and step by step. It can create invoices, record payments, import bills, reconcile bank transactions, and generate reports. Think of it as giving your AI a “remote control” to Netra, while keeping everything saved in the same accounting system your bookkeeper understands.

You can type or speak in a chat interface, describe what you need, and Netra will turn that into proper accounting transactions behind the scenes.

If you’re searching for “MCP accounting” or “AI accounting API”, this is Netra’s MCP integration page.

Endpoint

Local development endpoint:

https://netra.ee/api/mcp

Authentication

Use API token as Bearer token (or x-api-key for direct calls).

[mcp_servers.netra]
url = "https://netra.ee/api/mcp"
bearer_token_env_var = "NETRA_MCP_TOKEN"
  • Tokens are organization-scoped.
  • Use netra_whoami to confirm active org + role.
  • Use netra_list_organizations + netra_switch_organization when needed.

Error handling

{"error":{"code":-32602,"message":"Missing required arguments"}}

Common codes: -32602 invalid/missing params, -32601 unknown method, -32603 server error.

Idempotency & retries

Reads are safe to retry. For writes, retry only when you are sure the request did not reach Netra (e.g., network drop). If you receive a validation error, fix the input and send a new request rather than retrying the same one.

Pagination

List tools support limit (default 20, max 100). Use search and filters to narrow. Page/offset is not currently exposed.

Data model glossary

  • Journal: base accounting document (invoice, bill, payment, manual entry).
  • Invoice / Bill: journal subtypes with rows (credit/debit).
  • Contact: customer or vendor.
  • public_id: stable external ID used by MCP tools.

File uploads

Presigned upload (S3)

Use netra_prepare_bill_upload to get a presigned URL, upload the file, then call netra_create_bill_import_from_upload.

Base64 upload

Use netra_import_bill_from_base64 for small files and quick tests.

Payments & prepayments

  • Payments are allocated only up to outstanding amount.
  • Overpayments are posted to prepayment accounts (215/150).
  • Prepayments are auto-applied on invoice/bill approval.

Connect examples

Verify tools:

curl -X POST https://netra.ee/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NETRA_MCP_TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Common workflows

  • Who am I / current organization: netra_whoami
  • Switch organization token: netra_switch_organization
  • Auto reconcile: netra_reconcile_auto
  • Opening balance: netra_set_opening_balance
  • Registry contact creation: netra_create_contact_from_registry
  • Receive invoice payment: netra_receive_invoice_payment
Recipe: Salary (minimum wage)

Example uses minimum wage as the gross salary. Verify the current rate and tax rules before posting. This is a full template with the core payroll accounts.

Example prompt (natural language)
“I’m not an accountant. I pay a salary to one employee. Please set up all required payroll accounts, create the employee contact, and post the minimum‑wage payroll journal for 01.02.2026.”

Netra will store the result as standard payroll journals so accountants can audit, reconcile, and report them normally.

Step 1: Ensure payroll accounts (create if missing)
{"jsonrpc":"2.0","id":20,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"611","name":"Salary Expense","group":"expense","group_type":"salary","report":"Profit & Loss"
}}}
{"jsonrpc":"2.0","id":21,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"612","name":"Employer Social Tax Expense","group":"expense","group_type":"payroll_tax","report":"Profit & Loss"
}}}
{"jsonrpc":"2.0","id":22,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"613","name":"Employer Unemployment Insurance Expense","group":"expense","group_type":"payroll_tax","report":"Profit & Loss"
}}}
{"jsonrpc":"2.0","id":23,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"614","name":"Employer Funded Pension Expense","group":"expense","group_type":"payroll_tax","report":"Profit & Loss"
}}}
{"jsonrpc":"2.0","id":24,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"240","name":"Wages Payable","group":"liabilities","group_type":"payroll","report":"Balance Sheet"
}}}
{"jsonrpc":"2.0","id":25,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"241","name":"Payroll Taxes Payable (TSD)","group":"liabilities","group_type":"payroll","report":"Balance Sheet"
}}}
{"jsonrpc":"2.0","id":26,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"242","name":"Employee Pension Withholding Payable","group":"liabilities","group_type":"payroll","report":"Balance Sheet"
}}}
{"jsonrpc":"2.0","id":27,"method":"tools/call","params":{"name":"netra_create_account","arguments":{
  "code":"243","name":"Employee Unemployment Withholding Payable","group":"liabilities","group_type":"payroll","report":"Balance Sheet"
}}}

Step 2: Create employee contact
{"jsonrpc":"2.0","id":30,"method":"tools/call","params":{"name":"netra_create_contact","arguments":{
  "name":"Employee Name","email":"employee@example.com","kind":"person"
}}}

Step 3: Post payroll journal (fill amounts)
{"jsonrpc":"2.0","id":31,"method":"tools/call","params":{"name":"netra_create_manual_journal","arguments":{
  "date":"2026-02-01",
  "description":"Payroll - minimum wage",
  "lines":[
    {"account_id":"611_ACCOUNT_ID","debit":"GROSS","description":"Gross salary"},
    {"account_id":"612_ACCOUNT_ID","debit":"EMP_SOC_TAX","description":"Employer social tax"},
    {"account_id":"613_ACCOUNT_ID","debit":"EMP_UNEMP_TAX","description":"Employer unemployment insurance"},
    {"account_id":"614_ACCOUNT_ID","debit":"EMP_PENSION","description":"Employer funded pension"},
    {"account_id":"240_ACCOUNT_ID","credit":"NET_PAYABLE","description":"Net payable to employee"},
    {"account_id":"241_ACCOUNT_ID","credit":"PAYROLL_TAX","description":"Payroll taxes payable (TSD)"},
    {"account_id":"242_ACCOUNT_ID","credit":"EMP_PENSION_WHT","description":"Employee pension withholding"},
    {"account_id":"243_ACCOUNT_ID","credit":"EMP_UNEMP_WHT","description":"Employee unemployment withholding"}
  ]
}}}

Replace placeholders (GROSS, NET_PAYABLE, EMP_*). Debits must equal credits.

Recipe: Clone invoice for next month
Example prompt (natural language)
“Duplicate last month’s invoice for this customer, move the date and due date to the next month, and keep the same line items.”

Netra will create a normal invoice entry so it appears in sales, reports, and accounts receivable as usual.

Step 1: Get source invoice
{"jsonrpc":"2.0","id":10,"method":"tools/call","params":{"name":"netra_get_invoice","arguments":{"id":"INV_PUBLIC_ID"}}}

Step 2: Create new invoice with shifted dates
{"jsonrpc":"2.0","id":11,"method":"tools/call","params":{"name":"netra_create_invoice","arguments":{
  "contact_id":"CONTACT_ID",
  "date":"2026-03-05",
  "due_date":"2026-03-05",
  "rows":[{"account_id":"ACCOUNT_ID","description":"Invoice line","qty":"1","unit_price":"100"}]
}}}
Recipe: Receive invoice payment
Example prompt (natural language)
“Mark this invoice as paid from my bank account. If the payment is higher than the invoice, keep the extra as a customer prepayment.”

Netra will record a proper payment journal and keep accounting consistent.

{"jsonrpc":"2.0","id":12,"method":"tools/call","params":{"name":"netra_receive_invoice_payment","arguments":{
  "invoice_id":"INV_PUBLIC_ID",
  "bank_account_id":"BANK_ACCOUNT_ID",
  "amount":"210.00",
  "date":"2026-02-05"
}}}

Overpayments are automatically posted to Customer Prepayments (account 215).

Contacts from Business Register

Netra can create contacts directly from the Estonian Business Register. This keeps legal names, registry codes, and addresses consistent.

Example prompt (natural language)
“Find Telpro OÜ in the business register and add it as a contact.”
What Netra does
  • Searches the registry by name or code.
  • Creates the contact with official name, registry code, and address.
  • Saves the contact in Netra like any manually created contact.
Registry + manual fallback
“If the registry has no email, set contact email to info@telpro.ee.”

You can also use the regular contact tools to edit or add missing fields afterwards.

Report tools

  • netra_report_trial_balance
  • netra_report_balance_sheet
  • netra_report_profit_and_loss
  • netra_report_tax (summary/legacy)
  • netra_report_tax_kmd_csv
  • netra_report_annual_zip

Versioning

MCP tool names are stable. Breaking changes are announced in the changelog before deployment.

All tools (62)

Full tool list exposed by tools/list in the Netra MCP server.

Identity & Organization

  • netra_whoami
  • netra_list_organizations
  • netra_switch_organization

Sales

  • netra_list_quotes
  • netra_list_orders
  • netra_list_projects
  • netra_list_invoices
  • netra_get_invoice
  • netra_create_invoice
  • netra_update_invoice
  • netra_update_invoice_status
  • netra_receive_invoice_payment

Contacts & Registry

  • netra_list_contacts
  • netra_get_contact
  • netra_create_contact
  • netra_update_contact
  • netra_registry_autocomplete
  • netra_create_contact_from_registry

Bills Import

  • netra_prepare_bill_upload
  • netra_create_bill_import_from_upload
  • netra_import_bill_from_base64
  • netra_get_bill_import_status
  • netra_list_bills

Bank Reconciliation

  • netra_list_bank_transactions
  • netra_suggest_matches
  • netra_reconcile_auto
  • netra_prepare_reconciliation
  • netra_confirm_reconciliation
  • netra_undo_reconciliation
  • netra_allocate_payment
  • netra_receive_invoice_payment

Bank Rules

  • netra_list_bank_rules
  • netra_get_bank_rule
  • netra_create_bank_rule
  • netra_update_bank_rule
  • netra_delete_bank_rule
  • netra_create_bank_rule_from_transaction
  • netra_apply_bank_rule
  • netra_preview_bank_rule

Journals

  • netra_list_journals
  • netra_get_journal
  • netra_update_journal_status
  • netra_create_manual_journal

Opening Balance

  • netra_set_opening_balance
  • netra_get_opening_balance
  • netra_delete_opening_balance

Chart of Accounts

  • netra_list_accounts
  • netra_list_units
  • netra_list_unit_invoices
  • netra_get_account
  • netra_get_unit
  • netra_get_unit_last_meter_reading
  • netra_upsert_meter_reading
  • netra_create_account
  • netra_update_account

Taxes

  • netra_list_taxes
  • netra_get_tax
  • netra_create_tax
  • netra_update_tax
  • netra_delete_tax

Reports

  • netra_report_trial_balance
  • netra_report_balance_sheet
  • netra_report_profit_and_loss
  • netra_report_tax
  • netra_report_tax_kmd_csv
  • netra_report_annual_zip