Commit Graph

27 Commits

Author SHA1 Message Date
44b2f553d6 debug: log URL before API call
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 20s
2026-05-05 02:59:31 +00:00
1eb8eaacb2 enhance: add package location and BASE_URL verification to diagnostics
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 19s
2026-05-05 02:58:03 +00:00
157645b64d feat: add startup diagnostics for debugging environment and library version
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 20s
2026-05-05 02:54:38 +00:00
77656c9925 fix: add error handling to api_call for better debugging
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 20s
2026-05-05 02:38:08 +00:00
7a7140c76c feat: add api_call pass-through tool and API reference resource
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 46s
- Add single pass-through tool following blueprint 'escape hatch' pattern
- Add monarch://api-reference resource with available methods documentation
- Fix dependency: use monarchmoney>=0.1.15 instead of monarchmoneycommunity
- Add JSON error handling for malformed params
2026-05-05 02:32:32 +00:00
Ben
4382b02450 fix: use monarchmoney from git main to get budget fix (#119)
Some checks failed
Build and Push Monarch MCP Docker Image / build (push) Failing after 8s
Since no release has been published in ~11 months, install monarchmoney
directly from git main branch which contains the fix for flexible budgets.
Also updates gql to >=4.0 as required by the main branch.
2025-12-25 04:35:06 +00:00
Ben
52f7a746f9 fix: disable get_budgets tool due to upstream Monarch Money API bug
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 17s
The Monarch Money API incorrectly processes @include(if: false) GraphQL
directives, causing errors on goals-related fields. Tool commented out
until upstream issue is resolved. See budget_bug.md for details.
2025-12-25 04:28:19 +00:00
Ben
bb38e2441d fix: disable goals queries in get_budgets to work around Monarch API errors
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 16s
The Monarch Money API returns errors for goals-related GraphQL fields
(lines 119-131 in query). Setting use_legacy_goals=False and use_v2_goals=False
skips these problematic fields while still returning budget data.
2025-12-25 04:24:52 +00:00
Ben
a229537599 fix: add graceful error handling for get_budgets API errors
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 16s
Returns informative error message when Monarch Money API fails,
which may occur if budgets are not configured in the account.
2025-12-25 04:20:39 +00:00
Ben
4a309cbfb3 fix: update get_budgets to match actual monarchmoney API response structure
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 17s
The monarchmoney library's get_budgets() returns budgetData.monthlyAmountsByCategory
and categoryGroups, not a simple 'budgets' array. Updated parsing to correctly
extract budget data by category with monthly planned/actual/remaining amounts.
2025-12-25 04:17:48 +00:00
Ben
88bf8a60d5 fix: improve input validation, error logging, and env var handling
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 30s
- Add validate_account_id() for get_account_holdings input validation
- Fix double logging bug in retry_on_auth_error decorator
- Remove emojis from log messages for cleaner log parsing
- Make PORT and LOG_LEVEL environment variables functional
- Delete redundant requirements.txt (pyproject.toml is authoritative)
- Clarify MONARCH_PORT is for Docker Compose only in .env.example
2025-12-25 04:11:03 +00:00
Ben
e462c31907 fix: remove try-except blocks from MCP tools to allow auth-retry decorator to work
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 16s
2025-12-24 21:48:34 +00:00
Ben
6fc09d956f feat: add automatic re-authentication with MFA support
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
Implement automatic token refresh using stored credentials and TOTP MFA secret. When an API call fails with a 401/unauthorized error, the system now transparently re-authenticates using MONARCH_EMAIL, MONARCH_PASSWORD, and MONARCH_MFA_SECRET, then retries the original request.

Changes:
- Add refresh_authentication() function in auth.py for credential-based login
- Create @retry_on_auth_error decorator to handle and retry failed auth calls
- Apply decorator to all MCP tools (get_accounts, get_transactions, etc.)
- Add MONARCH_MFA_SECRET to .env.example with documentation
- Update login_setup.py to instruct users about required env vars
- Replace PROBLEM.md with PLAN.md documenting the implementation
2025-12-24 15:45:43 +00:00
Ben
27ef7f0e1e fix: add optional reason parameter to all tools for MCP compatibility
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 10s
2025-12-24 05:20:30 +00:00
Ben
1210cbf6d2 fix: use correct Starlette mount pattern for MCP SSE routing
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
The previous implementation added health route directly to mcp_app and
returned it, which broke MCP's internal /mcp endpoint routing.

Now matches the working pattern from komodo-mcp-custom:
- Mount mcp_app at / inside a parent Starlette app
- Pass lifespan=mcp_app.lifespan for proper task group init
- Health check is a separate route in the parent app
2025-12-24 05:10:32 +00:00
Ben
65c79efc60 refactor: use simplified FastMCP app pattern with health check
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
2025-12-24 05:03:05 +00:00
Ben
92fa2c3f11 refactor: mount FastMCP app at root and retain /health for compatibility
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 7s
2025-12-24 04:56:33 +00:00
Ben
ebb571a7a6 refactor: mount FastMCP app at /mcp and re-add /health to root for compatibility
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
2025-12-24 04:55:05 +00:00
Ben
df492c8bb4 refactor: simplify ASGI app setup by mounting FastMCP app at root
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 7s
2025-12-24 04:52:24 +00:00
Ben
8fc4312685 refactor: mount FastMCP app at / and remove health_check from root to avoid overlap
Some checks failed
Build and Push Monarch MCP Docker Image / build (push) Has been cancelled
2025-12-24 04:52:17 +00:00
Ben
748cc5c711 fix: mount FastMCP app at /mcp to correctly route SSE traffic
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 7s
2025-12-24 04:50:48 +00:00
Ben
75ba3433e8 refactor: use FastMCP.http_app() for robust SSE and health check support
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 7s
2025-12-24 04:48:18 +00:00
Ben
177832053f fix: refactor handle_sse to standard ASGI to avoid Starlette TypeError
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
2025-12-24 04:43:06 +00:00
Ben
776b4b8cc8 fix: use correct underlying server attribute for SSE handling in FastMCP
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 9s
2025-12-24 04:41:06 +00:00
Ben
f5a5bb3fc4 fix: use correct internal lifespan attribute for FastMCP
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
2025-12-24 02:09:53 +00:00
Ben
f17e485612 Refactor SSE endpoints to /mcp and fix library type errors
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 7s
2025-12-24 01:57:38 +00:00
Ben
714897276b Initial commit: Monarch MCP Custom SSE server 2025-12-24 01:54:42 +00:00