Skip to main content
Glama
ID45

Finance Tracker MCP Server

by ID45

Finance Tracker MCP Server

通过模型上下文协议 (MCP) 利用 Claude AI 进行 AI 驱动的个人财务分析。

Finance Tracker Demo

功能概述

此 MCP 服务器将 Claude AI 连接到财务交易数据,支持针对您的财务状况进行自然语言查询:

  • “显示我本月的消费情况”

  • “查找我所有的订阅”

  • “我最大的 10 笔支出是什么?”

  • “显示过去 3 个月的消费趋势”

  • “搜索所有星巴克交易”

  • “检查我的预算:餐饮 $500,购物 $300”

Related MCP server: My Finance MCP Server

特性

  • 6 种财务分析工具

    • 月度消费汇总

    • 订阅检测(循环扣款)

    • 预算跟踪与提醒

    • 消费趋势分析

    • 大额支出排名

    • 交易搜索

  • Plaid 集成

    • 连接 10,000 多家银行(沙盒模式用于测试)

    • 实时交易数据(连接真实账户时)

    • 安全的 API 访问

  • 隐私至上

    • 所有数据保留在您的本地机器上

    • 无外部数据存储

    • 加密 API 连接

快速入门

前置要求

安装

  1. 克隆仓库

   git clone https://github.com/yourusername/finance-plaid-mcp.git
   cd finance-plaid-mcp
  1. 创建虚拟环境

   python -m venv venv
   
   # Activate it:
   # Windows:
   venv\Scripts\activate
   # Mac/Linux:
   source venv/bin/activate
  1. 安装依赖

   pip install -r requirements.txt
  1. 设置 Plaid API 密钥

    将 .env.example 复制为 .env,并从 https://dashboard.plaid.com 添加您的 Plaid 密钥

   PLAID_CLIENT_ID=your_client_id_here
   PLAID_SECRET=your_sandbox_secret_here
   PLAID_ENV=sandbox
   DATA_DIR=./data
  1. 生成示例数据(用于测试)

   python generate_sample_data.py
  1. 配置 Claude Desktop

    将以下内容添加到您的 Claude Desktop 配置文件中:

    Windows: %APPDATA%\Claude\claude_desktop_config.json

    Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

   {
     "mcpServers": {
       "finance-tracker": {
         "command": "python",
         "args": [
           "/FULL/PATH/TO/finance-plaid-mcp/src/server.py"
         ]
       }
     }
   }

重要提示: 请使用您项目的完整绝对路径!

  1. 重启 Claude Desktop

  2. 进行测试!

    在 Claude 中询问: “Find all my subscriptions”

📁 项目结构

finance-plaid-mcp/ ├── src/ │ ├── server.py # MCP 服务器(主入口点) │ ├── plaid_client.py # Plaid API 集成 │ ├── analyzer.py # 交易分析逻辑 │ └── config.py # 配置与环境变量 ├── data/ │ └── sample_transactions.json # 生成的测试数据 ├── screenshot.png # 演示截图 ├── .env # 您的 API 密钥(不要提交到 git) ├── .env.example # API 密钥模板 ├── .gitignore # 防止提交机密信息 ├── requirements.txt # Python 依赖 └── README.md # 本文件

🔧 可用工具

Claude 在分析您的财务状况时可以调用这些工具:

工具

描述

monthly_summary

获取任意月份的消费/收入汇总

find_subscriptions

检测循环扣款(Netflix、Spotify 等)

spending_trends

分析随时间变化的消费模式

budget_check

比较实际消费与预算限额

top_expenses

获取按金额排序的大额支出

search_transactions

按商户或类别搜索

🏦 连接真实银行账户

目前处于沙盒模式(仅限测试数据)

要连接真实银行:

  1. 在 Plaid 仪表板中切换到开发模式 (Development mode)

  2. 更新 .env:PLAID_ENV=development

  3. 实现 Plaid Link UI(用于银行登录的 Web 界面)

出于投资组合/演示目的,建议使用沙盒模式,以避免泄露真实的财务数据。

📊 示例输出

查找订阅: 发现 19 个订阅,总计 $18,123/年 主要订阅:

Comcast Internet: $130.71/月 ($915 总计) Apple Store: $180.05/月 ($900 总计) Verizon Phone Bill: $110.75/月 ($886 总计) Electric Bill: $119.86/月 ($839 总计) Zara: $151.91/月 ($760 总计)

月度汇总: 月度总计: $1,510 收入: $5,000 支出: $3,490 净额: $1,510 按类别消费:

Groceries: $644 Shopping: $900 Utilities: $886 Dining: $450 Transportation: $380

🛠️ 技术栈

  • Python 3.14

  • MCP SDK - 模型上下文协议

  • Plaid API - 银行连接与交易数据

  • Pandas - 数据分析

  • Claude AI - 自然语言接口

🔐 安全与隐私

  • ✅ API 密钥存储在 .env 中(从不提交)

  • ✅ 所有数据在本地处理

  • ✅ 无外部日志记录或分析

  • ✅ Plaid 提供银行级加密

⚠️ 重要: 切勿将您的 .env 文件或 API 密钥提交到 GitHub!

🤝 贡献

欢迎贡献!请随时:

  • 报告 Bug

  • 建议功能

  • 提交 Pull Request

📝 许可证

MIT 许可证

🙏 致谢


⭐ 如果您觉得有帮助,请给仓库点个星!

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to access and analyze MonarchMoney personal finance data through natural language queries. Provides comprehensive financial insights including account balances, transaction analysis, budget tracking, and spending patterns with enterprise-grade security.
    10
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables Claude to store and query personal finance transactions using semantic search. Transactions are persisted in ChromaDB and JSON, allowing natural language questions about spending trends and portfolio allocations.
    4
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables users to manage personal finances—tracking expenses, income, budgets, and generating summaries—through natural language commands via AI assistants like Claude.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables Claude to analyze personal finances by reading bank CSVs or connecting to Plaid for live transactions, categorizing spending, flagging overspending against benchmarks, and generating actionable reports and savings tips.
    MIT