金融计算工具

一款集商业、金融和税务计算于一体的MCP服务器和命令行工具,支持多种金融计算和税务估算功能。

  • by FellowTraveler
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 FellowTraveler/finance-calc-mcp

使用说明

金融计算mcp

商业、金融和税务计算器——MCP服务器+CLI。

单命令安装。不需要克隆。


安装

# Run directly (no install needed)
uvx finance-calc-mcp calc "185000 * 0.21"

# Or install permanently
uv tool install finance-calc-mcp
# or: pip install finance-calc-mcp

用作MCP服务器

先决条件

安装 紫外线 如果你没有:

curl -LsSf https://astral.sh/uv/install.sh | sh

安装后重新启动终端,然后确认 uvx 作品:

uvx --version

克劳德桌面

编辑您的Claude Desktop配置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗户: %APPDATA%\Claude\claude_desktop_config.json

macOS:

{
  "mcpServers": {
    "finance-calculator": {
      "command": "/bin/bash",
      "args": ["-lc", "uvx finance-calc-mcp"]
    }
  }
}

macOS上的Claude Desktop是一个不继承shell PATH的GUI应用程序。 这 /bin/bash -lc 包装器运行登录shell,因此 uvx 无论如何都能找到 关于哪里 uv 已安装。

窗户:

{
  "mcpServers": {
    "finance-calculator": {
      "command": "uvx",
      "args": ["finance-calc-mcp"]
    }
  }
}

重新启动克劳德桌面。金融工具将自动出现。

克劳德代码(终端)

claude mcp add finance-calculator -- uvx finance-calc-mcp

其他MCP客户端

任何兼容MCP的客户端都可以启动服务器:

uvx finance-calc-mcp

在没有参数的情况下,它以MCP服务器模式(stdio传输)启动。


MCP工具

当作为MCP服务器连接时,Claude会获得以下工具:

calculate

评估财务/商业数学表达式。支持 +, -, *, /, **, %、括号和函数: round(), abs(), max(), min(), sum(), sqrt(), log(), floor(), ceil(), pow().

参数 类型 必填 说明
expression string yes 要计算的数学表达式

gross_margin

根据收入和销货成本计算毛利率、毛利和加价。

参数 类型 必填 说明
revenue number 是 总收入
cogs number 是 销售成本

us_income_tax_estimate

估计2024年美国联邦个人所得税,并按等级详细列出。

参数 类型 必填 说明
taxable_income number 是 应纳税所得额(美元)
filing_status string 是 single, married_jointly, married_separately,或 head_of_household

self_employment_tax

计算自雇(SE)税和附表SE的可扣除一半。包括社会保障、医疗保险和20万美元以上的额外医疗保险附加税。

参数 类型 必填 说明
net_self_employment_income number 是 自雇净利润

depreciation

计算折旧计划(直线或双倍余额递减)。

参数 类型 必填 说明
asset_cost number 是 资产购买价格
useful_life 数字 是 使用寿命(年)
salvage_value number no 残值/残值(默认值0)
method string 否 straight_line (默认)或 double_declining

payroll_summary

估算给定总工资的雇主工资成本和员工净工资。涵盖FICA(社会保障+医疗保险)、FUTA和SUTA。

参数 类型 必填 说明
gross_annual_salary number 是 年薪总额
state_suta_rate number no 州失业率%(默认值2.7)

loan_amortization

生成贷款分期偿还摘要:每月付款、支付的利息总额,以及可选的逐月时间表。

参数 类型 必填 说明
principal number 是 贷款本金
annual_rate_pct number yes 年利率百分比(例如6.5)
term_years number 是 贷款期限(年)
show_schedule boolean no 返回全额摊销表(默认为false)

percent_change

计算两个值之间的百分比变化。

参数 类型 必填 说明
old_value number yes 起始值/原始值
new_value number yes 结束/新值

break_even

根据固定成本、单位价格和单位可变成本计算盈亏平衡单位和收入。

参数 类型 必填 说明
fixed_costs number 是 总固定成本
price_per_unit number 是 单位售价
variable_cost_per_unit number 是 单位可变成本

currency_format

将数字格式化为美元货币字符串。

参数 类型 必填 说明
amount number yes 格式化金额
decimals integer no 小数位数(默认值2)

CLI使用情况

每个MCP工具都可以作为CLI命令使用。

# Evaluate any expression
finance-calc-mcp calc "185000 * 0.21"
finance-calc-mcp calc "(850000 - 612000) / 850000 * 100"

# Gross margin
finance-calc-mcp margin 850000 612000

# 2024 US federal income tax estimate
finance-calc-mcp tax 185000 single
finance-calc-mcp tax 320000 married_jointly

# Self-employment tax
finance-calc-mcp se-tax 95000

# Loan amortization (add --schedule for full table)
finance-calc-mcp amortize 400000 6.5 30
finance-calc-mcp amortize 400000 6.5 30 --schedule

# Payroll (optional: state SUTA rate %)
finance-calc-mcp payroll 95000
finance-calc-mcp payroll 95000 3.4

# Depreciation (straight-line default, or double_declining)
finance-calc-mcp depreciation 50000 5
finance-calc-mcp depreciation 50000 5 5000 --method double_declining

# Break-even analysis
finance-calc-mcp break-even 120000 49.99 18.50

# Percent change
finance-calc-mcp pct-change 1200000 1485000

# Format as currency
finance-calc-mcp format 1234567.89

输出示例

$ finance-calc-mcp tax 185000 single

2024 Federal Income Tax Estimate (single)
Taxable Income:   $185,000.00
Federal Tax:      $37,442.50
Effective Rate:   20.24%

Bracket Detail:
  10%  $0.00 – $11,600.00:  $11,600.00 taxed → $1,160.00
  12%  $11,600.00 – $47,150.00:  $35,550.00 taxed → $4,266.00
  22%  $47,150.00 – $100,525.00:  $53,375.00 taxed → $11,742.50
  24%  $100,525.00 – $191,950.00:  $84,475.00 taxed → $20,274.00
$ finance-calc-mcp amortize 400000 6.5 30

Loan Amortization Summary
Principal:       $400,000.00
Rate:            6.500% APR
Term:            30 years (360 months)
Monthly Payment: $2,528.27
Total Paid:      $910,177.52
Total Interest:  $510,177.52
Interest/Dollar: 127.54%

许可证

麻省理工学院