Skip to main content
Glama
tallyprime-mcp

tallyprime-mcp

by rkparupudi
README.md
# tallyprime-mcp

A read-only MCP server that lets Claude answer questions from the books in a
locally running TallyPrime: ledgers, vouchers, outstanding bills and the trial
balance.

It runs on the same Windows machine as TallyPrime and talks to Tally's local
HTTP server. The books never leave the machine except as the answers Claude
reads in the conversation.

> **Status: early version, not yet verified against a real TallyPrime.**
> It has only been tested against the included mock Tally server, which was
> written from Tally's documentation. Expect parsing fixes on first contact
> with real data, especially in `get_outstanding`.

## Tools

| Tool | What it answers |
|---|---|
| `list_companies` | Which companies are loaded; doubles as a connection check |
| `list_ledgers` | Ledger balances, optionally by group or name |
| `get_vouchers` | Transactions in a date range, with totals by voucher type |
| `get_outstanding` | Receivables or payables with ageing, per bill and per party |
| `get_trial_balance` | Debit and credit totals by group, and whether they balance |

Every request sent to Tally is an `Export`. The client refuses to send
anything else, so this version cannot create or change data.

## Setup

### 1. Turn on Tally's HTTP server

In TallyPrime: **F1 (Help) > Settings > Advanced Configuration**, enable the
HTTP server and keep port **9000**. Restart TallyPrime and load a company.

Check it from a browser: `http://localhost:9000` should answer with a short
"TallyPrime Server is Running" message.

### 2. Install

Needs Python 3.10 or newer.

```
cd tallyprime-mcp
pip install -e .
```

### 3. Add it to Claude Desktop

Settings > Developer > Edit Config, then add:

```json
{
  "mcpServers": {
    "tallyprime": {
      "command": "tallyprime-mcp",
      "env": {
        "TALLY_URL": "http://localhost:9000",
        "TALLY_COMPANY": ""
      }
    }
  }
}
```

Restart Claude Desktop. If `tallyprime-mcp` is not found, use
`"command": "python", "args": ["-m", "tallyprime_mcp.server"]` instead.

### Settings

| Variable | Default | Meaning |
|---|---|---|
| `TALLY_URL` | `http://localhost:9000` | Where Tally's HTTP server listens |
| `TALLY_COMPANY` | empty | Company to query; empty means the active company |
| `TALLY_TIMEOUT` | `60` | Seconds to wait for Tally |

Keep `TALLY_URL` pointed at a machine you trust. Tally's HTTP server has no
authentication, so do not expose port 9000 beyond the local machine.

## Try it without Tally

A mock Tally with sample data is included:

```
python tests/mock_tally.py 9000
```

Then point the server at it and ask things like:

- "Which customers have bills older than 60 days?"
- "Summarise October's sales and purchases."
- "Does the trial balance tally?"

## Tests

```
pip install -e ".[dev]"
pytest
```

## Conventions

- Balances are returned as an amount plus a side (`debit` / `credit`).
  Internally Tally stores debits as negative numbers.
- `get_outstanding` ages bills from the bill date, and reports
  `days_overdue` from the due date when Tally provides one. It only covers
  ledgers that maintain bill-wise details.
- `get_trial_balance` groups by each ledger's immediate parent group, not by
  Tally's primary groups.

## Not yet done

- Voucher creation (needs a confirm-before-write step).
- Stock and inventory, GST reports, profit and loss, balance sheet.
- Packaging as a one-click desktop extension.

## Licence and disclaimer

MIT; see [LICENSE](LICENSE).

This is an independent project. It is not affiliated with, endorsed by or
supported by Tally Solutions Pvt. Ltd. "Tally" and "TallyPrime" are trademarks
of their respective owner and are used here only to describe what this
software connects to.

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation4/5

Each tool maps to a distinct reporting concept: companies, ledgers, vouchers, outstanding bills, and trial balance. The only mild overlap is list_ledgers (per-ledger closing balances) versus get_trial_balance (the same balances aggregated by parent group); descriptions clarify the difference, but an agent could occasionally hesitate between them.

Naming Consistency5/5

All names follow a clean verb_noun pattern (list_companies, list_ledgers, get_vouchers, get_outstanding, get_trial_balance). The list_/get_ split is semantically meaningful rather than inconsistent.

Tool Count5/5

Five tools is well-scoped for a read-only TallyPrime reporting surface; every tool covers a real accounting workflow (connectivity, ledgers, transactions, receivables/payables, trial balance) with no filler.

Completeness3/5

Core read paths are covered, but the surface stops at trial balance: no P&L, balance sheet, stock/inventory summary, or single-voucher/ledger detail retrieval. Write operations (posting vouchers, creating ledgers) are absent, which may be deliberate but limits agents to reporting only.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues