TallyPrime MCP Server

TallyPrime MCP Server

Gives AI models native-level control over TallyPrime ERP, covering 169+ tools across all functional modules including masters, vouchers, reports, GST, payroll, and more.

Category
访问服务器

README

TallyPrime MCP Server

A production-grade Model Context Protocol (MCP) server that gives AI models complete, native-level control over TallyPrime ERP — covering every functional module across 169+ tools.

Architecture

                    ┌─ Stdio Transport (Claude Desktop / CLI)
AI Model ──► MCP ──┤
                    └─ StreamableHTTP (port 4000, remote clients)
                          │
                          ▼
                    TallyPrime XML Server (port 9000)
                          │
                    ├─ UTF-16LE encoded communication
                    ├─ Serial request queue (single-threaded safety)
                    ├─ Standard XML Export (Method A)
                    ├─ Inline TDL Queries (Method B)
                    ├─ XML Import (Method C)
                    ├─ TDL Actions (Method D)
                    └─ Object Export (Method E)

Three-Layer System

Layer Purpose Example
Standard XML API CRUD operations, report exports Create ledger, fetch Trial Balance
Inline TDL Queries Complex filtered queries built programmatically "All debtors with balance > 1L in Maharashtra"
Persistent TDL File Pre-built collections loaded on Tally startup MCP Ledgers, MCP StockItems, MCP FinancialSnapshot

Quick Start

Prerequisites

  • TallyPrime running with XML Server enabled (port 9000)
  • Node.js 20+

Setup

# Clone & install
cd tally-mcp-server
npm install

# Configure
cp .env.example .env
# Edit .env with your Tally settings

# Run in development (HTTP mode)
npm run dev

# Run in Stdio mode (for Claude Desktop)
npm run dev:stdio

# Build & run production
npm run build
npm start          # HTTP mode
npm run start:stdio  # Stdio mode

Docker

docker compose up -d

Transport Modes

Stdio (for Claude Desktop / CLI)

Add to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "tally": {
      "command": "node",
      "args": ["/path/to/tally-mcp-server/dist/index.js", "--stdio"]
    }
  }
}

Or set the environment variable:

MCP_TRANSPORT=stdio node dist/index.js

StreamableHTTP (for remote / web clients)

{
  "mcpServers": {
    "tally": {
      "url": "http://localhost:4000/mcp",
      "transport": "streamable-http"
    }
  }
}

Configuration

Variable Default Description
TALLY_HOST localhost TallyPrime hostname
TALLY_PORT 9000 TallyPrime XML server port
TALLY_TIMEOUT_MS 30000 Request timeout in ms
TALLY_COMPANY (auto) Force a specific company (optional)
MCP_SERVER_PORT 4000 HTTP transport port
MCP_TRANSPORT http Transport mode: stdio or http
MASTER_CACHE_TTL_MS 300000 Master cache TTL (5 min)
LOG_LEVEL info Winston log level

Tool Modules (169+ tools)

# Module Tools Description
1 Masters 28 Ledgers, groups, stock items, units, godowns, cost centres, currencies
2 Vouchers 16 Sales, purchases, receipts, payments, journals, contra, credit/debit notes
3 Orders 10 Sales/purchase orders, delivery/receipt notes, rejections
4 Financial Reports 15 Trial balance, P&L, balance sheet, cash flow, daybook, ratio analysis
5 Inventory Reports 10 Stock summary, movement, batch, expiry, reorder, valuation
6 Outstanding 8 Receivables, payables, ageing analysis, bill-wise, overdue
7 GST 18 GSTR-1/2A/2B/3B, HSN, e-Invoice, e-Way Bill, ITC, reconciliation
8 TDS/TCS 12 Computation, forms 26Q/27Q/16, challans, PAN verification
9 Payroll 20 Employees, pay heads, salary structures, payslips, PF/ESI/gratuity
10 Manufacturing 14 BOM, production, consumption, job costing, yield analysis
11 Banking 10 Bank reconciliation, cheque register, PDC, cash position
12 Budgets 8 Budget CRUD, variance, utilization, scenario reports
13 Security 8 Users, audit trail, altered/deleted voucher logs, exceptions
14 Company 8 Company info, connection test, cache refresh, feature status
15 Bulk Operations 12 Batch create/update/delete masters & vouchers
16 TDL Query Engine 12 Custom queries, inline TDL, functions, raw XML, search, reference

Key Technical Features

  • UTF-16LE encoding — Correct wire encoding for Tally's XML server (supports Indian languages: Hindi, Tamil, etc.)
  • Serial request queue — All requests are serialized to protect Tally's single-threaded XML server from concurrent request crashes
  • EXCEPTION/LINEERROR/STATUS detection — Comprehensive error detection covering all Tally error response formats
  • Master name cache with TTL — Fast ledger/stock/group name lookups without hitting Tally
  • Persistent TDL file — Pre-built optimized collections loaded on Tally startup
  • Tally value parsers — Correct parsing of Tally's date, amount, quantity, rate, and boolean formats
  • Input validation — Zod schemas with GSTIN/PAN/date format validators
  • Structured logging — Winston logger with configurable levels

Persistent TDL File

Install tdl/tally-mcp.tdl in your TallyPrime TDL folder for optimized pre-built collections:

Collection Contents
MCP Ledgers All ledgers with key financial fields
MCP StockItems All stock items with inventory fields
MCP Groups All account groups
MCP Vouchers All vouchers (date-filtered via SV)
MCP Debtors Sundry Debtors with balances
MCP Creditors Sundry Creditors with balances
MCP BankAccounts Bank accounts with balances
MCP CostCentres Cost centres
MCP Employees All employees with details
MCP CashBankSummary Cash + bank position
MCP FinancialSnapshot Quick financial summary function

API Endpoints (HTTP mode only)

Endpoint Method Description
/mcp POST MCP StreamableHTTP transport
/mcp GET SSE stream (session-based)
/mcp DELETE Close session
/health GET Health check + cache stats

Project Structure

tally-mcp-server/
├── src/
│   ├── index.ts              # Entry point (Stdio + HTTP)
│   ├── server.ts             # MCP server factory
│   ├── tally/
│   │   ├── client.ts         # HTTP client (UTF-16LE, serial queue)
│   │   ├── xml-builder.ts    # XML request builders
│   │   ├── xml-parser.ts     # XML response parser + value helpers
│   │   ├── tdl-builder.ts    # Inline TDL builder
│   │   └── state.ts          # Master cache with TTL
│   ├── tools/                # 16 tool modules (169+ tools)
│   └── utils/
│       ├── logger.ts         # Winston logger
│       ├── validators.ts     # GSTIN/PAN/date validators
│       ├── date-utils.ts     # Date utilities
│       └── helpers.ts        # Shared result/error helpers
├── tdl/
│   └── tally-mcp.tdl        # Persistent TDL file
├── package.json
└── tsconfig.json

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选