Skip to content

Commit bb95045

Browse files
chore: Address pull request feedback
This commit addresses feedback from the pull request review: - Merged `mcp/agents.md` into `spendee/agents.md` to consolidate agent documentation. - Simplified `docs/environment.md` and `agents.md` to reduce redundancy and point to the `.mise.toml` file and detailed documentation. - Documented the MCP server's bearer token authentication in `docs/mcp.md`. - Relocated the `firestore-schema.md` to the `docs` directory and referenced it in `docs/spendee.md`.
1 parent 8908488 commit bb95045

8 files changed

Lines changed: 44 additions & 52 deletions

File tree

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ This is a Python client for interfacing with the wonderful [Spendee app](https:/
44

55
The codebase was forked from [dionysio/spendee](https://github.com/dionysio/spendee) (many thanks! <3) in 2025, which was authored in 2019-2020 and archived since then.
66

7-
About Spendee:
8-
> Spendee.com is a budget and expense tracker application to manage personal finances. It allows users to connect bank accounts, e-wallets, and crypto wallets to get an aggregated overview of their financial situation. The app helps users organize and analyze spending through automatic transaction categorization, visually appealing graphs, and insights.
9-
107
## ⚠️ Warning
118

129
This is a work in progress and is not recommended for general use yet. The original Spendee API is undocumented, and while this client works at the time of writing, it might stop working at any time. The author is not associated with Spendee in any way.
@@ -15,29 +12,16 @@ This is a work in progress and is not recommended for general use yet. The origi
1512

1613
## For Users
1714

18-
To set up a development environment (only linux is documented):
15+
*This section is for people who want to use the `spendee-python-client` library in their own projects.*
1916

20-
1. Ensure you have Python 3.11+ installed.
21-
2. Setup the virtual environment:
22-
```bash
23-
# Create a virtual environment
24-
python3 -m venv .venv
25-
# Activate the virtual environment
26-
source .venv/bin/activate
27-
# Install dependencies
28-
pip install -r requirements.txt
29-
```
30-
3. Set credentials in a newly created `.env` file.
31-
```bash
32-
echo 'EMAIL=<email>' > .env
33-
echo 'PASSWORD=<password' >> .env
34-
```
35-
4. Adapt `run.py` for your experiment and execute.
17+
_(Coming soon)_
3618

3719
---
3820

3921
## For Developers & Contributors
4022

23+
*This section is for people who want to contribute to the development of this library.*
24+
4125
### Development Environment Setup
4226

4327
This project uses [mise](https://mise.jdx.dev/) to manage the development environment.
@@ -48,7 +32,16 @@ This project uses [mise](https://mise.jdx.dev/) to manage the development enviro
4832

4933
3. **Install Tools**: Once `mise` is activated, navigate to the project's root directory and run `mise install` to install the required tools.
5034

51-
4. **Follow the User guide** above.
35+
4. **Set Credentials**: Create a `.env` file in the project root and add your Spendee credentials:
36+
```bash
37+
echo 'EMAIL=<your-email>' > .env
38+
echo 'PASSWORD=<your-password>' >> .env
39+
```
40+
41+
5. **Run**: You can now run the `run.py` script to experiment with the library:
42+
```bash
43+
python run.py
44+
```
5245

5346
### Backstory and Roadmap
5447

agents.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
This document provides AI coding assistants with essential context for working with the spendee-python-client project.
55

66
## Development Environment Setup
7-
This project uses [mise](https://mise.jdx.dev/) to manage the development environment. To set up your environment, follow these steps:
8-
9-
1. **Install `mise`**: If you don't have `mise` installed, you can install it by running `curl https://mise.run | sh`.
10-
2. **Activate `mise`**: Activate `mise` in your shell by running `eval "$(~/.local/bin/mise activate bash)"`.
11-
3. **Install Tools**: Navigate to the project's root directory and run `mise install`. This will install the tools defined in the `.mise.toml` file.
12-
13-
For more detailed instructions, please refer to the [environment setup documentation](docs/environment.md).
7+
This project uses [mise](https://mise.jdx.dev/) to manage the development environment. For detailed instructions on how to set up the environment, please refer to the [environment setup documentation](docs/environment.md).
148

159
## Secrets Management
1610
We use Bitwarden for managing secrets. To access secrets, you will need the `BWS_ACCESS_TOKEN` environment variable set. You can then use the `bws` CLI to fetch secrets.

docs/environment.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@ This project uses [mise](https://mise.jdx.dev/) to manage the development enviro
1414
```
1515

1616
## Tools
17-
This project uses the following tools, which are managed by `mise`:
18-
* **Python 3.11**
19-
* **jq**: A command-line JSON processor.
20-
* **Bitwarden CLI**: The command-line interface for Bitwarden.
17+
This project uses several tools that are managed by `mise`. For a complete and up-to-date list of these tools, please refer to the `.mise.toml` file in the root of the repository.
File renamed without changes.

docs/mcp.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ MCP (Model Context Protocol) is an open-source standard for connecting AI applic
88
* **Clients:** Connect to MCP servers to access data and tools.
99
* **Transports:** The underlying communication mechanism between clients and servers.
1010

11+
## Authentication and Authorization
12+
The MCP server in this project uses a simple bearer token authentication mechanism. It does not implement OAuth or any other complex authentication schemes.
13+
14+
To authenticate with the server, you must provide a bearer token in the `Authorization` header of your requests. The server expects the token to be the value of the `MCP_TOKEN` environment variable.
15+
1116
## MCP Inspector
1217
The [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) is an interactive developer tool for testing and debugging MCP servers. It allows you to:
1318
* Inspect available resources, prompts, and tools.
@@ -20,4 +25,4 @@ The `inspect2.sh` script in this repository is designed to help you run the MCP
2025
For a deeper understanding of MCP, please refer to the [official documentation](https://modelcontextprotocol.io/docs/getting-started/intro).
2126

2227
---
23-
For implementation details, see `mcp/agents.md`.
28+
For implementation details, see `spendee/agents.md`.

docs/spendee.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ Spendee is a personal finance application that helps users track their expenses
99
* **Categories:** Categories help you classify your transactions (e.g., food, transportation).
1010
* **Labels:** Labels provide an additional way to organize your transactions.
1111

12+
For more details on the data model, please refer to the [Firestore Schema](firestore-schema.md).
13+
1214
---
1315
For implementation details, see `spendee/agents.md`.

mcp/agents.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

spendee/agents.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
# Spendee Agent Guide
22

3-
This document provides AI coding assistants with essential context for working with the Spendee client.
3+
This document provides AI coding assistants with essential context for working with the Spendee client and MCP server.
44

5-
## Key Files
5+
## Spendee Client
6+
7+
### Key Files
68
* **`spendee/spendee_api.py`**: This file contains the original REST API client. It is not actively used but is kept for reference.
79
* **`spendee/spendee_firestore.py`**: This is the main file for interacting with Spendee's Firestore backend. It contains the `SpendeeFirestore` class, which is used to perform all data operations.
810
* **`spendee/firebase_client.py`**: This file contains the `FirebaseClient` class, which is a generic client for interacting with Firebase services. It is used by `SpendeeFirestore`.
911
* **`run.py`**: This is a script for manual testing and experimentation. You can modify this file to test new features or debug existing ones.
1012

11-
## How to Work with the Spendee Client
13+
### How to Work with the Spendee Client
1214
When working with the Spendee client, you will primarily be interacting with the `SpendeeFirestore` class. Here are some common tasks:
1315
* **Listing Wallets**: Use the `get_wallets()` method to get a list of all wallets.
1416
* **Listing Transactions**: Use the `list_transactions()` method to get a list of transactions for a specific wallet.
1517
* **Editing Transactions**: Use the `edit_transaction()` method to modify a transaction.
1618

1719
For more examples, please refer to the `run.py` script.
20+
21+
## MCP Server
22+
23+
### Key Files
24+
* **`spendee/spendee_mcp.py`**: This file contains the implementation of the MCP server. It uses the `SpendeeFirestore` class to interact with Spendee.
25+
* **`run-mcp.sh`**: This script is used to run the MCP server.
26+
* **`inspect.sh`**: This script is a development script that sets up a Python virtual environment and executes the `spendee_mcp.py` script.
27+
* **`inspect2.sh`**: This script is used to run the MCP Inspector, which is a tool for debugging MCP servers.
28+
29+
### How to Work with the MCP Server
30+
When working with the MCP server, you will primarily be modifying the `spendee/spendee_mcp.py` file. Here are some common tasks:
31+
* **Adding New Endpoints**: Add new methods to the `SpendeeMcp` class to expose new functionality.
32+
* **Modifying Existing Endpoints**: Modify the existing methods in the `SpendeeMcp` class to change their behavior.
33+
* **Running the Server**: Use the `run-mcp.sh` script to run the MCP server.
34+
* **Debugging the Server**: Use the `inspect2.sh` script to run the MCP Inspector and debug the server.

0 commit comments

Comments
 (0)