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 17+ 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 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.
44
55## Features
66
77- ** Comprehensive Account Management** : List, search, and retrieve account information across all Firefly III account types
88- ** Transaction Operations** : Full CRUD operations for transactions with support for withdrawals, deposits, and transfers
9+ - ** Bulk Operations** : Efficient bulk transaction creation and updates for high-volume workflows
910- ** Budget Management** : Complete budget analysis with spending tracking, allocation, and summary reporting
11+ - ** Docker Support** : Production-ready Docker images with multi-platform support (amd64/arm64)
1012- ** Type Safety** : Full type hints and Pydantic validation throughout the codebase
1113- ** Async Operations** : Non-blocking HTTP operations for optimal performance
1214- ** Robust Error Handling** : Comprehensive error handling across all API interactions
1315
1416## Quick Start
1517
16- ### Prerequisites
18+ ### Option 1: Docker (Recommended)
19+
20+ The fastest way to get started is using the published Docker image:
21+
22+ ``` bash
23+ # Pull the latest image
24+ docker pull ghcr.io/radcod3/lampyrid:latest
25+
26+ # Run with stdio mode (for Claude Desktop)
27+ docker run --rm -i \
28+ -e MCP_TRANSPORT=stdio \
29+ -e FIREFLY_BASE_URL=https://your-firefly-instance.com \
30+ -e FIREFLY_TOKEN=your-api-token \
31+ ghcr.io/radcod3/lampyrid:latest
32+
33+ # Or use docker-compose
34+ cat > docker-compose.yml << EOF
35+ services:
36+ lampyrid:
37+ image: ghcr.io/radcod3/lampyrid:latest
38+ ports:
39+ - "3000:3000"
40+ environment:
41+ FIREFLY_BASE_URL: https://your-firefly-instance.com
42+ FIREFLY_TOKEN: your-api-token
43+ restart: unless-stopped
44+ EOF
45+ docker-compose up -d
46+ ```
47+
48+ ### Option 2: Local Installation
49+
50+ #### Prerequisites
1751
1852- Python 3.14+
1953- [ uv] ( https://github.com/astral-sh/uv ) package manager
2054- Access to a Firefly III instance with API token
2155
22- ### Installation
56+ #### Installation Steps
2357
24581 . Clone the repository:
2559``` bash
26- git clone < repository-url >
60+ git clone https://github.com/RadCod3/LamPyrid.git
2761cd LamPyrid
2862```
2963
@@ -53,7 +87,14 @@ LamPyrid uses environment variables for configuration:
5387- ` FIREFLY_BASE_URL ` : URL of your Firefly III instance
5488- ` FIREFLY_TOKEN ` : Personal access token for API authentication
5589
56- ### Optional: Google OAuth Authentication
90+ ### Server Configuration (Optional)
91+
92+ - ` MCP_TRANSPORT ` : Transport protocol (stdio/http/sse, default: stdio)
93+ - ` MCP_HOST ` : Host binding for HTTP/SSE transports (default: 0.0.0.0)
94+ - ` MCP_PORT ` : Port binding for HTTP/SSE transports (default: 3000)
95+ - ` LOGGING_LEVEL ` : Logging verbosity (DEBUG/INFO/WARNING/ERROR/CRITICAL, default: INFO)
96+
97+ ### Google OAuth Authentication (Optional)
5798
5899For remote server deployments requiring authentication, you can enable Google OAuth:
59100
@@ -169,22 +210,24 @@ After configuration, restart Claude Desktop. LamPyrid tools will be available fo
169210
170211## Available MCP Tools
171212
172- ### Account Management
213+ ### Account Management (3 tools)
173214- ` list_accounts ` - List accounts by type (asset, expense, revenue, etc.)
174215- ` search_accounts ` - Search accounts by name with optional type filtering
175216- ` get_account ` - Get detailed information for a single account
176217
177- ### Transaction Management
218+ ### Transaction Management (10 tools)
178219- ` get_transactions ` - Retrieve transactions with time range and type filtering
179220- ` search_transactions ` - Search transactions by description or text fields
180221- ` get_transaction ` - Get detailed information for a single transaction
181222- ` create_withdrawal ` - Create withdrawal transactions with budget allocation
182223- ` create_deposit ` - Create deposit transactions
183224- ` create_transfer ` - Create transfer transactions between accounts
225+ - ` create_bulk_transactions ` - Create multiple transactions efficiently in a single operation
226+ - ` update_transaction ` - Update existing transaction details (amount, description, accounts, budget, etc.)
227+ - ` bulk_update_transactions ` - Update multiple transactions efficiently in a single operation
184228- ` delete_transaction ` - Delete transactions by ID
185- - ` update_transaction_budget ` - Update or clear budget allocation for transactions
186229
187- ### Budget Management
230+ ### Budget Management (5 tools)
188231- ` list_budgets ` - List all budgets with optional filtering
189232- ` get_budget ` - Get detailed budget information
190233- ` get_budget_spending ` - Analyze spending for specific budgets and periods
@@ -198,89 +241,195 @@ All tools include comprehensive error handling and return structured data optimi
198241### Setup Development Environment
199242
200243``` bash
201- # Install with test dependencies
202- uv sync --group test
244+ # Install dependencies
245+ uv sync
203246
204247# Format code
205248uv run ruff format
206249
207250# Lint code
208251uv run ruff check --fix
209252
210- # Run tests
211- uv run pytest
253+ # Build Docker image locally
254+ docker build -t lampyrid:dev .
212255
213- # Run tests with coverage
214- uv run pytest --cov= lampyrid --cov-report=term-missing
256+ # Run local development server
257+ uv run lampyrid
215258```
216259
217260### Project Structure
218261
219- ```
262+ ``` text
220263LamPyrid/
221- +-- src/lampyrid/ # Main package
222- | +-- server.py # FastMCP server with MCP tools
223- | +-- config.py # Environment configuration
224- | +-- clients/
225- | | \-- firefly.py # Firefly III HTTP client
226- | \-- models/
227- | +-- firefly_models.py # Auto-generated API models
228- | \-- lampyrid_models.py # Simplified MCP models
229- +-- tests/ # Test suite
230- | +-- unit/ # Unit tests
231- | +-- integration/ # Integration tests
232- | \-- conftest.py # Test fixtures
233- \-- pyproject.toml # Project configuration
264+ ├── src/lampyrid/
265+ │ ├── __init__.py # Package initialization
266+ │ ├── __main__.py # Main entry point for MCP server
267+ │ ├── server.py # FastMCP server initialization and tool composition
268+ │ ├── config.py # Environment configuration
269+ │ ├── utils.py # Custom HTTP routes (favicon, etc.)
270+ │ ├── clients/
271+ │ │ └── firefly.py # HTTP client for Firefly III API
272+ │ ├── models/
273+ │ │ ├── firefly_models.py # Auto-generated Firefly III API models
274+ │ │ └── lampyrid_models.py# Simplified MCP interface models
275+ │ └── tools/
276+ │ ├── __init__.py # Tool server composition coordinator
277+ │ ├── accounts.py # Account management tools (3 tools)
278+ │ ├── transactions.py # Transaction management tools (10 tools)
279+ │ └── budgets.py # Budget management tools (5 tools)
280+ ├── .github/workflows/ # CI/CD workflows
281+ ├── assets/ # Project assets
282+ ├── Dockerfile # Docker image definition
283+ ├── docker-compose.yml # Docker Compose configuration
284+ ├── pyproject.toml # Project configuration and dependencies
285+ └── README.md # Project documentation
234286```
235287
236- ### Testing
288+ ## Architecture
289+
290+ LamPyrid follows a clean layered architecture with modular tool organization:
291+
292+ - ** Server Layer** (` server.py ` ): FastMCP server initialization, authentication setup, and tool registration orchestration
293+ - ** Tools Layer** (` tools/ ` ): Modular MCP tool definitions organized by domain
294+ - ` accounts.py ` : Account management tools (3 tools)
295+ - ` transactions.py ` : Transaction management tools (10 tools)
296+ - ` budgets.py ` : Budget management tools (5 tools)
297+ - ** Client Layer** (` clients/firefly.py ` ): HTTP client for Firefly III API with full CRUD support
298+ - ** Models Layer** :
299+ - ` firefly_models.py ` : Auto-generated Pydantic models from Firefly III OpenAPI spec
300+ - ` lampyrid_models.py ` : Simplified models for MCP tool interfaces
301+ - ** Configuration** (` config.py ` ): Environment-based settings using pydantic-settings
302+
303+ ### Tool Registration Pattern
304+ Tools are registered using FastMCP's native static composition pattern:
305+ - Each tool module exports a ` create_*_server(client) ` function that returns a standalone FastMCP instance
306+ - The ` tools/__init__.py ` module provides ` compose_all_servers() ` to coordinate composition
307+ - The ` server.py ` uses ` mcp.import_server() ` to compose all domain servers into the main server
308+ - This leverages FastMCP's built-in server composition while keeping modular organization
309+
310+ The architecture enables easy extension and modification while maintaining type safety and comprehensive error handling throughout.
311+
312+ ## Docker Deployment
313+
314+ LamPyrid provides production-ready Docker images published to GitHub Container Registry.
315+
316+ ### Available Images
317+
318+ - ** Latest** : ` ghcr.io/radcod3/lampyrid:latest ` (main branch)
319+ - ** Versioned** : ` ghcr.io/radcod3/lampyrid:0.2.0 ` , ` ghcr.io/radcod3/lampyrid:0.2 ` , ` ghcr.io/radcod3/lampyrid:0 `
320+ - ** Platforms** : linux/amd64, linux/arm64
237321
238- The project includes comprehensive test coverage:
322+ ### Running with Docker
239323
240324``` bash
241- # Run all tests
242- uv run pytest
325+ # Run in stdio mode (for Claude Desktop integration)
326+ docker run --rm -i \
327+ -e MCP_TRANSPORT=stdio \
328+ -e FIREFLY_BASE_URL=https://your-firefly-instance.com \
329+ -e FIREFLY_TOKEN=your-api-token \
330+ ghcr.io/radcod3/lampyrid:latest
331+
332+ # Run in HTTP mode
333+ docker run -d \
334+ -p 3000:3000 \
335+ -e FIREFLY_BASE_URL=https://your-firefly-instance.com \
336+ -e FIREFLY_TOKEN=your-api-token \
337+ --name lampyrid \
338+ ghcr.io/radcod3/lampyrid:latest
339+ ```
243340
244- # Run specific test categories
245- uv run pytest tests/unit
246- uv run pytest tests/integration
341+ ### Using Docker Compose
342+
343+ ``` yaml
344+ services :
345+ lampyrid :
346+ image : ghcr.io/radcod3/lampyrid:latest
347+ ports :
348+ - " 3000:3000"
349+ environment :
350+ FIREFLY_BASE_URL : https://your-firefly-instance.com
351+ FIREFLY_TOKEN : your-api-token
352+ # Optional: Configure transport and logging
353+ MCP_TRANSPORT : http
354+ LOGGING_LEVEL : INFO
355+ restart : unless-stopped
356+ ` ` `
247357
248- # Run with coverage
249- uv run pytest --cov=lampyrid
358+ ### Building Custom Images
250359
251- # Run specific tests
252- uv run pytest -k " test_account"
360+ ` ` ` bash
361+ # Build locally
362+ docker build -t lampyrid:custom .
363+
364+ # Build for specific platform
365+ docker buildx build --platform linux/amd64 -t lampyrid:custom .
253366```
254367
255- Test categories:
256- - Unit tests (` @pytest.mark.unit ` ): Fast, isolated component tests
257- - Integration tests (` @pytest.mark.integration ` ): End-to-end workflow tests with mocked APIs
368+ ## CI/CD and Releases
258369
259- ## Architecture
370+ LamPyrid uses GitHub Actions for continuous integration and deployment:
260371
261- LamPyrid follows a clean layered architecture:
372+ ### Automated Workflows
262373
263- - ** Server Layer ** : FastMCP server exposing MCP tools with comprehensive tagging
264- - ** Client Layer ** : HTTP client for Firefly III API with full CRUD support
265- - ** Models Layer ** : Type-safe data models with Pydantic validation
266- - ** Configuration ** : Environment-based settings management
374+ - ** CI Workflow ** : Runs on all pull requests
375+ - Code linting and formatting validation
376+ - Package build verification
377+ - Docker image build test
267378
268- The architecture enables easy extension and modification while maintaining type safety and comprehensive error handling throughout.
379+ - ** Docker Publish Workflow** : Runs on main branch and version tags
380+ - Multi-platform image builds (amd64/arm64)
381+ - Security scanning with Trivy
382+ - Publishes to ghcr.io with appropriate tags
383+
384+ - ** Release Workflow** : Runs on version tags (e.g., ` v0.2.0 ` )
385+ - Generates changelog from git commits
386+ - Creates GitHub release with installation instructions
387+ - Links to published Docker images
388+
389+ ### Creating a Release
390+
391+ To create a new release:
392+
393+ 1 . Merge all features to main via pull requests
394+ 2 . Create a release branch and update version in ` pyproject.toml `
395+ 3 . Merge the version bump PR
396+ 4 . Create and push a version tag (e.g., ` v0.2.0 ` )
397+ 5 . GitHub Actions automatically builds and publishes the release
269398
270399## Contributing
271400
272- 1 . Fork the repository
273- 2 . Create a feature branch
274- 3 . Make your changes with appropriate tests
275- 4 . Run the test suite and ensure all tests pass
276- 5 . Submit a pull request
277-
278- Please ensure all code follows the project's style guidelines:
279- - Use tabs for indentation
280- - Single quotes for strings
281- - 100 character line limit
282- - Type hints for all functions
283- - Comprehensive test coverage
401+ Contributions are welcome! Please follow this workflow:
402+
403+ 1 . ** Fork the repository**
404+ 2 . ** Create a feature branch** from ` main ` :
405+ ``` bash
406+ git checkout -b feat/your-feature-name
407+ ```
408+ 3 . ** Make your changes** following the code style guidelines below
409+ 4 . ** Test locally** :
410+ ``` bash
411+ uv run ruff format
412+ uv run ruff check --fix
413+ uv run lampyrid # Verify the server starts
414+ ```
415+ 5 . ** Commit your changes** with clear, descriptive messages
416+ 6 . ** Push to your fork** and create a pull request
417+
418+ ### Code Style Guidelines
419+
420+ - ** Indentation** : Use tabs for indentation
421+ - ** Quotes** : Single quotes for strings
422+ - ** Line Length** : 100 character line limit
423+ - ** Type Safety** : Type hints required for all functions and methods
424+ - ** Async Operations** : Use async/await pattern for HTTP operations
425+ - ** Documentation** : Include docstrings for all MCP tools and complex functions
426+
427+ ### CI/CD Process
428+
429+ The main branch is protected with the following requirements:
430+ - All pull requests must pass CI checks (linting, formatting, Docker build)
431+ - GitHub Actions automatically run on all PRs
432+ - Docker images are published on version tags and main branch pushes
284433
285434## License
286435
0 commit comments