Skip to main content

A Model Context Protocol server for iCost application integration

Project description

iCost App MCP Server

Python Version License FastMCP

一个基于 FastMCP 2.0 框架构建的模型上下文协议(MCP)服务,专为 iCost iOS 记账应用提供智能记账功能集成。

✨ 功能特性

  • 🏦 多账户支持: 支持支付宝、微信、银行卡等多种账户类型
  • 💱 多币种支持: 支持人民币及其他主要货币
  • 📊 智能分类: 提供完整的收入和支出分类系统
  • 📱 无缝集成: 通过 URL Scheme 与 iCost 应用深度集成
  • 🚀 高性能: 基于 FastMCP 2.0 和现代 Python async/await 模式
  • 🛡️ 类型安全: 完整的类型提示和数据验证
  • 📝 详细记录: 支持备注、标签、位置等详细信息记录

🔧 核心功能

记账操作

  • 添加支出记录 (icost_add_expense): 记录日常消费,支持多种分类如餐饮、购物、交通等
  • 添加收入记录 (icost_add_income): 记录收入来源,如工资、奖金、投资收益等
  • 添加转账记录 (icost_add_transfer): 记录账户间资金转移

应用控制

  • 打开应用页面 (icost_open_app): 快速跳转到 iCost 应用的特定功能页面
    • asset_main: 资产首页
    • chart_main: 统计首页
    • quick_record: 记账页面

智能分类

  • 获取支持分类 (icost_categories): 提供完整的收入和支出分类列表

时间工具

  • 当前时间 (current_time): 获取当前时间用于记账
  • 时间快捷方式: am(), pm(), default_time() 等便捷时间设置

📦 安装方式

环境要求

  • Python 3.9+
  • macOS (用于 URL Scheme 集成)

从 PyPI 安装(推荐)

# 安装最新版本
pip install icost-app-mcp-server

# 验证安装
icost-mcp-server --help

🚀 快速开始

命令行启动

# 使用默认配置启动
icost-mcp-server

# 自定义主机和端口
icost-mcp-server --host 0.0.0.0 --port 8080

# 启用调试模式
icost-mcp-server --debug --log-level DEBUG

🔌 MCP Client 集成

Claude Desktop 集成

  1. 安装服务器

    pip install icost-app-mcp-server
    
  2. 配置 Claude Desktop

    编辑 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    {
      "mcpServers": {
        "icost-app-mcp-server": {
          "command": "icost-mcp-server",
          "args": ["--port", "9000"]
        }
      }
    }
    
  3. 重启 Claude Desktop 即可开始使用

Cherry Studio 集成

  1. 安装服务器

    pip install icost-app-mcp-server
    
  2. 启动服务器

    icost-mcp-server --host localhost --port 9000
    
  3. 在 Cherry Studio 中配置

    • 打开 Cherry Studio 设置
    • 找到 MCP 服务器配置
    • 添加新的 MCP 服务器:
      • 名称: iCost App MCP Server
      • URL: http://localhost:9000
      • 类型: HTTP
  4. 保存配置并重启 Cherry Studio

其他 MCP Client 集成

对于支持 MCP 协议的其他客户端:

  1. 作为命令行工具

    {
      "command": "icost-mcp-server",
      "args": ["--port", "9000"]
    }
    
  2. 作为 HTTP 服务

    icost-mcp-server --host 0.0.0.0 --port 9000
    

    然后在客户端中配置 http://localhost:9000

验证集成

集成成功后,您应该能在 MCP Client 中看到以下工具:

  • icost_add_expense - 添加支出记录
  • icost_add_income - 添加收入记录
  • icost_add_transfer - 添加转账记录
  • icost_open_app - 打开 iCost 应用页面
  • icost_categories - 获取支持的分类
  • current_time - 获取当前时间

📖 使用示例

iCost App MCP Server 架构图

📋 支持的分类

支出分类

餐饮、购物、交通、日用、通讯、住房、医疗、医疗健康、服饰、数码电器、汽车、学习、办公、运动、社交、人情、育儿、母婴亲子、旅行、烟酒、扫二维码付款、充值缴费、生活服务、文化休闲、理财、水果、其他

收入分类

工资、奖金、福利、退款、红包、副业、退税、投资、其他

⚙️ 配置选项

服务器支持以下配置参数:

参数 默认值 说明
--host localhost 服务器绑定主机
--port 9000 服务器端口
--debug False 调试模式
--log-level INFO 日志级别

📋 支持的分类

支出分类

餐饮、购物、交通、日用、通讯、住房、医疗、医疗健康、服饰、数码电器、汽车、学习、办公、运动、社交、人情、育儿、母婴亲子、旅行、烟酒、扫二维码付款、充值缴费、生活服务、文化休闲、理财、水果、其他

收入分类

工资、奖金、福利、退款、红包、副业、退税、投资、其他

🤝 贡献指南

我们欢迎各种形式的贡献!请查看 贡献指南 了解详细信息。

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。

🔗 相关链接

📞 支持

🙏 致谢

  • 感谢 FastMCP 框架提供的强大基础
  • 感谢 iCost 应用团队的 URL Scheme 支持
  • 基于现代 Python 开发最佳实践构建
  • 该项目不设计商用,仅用于个人学习和个人使用

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icost_app_mcp_server-0.1.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icost_app_mcp_server-0.1.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file icost_app_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: icost_app_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for icost_app_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 daee1227abf8c82259cc901014a8e907de3da584c1b97e74e19bf7462be475fb
MD5 21529363dce2d2336a308e2e59377b73
BLAKE2b-256 2fc293486edb957173f80fc4c754e8ea9909e612427fdbc6c6f6261c531b34a9

See more details on using hashes here.

File details

Details for the file icost_app_mcp_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for icost_app_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4ad769352a04d8a54e901467097b698dc4eabf2e12a326f9b885632ed8448ee
MD5 0c64298a3f89f046f389041febbe4a0b
BLAKE2b-256 307a525d987958ee2570a39dcb1254638b7758750ddd076b4a442d8960420e92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page