{"id":48109477,"url":"https://github.com/sailro/finaryexport","last_synced_at":"2026-04-04T16:01:20.316Z","repository":{"id":344890419,"uuid":"1182685517","full_name":"sailro/FinaryExport","owner":"sailro","description":"Exports Finary's portfolio summaries, account balances, holdings, transactions, and dividends","archived":false,"fork":false,"pushed_at":"2026-03-16T20:36:08.000Z","size":716,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-17T05:59:11.331Z","etag":null,"topics":["export","finary","llm","mcp","mcp-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sailro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T20:55:08.000Z","updated_at":"2026-03-16T20:36:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sailro/FinaryExport","commit_stats":null,"previous_names":["sailro/finaryexport"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sailro/FinaryExport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sailro%2FFinaryExport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sailro%2FFinaryExport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sailro%2FFinaryExport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sailro%2FFinaryExport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sailro","download_url":"https://codeload.github.com/sailro/FinaryExport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sailro%2FFinaryExport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31405197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["export","finary","llm","mcp","mcp-server"],"created_at":"2026-04-04T16:00:35.705Z","updated_at":"2026-04-04T16:01:20.205Z","avatar_url":"https://github.com/sailro.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FinaryExport (and MCP Server)\n\nA .NET command-line tool that exports your [Finary](https://finary.com) wealth management data to Excel (`.xlsx`) files.\n\nConnects to the Finary API, authenticates via Clerk, and exports portfolio summaries, account balances, holdings, transactions, and dividends — one workbook per profile, plus a unified workbook across all profiles.\n\n## Prerequisites\n\n- **Windows 10 or later** — required (DPAPI session encryption and TLS impersonation depend on Windows-only native libraries)\n- [.NET 10 SDK](https://dotnet.microsoft.com/download)\n- NuGet packages are restored automatically by `dotnet build`\n\n## Build\n\n```bash\ndotnet build\n```\n\n## Usage\n\nAll commands are run from the repository root. The `--project` flag tells `dotnet run` which project to execute.\n\n### Export data\n\n```bash\ndotnet run --project src/FinaryExport -- export\n```\n\nExports all profiles to the default output directory. Each profile gets its own file (e.g., `finary-export-jean-dupont.xlsx`) and a unified workbook (`finary-export-unified.xlsx`) is generated combining all profiles.\n\n### Export with custom output path\n\n```bash\ndotnet run --project src/FinaryExport -- export --output myfile.xlsx\n```\n\n### Force re-authentication\n\n```bash\ndotnet run --project src/FinaryExport -- clear-session\n```\n\nDiscards the cached session and forces a fresh login on the next export.\n\n### Show version\n\n```bash\ndotnet run --project src/FinaryExport -- version\n```\n\n## Authentication\n\nOn first run, FinaryExport prompts interactively for:\n\n1. **Email** — your Finary account email\n2. **Password** — your Finary account password\n3. **TOTP code** — a 6-digit code from your authenticator app (if 2FA is enabled)\n\nAfter successful login, the session is encrypted and cached locally using DPAPI (Windows). Subsequent runs reuse the cached session until it expires, with automatic token refresh in the background.\n\n### Session Storage \u0026 Security\n\n**Your email, password, and TOTP codes are never saved to disk.** They are used only during the interactive login prompt and discarded immediately after authentication.\n\nWhat IS saved is a session token and cookies, stored in:\n\n```\n~/.finaryexport/session.dat\n```\n\nThis file is encrypted at rest using [**DPAPI** (Data Protection API)](https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-use-data-protection) — a well-established Windows cryptographic framework used by Chrome, Edge, and other major applications to protect sensitive data. DPAPI encryption is scoped to the current Windows user account, meaning the file cannot be decrypted by other users on the same machine or if copied to another computer.\n\nTo discard the cached session, use `clear-session` (see above) or simply delete `~/.finaryexport/session.dat`.\n\n## Currency Handling\n\nFinary lets you choose a **display currency** in your account settings (e.g. EUR, USD). All monetary values in the export (balances, prices, P\u0026L, dividends…) are expressed in this display currency, and the corresponding symbol (€, $, £…) is automatically applied to every amount column in the workbook.\n\nEach account and transaction also has a **Native Currency** column showing the original currency of the underlying asset or operation — for example, a US brokerage account will show `USD` as native currency even if your display currency is set to EUR.\n\n\u003e **Tip:** To change the currency used in the export, update your display currency in Finary's settings and re-export.\n\n## Output\n\nEach profile export generates an `.xlsx` workbook. A unified workbook combining all profiles is also generated. A full profile for instance produces **14 sheets**:\n\n### Portfolio Summary\n\nOverall portfolio metrics:\n- Gross/net total, evolution (€ and %)\n- Per-category breakdown: account count and total balance for each asset category\n\n### Account Sheets (one per category with data)\n\nUp to 10 category-specific sheets — only created if the category has accounts:\n\n| Sheet | Category |\n|-------|----------|\n| Checkings | Bank checking accounts |\n| Savings | Savings accounts |\n| Investments | Investment/brokerage accounts |\n| Real Estate | Property holdings (SCPIs, etc.) |\n| Cryptos | Cryptocurrency accounts |\n| Fonds Euro | Euro-denominated funds |\n| Commodities | Commodity holdings |\n| Credits | Loans and credit lines |\n| Other Assets | Miscellaneous assets |\n| Startups | Startup equity/investments |\n\nEach account sheet has columns: **Name**, **Institution**, **Balance**, **Native Currency**, **Buying Value**, **Unrealized P\u0026L**, **Annual Yield**, **IBAN**, **Opened At**, **Last Sync**.\n\n### Holdings\n\nIndividual security positions from investment accounts: **Account**, **Name**, **ISIN**, **Symbol**, **Type**, **Quantity**, **Buy Price**, **Current Price**, **Value**, **+/- Value**, **+/- %**.\n\n### Crypto Holdings\n\nIndividual cryptocurrency and fiat positions held in crypto accounts: **Account**, **Name**, **Code**, **Quantity**, **Buy Price**, **Current Price**, **Value**, **Buy Value**, **+/- Value**, **+/- %**. Includes both crypto coins and fiat balances held within crypto accounts.\n\n### Transactions\n\nBuy/sell/income/expense records across checking, savings, investment, and credit accounts: **Category**, **Date**, **Name**, **Value**, **Type**, **Account**, **Institution**, **Native Currency**, **Commission**, **Transaction Category**.\n\n\u003e Note: Only 4 categories support transactions in the Finary API (checkings, savings, investments, credits). Real estate, cryptos, and others do not have transaction endpoints.\n\n### Dividends\n\nThree sections in one sheet:\n- **Summary** — annual income, past income, projected next year, yield %\n- **Past Dividends** — investment name, amount, payment date, type, category\n- **Upcoming Dividends** — investment name, projected amount, date, status, category\n\n### Multi-Profile\n\nThe tool discovers all Finary profiles (personal + organization memberships) and exports:\n- One workbook per profile: `finary-export-{name}.xlsx` (ownership-adjusted values)\n- One unified workbook: `finary-export-unified.xlsx` (aggregated raw values across all profiles)\n\n## MCP Server — Talk to Your Portfolio\n\nFinaryExport includes an [MCP](https://modelcontextprotocol.io) server that lets you ask questions about your Finary data in plain language from any AI assistant — GitHub Copilot, Claude Desktop, or any MCP-compatible client. No API knowledge needed. Just ask.\n\n**Important:** The MCP server queries the Finary API **live** — it does NOT read from previously exported xlsx files. Every question gets fresh, real-time data. The server shares the same Core library (authentication, API client, models) as the CLI exporter but operates independently; you don't need to run an export first. Think of it this way: the CLI exporter produces xlsx snapshots, while the MCP server provides interactive, on-demand access to the same data.\n\n### What You Can Do\n\nHere are some things you can say to your AI assistant once the server is set up:\n\n**Portfolio overview**\n\u003e \"What's my total portfolio value?\"\n\u003e \"How has my portfolio performed over the last 6 months?\"\n\u003e \"Give me a breakdown of fees across all my accounts\"\n\n**Accounts \u0026 holdings**\n\u003e \"Show me all my investment accounts\"\n\u003e \"What accounts does my daughter have?\"\n\u003e \"List my holdings with their current P\u0026L\"\n\u003e \"What are my individual positions worth right now?\"\n\n**Transactions**\n\u003e \"Show me all transactions for the last month\"\n\u003e \"What buys and sells did I make this year in my brokerage account?\"\n\n**Dividends**\n\u003e \"Show me the dividends I'll receive this year\"\n\u003e \"What was my dividend income last year?\"\n\n**Allocation**\n\u003e \"How are my investments allocated by sector?\"\n\u003e \"Show me my geographical allocation\"\n\n**Multi-profile (family accounts)**\n\u003e \"Switch to my daughter's profile and show me her transactions\"\n\u003e \"What profiles are available?\"\n\u003e \"Switch to the kids' account\"\n\nThe AI assistant figures out which data to fetch — you just describe what you want to know.\n\n### Setup\n\nAdd this to your MCP configuration file and restart your client:\n\n- **GitHub Copilot (CLI or VS Code):** `~/.copilot/mcp-config.json` or `.vscode/mcp.json`\n- **Claude Desktop:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"finary\": {\n      \"type\": \"stdio\",\n      \"command\": \"dotnet\",\n      \"args\": [\"run\", \"--project\", \"src/FinaryExport.Mcp\"]\n    }\n  }\n}\n```\n\n\u003e **Tip:** You can replace `dotnet run --project ...` with the path to a published executable for faster startup.\n\n### Authentication\n\nThe first time you use a Finary tool, the assistant will prompt you for your **email**, **password**, and **TOTP code** (if you have 2FA enabled). Your credentials are used once to log in and are never saved. The session token is encrypted with DPAPI and stored locally at `~/.finaryexport/session.dat`, so you won't need to log in again until the session expires.\n\nIf you've already used the CLI exporter, the MCP server picks up your existing session automatically — no extra login required.\n\n\u003e **Note:** If your MCP client doesn't support interactive prompts (elicitation), run the CLI exporter once first (`dotnet run --project src/FinaryExport -- export`) to create the session file.\n\n### Multi-Profile\n\nIf you have a family account with multiple profiles (e.g., personal + kids), just ask the assistant to switch:\n\n\u003e \"Switch to my daughter's profile\"\n\nThe assistant discovers all your available profiles automatically. All subsequent questions use the selected profile until you switch again.\n\n### Tool Reference\n\n\u003cdetails\u003e\n\u003csummary\u003eAvailable tools (for developers and advanced users)\u003c/summary\u003e\n\nThe server exposes 16 read-only tools. Most accept an optional `period` parameter (`all`, `1d`, `1w`, `1m`, `3m`, `6m`, `1y`, `5y`).\n\n| Tool | What it does |\n|------|-------------|\n| `get_user_profile` | Authenticated user's profile info (name, email, currency) |\n| `get_profiles` | Lists all available profiles (personal + org memberships) |\n| `set_active_profile` | Switches the active profile for subsequent queries |\n| `get_portfolio_summary` | Total portfolio valuation, gross/net, period performance |\n| `get_portfolio_timeseries` | Historical portfolio value over time |\n| `get_portfolio_fees` | Fee analysis: annual, cumulated, potential savings |\n| `get_accounts` | Accounts for a specific asset category |\n| `get_all_accounts` | Accounts across all asset categories |\n| `get_category_timeseries` | Historical value for a specific category |\n| `get_transactions` | Transactions for a category (checkings, savings, investments, credits) |\n| `get_all_transactions` | Transactions across all supported categories |\n| `get_holdings` | Investment holdings with security positions and balances |\n| `get_account_positions` | Individual positions (securities, crypto, or fiat) within a specific account, category-aware |\n| `get_crypto_holdings` | All crypto + fiat positions across all crypto accounts with logo URLs and totals |\n| `get_dividends` | Dividend summary: annual income, yield, past and upcoming |\n| `get_geographical_allocation` | Portfolio allocation by region |\n| `get_sector_allocation` | Portfolio allocation by economic sector |\n\n\u003c/details\u003e\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsailro%2Ffinaryexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsailro%2Ffinaryexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsailro%2Ffinaryexport/lists"}