npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

verde-myobgreentree-mcp-server

v4.0.0

Published

MCP server for MYOB Greentree API integration - Now with Code Mode for 97% token reduction

Downloads

28

Readme

Greentree MCP Server

A comprehensive Model Context Protocol (MCP) server for integrating with MYOB Greentree ERP system. This server provides 427 tools covering 71 entity types with full CRUD operations, advanced filtering, approval workflows, special actions, and multi-company support.

npm version

What's New in v4.0.0 🚀

  • Code Mode: New high-performance mode with 97% token reduction - LLM writes TypeScript instead of calling 430 tools
  • Performance Optimizations: Config caching, client reuse, HTTP keep-alive, parallel helpers
  • Parallel Helpers: parallel(), parallelMap(), batchGet() for 5-10x faster multi-entity operations
  • All optimizations enabled by default - zero configuration needed

v2.0.0 Features (included)

  • 70+ Entity Types: Full coverage of Greentree modules (AR, AP, SO, PO, Inventory, GL, Job Costing, CRM, HR, Fixed Assets, Manufacturing)
  • 427 Total Tools: CRUD operations for all entities plus system tools
  • Multi-Company Support: Query and access data from any company the user has access to
  • Advanced Filtering: 50+ filter modifiers including sorting, date ranges, status filters
  • Approval Workflows: Approve, reject, and clear approval status
  • Special Actions: Cancel transactions, hold management, primary images, selling price queries
  • System Tools: Ping/health check, company list, and user information queries

Features

Comprehensive Entity Coverage

Accounts Receivable (AR)

  • Customer, ARInvoice, ARCreditNote, ARReceipt, ARControl, Salesperson

Accounts Payable (AP)

  • Supplier, APInvoice, APCreditNote, APPayment, APControl

Sales Orders (SO)

  • SOSalesOrder, SOPackingSlip, SOCarrier, SOStatusDefinition

Purchase Orders (PO)

  • POPurchaseOrder, POReceipt, POShipments, POStatusDefinition

Inventory (IN)

  • StockItem, INTransaction, INLocation, INSerialLot, INControl
  • INAnalysisCode, INUnitOfMeasure, INBinTransaction, INForecast
  • INBudget, INStockTake, INStockTakeItem

General Ledger (GL)

  • GLAccount, GLDocument, GLBudget, GLPeriodSummary, GLControl
  • GLBankInCashReceipts, GLBankOutCashPayments, GLAccountSegmentDefinition

Job Costing (JC)

  • JCJob, JCTimesheet, JCDisbursement, JCEstimate, JCActivity
  • JCEmployee, JCStatus, JCJobType, JCWorkCentre, JCControl, JCPlantCharge

CRM

  • CRMContact, CRMOrganisation, CRMLead, CRMQuote, CRMTask
  • CRMCommunication, CRMMessage, CRMSVRequest
  • Full Service/Asset module support (9 additional entities)

Fixed Assets (FA)

  • FAMaster, FAPurchase, FADepreciation, FADisposal, FATransfer
  • FARevaluation, FAWriteOffs, FAAdjustment, FABalanceAdjustment, FAControl

Human Resources (HR)

  • HRPerson, HRPosition, HRApplicant, HRLeaveRequest, HRIncident
  • CV management (5 entities for certifications, education, employment, skills, training, medical)

Manufacturing

  • BOMBillOfMaterials, FOFactoryOrder, FOFactoryOrderReceipts

System/Utility

  • Branch, Company, ProfitCentre, Tree, Countries, Currencies
  • Payment Terms, Tax Codes, Report Definitions, UDF Definitions
  • eCommerce Web Users, SCM Requisitions

Advanced Features

Global Modifiers (Work on Most Entities)

  • Pagination: page, pageSize (up to 100 records)
  • Date Filtering: modifiedSince (ISO format: 2024-01-01T00:00:00)
  • Search: globalSearch (full-text search)
  • Inclusions: includeAttachments, includeStickyNotes, includePluginProperties, includeLinkedObjects, includeApprovals
  • Sorting: sortBy1, sortBy2, sortBy3 with sortDesc1, sortDesc2, sortDesc3

Stock Item Specific Modifiers

  • Inclusions: includeBarcodes, includeSerialLots, includeItemTexts, includeAliases, includeCompanionItems, includeSubstituteItems, includeComponentDefinitions
  • Exclusions: excludeUnitConversions, excludeSupplierDetails, excludeStockLocations, excludePriceBooks
  • Filters: treeName, treeBranch, analysisCode, isActive, stockingLocation, listOnly

AR Invoice Filters

  • customer, holdCode, outstandingOnly, postingDate, paymentDate, branch

Sales/Purchase Order Filters

  • customer/supplier, status, salesPerson, branch, customerOrderNumber, canBeApprovedByUser

Job Costing Filters

  • customer, jobManager, accountManager, parentJob, jobType, isOpen, excludeClosed, profitCentre, includeSubJobs, isRecursive, template, workCentreAssignedEmployee

Approval Workflows

  • greentree_approve - Approve records
  • greentree_reject - Reject records
  • greentree_clear_approval - Clear approval status

Special Actions

  • greentree_cancel - Cancel transactions
  • greentree_put_on_hold - Put sales orders on hold
  • greentree_take_off_hold - Remove hold status
  • greentree_get_primary_image - Get primary image attachment
  • greentree_get_selling_price - Query selling price for stock items

System Tools

  • greentree_ping - Health check with server information
  • greentree_get_companies - List all companies available to the user
  • greentree_get_user - Query user information

Multi-Company Support

All tools accept an optional company parameter to query data from a specific company:

  • If not specified, uses the default company from configuration
  • Pass company code (e.g., "DEMO", "ACME") to access data from that company
  • Use greentree_get_companies to discover available companies
  • Example: Query customers in company "ACME" instead of default company

Attachments

  • Upload, download, and list attachments for any entity
  • Base64 encoding for file content

Reports

  • Run Greentree reports with parameters
  • PDF output support
  • Optional attachment to entities

Code Mode (Recommended) 🚀

Code Mode is a high-performance alternative that reduces token usage by 97% by letting the LLM write TypeScript code instead of making individual tool calls.

Why Code Mode?

| Aspect | Traditional (427 tools) | Code Mode (5 tools) | |--------|------------------------|---------------------| | Tool definition tokens | ~86,000 | ~2,500 | | Multi-step workflow | Multiple round-trips | Single code execution | | Performance | Sequential API calls | Parallel helpers available |

Quick Start

{
  "mcpServers": {
    "greentree": {
      "command": "npx",
      "args": ["verde-myobgreentree-mcp-server-codemode"]
    }
  }
}

Example

Instead of multiple tool calls, the LLM writes:

// Get outstanding invoices for all active customers in parallel
const customers = await greentree.listCustomers({ status: "Active" });
const invoices = await greentree.parallelMap(
  customers,
  (c) => greentree.listARInvoices({ customer: c.Code, outstandingOnly: true }),
  5  // 5 concurrent requests
);
const total = invoices.flat().reduce((sum, inv) => sum + inv.Outstanding, 0);
console.log(`Total outstanding: $${total.toFixed(2)}`);

Performance Settings (all enabled by default)

| Setting | Default | Description | |---------|---------|-------------| | GREENTREE_CACHE_CONFIG | true | Cache config file | | GREENTREE_CACHE_CLIENT | true | Reuse HTTP client | | GREENTREE_CLIENT_KEEPALIVE | true | HTTP keep-alive | | GREENTREE_PARALLEL_HELPERS | true | Enable parallel(), parallelMap(), batchGet() | | GREENTREE_PARALLEL_CONCURRENCY | 5 | Max concurrent requests |

To disable an optimization, set env var to "false".

See CODEMODE.md for full documentation.


Installation

Quick Install (Recommended)

npx verde-myobgreentree-mcp-server

Or install globally:

npm install -g verde-myobgreentree-mcp-server

Interactive Setup

Run the setup wizard:

verde-myobgreentree-mcp-setup

This will guide you through:

  • Entering your Greentree connection details
  • Testing the connection
  • Saving the configuration
  • Getting instructions for Claude Desktop integration

Configuration

Option 1: Use the Setup Wizard (Recommended)

verde-myobgreentree-mcp-setup

Option 2: Manual Configuration

Create a configuration file named greentree-config.json in one of these locations:

  • Current directory: ./greentree-config.json
  • User home directory: ~/.greentree/config.json

Configuration Format

{
  "greentree": {
    "server": "greentree.yourcompany.com",
    "port": 9000,
    "company": "01",
    "apiKey": "your-greentree-serial-number",
    "username": "your-username",
    "password": "your-password"
  }
}

Configuration Fields

  • server: Your Greentree server hostname or IP address
  • port: API port (default: 9000)
  • company: Your Greentree company code (e.g., "01")
  • apiKey: Your Greentree serial number (used for API authentication)
  • username: Greentree username for authentication
  • password: Greentree password for authentication

Usage with Claude Desktop

Add this to your Claude Desktop configuration file:

macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Code Mode (Recommended)

{
  "mcpServers": {
    "greentree": {
      "command": "npx",
      "args": ["verde-myobgreentree-mcp-server-codemode"]
    }
  }
}

Traditional Mode (427 tools)

{
  "mcpServers": {
    "greentree": {
      "command": "npx",
      "args": ["verde-myobgreentree-mcp-server"]
    }
  }
}

Restart Claude Desktop after updating the configuration.

Tool Naming Convention

All tools follow a consistent pattern:

CRUD Operations:

  • greentree_get_[entity] - Get single record or list with filters
  • greentree_create_[entity] - Create new record
  • greentree_update_[entity] - Update existing record
  • greentree_delete_[entity] - Delete record

Entity Names: Lowercase version of entity type (e.g., customer, arinvoice, stockitem, jcjob)

Examples:

  • greentree_get_customer
  • greentree_create_supplier
  • greentree_update_sosalesorder
  • greentree_delete_glaccount

Example Usage

System Operations

Check if the Greentree server is running
→ Uses greentree_ping

Get list of available companies
→ Uses greentree_get_companies
→ Returns: [{"Code":"ACME","Name":"Acme Corporation"},{"Code":"DEMO","Name":"Demo Company Ltd","IsDefault":true}]

Get information about user "john.smith"
→ Uses greentree_get_user

Multi-Company Operations

Get customers from company "ACME" instead of default company
→ Uses greentree_get_customer with company="ACME"

List all stock items in company "DEMO"
→ Uses greentree_get_stockitem with company="DEMO"

Get AR invoices for customer "CUST001" in company "ACME"
→ Uses greentree_get_arinvoice with company="ACME", customer="CUST001"

Create a new customer in company "ACME"
→ Uses greentree_create_customer with company="ACME", data="{...}"

Customer Operations

Get customer with code "CUST001" from Greentree
→ Uses greentree_get_customer

List all active customers, sorted by name
→ Uses greentree_get_customer with status="Active" and sortBy1="name"

Find customers modified since January 1, 2024
→ Uses greentree_get_customer with modifiedSince="2024-01-01T00:00:00"

Stock Item Operations

Get stock item "ITEM123" with barcodes and serial lots
→ Uses greentree_get_stockitem with includeBarcodes=true, includeSerialLots=true

List all active stock items, exclude supplier details
→ Uses greentree_get_stockitem with isActive=true, excludeSupplierDetails=true

Get selling price for stock item "ITEM123" for customer "CUST001"
→ Uses greentree_get_selling_price

Invoice Operations

Get all outstanding invoices for customer "CUST001"
→ Uses greentree_get_arinvoice with customer="CUST001", outstandingOnly=true

List invoices posted in January 2024, sorted by document date descending
→ Uses greentree_get_arinvoice with postingDate="2024-01-01", sortBy1="documentDate", sortDesc1=true

Sales Order Operations

Get sales orders for customer "CUST001" with status "Open"
→ Uses greentree_get_sosalesorder

Put sales order "SO12345" on hold
→ Uses greentree_put_on_hold

Cancel purchase order "PO98765"
→ Uses greentree_cancel

Job Costing Operations

Get all open jobs for customer "CUST001"
→ Uses greentree_get_jcjob with customer="CUST001", isOpen=true

List jobs assigned to manager "john.smith", include sub-jobs
→ Uses greentree_get_jcjob with jobManager="john.smith", includeSubJobs=true

Approval Workflows

Approve purchase order "PO12345"
→ Uses greentree_approve with entityType="POPurchaseOrder"

Reject AR invoice "INV98765" with notes
→ Uses greentree_reject with narration="Missing documentation"

Clear approval status for sales order "SO11111"
→ Uses greentree_clear_approval

Attachments

List attachments for customer "CUST001"
→ Uses greentree_get_attachments

Download "invoice.pdf" from customer "CUST001"
→ Uses greentree_download_attachment

Upload a document to supplier "SUPP999"
→ Uses greentree_upload_attachment

Reports

Run the "Customer Statement" report for customer "CUST001"
→ Uses greentree_run_report with appropriate parameters

Data Format

The server uses JSON format for all communication with the Greentree API:

  • Input: Provide data as JSON strings in the data parameter
  • Output: Receives and returns JSON directly from Greentree API
  • API Calls: All requests use .json suffix for JSON responses (e.g., /DEMO/Customer.json)

Development

Build

npm run build

Watch Mode

npm run watch

Test with MCP Inspector

npm run inspector

Logging

Logs are written to:

  • Default: ~/.greentree/mcp-server.log
  • Claude Desktop MCP logs: Check Claude's log directory for mcp-server-greentree.log

Error Handling

The server provides detailed error messages for:

  • Authentication failures
  • Missing configuration
  • Invalid entity types or identifiers
  • Network errors
  • API errors from Greentree

Security Notes

⚠️ Important:

  • Keep your greentree-config.json file secure
  • Never commit credentials to version control
  • Use environment-specific configurations
  • Consider using file permissions to restrict access to config file:
    chmod 600 ~/.greentree/config.json

Troubleshooting

Server Won't Start

  1. Check configuration file exists and is valid JSON
  2. Verify all required fields are present
  3. Check network connectivity to Greentree server

Authentication Errors

  1. Verify username and password are correct
  2. Check API key (serial number) is valid
  3. Ensure user has appropriate permissions in Greentree

Connection Timeouts

  1. Check firewall settings
  2. Verify Greentree API service is running
  3. Confirm port number in configuration

Tool Not Found

  • Ensure you're using the correct entity name (lowercase)
  • Check the entity type exists in your Greentree version
  • Refer to CLAUDE.md for complete entity list

Migration from v1.x

Version 2.0.0 is fully backward compatible with 1.x. All existing tools work the same way, with these additions:

  • 64 new entity types (was 7, now 71)
  • Multi-company support (optional company parameter on all tools)
  • Additional filter modifiers on all entities
  • New special action tools
  • System health check and company discovery tools
  • Approval workflow tools

No configuration changes required. Existing tool calls work exactly as before.

API Reference

For detailed information about the Greentree API:

  • Visit: https://enterprisesupport.myob.com/greentree/api-overview
  • See src/greentree-mcp-promp.md for complete API documentation

License

MIT

Support

For issues related to:

  • This MCP Server: Create an issue in this repository
  • Greentree API: Contact MYOB Greentree support
  • MCP Protocol: Visit https://modelcontextprotocol.io

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

v4.0.0 (2026-02-03)

  • CHANGED: License changed to UNLICENSED (proprietary)
  • All v3.0.0 features included

v3.0.0 (2026-02-03)

  • NEW: Code Mode - 97% token reduction by letting LLM write TypeScript
  • NEW: Performance optimizations (all enabled by default):
    • Config caching - avoid disk reads
    • Client caching - reuse HTTP connections
    • HTTP keep-alive - connection reuse
    • Parallel helpers - parallel(), parallelMap(), batchGet()
  • NEW: Configurable via environment variables
  • NEW: 5-10x faster multi-entity operations with parallel helpers
  • IMPROVED: Better LLM compatibility (Opus 4.5 recommended for Code Mode)

v2.0.0 (2026-01-28)

  • BREAKING: None (fully backward compatible)
  • NEW: 64 additional entity types (GL, JC, CRM, HR, FA, Manufacturing, etc.)
  • NEW: Multi-company support - query data from any accessible company
  • NEW: 50+ filter modifiers (sorting, date filters, entity-specific filters)
  • NEW: Approval workflow tools (approve, reject, clearApproval)
  • NEW: Special action tools (cancel, hold management, primary image, selling price)
  • NEW: System tools (ping, get companies, user info)
  • IMPROVED: Complete coverage of Greentree API modifiers
  • TOTAL: 427 tools (was 28 in v1.0.4)

v1.0.4 (2026-01-23)

  • Fixed bin name to match package name
  • Initial release with 7 entity types

Credits

Developed by Verde Group for MYOB Greentree integration with Claude Desktop.