JSPM

@wirux/mcp-wealthfolio

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 205
  • Score
    100M100P100Q71286F
  • License MIT

MCP server for Wealthfolio โ€” read-only portfolio analysis and advisory rebalancing for LLM clients

Package Exports

  • @wirux/mcp-wealthfolio
  • @wirux/mcp-wealthfolio/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wirux/mcp-wealthfolio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿ’ฐ MCP Wealthfolio

MCP server for Wealthfolio โ€” portfolio analysis and advisory rebalancing for LLM clients.

npx and connect your self-hosted portfolio tracker to any AI assistant. Read-only by default. Multi-currency. Rebalancing built-in.

CI/CD npm version Docker License: MIT TypeScript Node.js MCP Tests


๐Ÿ’ก Why this server?

TL;DR โ€” One npx command. Read-only by default. Multi-currency. Advisory rebalancing. No trade execution.

Differentiator Details
๐Ÿ”’ Read-only by default 12 of 13 tools are strictly read-only. No trade execution, no deletions. Only sync_prices can trigger market data updates.
๐ŸŒ Multi-currency native Handles portfolios across diverse currencies with automatic base-currency conversion and live exchange rates.
โš–๏ธ Advisory rebalancing Compute deltas to reach target allocation with structured JSON recommendations โ€” no guesswork, no manual math.
๐Ÿ“Š Deep analytics Per-lot cost basis, unrealized gains, TWR performance, dividend streams, allocation breakdowns by class/sector/currency.
๐Ÿณ Docker ready Fully containerized, optimized for deployment alongside your Wealthfolio instance. Stdio or HTTP transport.
๐Ÿ›๏ธ Clean Architecture Domain-driven design with strict layer separation, Zod validation, and comprehensive test coverage.

๐Ÿ–ฅ๏ธ Claude Desktop ยท ๐Ÿค– Claude Code ยท ๐Ÿ”ง Any MCP Client


โœจ Features

Feature Description
๐Ÿ›ก๏ธ Secure by design Loopback-only HTTP, credential scrubbing, Docker secrets support, error masking
๐Ÿ’ฑ Exchange rates Live rates for multi-currency valuation and conversion
๐Ÿ“ˆ Performance metrics Total return, TWR, gain/loss for any date range with history time series
๐Ÿ“‹ Transaction history Flexible filtering, pagination, keyword search across all activities
๐Ÿ’ธ Dividend tracking Filter by account and year for income yield analysis
๐Ÿ”„ Price sync Trigger incremental market data updates directly from agent context
๐Ÿ“ก Dual transport Stdio (local pipe) or streamable HTTP (network/cloud)
โœ… Zod validation Strict schema validation for all inputs and configuration

๐Ÿ› ๏ธ MCP Tools

13 specialized tools for granular access to your investment data:

Tool Description Key Parameters
๐Ÿ“‹ list_accounts List all investment accounts โ€” discover account IDs, names, types โ€”
๐Ÿ’ผ get_holdings Current positions with market values and quantities account_id
๐Ÿ” get_holding_detail Detailed holding: cost basis, unrealized gain/loss, quantity account_id, asset_id
๐Ÿฅง get_allocation Allocation breakdown by asset class, sector, currency account_id
๐Ÿ“ˆ get_performance_summary Performance summary: total return, TWR, gain/loss metrics from, to
๐Ÿ“‰ get_performance_history Performance time series for portfolio or benchmark item_type, item_id, start_date, end_date
๐Ÿ“ get_activities Search activities with pagination, type filters, keyword search account_id, activity_types, symbol_keyword, page
๐Ÿ’ธ get_dividends Dividend activities filtered by account and/or year account_id, year
๐Ÿ’ฐ get_net_worth Current net worth aggregated across all accounts โ€”
๐Ÿ’ฑ get_exchange_rates Current exchange rates for multi-currency valuation โ€”
๐Ÿฅ get_health Health check โ€” confirm Wealthfolio is reachable โ€”
๐Ÿ”„ sync_prices Mutating: Trigger incremental market price sync โ€”
โš–๏ธ compute_rebalancing Compute rebalancing plan with target weights and optional cash target_weights, cash_to_invest

All tools except sync_prices are read-only.


๐Ÿš€ Quick Start

๐Ÿ“ฆ Using npx

export WEALTHFOLIO_URL="http://your-wealthfolio:8088"
export WEALTHFOLIO_PASSWORD="your-secure-password"

npx -y @wirux/mcp-wealthfolio

๐Ÿ”Œ Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "wealthfolio": {
      "command": "npx",
      "args": ["-y", "@wirux/mcp-wealthfolio"],
      "env": {
        "WEALTHFOLIO_URL": "http://localhost:8088",
        "WEALTHFOLIO_PASSWORD": "your-password",
        "MCP_TRANSPORT_TYPE": "stdio"
      }
    }
  }
}

๐Ÿณ Docker

docker run -d \
  --name mcp-wealthfolio \
  -p 3000:3000 \
  -e WEALTHFOLIO_URL=http://wealthfolio:8088 \
  -e WEALTHFOLIO_PASSWORD=your-secret-password \
  -e WEALTHFOLIO_ALLOW_INSECURE=true \
  -e MCP_TRANSPORT_TYPE=http \
  -e PORT=3000 \
  ghcr.io/wirux/mcp-wealthfolio:latest

Or use Docker Compose:

docker compose up -d

The included docker-compose.yml uses HTTP transport on port 3000. Set WEALTHFOLIO_PASSWORD in a .env file or export it before running.


๐ŸŒ Transport Modes

Mode Use case How it works
๐Ÿ“ก stdio (default) Local MCP clients (Claude Desktop) Reads/writes stdin/stdout; most secure, no network ports
๐ŸŒŠ http Network/cloud deployments Streamable HTTP server; clients connect over the network
# HTTP mode
MCP_TRANSPORT_TYPE=http PORT=3000 npx @wirux/mcp-wealthfolio

โš™๏ธ Configuration

Variable Required Default Description
WEALTHFOLIO_URL No http://127.0.0.1:8088 Base URL of your Wealthfolio instance
WEALTHFOLIO_PASSWORD Yes* โ€” Wealthfolio web-mode password
WEALTHFOLIO_PASSWORD_FILE No โ€” Path to password file (Docker Secrets)
WEALTHFOLIO_ALLOW_INSECURE No false Allow HTTP to non-loopback addresses
MCP_TRANSPORT_TYPE No stdio Transport: stdio or http
PORT No 3000 HTTP server port (http mode only)
LOG_LEVEL No info Verbosity: trace debug info warn error

*Required if Wealthfolio is password-protected. WEALTHFOLIO_PASSWORD_FILE takes precedence over WEALTHFOLIO_PASSWORD.


๐Ÿ—๏ธ Architecture

Clean Architecture with strict inward dependency direction:

src/
โ”œโ”€โ”€ domain/          ๐Ÿ”ท Entities, value objects, ports (interfaces), domain errors
โ”œโ”€โ”€ use-cases/       ๐Ÿ”ถ Application services orchestrating domain logic
โ”œโ”€โ”€ infrastructure/  ๐ŸŸข Adapters: Wealthfolio HTTP client, auth, config, cache
โ””โ”€โ”€ presentation/    ๐ŸŸฃ MCP tool bindings, zod schemas, transport (stdio/HTTP)
Layer May import from Must NOT import from
Domain nothing use-cases, infrastructure, presentation
Use Cases domain infrastructure, presentation
Infrastructure domain use-cases, presentation
Presentation domain, use-cases infrastructure directly

๐Ÿงช Testing

300+ tests across all layers, maintaining โ‰ฅ80% coverage overall and 100% on domain logic.

npm test              # Run all tests
npm run test:watch    # Watch mode
npm run test:coverage # Coverage report (โ‰ฅ80% required)
npm run lint          # tsc --noEmit

Tests use mocked ports for unit tests, recorded API fixtures for integration, and InMemoryTransport.createLinkedPair() for E2E.


๐Ÿ”’ Security

Protection Details
๐Ÿ›ก๏ธ Minimal surface area 12/13 tools are read-only. No trade execution or destructive operations.
๐Ÿ” Secure credentials Docker secrets support. No credentials in env or process listings.
๐ŸŒ Network security Loopback-only HTTP by default. Explicit opt-in for non-localhost.
๐Ÿšซ No sensitive logging Tokens and passwords scrubbed. Logs to stderr only.
๐Ÿ›‘ Path traversal guard Password file paths validated against ../ attacks.
๐ŸŽญ Error masking Internal details never exposed in MCP error messages.

See SECURITY.md for vulnerability reporting.


๐Ÿšข CI/CD & Release

Workflow Trigger What it does
PR Check Pull request to main Lint โ†’ Build โ†’ Test
Release Push to main Lint โ†’ Test โ†’ Semantic Release (NPM + GitHub Release) โ†’ Docker build & push

๐Ÿค Contributing

We welcome contributions! Before submitting a PR:

  • Follow the Clean Architecture layer rules
  • Add unit tests for new logic
  • Pass npm run lint and npm test
  • Use conventional commits (feat:, fix:, etc.)
  • Update docs if introducing new config or tools

๐Ÿ“„ License

MIT