← Back to the project

Installation guide

From your server
to ChatGPT.

Set up your own finance MCP server, connect your bank and bring read-only financial tools into ChatGPT.

01 / Before you start

This guide creates your own private installation. You need Python 3.10+, Git, a Linux or macOS shell, and an Enable Banking application with access to the banks you want to connect. Linux is required for the optional systemd service.

The project supports BNP Paribas Fortis Belgium and Revolut Belgium. Confirm provider access before using real accounts. Each installation needs its own application ID, RSA key and registered HTTPS callback.

Python first. This repository does not include a Docker image or Compose configuration. The supported path here is a Python virtual environment on your computer or VPS.

For ChatGPT, you also need access to custom MCP connections and a permitted OpenAI tunnel. Bank consent and OpenAI tunnel credentials are separate. An existing installation should preserve its database, encryption key, tunnel and bank sessions.

02 / Install the server

Use ~/finance-bot: the historical bank authorization script expects this location. If you fork the repository, replace the clone URL with your fork.

git clone https://github.com/edouaz/finance-bot.git "$HOME/finance-bot"
cd "$HOME/finance-bot"
./scripts/install.sh

The installer creates .venv, installs requirements.lock and runs offline tests. On Debian/Ubuntu, install python3-venv if your system cannot create a virtual environment. These tests use synthetic data and do not contact your banks.

03 / Configure your bank application

Register your own application with Enable Banking and obtain the matching RSA private key. Register your exact HTTPS callback with the provider, using the same scheme, host and path as your configuration. For the private web interface, use https://YOUR_PRIVATE_SERVER/callback; bank codes return directly to your server.

The current authorization script reads the protected environment file described below. Set ENABLE_BANKING_APP_ID to your application ID, ENABLE_BANKING_KEY to your private key path and FINANCE_AUTH_REDIRECT_URL to your registered callback. Do not edit source constants or reuse the original owner’s application.

The historical static callback.html and callback.js remain available for a separately registered CLI fallback. Prefer the private web callback for renewal: the Pages entry page must never be registered as that callback.

mkdir -p keys data
chmod 700 keys data
# Copy your application's RSA private key to keys/private.pem first.
chmod 600 keys/private.pem

Never use the original owner’s application ID or callback for your own application. The static callback removes the query from the address bar, but the host can still log the initial URL. Do not publish keys, sessions or callback URLs containing authorization codes.

04 / Create encrypted local storage

For a new installation only, create a separate encryption key and a protected environment file. Do not replace a key or environment file used by an existing installation.

mkdir -p "$HOME/.config/finance-tracker" "$HOME/.local/share/finance-tracker"
chmod 700 "$HOME/.config/finance-tracker" "$HOME/.local/share/finance-tracker"
.venv/bin/python -m finance.cli init-key "$HOME/.config/finance-tracker/data.key"
(umask 077; cp .env.example "$HOME/.config/finance-tracker/environment")
chmod 600 "$HOME/.config/finance-tracker/environment"

Edit ~/.config/finance-tracker/environment. Replace every example with your own absolute path and application ID:

ENABLE_BANKING_APP_ID=your-application-id
ENABLE_BANKING_KEY=/absolute/path/to/finance-bot/keys/private.pem
FINANCE_SESSIONS=/absolute/path/to/finance-bot/data
FINANCE_STORAGE=/absolute/path/outside-the-repository/finance-tracker
FINANCE_DATA_KEY=/absolute/path/to/data.key

Do not use ~ or $HOME inside this file. Keep the database and encryption key outside the repository. Keep a protected offline copy of the encryption key: losing it means losing access to encrypted history.

The CLI and finance_mcp.py load this protected file. A repository-root .env is not loaded automatically; already exported process variables take precedence.

Renew bank access on your private server

The optional bank_auth_web.py interface runs on your own VPS. It provides buttons for BNP Paribas Fortis and Revolut, validates a short-lived, single-use state, exchanges the bank code server-side and checks the new session before replacing the local session file. Existing transaction history stays in your encrypted database.

  1. Use your own HTTPS hostname and a private login. Configure a local TLS reverse proxy to 127.0.0.1:8765; do not expose that internal port directly.
  2. Register https://YOUR_PRIVATE_SERVER/callback in your own Enable Banking application. Set FINANCE_AUTH_REDIRECT_URL to that exact URL and FINANCE_AUTH_PASSWORD_FILE to a protected 0600 file containing a strong, randomly generated password. The private login username is finance.
  3. Follow the full private renewal runbook for password generation, TLS proxy configuration, log redaction, tests and explicit service startup. Enable it only after you approve the configuration and any hosting or provider costs.
  4. Open the private server entry page, enter only your server’s HTTPS origin and confirm. Sign in on your server, select your bank and complete consent in the same browser. Never paste bank codes, secrets or callback URLs into ChatGPT.

GitHub Pages only helps you navigate to your own instance. It hosts no private banking service, starts no authorization and remembers only the nonsecret server origin in your browser after confirmation. Use “Forget this address” to remove it. Each person provides their own VPS, application credentials and configuration; no central financial storage or payment service is added.

Once the private interface is configured, get_reauthorization_link(bank="bnp") or get_reauthorization_link(bank="revolut") can return its entry link in ChatGPT. This read-only tool does not launch bank consent. If it reports private_web_not_configured, check the private callback configuration and refresh MCP discovery after restarting your own server.

Renewal does not download transactions automatically. Inspect the session status and run a limited synchronization afterwards. Failed verification leaves the old local session in place; restart the authorization flow after an expired or consumed callback.

06 / Set up the private MCP tunnel

Create a tunnel in Platform tunnel settings, associate your target ChatGPT workspace, and obtain its ID. Creation requires Tunnels Read + Manage; runtime access requires Read + Use. Install the client from the download linked there:

mkdir -p "$HOME/.local/bin"
# Replace /path/to/downloaded/tunnel-client with your extracted binary.
install -m 755 /path/to/downloaded/tunnel-client "$HOME/.local/bin/tunnel-client"
export PATH="$HOME/.local/bin:$PATH"
tunnel-client help quickstart

Save your runtime API key privately using this project’s masked prompt. A tunnel_… ID is not an API key. Configuration refuses to overwrite an existing saved key.

.venv/bin/python -m finance.tunnel_runtime configure

Initialize a new profile with your tunnel ID. Keep the credential out of command arguments; load it from the protected file:

export CONTROL_PLANE_API_KEY="$(cat "$HOME/.config/finance-tracker/tunnel-api.key")"
tunnel-client init \
  --sample sample_mcp_stdio_local \
  --profile finance-bot \
  --tunnel-id YOUR_TUNNEL_ID \
  --mcp-command "$HOME/finance-bot/.venv/bin/python $HOME/finance-bot/finance_mcp.py"
.venv/bin/python -m finance.tunnel_runtime doctor
.venv/bin/python -m finance.tunnel_runtime run

Reuse an existing profile instead of initializing it again. The launcher expects ~/.local/bin/tunnel-client and profile finance-bot.

Keep the client running. The connection uses outbound HTTPS; no public banking listener is required. Check your installed client’s help if flags differ. Source: official OpenAI Secure MCP Tunnel documentation.

07 / Connect ChatGPT

In ChatGPT Plugins, add a custom MCP server, choose Tunnel and select your tunnel. Workspace permissions still apply. See OpenAI’s connection instructions.

With the client running, verify tool discovery and try get_accounts and get_data_coverage. Ask which date range is available before requesting a spending summary. The tools read cached data; refresh it using the synchronization command.

Check the full path. Local health alone does not confirm a working ChatGPT connection. Finish by making a successful read-only tool call in ChatGPT. Information returned by tools can include financial data and is subject to your OpenAI account’s settings.

08 / Keep it running on Linux (optional)

For a foreground trial, keep your terminal open. For automatic startup, adapt the supplied systemd unit. The existing shell helpers and service contain /home/edouard paths and an edouard user; do not run them unchanged on someone else’s machine.

  1. Edit scripts/run_tunnel.sh and scripts/activate_tunnel.sh to use your absolute checkout path.
  2. Edit deploy/finance-tunnel.service: set User, Group, WorkingDirectory, EnvironmentFile, ExecStart and ReadWritePaths for your account and storage path.
  3. Stop the foreground process before starting the service.
./scripts/activate_tunnel.sh
systemctl is-active finance-tunnel.service
# After editing the unit later:
sudo systemctl daemon-reload
sudo systemctl restart finance-tunnel.service

The activation script uses sudo and enables the system service. Keep only one supervisor for this tunnel. Confirm the client’s configured health port before using a local health probe; keep its admin endpoint private.

Synchronization is separate from the tunnel. The optional weekly timer and service in deploy/ also need their user and paths adapted. Reports stay encrypted locally; scheduling a report does not send a ChatGPT notification.

Troubleshooting

application_id_not_configured
Check the protected environment file and any exported variable taking precedence.
unsafe_*_permissions
Use mode 600 for secret files and 700 for their private directories. Do not solve this by making secrets public.
Callback rejected or authorization expired
Check the registered HTTPS URL and FINANCE_AUTH_REDIRECT_URL in your protected environment file, then restart authorization.
authorization_unavailable
Check the application, RSA key and provider authorization. This error alone does not prove bank consent expired.
No tools in ChatGPT
Check the running client, profile command, workspace association and tunnel permissions. Refresh tool discovery after fixing the connection.
Wrong API key saved
Run .venv/bin/python -m finance.tunnel_runtime configure --replace privately, then restart the client. This replaces only the local credential file.
Missing or stale transactions
Check bank consent, sync dates, provider history limits and coverage. Run synchronization again as needed.

Backups and local development

.venv/bin/python -m finance.cli backup /secure/external/path/finance-backup.sqlite3
./scripts/verify.sh
python3 -m http.server 8000 --directory public

The backup destination must be new and outside the repository. Protect the matching encryption key separately. Open http://localhost:8000 to preview the website. Run tests through verify.sh: the legacy root-level test_api.py makes a live bank call on import.

Publish only public/ to your static host. For this repository, the live site comes from gh-pages:/; merging source changes into main does not update it. The historical publishing script is owner-specific and refuses an existing repository.

Operational documentation on GitHub includes backup recovery and shutdown notes. Some older runbooks describe the original host rather than a new installation.