Xledger MCP Server

Xledger MCP Server

Provides read-only access to Xledger accounting data via GraphQL API for querying invoices, balances, projects, timesheets, and more.

Category
访问服务器

README

Xledger MCP Server

An MCP (Model Context Protocol) server that provides read-only access to the Xledger accounting system via its GraphQL API.

Use it with Claude, VS Code Copilot, or any MCP-compatible AI assistant to query your financial data — invoices, account balances, projects, timesheets, and more.

Features

  • 9 read-only tools covering core accounting data
  • Compatible with Xledger GraphQL API v2
  • Token-based authentication (no OAuth complexity)
  • Zero runtime dependencies beyond the MCP SDK
  • TypeScript with full type safety

Tools

Tool Description
get_ar_transactions Customer invoices (Accounts Receivable) — filter by date, outstanding only
get_ap_transactions Supplier invoices (Accounts Payable) — filter by date, outstanding only
get_account_balances GL account balances by fiscal year and period
get_projects Project financials — revenue, cost, hours, billability
get_timesheets Timesheet entries — hours per employee per project
get_journal_entries Raw GL transactions with account, amount, project
get_employees Employee list with employment dates
get_customers Customer lookup with name search
get_revenue_summary Aggregated revenue by customer for a date period

All tools are annotated with readOnlyHint: true — they never modify data in Xledger.

Quick Start

Prerequisites

  • Node.js 18+
  • A Xledger account with GraphQL API access
  • An API token (generate at: Xledger > Administration > System Access > GraphQL/API tokens)

Install and Build

git clone https://github.com/Eyevinn/xledger-mcp-server.git
cd xledger-mcp-server
npm install
npm run build

Configure

Set the required environment variable:

export XLEDGER_GRAPHQL_TOKEN=your-token-here
Variable Required Default Description
XLEDGER_GRAPHQL_TOKEN Yes Your Xledger API token
XLEDGER_API_URL No https://www.xledger.net/graphql API endpoint (use https://demo.xledger.net/graphql for testing)

Run

npm start

The server communicates over stdio — it's designed to be launched by an MCP client, not run standalone.

Configuration

Claude Desktop / Claude Code

Add to your Claude configuration (~/.claude/settings.json or Claude Desktop config):

{
  "mcpServers": {
    "xledger": {
      "command": "node",
      "args": ["/path/to/xledger-mcp-server/dist/index.js"],
      "env": {
        "XLEDGER_GRAPHQL_TOKEN": "your-token-here"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json:

{
  "servers": {
    "xledger": {
      "command": "node",
      "args": ["/path/to/xledger-mcp-server/dist/index.js"],
      "env": {
        "XLEDGER_GRAPHQL_TOKEN": "your-token-here"
      }
    }
  }
}

Tool Details

get_ar_transactions

Get customer invoices with optional filters.

Parameters:

  • first (number, default: 50) — Number of records (max 200)
  • outstandingOnly (boolean, default: false) — Only unpaid invoices
  • fromDate (string, YYYY-MM-DD) — Invoice date from
  • toDate (string, YYYY-MM-DD) — Invoice date to

get_ap_transactions

Get supplier invoices with optional filters. Same parameters as get_ar_transactions.

get_account_balances

Get GL account balances.

Parameters:

  • fiscalYear (number) — Fiscal year, defaults to current year
  • periodNumber (number, 1-12) — Month. Returns YTD if omitted
  • first (number, default: 200) — Number of records (max 500)

get_projects

Get projects with financial data.

Parameters:

  • first (number, default: 100) — Number of records (max 500)
  • activeOnly (boolean, default: true) — Only active projects
  • billableOnly (boolean, default: false) — Only billable projects

get_timesheets

Get timesheet entries.

Parameters:

  • first (number, default: 100) — Number of records (max 500)
  • fromDate / toDate (string, YYYY-MM-DD) — Date range
  • invoicedOnly (boolean) — Only invoiced entries
  • notInvoiced (boolean) — Only uninvoiced entries

get_journal_entries

Get raw GL transactions.

Parameters:

  • first (number, default: 50) — Number of records (max 200)
  • fromDate / toDate (string, YYYY-MM-DD) — Date range (uses createdAt as proxy since postedDate is not filterable in API v2)
  • fiscalYear (number) — Client-side fiscal year filter

get_employees

Get employee list.

Parameters:

  • first (number, default: 100) — Number of records
  • activeOnly (boolean, default: true) — Only currently employed

get_customers

Get customers (subledgers).

Parameters:

  • first (number, default: 100) — Number of records
  • search (string) — Partial name/code match (client-side)

get_revenue_summary

Get aggregated revenue by customer.

Parameters:

  • fromDate (string, YYYY-MM-DD, required) — Period start
  • toDate (string, YYYY-MM-DD, required) — Period end

Xledger API v2 Notes

This server is compatible with Xledger's GraphQL API v2 schema, which introduced several changes:

  • Filter syntax: Direct field suffixes (e.g., invoiceDate_gte) instead of { AND: [{ field, op, value }] }
  • OrderBy: Array of { field, direction } enums instead of single object
  • Removed filters: Some fields are no longer filterable (fiscalYear on account balances, description on subledgers, billable on projects, postedDate on journal entries). These are handled with client-side filtering.
  • SystemValue: Uses .name instead of .description

Development

npm install
npm run build        # Compile TypeScript
npm test             # Run tests
npm run dev          # Watch mode (recompile on changes)
npm run lint         # Type-check without emitting

Security

  • The API token grants read access scoped to your Xledger tenant
  • Never commit tokens to version control — use environment variables
  • All tools are read-only (no mutations)
  • Consider using Xledger's token scope controls to limit access to only the data you need

License

MIT — see LICENSE

About Eyevinn Technology

Eyevinn Technology is a Stockholm-based consultancy specializing in video streaming technology. We contribute to the open source community through our GitHub organization and Open Source Cloud platform.

推荐服务器

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

官方
精选