Tally MCP

Tally MCP

An MCP server that connects Claude to TallyPrime, allowing natural language queries for reading ledgers, trial balances, and daybooks, and creating vouchers with a dry-run and confirmation safety model.

Category
访问服务器

README

Tally MCP

An MCP (Model Context Protocol) server that connects Claude directly to TallyPrime, using Tally's built-in XML-HTTP gateway. Point Claude Desktop or Claude Code at your Tally instance and ask it to read ledgers, pull a trial balance, summarise a day book, or draft (and, once you approve, post) vouchers — all without manual export/import.

Built and open-sourced by a Chartered Accountancy firm in India that uses it for their own client accounting workflows. Not officially affiliated with Tally Solutions or Anthropic.

What you can do with it

Once connected, you can ask Claude things like:

  • "Show me the trial balance as on 31-03-2026"
  • "Pull the ledger for ABC Traders and summarise the last 10 entries"
  • "List all stock items with GST rate 18%"
  • "Create a sales voucher dated today: Debtor XYZ ₹1,18,000, Sales ₹1,00,000, Output CGST ₹9,000, Output SGST ₹9,000" — Claude shows you a preview first; nothing is written to Tally until you approve it.

⚠️ Safety model — read this before use

This connector can have full read/write access to whichever Tally company is open. Three layers of protection are built in:

  1. Dry-run by default. Every write tool (tally_create_voucher, tally_create_ledger, tally_create_stock_item) returns a preview of the exact XML it would send and does nothing to Tally unless called with "confirm": true. The tool descriptions instruct Claude to always show you the preview and get your go-ahead first — but read what it shows you before approving; don't rely on Claude alone as the control point.
  2. Company lock. .env requires TALLY_COMPANY_NAME. Before any write, the server re-checks that this exact company is the one open in Tally. If a different company has been opened since the server started, the write is blocked, not silently redirected.
  3. Audit log. Every tool call — read or write, dry-run or real — is appended to audit/tally-mcp-audit.log as JSON lines: timestamp, tool, inputs, XML sent, Tally's response, and status.

There's also a global kill switch: set DRY_RUN_ONLY=true in .env to force every write tool into preview-only mode regardless of confirm — useful while testing against real data for the first time.

This is a template for a safety-conscious integration, not a guarantee. Review the code, especially src/tallyClient.ts and src/tools/writeTools.ts, before pointing it at production accounting data.

Prerequisites

  • Node.js 18+
  • TallyPrime with ODBC/HTTP connectivity enabled (Gateway of Tally → F1 (Help) → Settings → Connectivity → enable HTTP, default port 9000)
  • The company you want to connect to must be open in Tally before you start the MCP server

Setup

git clone https://github.com/<your-username>/tally-mcp.git
cd tally-mcp
npm install
cp .env.example .env

Edit .env:

TALLY_URL=http://localhost:9000
TALLY_COMPANY_NAME=<exact company name as shown in Tally>
DRY_RUN_ONLY=false

Build:

npm run build

Smoke-test it starts cleanly:

npm start
# Expect: [tally-mcp] Connected. Tally URL: ..., Company lock: "...", DRY_RUN_ONLY: false
# Ctrl+C to stop.

Connect to Claude Desktop

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

{
  "mcpServers": {
    "tally": {
      "command": "node",
      "args": ["/absolute/path/to/tally-mcp/dist/index.js"],
      "env": {
        "TALLY_URL": "http://localhost:9000",
        "TALLY_COMPANY_NAME": "Your Company Name",
        "DRY_RUN_ONLY": "false"
      }
    }
  }
}

Restart Claude Desktop. You should see "tally" listed under connected tools/MCP servers.

Connect to Claude Code

claude mcp add tally -- node /absolute/path/to/tally-mcp/dist/index.js

Set env vars via your shell, a wrapper script, or .env in the working directory (loaded automatically via dotenv).

Tool reference

Read (no confirmation needed)

Tool Purpose
tally_get_company_info List companies open in Tally — use to verify connectivity
tally_list_ledgers Full Chart of Accounts with closing balances
tally_get_ledger Single ledger detail + voucher history
tally_get_daybook All vouchers in a date range
tally_get_trial_balance Trial balance as on a date
tally_list_stock_items Inventory list with qty/rate/HSN/GST

Write (dry-run by default, needs "confirm": true)

Tool Purpose
tally_create_voucher Sales / Purchase / Payment / Receipt / Journal / Contra / Credit Note / Debit Note
tally_create_ledger New ledger master under a parent group
tally_create_stock_item New stock item with HSN + GST rate

Architecture

Claude (Desktop/Code)
      │  MCP protocol (stdio)
      ▼
tally-mcp server (Node.js/TypeScript)
      │  XML over HTTP
      ▼
TallyPrime (XML-HTTP gateway, default port 9000)
src/
├── index.ts              # MCP server entry point, tool registry
├── config.ts              # .env loading + validation
├── types.ts                # Shared TypeScript types
├── tallyClient.ts         # HTTP transport to Tally + company-lock check
├── zodToJsonSchema.ts     # Zod → MCP tool schema converter
├── xml/
│   ├── builder.ts         # Builds Tally XML requests
│   └── parser.ts          # Parses Tally XML responses
├── tools/
│   ├── readTools.ts       # Read-only tool handlers
│   └── writeTools.ts      # Write tool handlers (dry-run/confirm gate)
└── audit/
    └── auditLogger.ts     # Append-only JSONL audit trail

Known limitations / roadmap

  • tally_alter_voucher types exist but the tool isn't wired up yet — altering an existing voucher needs an extra lookup-by-voucher-number step in Tally's XML schema. PRs welcome.
  • No dedicated GST report tool (GSTR-1/3B summary) yet — tally_get_daybook + tally_get_ledger cover most reconciliation needs today, but a purpose-built GST summary tool would be a good addition.
  • Credentials are plain .env. Fine for local/single-user use; if you're deploying this for a team or multiple client instances, consider wiring in a proper secrets manager instead.
  • Single company per running server instance — the TALLY_COMPANY_NAME lock in .env assumes one server process per Tally company. Multi- company support (company name as a per-call parameter instead of an .env lock) is a reasonable Phase 2 if there's interest.

Contributions on any of the above are welcome — see CONTRIBUTING.md.

License

MIT — see LICENSE. This software connects to a live accounting system; you are responsible for reviewing dry-run previews and securing your own Tally connection. See SECURITY.md for operational guidance.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选