Tally Prime MCP Server
Bridges Tally Prime ERP with GitHub Copilot, enabling AI-assisted financial management through natural language.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tally Prime MCP Servershow me the profit and loss for last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Tally Prime MCP Server
Note: Git history was rewritten on 16 Apr 2026 to remove accidentally committed auth tokens. All leaked credentials have been rotated. Thanks to @Journeyman1987 for flagging this.
An MCP (Model Context Protocol) server that bridges Tally Prime ERP with AI assistants like Claude, ChatGPT, GitHub Copilot, and any MCP-compatible client. Query financial reports, manage masters, create vouchers, and analyse GST data — all through natural language.
Features
29 MCP tools — financial reports, master data, stock, GST, voucher creation, plus dedicated company-management tools (
load-company,set-active-company,list-loaded-companies,list-available-companies)Cold-load with credentials — load a password-protected company from a Tally with nothing resident, end-to-end via MCP. Edition-aware (Silver swaps, Gold accumulates). Documented in Editions.
Companion GUI agent — runs in the user session, bridges Windows Session 0 isolation so the Session-0 service can spawn
tally.exeand keystroke through credential prompts. Self-restarts on script update; version handshake refuses stale agents.DuckDB in-memory analytics — cached report tables for complex SQL queries
OAuth 2.1 + PKCE authentication for remote/cloud deployments
Security hardened — Helmet, CORS, rate limiting, audit logging, read-only mode
Local & remote — run as a local stdio server or a cloud HTTP server behind a reverse proxy
Windows installer (#18) — double-click
.exefrom "nothing installed" to "service running" in under 5 minutes. Bundles portable Node + NSSM; no admin pre-reqs beyond UAC.Status tray icon (#20) — at-a-glance health for non-developer operators. Service + agent + Tally + public URL all visible in one click.
Related MCP server: TallyPrime MCP Server
Prerequisites
Tally Prime (Silver / Gold) with XML Server enabled
Node.js 20+
Enable the XML server in Tally: F1 → Settings → Connectivity → Client/Server Configuration
TallyPrime acts as = Server
Port = 9000Note: Avoid the Educational edition — its date-range limitations produce incomplete data.
Installation
Option A — Windows installer (recommended for client deployments)
A double-click TallyMCP-Setup-<version>.exe takes a Windows box from
"nothing installed" to "service running" in under 5 minutes. Bundles portable
Node.js + NSSM, prompts for the few values it can't auto-detect, registers
the Windows service and the GUI agent at-logon task. See
docs/installer.md for build instructions.
Option B — From source (development / custom deployments)
git clone https://github.com/JINA-CODE-SYSTEMS/tally-mcp-server.git
cd tally-mcp-server
npm install
npx tscConfiguration
Copy .env.example to .env and configure:
Variable | Default | Description |
Core | ||
| (required for remote) | OAuth authentication password |
|
| Tally Prime XML server hostname |
|
| Tally Prime XML server port |
|
| Tally data directory (for |
|
| Tally executable path |
|
| Path to tally.ini (used by |
|
| Optional credential-hint config for |
|
|
|
| (unset) | Set to |
|
| HTTP server port |
|
| Public-facing URL |
|
| Bind address ( |
| (defaults to MCP_DOMAIN) | Comma-separated allowed origins |
|
| Set |
| Optional secret for manual client registration | |
Auth & Rate Limiting | ||
|
| Rate limit window in ms (1 minute) |
|
| Max auth attempts per window |
|
| Authorization code TTL in ms (10 minutes) |
|
| Access token TTL in seconds (1 hour) |
|
| Expired token cleanup interval in ms |
Analytics | ||
|
| DuckDB temp table TTL in ms (15 minutes) |
|
| Max rotated log files to keep |
GUI Agent (open-company) | ||
|
| GUI agent timeout in seconds (min 90) |
|
| Max LLM-guided steps per command (min 12) |
|
| Anthropic model for GUI agent |
|
| OpenAI model for GUI agent |
|
| Max tokens per LLM response |
|
| LLM API request timeout in seconds |
|
| Anthropic API version header |
Editions
Tally Prime ships in two relevant editions, and load-company adapts its behavior to each. You must set TALLY_EDITION correctly — defaulting to silver is the safe assumption.
Edition | Companies resident at once |
|
| 1 (engine limit) | Always a SWAP — strips other |
| many | Additive by default — appends |
Why this matters for the multi-subsidiary cross-reference workflow: Silver clients can only query one company at a time, so an LLM doing "compare ledgers across 3 subsidiaries" will pay the ~10–30s restart latency between each. Gold clients can pre-load all subsidiaries and switch between them for free.
Why no auto-detection: Tally's edition isn't reliably exposed via the XML server. Rather than ship a fragile auto-detect that could miscategorize and silently degrade behavior, the server takes the configured value as authoritative.
Background: why Tally must be restarted to load a company
Tally Prime has no XML or TDL primitive that loads a company from disk into memory. We confirmed this by reverse-engineering every dispatch surface the XML server exposes (see notes/tdl-experiments.md). The built-in $$CmpLoadCompany is misleadingly named — it's "select among already-loaded companies", not "load from disk". Loading is exclusively initiated by Tally process startup (via Load= directives in tally.ini) or the Tally UI (Alt+F3).
Therefore load-company works the only way it can: rewrites tally.ini, kills tally.exe, and asks the GUI agent (which lives in the user's interactive desktop session) to start it again. This is unavoidable until Tally exposes a load verb in a future protocol version.
Operational requirement: GUI agent must be running
Because the MCP server typically runs as a Windows service in Session 0 (no desktop), it cannot spawn tally.exe directly. The companion script scripts/tally-gui-agent-v2.ps1 runs in the user's interactive session and acts as the bridge — load-company IPCs to it to perform the spawn.
Install the agent to start at user logon.
setup-windows.ps1registers aTallyMCPAgentScheduled Task at-logon for the configured user — no manual setup needed. The Windows installer (option A above) does the same automatically.Self-update on deploy. When a
git pullreplacestally-gui-agent-v2.ps1on disk, the running agent detects the mtime change between commands and re-launches into the new version. Combined with the at-logon task, deploys propagate without operator intervention.Version handshake. The agent reports
agentVersionon every response.load-companyrefuses to call destructive actions on an agent older thanREQUIRED_AGENT_VERSIONand returns a clear remediation message instead of silently no-op'ing on unrecognized IPC fields.open-company-debugsurfaces both the running version andversionOkstatus.No LLM key required for the deterministic actions (
ping,start-tally,select-and-unlock-company). Only setANTHROPIC_API_KEY/OPENAI_API_KEYif you want the LLM-guided UI navigation fallback (open-companyStrategy 3).load-companypings the agent before doing anything destructive — if the agent isn't responding (or is too old), the tool refuses to kill Tally and returns a clear error. So a misconfigured deployment never ends up worse than it started.Check liveness any time via
open-company-debug— it returnsguiAgentResponding,guiAgentVersion,guiAgentVersionOk, andguiAgentVersionRequired.
Setup
Local (Claude Desktop)
Add to your claude_desktop_config.json (File → Settings → Developer):
{
"mcpServers": {
"Tally Prime": {
"command": "node",
"args": ["<path-to-repo>/dist/index.mjs"]
}
}
}Local (VS Code / GitHub Copilot)
Add to your workspace .vscode/mcp.json:
{
"servers": {
"tally-prime": {
"type": "stdio",
"command": "node",
"args": ["<path-to-repo>/dist/index.mjs"]
}
}
}Remote / Cloud
For browser-based clients (ChatGPT, Claude web, Copilot) that can't reach a local Tally install, deploy the server on a machine that can access Tally and expose it over HTTPS.
{
"servers": {
"tally-prime": {
"type": "http",
"url": "https://your-domain.example/mcp"
}
}
}The server uses OAuth 2.1 with PKCE for authentication. Detailed setup guides:
Linux-based Server (recommended — Tally connects via SSH tunnel)
Available Tools
Company Management
Tool | Description |
| Lists company folders in the Tally data directory (no open company required) |
| Recursive scan with display names + credential-requirement hints. Handles both stock layout and Tally Prime Edit Log's nested layout. Use this BEFORE |
| Lists companies currently resident in Tally (no restart needed) |
| Loads a company by editing |
| Cheap pointer flip between already-loaded companies (Gold edition) |
| Legacy multi-strategy loader (experimental — see #1) |
| Reports server config, agent liveness, agent version, edition, and Tally XML reachability |
Optional credential-hint config (used by list-available-companies): drop a .tally-mcp-companies.json into the Tally data path (or set TALLY_COMPANIES_CONFIG to point elsewhere) with the shape:
{
"100000": { "requiresCredentials": true, "knownUsername": "admin", "notes": "Edit Log; user-based security" },
"200000": { "requiresCredentials": false, "notes": "Auto-loads cleanly" }
}The config never stores passwords — only the hint that one is needed, so callers can prompt the human up-front instead of waiting for load-company to fail.
Financial Reports
Tool | Description |
| Group hierarchy with BS/PL classification, Dr/Cr nature |
| Ledger-wise opening, debit, credit, closing for a period |
| Balance sheet as on date |
| Profit & Loss statement for a period |
| Closing balance of a single ledger as on date |
| Voucher-level ledger statement with GST breakup |
| Outstanding receivables / payables with overdue days |
Inventory
Tool | Description |
| Stock item summary with opening, inward, outward, closing |
| Available quantity of a stock item as on date |
| Voucher-level stock item statement with tracking numbers |
GST
Tool | Description |
| GST tax breakup of Sales/Purchase vouchers |
| GST configuration of all stock items (HSN, rates) |
| HSN-wise GST summary for return filing |
| GSTR-1 outward supplies summary (B2B/B2C) |
| GSTR-2 inward supplies summary for ITC reconciliation |
Master Data
Tool | Description |
| List any master collection (ledger, group, stockitem, vouchertype, etc.) |
Write Operations
Tool | Description |
| Create vouchers (Sales, Purchase, Payment, Receipt, Journal, etc.) |
| Create GST-compliant vouchers with auto tax ledger allocation |
| Create a new GL ledger master |
| Create a new stock item master |
Write tools are disabled when
READONLY_MODE=true.
Analytics
Tool | Description |
| Run SQL queries on DuckDB against cached report tables |
Most report tools cache their output in a temporary DuckDB table (returned as tableID). Use query-database to run analytical SQL — aggregate, filter, join, sort — on those cached tables. Tables auto-expire after 15 minutes (configurable via DB_TABLE_RETENTION_MS).
Security
OAuth 2.1 + PKCE with constant-time token comparison
Helmet security headers
CORS restricted to configured origins
Rate limiting on authentication endpoints (configurable via
AUTH_RATE_LIMIT_*)SQL validation — only
SELECTstatements allowed inquery-databaseAudit logging — every tool invocation logged with timestamp, args (secrets redacted), and duration
Read-only mode — disable all write operations via env var
Architecture
┌─────────────┐ ┌──────────────────────┐ ┌─────────────┐
│ MCP Client │────▶│ Tally MCP Server │────▶│ Tally Prime │
│ (Claude, │ MCP │ Express + MCP SDK │ XML │ Port 9000 │
│ Copilot…) │◀────│ DuckDB · OAuth 2.1 │◀────│ │
└─────────────┘ └──────────────────────┘ └─────────────┘Scripts & Utilities
The scripts/ directory contains Windows-specific automation tools used by the open-company feature and server deployment.
GUI Agent — Companion Script for Cross-Session Operations
powershell -ExecutionPolicy Bypass -File scripts\tally-gui-agent-v2.ps1 [-LLMProvider anthropic|openai] [-MaxSteps 15]Runs in the interactive desktop session where Tally is visible. The MCP server (which typically runs in Windows Session 0 with no desktop) communicates with this agent via JSON file IPC to perform actions that need a real desktop — most importantly launching tally.exe for load-company and automating Alt+F3 → Select Company for the optional LLM-guided fallback.
Install: Add to Windows Startup folder or Task Scheduler (run at user logon)
Requires
TallyUI.dll(see below)LLM key is OPTIONAL. Deterministic actions (
ping,start-tally) work without one. SetANTHROPIC_API_KEYorOPENAI_API_KEYonly if you need the LLM-guided UI navigation fallback (open-companyStrategy 3).LLM model, tokens, and timeout are configurable via env vars (see Configuration)
TallyUI.dll — Win32 Interop Library
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:library /reference:System.Drawing.dll /out:scripts\TallyUI.dll scripts\TallyUI.csCompiled C# library wrapping Windows APIs for window management, keystroke injection, and screenshot capture. Required by GUI Agent v2. The setup-windows.ps1 script compiles this automatically.
Windows Service Setup
powershell -ExecutionPolicy Bypass -File scripts\setup-windows.ps1 [-InstallDir C:\tally-mcp-server] [-NodePath "..."] [-ServiceName TallyMCP]One-time setup to register the MCP server as a Windows service via NSSM. Configures auto-start, log rotation, loads .env variables, and registers two at-logon scheduled tasks: TallyMCPAgent (the GUI agent) and TallyMCPTray (the status tray icon). See Windows Server Setup for the full guide.
Status Tray Icon (issue #20)
powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File scripts\tray\tally-mcp-tray.ps1Runs in the user's interactive desktop session and surfaces a coloured tray icon (green/yellow/red/gray) reflecting overall TallyMCP health. Polls every few seconds for: service status, GUI agent task + process, Tally Prime process, and a public-URL OAuth metadata probe. Right-click for one-click admin actions:
Open logs folder (also: double-click the tray icon)
Restart service (prompts UAC for admin)
Restart GUI agent
Launch Tally Prime (uses
TALLY_EXE_PATHfrom.env)Reconfigure... (re-runs
firstrun-config.ps1for.envchanges)Quit (hide tray) — hides the icon only; service and agent keep running
setup-windows.ps1 registers this as TallyMCPTray ONLOGON; the Windows installer (Option A above) does the same. Pass -SkipTrayTask to either if you don't want the tray icon (e.g. headless server install).
No new runtime dependencies — uses WinForms NotifyIcon + System.Drawing already present on every Windows 10+ box.
Deploy a New Version
After pushing changes to origin/main, refresh the running service on the Windows box.
One command (recommended):
# From an admin PowerShell on the Tally box
cd C:\tally-mcp-server
.\scripts\deploy.ps1The script halts on any failure rather than leaving a half-deployed state. It runs:
git pull origin mainnpm install(skip with-SkipInstallwhenpackage.jsonhasn't changed)npm run buildForce-stops the service (kills the
node.exeprocess — graceful stop is unreliable under NSSM on Windows), thenStart-Service TallyMCPand verifies the service isRunningafterwards
Useful flags:
Flag | Purpose |
| Skip |
| Pull and build, but don't restart — for staging a deploy |
| Override service name (default |
| Override repo path (default |
Smoke test after deploy (from anywhere):
curl -sS https://<your-domain>/.well-known/oauth-protected-resourceA JSON body with resource confirms the server is up. A 502 means the upstream Node process didn't come back — tail logs\service-*.log for the cause (most often a missing env var or a port collision).
Manual fallback — if deploy.ps1 ever misbehaves, the equivalent five-step recipe is:
cd C:\tally-mcp-server
git pull origin main
npm install
npm run build
Restart-Service TallyMCP
Get-Service TallyMCPDevelopment
npm run build # Compile TypeScript
npm test # Build + run tests
npx tsc --noEmit # Type-check without emitting
npm audit # Check for dependency vulnerabilitiesCredits
Originally created by Dhananjay Gokhale. This fork is maintained by Jinacode Systems.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JINA-CODE-SYSTEMS/tally-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server