Bluecoins MCP Server
Provides read-only SQL querying and analysis of the Bluecoins SQLite database, including semantic views and raw tables for transactions, accounts, categories, labels, and related finance data.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Bluecoins MCP Server
Disclaimer: This is an independent, unofficial project. It is not affiliated with, endorsed by, sponsored by, or otherwise associated with Bluecoins or its developers. All product names and trademarks are the property of their respective owners.
This software is provided "as is", without warranty, guarantee, or support of any kind. Use it at your own risk — the authors assume no responsibility or liability for any loss of data, database corruption, inaccuracies, or other damages resulting from its use. Always maintain backups of your Bluecoins database.
Strictly read-only FastMCP server for querying and analyzing personal finance data from a synced Bluecoins SQLite database (bluecoins.fydb), designed to run in Docker on a local NAS behind an internet-facing reverse proxy.
Features
Strictly read-only: Never modifies or locks your Bluecoins database. Snapshots are opened with SQLite
mode=ro&immutable=1andPRAGMA query_only = ON, and the Docker volume is mounted:ro.Live NAS sync without restarts: Monitors
(st_mtime_ns, st_size, st_ino)on the read-only mounted NAS folder. Whenrcloneor Synology Cloud Sync updatesbluecoins.fydb, the server copies it to container/tmp, verifies integrity viaPRAGMA quick_check, and atomically swaps snapshots. If a file is caught mid-write, it safely keeps serving the last valid snapshot and marks/healthasdegraded.Accurate Bluecoins accounting: Automatically handles micros scaling (
1_000_000), active posted transaction filtering (deletedTransaction = 6 AND reminderTransaction IS NULL), FX-accurate foreign-currency account balances, split resolution, transfer exclusion in analytics, and placeholder account exclusion.Fail-closed authentication: Constant-time Bearer token auth by default (supporting comma-separated tokens for zero-downtime key rotation), or optional OAuth 2.1 (
google,github,oidc) with a mandatory single-owner allowlist.Hardened container: Multi-stage
uv→python:3.13-slimbuild, non-rootappuser(uid 1000),read_only: trueroot filesystem,cap_drop: ALL,no-new-privileges, and/tmpontmpfs.
Related MCP server: analytics-mcp-server
How It Works
Bluecoins (Android) ──► Google Drive ──► NAS sync folder (mounted /data:ro)
│
stat check + copy + PRAGMA quick_check
▼
Verified snapshot in /tmp (ro, immutable)
│
Semantic TEMP VIEWs + Repositories + SQL Guard
▼
FastMCP Streamable HTTP (/mcp) + /healthQuick Start (Docker on NAS)
Copy
.env.exampleto.env:cp .env.example .env chmod 600 .envEdit
.envand set:HOST_BLUECOINS_DATA_DIR=/path/on/nas/to/bluecoins-folder— point to the parent directory containingbluecoins.fydb, not the file itself, so atomic renames fromrcloneor Synology Cloud Sync are detected cleanly.MCP_AUTH_TOKENS— generate a strong token (≥ 32 characters):python3 -c "import secrets; print(secrets.token_urlsafe(48))"
Set
PUIDandPGIDin.envto match a NAS user with read access tobluecoins.fydb(runidon your NAS to check; defaults to1000:1000).docker-compose.ymlpasses these directly viauser: "${PUID:-1000}:${PGID:-1000}"while keepingread_only: true,cap_drop: ALL, andno-new-privileges.Build and start:
docker compose up -d --buildVerify health (unauthenticated, returns zero financial data):
curl http://127.0.0.1:8000/health
Reverse Proxy Notes
docker-compose.yml binds 127.0.0.1:8000:8000 so TLS termination stays at your reverse proxy or tunnel:
Caddy / Cloudflare Tunnel: Streamable HTTP works out of the box; proxy
/mcp(and optionally/health) tohttp://127.0.0.1:8000.Nginx: Disable response buffering so Streamable HTTP SSE streams flush immediately:
location /mcp { proxy_pass http://127.0.0.1:8000; proxy_http_version 1.1; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
Connecting MCP Clients
Claude Code CLI (claude)
Streamable HTTP (remote NAS or local HTTP server):
claude mcp add --transport http bluecoins https://bluecoins-mcp.example.com/mcp \
--header "Authorization: Bearer <YOUR_TOKEN>"Local stdio (no HTTP server required):
claude mcp add bluecoins \
-e MCP_TRANSPORT=stdio \
-e AUTH_MODE=none \
-e ALLOW_UNAUTHENTICATED=true \
-e BLUECOINS_DATA_DIR="/path/to/bluecoins-folder" \
-e DB_STAGING_DIR="/tmp/bluecoins-mcp" \
-- uv run --directory "/path/to/bluecoins-mcp" bluecoins-mcpAntigravity (agy CLI / App)
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"bluecoins": {
"url": "https://bluecoins-mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}Generic Streamable HTTP Clients & MCP Inspector
Endpoint:
https://bluecoins-mcp.example.com/mcp(orhttp://127.0.0.1:8000/mcplocally)Header:
Authorization: Bearer <YOUR_TOKEN>Test interactively with
npx @modelcontextprotocol/inspector.
Tools & Resources Reference
All 13 tools carry read-only MCP annotations (read_only_hint=True, destructive_hint=False, idempotent_hint=True, open_world_hint=False).
Tools
Category | Tool | Description |
Context |
| Default currency, schema version, date range, active/hidden counts, and NAS sync status |
Context |
| Parent and child category hierarchy (filterable by |
Context |
| Distinct labels with active posted transaction counts |
Transactions |
| Filter by dates, type, account, category, payee/item, label, free-text query, amount range, currency; returns paginated rows plus exact |
Transactions |
| Full details for one transaction, including sibling split legs or paired transfer leg |
Analytics |
| Total income, expenses, net cash flow, and savings rate for an inclusive date range (excludes transfers) |
Analytics |
| Ranked breakdown by |
Analytics |
| Chronological |
Analytics |
| Side-by-side comparison of two date ranges with overall and per-group deltas |
Accounts |
| Account list with FX-accurate native and base-currency balances and optional credit card fields |
Accounts |
| Total assets, total liabilities (positive debt magnitude), net worth, and breakdowns by account type & currency (supports historical |
Accounts |
| Per-card balance owed, credit limit, available credit, utilization %, cutoff/due days, and current-cycle spend |
Ad-Hoc SQL |
| Single read-only |
Resources
URI | MIME Type | Description |
|
| Database overview and sync metadata |
|
| Semantic SQL view schemas, sign conventions, and example queries |
Example Prompts
"Give me an overview of my Bluecoins database and my current net worth."
"Compare my spending by category this month vs last month."
"What is my current credit card utilization and spending since my last cutoff date?"
"Run a read-only SQL query to find my top 10 payees this year."
Configuration Reference
Variable | Default | Description |
| (required in Compose) | Host NAS directory containing |
|
| UID and GID used by Docker Compose ( |
|
| Directory path inside the app/container |
|
| SQLite database filename |
|
| Minimum interval between NAS file stat checks |
|
| Local directory for verified read-only snapshots |
|
| Max runtime for |
|
| Upper bound for |
|
|
|
|
| HTTP server bind address and port |
|
| Structured JSON log level |
|
|
|
|
| Comma-separated Bearer tokens (each ≥ 32 chars; supports zero-downtime rotation) |
|
| Must be |
| (none) |
|
| (none) | OAuth client ID |
| (none) | OAuth client secret |
| (none) | Public HTTPS base URL (register |
|
| Required comma-separated allowlist of permitted emails/subjects/logins for OAuth |
| (none) | Required only when |
Compatibility
Tested against Bluecoins SQLite schema PRAGMA user_version = 47.
Local Development
uv sync
uv run pytest -v
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src testsLicense
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask about your multi-currency budget: spending, budgets, bills, goals and net worth, read-only.
Read-only bank & investment accounts via Plaid: balances, holdings, transactions, SQL analytics.
Read-only cash flow, spending, subscriptions and transaction search from your US and Canadian banks.
Ask about your Waypoint Budget spending, budgets, goals and accounts. Read-only.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides read-only access to Quicken for Mac financial data, allowing users to query accounts, transactions, and spending trends through natural language. The server functions by reading the local SQLite database directly while the Quicken application is open.8153 npm56MIT
- AlicenseAqualityDmaintenanceEnables safe exploration and analysis of SQLite databases through guarded read-only queries, schema inspection, aggregations, and CSV imports.5MIT
- FlicenseBqualityCmaintenanceEnables read-only SQL queries and transaction classification tools for local expense tracking, including listing, filtering, and bulk account assignment with dry-run mode.8-
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients to query a local MoneyWiz SQLite database through a permanently read-only, local-first interface with Decimal-safe per-currency results for accounts, transactions, categories, payees, tags, budgets, scheduled transactions, and cashflow summaries.MIT