聚会 MCP 服务器
用于管理聚会和费用分摊的模型上下文协议服务器。
依赖管理
该项目使用uv
而不是pip
进行 Python 依赖项管理。由于模型上下文协议 Python SDK 的依赖项要求,因此必须进行此更改。
确保已安装uv
或通过 pip 安装它:
安装项目依赖项:
概述
Gatherings MCP 服务器提供了一个 API,允许 AI 助手通过机器对话协议 (MCP) 与 Gatherings 应用程序进行交互。这使得 AI 系统能够帮助用户管理社交活动、郊游或任何由参与者分摊费用的聚会的共享费用。
特征
- 创建和管理多个成员的聚会
- 为特定成员添加费用
- 计算公平的报销金额
- 记录付款和报销
- 生成详细的付款摘要
- 添加/删除聚会成员
- 根据需要重命名成员
安装
先决条件
- Python 3.8+
- SQLAlchemy
- MCP SDK
设置
- 克隆此存储库:
- 安装所需的依赖项:
- 设置环境变量(可选):
用法
启动 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 位朋友共进晚餐的聚会:
- 添加人们支付的费用:
- 计算报销金额:
- 结算时记录付款:
- 当所有付款都结清后,结束聚会:
建筑学
Gatherings MCP 服务器由三个主要组件组成:
- MCP 服务器接口(
gatherings_mcp_server.py
):提供 AI 工具可以交互的 MCP 协议接口。 - 服务层(
services.py
):包含管理收集、费用和付款的业务逻辑。 - 数据层(
models.py
):使用 SQLAlchemy ORM 定义数据库模式并处理数据持久性。
数据模型
- 聚会:代表需要分摊费用的社交活动
- 成员:聚会的参与者
- 费用:会员为聚会所花费的钱
- 付款:会员支付的用于结清余额的钱
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
MCP 服务器可帮助 AI 助手管理社交活动的费用分摊,从而能够创建聚会、跟踪费用并计算参与者之间的公平报销。
- 依赖管理
- 概述
- 特征
- 安装
- 用法
- API 参考
- 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)
- 示例流程
- 建筑学
- 数据模型
- 贡献
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that lets AI assistants interact with your Lunchmoney data, enabling natural language queries about transactions, budgets, and spending patterns.Last updated -438TypeScriptMIT License
Fewsats MCP Serverofficial
AsecurityFlicenseAqualityAn MCP server that integrates with Fewsats allowing AI agents to securely purchase anything by retrieving balances, accessing payment methods, and processing payments.Last updated -413Python- -securityFlicense-qualityA specialized MCP server that enables AI agents to interact with Reddit, including reading posts, creating content, and managing subreddit configurations.Last updated -76JavaScript
- -security-license-qualityA simple MCP server that enables meeting room booking through an AI assistant, supporting room availability checks and booking operations with React Agent pattern for tool calling.Last updated -Python