Gatherings MCP Server

by abutbul
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

聚会 MCP 服务器

用于管理聚会和费用分摊的模型上下文协议服务器。

这是一个基于 TypeScript 的 MCP 服务器,可帮助跟踪社交活动的费用和付款,从而轻松计算报销并结算朋友之间的余额。

建筑笔记

重要提示:本项目使用 Node.js 应用程序的非标准架构。TypeScript MCP 服务器充当 Python 后端实现的包装器。Node.js 服务器接收 MCP 请求,将其转换为对 Python 脚本的命令行调用,并返回结果。

虽然这种架构可以满足我们当前的需求,但对于生产应用程序来说,它并不是最有效或最可维护的方法。

待办事项

  • 重构实现以使用更标准的架构:
    • 要么将后端完全迁移到 TypeScript/JavaScript
    • 或者在 Node.js 和 Python 组件之间实现适当的进程间通信
    • 或者用 REST API 方法替换,其中 Python 后端提供 MCP 服务器使用的 API
  • 改进 Node.js 和 Python 组件之间的错误处理
  • 添加组件之间集成的自动化测试

特征

工具

  • create_gathering - 创建一个新的聚会
    • gathering_idmembers作为必需参数
  • add_expense - 为会员添加费用
    • gathering_idmember_nameamount作为必需参数
  • calculate_reimbursements聚会的报销金额
    • gathering_id作为必需参数
  • record_payment - 记录会员的付款
    • gathering_idmember_nameamount作为必需参数
  • rename_member - 重命名未命名的成员
    • gathering_idold_namenew_name作为必需参数
  • show_gathering - 显示聚会的详细信息
    • gathering_id作为必需参数
  • list_gatherings - 列出所有聚会
  • close_gathering - 结束聚会
    • gathering_id作为必需参数
  • delete_gathering - 删除聚会
    • gathering_id作为必需参数, force参数为可选参数
  • add_member - 向聚会添加新成员
    • gathering_idmember_name作为必需参数
  • remove_member - 从聚会中删除成员
    • gathering_idmember_name作为必需参数

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

安装

配置

要与 Claude Desktop 一起使用,请添加服务器配置:

{ "mcpServers": { "gatherings": { "command": "node", "args": ["/path/to/gatherings-server/build/index.js"], "env": { "GATHERINGS_DB_PATH": "gatherings.db", "GATHERINGS_SCRIPT": "/path/to/gatherings-server/gatherings.py" }, "disabled": false, "autoApprove": [], "alwaysAllow": [ "create_gathering", "add_expense", "calculate_reimbursements", "record_payment", "rename_member", "show_gathering", "list_gatherings", "close_gathering", "delete_gathering", "add_member", "remove_member" ], "timeout": 300 } } }

配置选项

  • commandargs :指定如何运行服务器
  • env :环境变量
    • GATHERINGS_DB_PATH :数据库文件的路径
    • GATHERINGS_SCRIPT :用于处理收集操作的 Python 脚本的路径
  • alwaysAllow :无需提示即可自动允许的工具列表
  • timeout :最大执行时间(秒)

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器可帮助跟踪费用并计算社交活动的报销,从而轻松结算朋友之间的余额。

  1. Architecture Note
    1. TODO
  2. Features
    1. Tools
  3. Development
    1. Installation
      1. Configuration
      2. Debugging
    ID: 3iklcgah07