Skip to content

Commit b9b7914

Browse files
authored
Merge pull request #59 from RadCod3/chore/update-readme
Update README.md
2 parents f4b449d + c7dffb5 commit b9b7914

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# LamPyrid
22

3-
A Model Context Protocol (MCP) server providing comprehensive tools for interacting with Firefly III personal finance software. LamPyrid enables automated personal finance workflows and analysis through 18 MCP tools with support for account management, transaction operations, and budget management.
3+
A Model Context Protocol (MCP) server providing comprehensive tools for interacting with [Firefly III](https://github.com/firefly-iii/firefly-iii) personal finance software. LamPyrid enables automated personal finance workflows and analysis through 18 MCP tools with support for account management, transaction operations, and budget management.
4+
5+
> **What is Firefly III?** [Firefly III](https://www.firefly-iii.org/) is a free and open-source personal finance manager that helps you track expenses, income, budgets, and more. LamPyrid provides an MCP interface to automate interactions with your Firefly III instance.
46
57
## Features
68

@@ -302,11 +304,17 @@ LamPyrid/
302304
│ ├── models/
303305
│ │ ├── firefly_models.py # Auto-generated Firefly III API models
304306
│ │ └── lampyrid_models.py# Simplified MCP interface models
307+
│ ├── services/
308+
│ │ ├── __init__.py # Services layer exports
309+
│ │ ├── accounts.py # AccountService - account business logic
310+
│ │ ├── transactions.py # TransactionService - transaction business logic
311+
│ │ └── budgets.py # BudgetService - budget business logic
305312
│ └── tools/
306313
│ ├── __init__.py # Tool server composition coordinator
307314
│ ├── accounts.py # Account management tools (3 tools)
308315
│ ├── transactions.py # Transaction management tools (10 tools)
309316
│ └── budgets.py # Budget management tools (5 tools)
317+
├── tests/ # Unit and integration tests
310318
├── .github/workflows/ # CI/CD workflows
311319
├── assets/ # Project assets
312320
├── Dockerfile # Docker image definition
@@ -320,10 +328,14 @@ LamPyrid/
320328
LamPyrid follows a clean layered architecture with modular tool organization:
321329

322330
- **Server Layer** (`server.py`): FastMCP server initialization, authentication setup, and tool registration orchestration
323-
- **Tools Layer** (`tools/`): Modular MCP tool definitions organized by domain
331+
- **Tools Layer** (`tools/`): Thin MCP tool wrappers organized by domain that delegate to services
324332
- `accounts.py`: Account management tools (3 tools)
325333
- `transactions.py`: Transaction management tools (10 tools)
326334
- `budgets.py`: Budget management tools (5 tools)
335+
- **Services Layer** (`services/`): Business logic services that orchestrate operations between tools and the client
336+
- `accounts.py`: `AccountService` - account operations and model conversion
337+
- `transactions.py`: `TransactionService` - transaction CRUD, bulk operations, search query building
338+
- `budgets.py`: `BudgetService` - budget operations, spending calculations, multi-call aggregations
327339
- **Client Layer** (`clients/firefly.py`): HTTP client for Firefly III API with full CRUD support
328340
- **Models Layer**:
329341
- `firefly_models.py`: Auto-generated Pydantic models from Firefly III OpenAPI spec
@@ -333,10 +345,18 @@ LamPyrid follows a clean layered architecture with modular tool organization:
333345
### Tool Registration Pattern
334346
Tools are registered using FastMCP's native static composition pattern:
335347
- Each tool module exports a `create_*_server(client)` function that returns a standalone FastMCP instance
348+
- Tool functions are thin wrappers that delegate to corresponding service classes
336349
- The `tools/__init__.py` module provides `compose_all_servers()` to coordinate composition
337350
- The `server.py` uses `mcp.import_server()` to compose all domain servers into the main server
338351
- This leverages FastMCP's built-in server composition while keeping modular organization
339352

353+
### Services Layer Pattern
354+
The services layer separates business logic from tool definitions:
355+
- Each service class takes a `FireflyClient` instance via constructor injection
356+
- Services handle model conversion (Firefly API models to LamPyrid models)
357+
- Complex operations (bulk transactions, spending calculations) are encapsulated in services
358+
- This enables easier unit testing with mocked clients
359+
340360
The architecture enables easy extension and modification while maintaining type safety and comprehensive error handling throughout.
341361

342362
## Docker Deployment
@@ -475,7 +495,7 @@ Contributions are welcome! Please follow this workflow:
475495

476496
### Code Style Guidelines
477497

478-
- **Indentation**: Use tabs for indentation
498+
- **Indentation**: Use spaces for indentation
479499
- **Quotes**: Single quotes for strings
480500
- **Line Length**: 100 character line limit
481501
- **Type Safety**: Type hints required for all functions and methods
@@ -491,7 +511,7 @@ The main branch is protected with the following requirements:
491511

492512
## License
493513

494-
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
514+
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the [LICENSE](LICENSE) file for details.
495515

496516
## Support
497517

0 commit comments

Comments
 (0)