A Model Context Protocol server for managing gatherings and expense sharing.
This project uses uv
for Python dependency management instead of pip
. This change is necessary due to dependency requirements from the Model Context Protocol Python SDK.
Ensure you have uv
installed or install it via pip:
pip install uv
To install project dependencies:
uv pip install -r requirements.txt
The Gatherings MCP Server provides an API that allows AI assistants to interact with the Gatherings application through the Machine Conversation Protocol. This enables AI systems to help users manage shared expenses for social events, outings, or any gathering where costs are split among participants.
- Create and manage gatherings with multiple members
- Add expenses for specific members
- Calculate fair reimbursements
- Record payments and reimbursements
- Generate detailed payment summaries
- Add/remove members from gatherings
- Rename members as needed
- Python 3.8+
- SQLAlchemy
- MCP SDK
-
Clone this repository:
git clone https://your-repository.git cd accel
-
Install the required dependencies:
pip install -r requirements.txt
-
Set environment variables (optional):
# Custom database location export GATHERINGS_DB_PATH=path/to/database.db # Custom script location export GATHERINGS_SCRIPT=path/to/gatherings.py
Start the MCP server:
python gatherings_mcp_server.py
The server runs on stdio, which makes it compatible with MCP protocol clients.
The MCP server exposes the following tools:
Create a new gathering with the specified number of members.
Add an expense for a member in a gathering.
Calculate who owes what to whom for a gathering.
Record a payment made by a member (positive value) or a reimbursement to a member (negative value).
Rename a member in a gathering.
Show details of a gathering including expenses and payment status.
List all gatherings in the database.
Mark a gathering as closed.
Delete a gathering and all associated data. Set force=True
to delete closed gatherings.
Add a new member to an existing gathering.
Remove a member from a gathering (only if they have no expenses).
-
Create a gathering for a dinner with 5 friends:
create_gathering("2023-10-15-dinner", 5)
-
Add expenses as people pay for things:
add_expense("2023-10-15-dinner", "Alice", 120.50) add_expense("2023-10-15-dinner", "Bob", 35.00)
-
Calculate reimbursements:
calculate_reimbursements("2023-10-15-dinner")
-
Record payments as people settle up:
record_payment("2023-10-15-dinner", "Charlie", 31.10)
-
Close the gathering when all payments are settled:
close_gathering("2023-10-15-dinner")
The Gatherings MCP server consists of three main components:
-
MCP Server Interface (
gatherings_mcp_server.py
): Provides the MCP protocol interface that AI tools can interact with. -
Service Layer (
services.py
): Contains business logic for managing gatherings, expenses, and payments. -
Data Layer (
models.py
): Defines the database schema using SQLAlchemy ORM and handles data persistence.
- Gathering: Represents a social event with expenses to split
- Member: A participant in a gathering
- Expense: Money spent by a member for the gathering
- Payment: Money paid by a member to settle balances
Contributions are welcome! Please feel free to submit a Pull Request.