remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Serves as the runtime environment for the MCP server, enabling the creation and management of shared expenses for social events through Python-based implementations.
Provides an ORM interface for storing gathering data, expenses, and payment records in a SQL database, allowing for persistence of user expense-sharing information.
聚会 MCP 服务器
用于 Groups 费用分摊应用程序的机器对话协议 (MCP) 服务器接口。
概述
Gatherings MCP 服务器提供了一个 API,允许 AI 助手通过机器对话协议 (MCP) 与 Gatherings 应用程序进行交互。这使得 AI 系统能够帮助用户管理社交活动、郊游或任何由参与者分摊费用的聚会的共享费用。
特征
- 创建和管理多个成员的聚会
- 为特定成员添加费用
- 计算公平的报销金额
- 记录付款和报销
- 生成详细的付款摘要
- 添加/删除聚会成员
- 根据需要重命名成员
安装
先决条件
- Python 3.8+
- SQLAlchemy
- MCP SDK
设置
- 克隆此存储库:Copy
- 安装所需的依赖项:Copy
- 设置环境变量(可选):Copy
用法
启动 MCP 服务器:
服务器在 stdio 上运行,这使其与 MCP 协议客户端兼容。
API 参考
MCP 服务器公开以下工具:
create_gathering(gathering_id: str, members: int)
创建具有指定成员数量的新聚会。
add_expense(gathering_id: str, member_name: str, amount: float)
为聚会中的某个成员添加费用。
calculate_reimbursements(gathering_id: str)
计算聚会时谁欠谁什么。
record_payment(gathering_id: str, member_name: str, amount: float)
记录会员支付的款项(正值)或向会员报销的款项(负值)。
rename_member(gathering_id: str, old_name: str, new_name: str)
重命名聚会中的成员。
show_gathering(gathering_id: str)
显示聚会的详细信息,包括费用和付款状态。
list_gatherings()
列出数据库中的所有聚会。
close_gathering(gathering_id: str)
将聚会标记为已结束。
delete_gathering(gathering_id: str, force: bool = False)
删除聚会及其所有相关数据。设置force=True
可删除已关闭的聚会。
add_member(gathering_id: str, member_name: str)
向现有聚会添加新成员。
remove_member(gathering_id: str, member_name: str)
将一名成员从聚会中移除(仅当他们没有开支时)。
示例流程
- 创建一个与 5 位朋友共进晚餐的聚会:Copy
- 添加人们支付的费用:Copy
- 计算报销金额:Copy
- 记录人们结算时的付款情况:Copy
- 当所有付款都结清后,结束聚会:Copy
建筑学
Gatherings MCP 服务器由三个主要组件组成:
- MCP 服务器接口(
gatherings_mcp_server.py
):提供 AI 工具可以交互的 MCP 协议接口。 - 服务层(
services.py
):包含管理收集、费用和付款的业务逻辑。 - 数据层(
models.py
):使用 SQLAlchemy ORM 定义数据库模式并处理数据持久性。
数据模型
- 聚会:代表需要分摊费用的社交活动
- 成员:聚会的参与者
- 费用:会员为聚会所花费的钱
- 付款:会员支付的用于结清余额的钱
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
This server cannot be installed
MCP 服务器可帮助 AI 助手管理社交活动的费用分摊,从而能够创建聚会、跟踪费用并计算参与者之间的公平报销。
- Overview
- Features
- Installation
- Usage
- API Reference
- create_gathering(gathering_id: str, members: int)
- add_expense(gathering_id: str, member_name: str, amount: float)
- calculate_reimbursements(gathering_id: str)
- record_payment(gathering_id: str, member_name: str, amount: float)
- rename_member(gathering_id: str, old_name: str, new_name: str)
- show_gathering(gathering_id: str)
- list_gatherings()
- close_gathering(gathering_id: str)
- delete_gathering(gathering_id: str, force: bool = False)
- add_member(gathering_id: str, member_name: str)
- remove_member(gathering_id: str, member_name: str)
- Example Flow
- Architecture
- Data Model
- Contributing