Gatherings (Expense Sharing)

by abutbul

165 downloads
Not rated
GitHub

About

Provides a robust expense-sharing solution for social gatherings, enabling creation of events, member management, expense tracking, and automated reimbursement calculations.

Details

Author
abutbul
Repository
abutbul/gatherings-mcp-python
Downloads
165
License
Apache License 2.0
Categories
Community, Design, Developer Tools, AI, Automation, Infrastructure, Database, Frontend, Other, API

- 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Gatherings (Expense Sharing)
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Start the MCP server:

python gatherings_mcp_server.py

The server runs on stdio, which makes it compatible with MCP protocol clients.

create_gathering

Create a new gathering with the specified number of members. Parameters: gathering_id (string), members (int)

add_expense

Add an expense for a member in a gathering. Parameters: gathering_id (string), member_name (string), amount (float)

calculate_reimbursements

Calculate who owes what to whom for a gathering. Parameters: gathering_id (string)

record_payment

Record a payment made by a member (positive value) or a reimbursement to a member (negative value). Parameters: gathering_id (string), member_name (string), amount (float)

rename_member

Rename a member in a gathering. Parameters: gathering_id (string), old_name (string), new_name (string)

show_gathering

Show details of a gathering including expenses and payment status. Parameters: gathering_id (string)

list_gatherings

List all gatherings in the database.

close_gathering

Mark a gathering as closed. Parameters: gathering_id (string)

delete_gathering

Delete a gathering and all associated data. Set force=True to delete closed gatherings. Parameters: gathering_id (string), force (boolean, optional)

add_member

Add a new member to an existing gathering. Parameters: gathering_id (string), member_name (string)

remove_member

Remove a member from a gathering (only if they have no expenses). Parameters: gathering_id (string), member_name (string)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "gatherings (expense sharing)": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Gatherings MCP Server

A Model Context Protocol server for managing gatherings and expense sharing.

Dependency Management

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

Overview

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.

Features

- 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

Installation

Prerequisites

- Python 3.8+
- SQLAlchemy
- MCP SDK

Setup

1. Clone this repository:

   git clone https://your-repository.git
cd accel

2. Install the required dependencies:

   pip install -r requirements.txt

3. 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

Usage

Start the MCP server:

python gatherings_mcp_server.py

The server runs on stdio, which makes it compatible with MCP protocol clients.

API Reference

The MCP server exposes the following tools:

create_gathering(gathering_id: str, members: int)

Create a new gathering with the specified number of members.

add_expense(gathering_id: str, member_name: str, amount: float)

Add an expense for a member in a gathering.

calculate_reimbursements(gathering_id: str)

Calculate who owes what to whom for a gathering.

record_payment(gathering_id: str, member_name: str, amount: float)

Record a payment made by a member (positive value) or a reimbursement to a member (negative value).

rename_member(gathering_id: str, old_name: str, new_name: str)

Rename a member in a gathering.

show_gathering(gathering_id: str)

Show details of a gathering including expenses and payment status.

list_gatherings()

List all gatherings in the database.

close_gathering(gathering_id: str)

Mark a gathering as closed.

delete_gathering(gathering_id: str, force: bool = False)

Delete a gathering and all associated data. Set force=True to delete closed gatherings.

add_member(gathering_id: str, member_name: str)

Add a new member to an existing gathering.

remove_member(gathering_id: str, member_name: str)

Remove a member from a gathering (only if they have no expenses).

Example Flow

1. Create a gathering for a dinner with 5 friends:

   create_gathering("2023-10-15-dinner", 5)

2. 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)

3. Calculate reimbursements:

   calculate_reimbursements("2023-10-15-dinner")

4. Record payments as people settle up:

   record_payment("2023-10-15-dinner", "Charlie", 31.10)

5. Close the gathering when all payments are settled:

   close_gathering("2023-10-15-dinner")

Architecture

The Gatherings MCP server consists of three main components:

1. MCP Server Interface (gatherings_mcp_server.py): Provides the MCP protocol interface that AI tools can interact with.

2. Service Layer (services.py): Contains business logic for managing gatherings, expenses, and payments.

3. Data Layer (models.py): Defines the database schema using SQLAlchemy ORM and handles data persistence.

Data Model

- 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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.