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

chinataxcalc-cli

v1.0.0

Published

Official CLI & MCP client for ChinaTaxCalc (chinataxcalc.com): China expat IIT net salary, BIA tax-free allowances, annual bonus cliffs & GBA 15% rebates.

Readme

chinataxcalc-cli

Official zero-dependency terminal CLI and Model Context Protocol (MCP) client for ChinaTaxCalc (chinataxcalc.com). Connects directly to the stateless production MCP server (https://chinataxcalc.com/api/mcp) implementing China's 7-tier progressive IIT schedule, MOF/STA [2023] No. 29 expat BIA tax-free allowances, [2023] No. 30 annual bonus separate filing and cliff detection, STA [2018] No. 56 cumulative payroll withholding, Greater Bay Area 15% talent subsidies, 7 international relocation net pay comparisons, the 6-year worldwide tax 31-day exit rule, and SAFE Circular [2020] No. 14 salary repatriation bank checklists.

Quick CLI Commands

# List all 8 read-only MCP tools
npx -y [email protected] tools

# Run live Shanghai expat IIT + BIA allowance net salary calculation
npx -y [email protected] demo

# Analyze whether a landlord rental Fapiao fee yields positive IIT ROI
npx -y [email protected] call analyze_landlord_fapiao_surcharge_roi '{"monthlyRentRMB":12000,"surchargeRatePct":5,"marginalRate":0.30}'

Available MCP Tools (8 Read-Only)

| Tool Name | Purpose & Deterministic Engine | Key Parameters | Safety | | :--- | :--- | :--- | :---: | | calculate_china_expat_iit_and_net_salary | Compute annual and monthly net take-home cash, marginal brackets, employer costs, and tax savings from eight Fapiao-backed BIA allowances across | grossAmount, incomePeriod, currency, cityId (+4 more) | readOnly | | simulate_cumulative_monthly_withholding | Simulate January-to-December paycheck variance under STA Announcement 2018 No. 56, highlighting bracket jump months and lumpy school tuition spik | monthlyGrossRMB, monthlySSRMB, monthlyBIARMB, lumpyTuitionMode (+1 more) | readOnly | | compare_annual_bonus_separate_vs_combined_tax | Contrast MOF/STA Announcement 30 separate bonus taxation against combined comprehensive filing and warn about statutory bracket cliff traps. | annualTaxableSalaryRMB, annualBonusRMB | readOnly | | analyze_landlord_fapiao_surcharge_roi | Evaluate whether paying a landlord surcharge to obtain official housing VAT invoices generates positive after-tax savings at your marginal rate. | monthlyRentRMB, surchargeRatePct, marginalRate* | readOnly | | calculate_gba_15pct_talent_tax_subsidy | Quantify municipal fiscal refunds across nine Greater Bay Area hubs like Shenzhen Qianhai and Guangzhou Nansha where effective burden caps at 15 | actualIITPaidRMB, taxableIncomeRMB, gbaCityId | readOnly | | compare_cross_border_relocation_net_pay | Benchmark equivalent USD compensation across seven global financial hubs against Shanghai expat net pay with cost-of-living index comparisons. | grossUSD, comparisonHubs, chinaCityId, chinaHousingAllowanceUSD | readOnly | | diagnose_six_year_worldwide_tax_rule | Track consecutive 183-day residency years and verify whether a continuous 30+ day absence resets non-domiciled offshore income protection. | records | readOnly | | generate_safe_salary_repatriation_checklist | Assemble the six mandatory counter verification items, Tax App registration tips, and bilingual SAFE quota exemption text for wiring RMB abroad. | remitAmountRMB, targetCurrency | readOnly |

Live Production Sample Output

{
  "sourceEngine": "src/utils/taxCalculations.ts (calculateExpatIIT)",
  "cityProfile": {
    "id": "shanghai",
    "name": "Shanghai",
    "minSocialBaseRMB": 7310,
    "maxSocialBaseRMB": 36549,
    "notes": "Expat Social Security exemption is historically supported in Shanghai (Hu Ren She Han [2021] No. 272). Foreign hires may mutually agree with employers to opt out."
  },
  "exchangeRateToRMB": 1,
  "standardAnnualDeductionRMB": 60000,
  "summary": {
    "currency": "RMB",
    "annualNetPay": 571440,
    "monthlyNetPay": 47620,
    "annualIIT": 58560,
    "monthlyIIT": 4880,
    "annualSocialSecurityEmployee": 0,
    "effectiveTaxRatePct": 9.3,
    "marginalTaxBracketPct": 25,
    "netTakeHomePct": 90.7,
    "taxSavingsFromBIA": 39000,
    "annualEmployerCost": 630000
  },
  "rmbBreakdown": {
    "totalAnnualGrossRMB": 630000,
    "totalAnnualBIARMB": 144000,
    "annualTaxableIncomeRMB": 336000,
    "annualComprehensiveIITRMB": 52080,
    "annualBonusIITRMB": 6480,
    "totalAnnualIITRMB": 58560,
    "totalAnnualNetPayRMB": 571440,
    "taxSavingsFromBIARMB": 39000
  },
  "calculatorUrl": "https://chinataxcalc.com"
}

Connect in Claude Desktop / Cursor / Windsurf / Gemini CLI

{
  "mcpServers": {
    "chinataxcalc": {
      "type": "http",
      "url": "https://chinataxcalc.com/api/mcp"
    }
  }
}

Statutory Compliance & Tax Reference Matrices

China Comprehensive Income 7-Tier Progressive IIT Brackets (Standard Deduction: ¥60,000/yr)

| Level | Annual Taxable Income (RMB) | Statutory Marginal Rate | Quick Deduction (RMB) | Statutory Basis | | :---: | :--- | :---: | :---: | :--- | | 1 | ¥0 – ¥36,000 | 3% | ¥0 | PRC IIT Law (Comprehensive Income) | | 2 | ¥36,001 – ¥144,000 | 10% | ¥2,520 | PRC IIT Law / STA [2018] No. 56 | | 3 | ¥144,001 – ¥300,000 | 20% | ¥16,920 | PRC IIT Law / STA [2018] No. 56 | | 4 | ¥300,001 – ¥420,000 | 25% | ¥31,920 | PRC IIT Law / STA [2018] No. 56 | | 5 | ¥420,001 – ¥660,000 | 30% | ¥52,920 | PRC IIT Law / STA [2018] No. 56 | | 6 | ¥660,001 – ¥960,000 | 35% | ¥85,920 | PRC IIT Law / STA [2018] No. 56 | | 7 | Exceeding ¥960,000 | 45% | ¥181,920 | PRC IIT Law / Top Marginal Bracket |

Six-City Expat Social Insurance Base Caps & Policy Matrix

| Municipality | Social Average Wage (RMB/mo) | Contribution Base Floor | Contribution Base Ceiling (3x) | Expat Participation & Regional Tax Rules | | :--- | :---: | :---: | :---: | :--- | | Shanghai | ¥12,183 | ¥7,310 | ¥36,549 | Historical opt-out flexibility under Hu Ren She Han [2021] No. 272 | | Beijing | ¥11,761 | ¥6,326 | ¥35,283 | Strictly mandatory unless covered by bilateral totalization treaty | | Shenzhen | ¥8,807 | ¥4,404 | ¥26,421 | Qianhai / GBA 15% effective IIT fiscal subsidy (capped RMB 5M/yr) | | Guangzhou | ¥8,807 | ¥5,284 | ¥26,421 | Nansha / Huangpu 15% IIT ceiling rebate for verified overseas talent | | Hangzhou | ¥8,023 | ¥4,814 | ¥24,069 | Mandatory municipal contribution rules up to 300% cap | | Chengdu | ¥7,356 | ¥4,414 | ¥22,068 | Mandatory social insurance with Western China talent incentives |

Eight Statutory Expat Tax-Exempt BIA Allowances (MOF/STA Announcement [2023] No. 29 · Through Dec 31, 2027)

| Allowance Category | Documentation Requirement | Payroll Treatment & Key Caution | | :--- | :--- | :--- | | Housing Rental | Official tax bureau VAT rental Fapiao | Direct tax-base deduction; analyze landlord Fapiao fee ROI vs marginal tax rate | | Children Education | Accredited school tuition invoice inside China | Must match non-cash direct payment or genuine Fapiao reimbursement | | Language Training | Accredited Mandarin school receipt | Eligible for bona fide language instruction for the foreign assignee | | Home Leave Flights | Airline itinerary + Fapiao (up to 2 round trips/yr) | Covers economy/business fare between work city in China and home country | | Meal & Laundry Allowances | Corporate receipts / legitimate VAT Fapiao | Must be reasonable and non-cash fixed subsidy | | Relocation & Travel Per Diem | Moving invoices / business travel policy receipts | Documented arrival, departure, or business travel costs remain non-taxable |

Official Web Calculators & Regulatory Guides

Source & License

  • GitHub MCP Repository: https://github.com/AbigailDavised/chinataxcalc-mcp
  • License: MIT © ChinaTaxCalc