How the TRES Finance Plugin Handles Blockchain Accounting in Claude Code
The TRES Finance plugin implements blockchain accounting through a Model Context Protocol (MCP) skill set that ingests on-chain data from explorers, converts transactions into double-entry ledger records, and generates visual flow diagrams with natural-language explanations.
The tres-finance-plugin in the anthropics/claude-plugins-community repository provides a full-stack blockchain accounting solution within Claude Code conversations. It bridges raw blockchain transactions from Etherscan and Polygonscan with traditional double-entry bookkeeping, enabling automated ledger management and financial reporting.
Three-Layer Architecture for Blockchain Accounting
The plugin operates through a stratified architecture that separates data ingestion, accounting logic, and presentation.
Data Ingestion from Block Explorers
The tres-explorer-tx-to-ledger skill handles the initial retrieval and parsing of on-chain data. Located in /tres-finance-plugin/skills/tres-explorer-tx-to-ledger/SKILL.md, this skill accepts public explorer URLs (such as Etherscan or Polygonscan) and uses the WebFetch tool to scrape transaction details. It normalizes the raw blockchain payload into structured ledger entries, extracting fields like transaction hash, gas fees, token transfers, and timestamps for accounting processing.
Ledger and Accounting Engine
The accounting core maintains persistent double-entry records through two primary skills. The tres-wallets-upload skill (/tres-finance-plugin/skills/tres-wallets-upload/SKILL.md) distinguishes between on-chain wallets (requiring valid blockchain addresses like 0x…) and off-chain exchange accounts, mapping each to a corresponding accounting "account" object. This dual-model enables reconciliation between traditional ERP invoicing and crypto transactions.
The tres-settings-management skill (/tres-finance-plugin/skills/tres-settings-management/SKILL.md) controls platform collections and sync boundaries. Administrators configure which blockchains or exchanges to enable, specify sync start dates, and apply filters to limit historic data ingestion, ensuring the ledger remains relevant and performant.
Insight and Reporting Generation
The tres-tx-story skill (/tres-finance-plugin/skills/tres-tx-story/SKILL.md) transforms transaction hashes into animated SVG flow diagrams accompanied by plain-language narratives of asset movements. For financial validation, the tres-asset-balance-validation skill (/tres-finance-plugin/skills/tres-asset-balance-validation/SKILL.md) queries the ledger to compare recorded balances against on-chain snapshots, flagging discrepancies for reconciliation.
Key Accounting Concepts
The plugin implements several architectural patterns essential for accurate blockchain accounting.
Dual Account Model: On-Chain vs. Off-Chain
As defined in the wallet upload skill, the system categorizes accounts based on their data source. On-chain accounts require valid blockchain addresses and pull data directly from public ledgers. Off-chain accounts represent centralized exchanges or custodial services, requiring only exchange identifiers. This distinction allows the tres-invoice-bill-matching skill (/tres-finance-plugin/skills/tres-invoice-bill-matching/SKILL.md) to match traditional invoices against on-chain payments using transaction correlation.
Privacy-First MCP Architecture
According to the plugin manifest in /tres-finance-plugin/.claude-plugin/plugin.json, the architecture delegates all heavy processing to the hosted TRES Finance MCP server. The plugin acts as a thin client, forwarding only transaction hashes or explorer URLs. No telemetry or personal data is collected beyond what the user explicitly provides, ensuring compliance with financial privacy standards.
Sync Boundaries and Platform Collections
The settings management interface allows granular control over data scope. Administrators define platform collections—sets of enabled blockchains and exchanges—and establish sync boundaries that limit historical data pulls. This prevents ledger bloat while maintaining complete records for active accounting periods.
Implementation Examples
The following Python-style pseudocode illustrates how Claude Code clients invoke the plugin's blockchain accounting capabilities via the MCP SDK.
# Ingest a transaction from Etherscan into the accounting ledger
result = await mcps.call_skill(
skill="tres-explorer-tx-to-ledger",
inputs={"explorer_url": "https://etherscan.io/tx/0xabc123..."},
)
print(result["ledger_entry_id"])
# Generate a visual narrative for a transaction hash
story = await mcps.call_skill(
skill="tres-tx-story",
inputs={"tx_hash": "0xdef456..."},
)
print(story["svg_url"]) # Animated flow diagram URL
print(story["explanation"]) # Human-readable asset movement description
# Validate ledger balances against on-chain state
validation = await mcps.call_skill(
skill="tres-asset-balance-validation",
inputs={"organization_id": "org-123"},
)
print(validation["status"]) # Returns "OK" or "MISMATCH"
print(validation["details"])
These calls demonstrate the plugin's workflow: receiving blockchain data via URLs or hashes, normalizing transactions into accounting entries, storing them in organization-specific ledgers, and analyzing them for reporting and validation.
Summary
- Data Ingestion: The
tres-explorer-tx-to-ledgerskill scrapes and parses blockchain explorer data into structured accounting entries. - Dual Account Model: Distinguishes on-chain wallets (blockchain addresses) from off-chain exchanges for comprehensive reconciliation.
- MCP Architecture: Delegates processing to a hosted server while maintaining privacy by transmitting only transaction identifiers.
- Reporting Tools: Generates animated flow diagrams and natural-language explanations through
tres-tx-story, plus balance validation viatres-asset-balance-validation. - Configurable Sync: Administrators control data scope through platform collections and sync boundaries in the settings management skill.
Frequently Asked Questions
How does the plugin handle different blockchain networks?
The plugin supports multiple networks including Ethereum and Polygon through the tres-explorer-tx-to-ledger skill, which parses URLs from Etherscan, Polygonscan, and similar explorers. The tres-settings-management skill allows administrators to enable or disable specific blockchains and define sync boundaries for each network, ensuring only relevant chains contribute to the ledger.
Can the plugin reconcile cryptocurrency transactions with traditional invoices?
Yes. The tres-invoice-bill-matching skill specifically addresses this use case by correlating on-chain payment transactions with off-chain invoice records. The dual account model distinguishes between blockchain wallets and exchange accounts, enabling the system to match an invoice to a specific on-chain payment using transaction hashes and amount verification.
What privacy measures protect sensitive financial data?
The plugin implements a privacy-first design where only transaction hashes or explorer URLs are transmitted to the hosted MCP server, as specified in /tres-finance-plugin/.claude-plugin/plugin.json. No personal telemetry or sensitive ledger data is collected beyond what users explicitly provide, and all heavy processing occurs server-side while the Claude Code client acts as a thin interface.
How are accounting entries stored and validated?
Transactions convert into double-entry ledger records through the wallet upload and explorer skills, stored persistently per organization. The tres-asset-balance-validation skill performs automated reconciliation by comparing ledger balances against live on-chain snapshots, returning "OK" for matched balances or "MISMATCH" with detailed discrepancy reports for accounting correction.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →