Skip to main content
Glama
wealthapi-mcp

wealthapi-mcp

Official
by wealthAPI-eu

wealthapi-mcp

A small Model Context Protocol (MCP) server that lets Claude (or any MCP-compatible assistant) answer everyday portfolio questions about your wealthAPI account:

"What did I spend the most money on last month?" "How is my portfolio performing this year?" "Show me my five biggest positions." "Which of my investments lost the most value?"

It runs locally on your machine. Your bearer token never leaves your computer.

What is an MCP server?

MCP is an open protocol that lets an AI assistant call tools you control. The assistant runs in one process (e.g. Claude Desktop); the MCP server runs as a separate process you launch. They talk to each other over stdio using JSON-RPC: the assistant writes a tools/call message to the server's stdin, the server runs the tool and writes the result back to its stdout. That's the whole protocol.

Note the distinction: this is an MCP server, not an MCP plugin. There is no such thing as an MCP plugin — plugins (e.g. Claude Code plugins) extend the assistant itself, while an MCP server is a standalone process the assistant connects to over the protocol. Any MCP-compatible client (Claude Desktop, Claude Code, others) can use this server.

Concretely, this repo is a Node script. When Claude Desktop starts it, the script registers its tools, waits for tool calls, and when one arrives, makes an HTTPS request to the wealthAPI REST API on your behalf and returns a text summary. No state, no database, no server to maintain.

Read more at https://modelcontextprotocol.io.

Related MCP server: t212-mcp

The tools

Auth is a wealthAPI API token (wapi_key_…) carrying the read scopes (accounts:read, investments:read, transactions:read, profile:read). All tools are read-only.

Accounts & cash flow

Tool

Wraps

Answers

list_accounts

GET /api/v1/accounts

"What accounts do I have?"

get_account_balances

GET /api/v1/accounts/balances

"Show my cash balance history"

get_portfolio_valuation

GET /api/v1/accounts/valuation (+ historicValuations)

"What is my portfolio worth (today / over time)?"

list_transactions

GET /api/v1/transactions

"What did I spend most on last month?"

detect_recurring_transactions

GET /api/v1/transactions

"What subscriptions / fixed costs do I have?"

list_bookings

GET /api/v1/bookings

"Show my buys / sells / dividends"

get_cash_flow_summary

GET /api/v1/cashFlowAnalytics/history

"Income vs spending per month"

get_savings_rate

GET /api/v1/cashFlowAnalytics/history

"What's my savings rate?"

Portfolio & performance

Tool

Wraps

Answers

list_investments

GET /api/v2/investments

"What do I own and what is it worth?"

get_gainers_and_losers

GET /api/v1/investments/gainersAndLosers

"Best / worst performers"

get_portfolio_performance

POST /api/v2/performance

"How did my portfolio do this year?"

get_portfolio_allocation

GET /api/v1/investments

"How diversified am I by region / sector / asset type?"

get_risk_metrics

GET /api/v1/riskYieldMetrics (+ /investments)

"How risky is my portfolio?"

get_realized_gains

GET /api/v1/performance/realizedGains

"What did I realize this year?" (tax season)

Dividends

Tool

Wraps

Answers

get_dividend_history

GET /api/v1/dividends/history

"How much dividend income did I get per year / month?"

get_dividend_calendar

GET /api/v1/dividends/calendar

"When are my next dividend payments?"

get_portfolio_yield

GET /api/v1/dividends/portfolioYield

"What's my dividend yield?"

Market data & profile

Tool

Wraps

Answers

search_symbols

GET /api/v2/symbols

"Find Apple / this ISIN"

get_quotes

GET /api/v2/quotes

"What's the current price?"

get_security_fundamentals

GET /api/v1/fundamentals/{isin} (+ /statistics)

"Is this stock expensive?" (P/E, P/B, F-Score)

whoami

GET /api/v1/users/myself

"Which account is this?"

The server also registers prompts (monthly_review, savings_rate_check, subscription_audit, fixed_costs_summary, financial_health_check) that chain these tools into guided analyses.

Tool registration is gated by SUPPORTED_TOOLS/SUPPORTED_PROMPTS in src/server.ts — remove a name there to disable it without deleting code.

Install

You need Node 20+ and pnpm.

git clone git@github.com:wealthAPI-eu/wealthapi-mcp.git
cd wealthapi-mcp
pnpm install
pnpm build

Get a personal bearer token from wealthAPI (your account → API settings).

Add the server to Claude Desktop's config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "wealthapi": {
      "command": "node",
      "args": ["/absolute/path/to/wealthapi-mcp/build/index.js"],
      "env": {
        "BEARER_TOKEN": "paste-your-token-here"
      }
    }
  }
}

Restart Claude Desktop. The active tools will appear in the tools panel of any chat, and you can ask portfolio questions in plain English.

Use as a library

A Node backend can import the tools and run them in its own process, without stdio:

import { connectTools } from "@wealth_api/mcp-server";

const connection = await connectTools({ baseUrl: "https://wealthapi.eu/api", token });

connection.tools;
await connection.call("list_accounts", {});
await connection.close();
  • tools lists each tool's name, description and inputSchema (JSON Schema).

  • call returns { text, isError }.

  • Each connectTools call has its own token, so one backend can serve many users.

  • Take baseUrl from your configuration, never from a request: the token is sent there.

  • The library does not check the token; check it before you call a tool.

How to add a new tool

The canonical example lives in src/tools/accounts.ts — list_accounts is ~50 lines and shows the whole pattern.

  1. Create or open the relevant file under src/tools/ and write a register*Tools(server, client) function that calls server.registerTool(...). Each call takes a name, a { description, inputSchema } object (Zod for the input schema), and an async handler that returns { content: [{ type: "text", text }] }.

  2. Import and call your register*Tools from src/server.ts.

  3. pnpm build and restart Claude Desktop.

That's it. No code generation, no registration files, no boilerplate.

Layout

src/
  index.ts          Command entry: starts the server over stdio
  server.ts         createServer: McpServer + register*Tools(...), tool and prompt allowlists
  library.ts        connectTools: the tools in-process, for use from another backend
  config.ts         For the command only: BEARER_TOKEN from env, production API base URL
  api/
    client.ts       fetch wrapper: takes token and base URL; GET/POST, query strings, retry on 5xx/429
    types.ts        TS interfaces for API response shapes
  tools/
    accounts.ts     list_accounts, get_account_balances, get_portfolio_valuation
    allocation.ts   get_portfolio_allocation
    cash-flow.ts    get_cash_flow_summary, get_savings_rate, detect_recurring_transactions
    dividends.ts    get_dividend_history, get_dividend_calendar, get_portfolio_yield
    investments.ts  list_investments, get_gainers_and_losers
    performance.ts  get_portfolio_performance, get_realized_gains
    risk.ts         get_risk_metrics
    securities.ts   search_symbols, get_quotes, get_security_fundamentals
    transactions.ts list_transactions, list_bookings
    user.ts         whoami
  util/
    logger.ts       Pino → stderr (stdout is reserved for MCP)
    format.ts       formatCurrency, formatDate, formatTable
test/
  library.test.ts   connectTools: tool list, token and base URL
  api/
    client.test.ts  Vitest unit test for the query-string builder
  tools/
    *.test.ts       Unit tests for the pure aggregation helpers and the percent output

Run tests

pnpm test

Available Tools

21 tools
detect_recurring_transactionsA

List transactions flagged as regular (salary, rent, subscriptions, standing orders). Grouped by counterpart and direction, with detected payment interval (in months) and average amount. Use this to answer 'what subscriptions do I have?' or 'what are my fixed costs?'.

Inputs: maxDate, minDate, perPage, accountId, +1 more.

get_account_balancesA

Get balance history for one or more cash accounts over a date range. Works only with cash accounts (type '02_cash'), not depots.

Inputs: id (required), to, from.

get_cash_flow_summaryA

Monthly income vs. spending for the user's cash accounts. Answers 'how much did I earn and spend?' over a period. Inflows are positive, outflows positive (spending), net = income − spending.

Inputs: from (required), to, accountId, excludeTransfers.

get_dividend_calendarA

Get this year's dividend calendar for current holdings: expected and received payouts with dates, amounts and yields. Use this for 'when are my next dividend payments?'.

Inputs: accountIds (required).

get_dividend_historyA

Get dividend income per year (gross and net), with a per-month breakdown for the current year. Use this for 'how much dividend income did I get in 2024?'.

Inputs: accountIds (required), cutoffDate.

get_gainers_and_losersA

Get the top gainers or losers — either by today's change or by total return since purchase. Use this for 'best/worst performers'.

Inputs: mode (required), max, accountId.

get_portfolio_allocationA

Break down the portfolio's market value by region, industry sector, or asset type. Use this for 'how diversified am I?' and 'what's my US exposure?'.

Inputs: dimension (required), accountIds.

get_portfolio_performanceA

Get TWROR (time-weighted rate of return) timeseries for the portfolio over a date range. Use this to answer 'how did my portfolio perform this year / last 5 years?'.

Inputs: startDate (required), accountIds (required), endDate, interval.

get_portfolio_valuationA

Get the current total value of one or more depots, and optionally its history when 'from' is given. Use this for 'what is my portfolio worth (today / over time)?'.

Inputs: accountIds (required), from, interval, includeCash.

get_portfolio_yieldA

Get the portfolio's dividend yield per year (on current value and on invested capital) plus the dividend CAGR. Use this for 'what's my dividend yield?'.

Inputs: accountIds (required), cagrYears, calculationType.

get_quotesA

Get current quotes (last price, daily change) for securities by security ID. Get the IDs from search_symbols first.

Inputs: securityIds (required), quoteProvider (required), preferredCurrency.

get_realized_gainsA

Get realized gains per year, split into trading, dividend, interest and other gains (gross and net, plus tax refunds). Use this for 'what did I realize this year?' and tax questions.

Inputs: accountIds (required).

get_risk_metricsA

Get annualized risk (volatility) and return metrics — for the whole portfolio, or per investment with breakdown=true. Use this for 'how risky is my portfolio?'.

Inputs: from, depotIds, interval, breakdown, +1 more.

get_savings_rateA

Compute the user's savings rate over a period: (income − spending) / income, expressed as a percentage. Uses cash flow analytics. Higher is better; negative means the user spent more than they earned.

Inputs: from (required), to, accountId, excludeTransfers.

get_security_fundamentalsA

Get master data and valuation fundamentals (P/E, P/B, P/S, F-Score) for a security by ISIN. Use this for 'tell me about this holding' or 'is this stock expensive?'.

Inputs: isin (required).

list_accountsA

List all of the user's accounts with their bank: depots (where investments live), cash accounts, insurance, etc. Start here when you need to know which accounts exist before drilling in.

Inputs: no named parameters.

list_bookingsA

List investment bookings: buys, sells, dividends, splits. Use this to see the trade history for a specific security or depot.

Inputs: isin, type, maxDate, minDate, +2 more.

list_investmentsA

List the user's investment holdings (stocks, funds, bonds, ETFs). Returns name, ISIN, type, depot ID, lots, market value and gain/loss. Use this for 'what do I own?' and 'show me my biggest positions'.

Inputs: depotId, includeHistoric.

list_transactionsA

List cash transactions (deposits, withdrawals, fees, interest, transfers). Results are sorted by amount (largest absolute value first), so the top rows answer 'what did I spend most money on?'.

Inputs: type, maxDate, minDate, perPage, +1 more.

search_symbolsA

Search securities by name, ISIN or WKN. Returns the security ID and quote provider needed by get_quotes. Use this to resolve 'Apple' or an ISIN to a tradable security.

Inputs: types, search, isinOrWkn, maxPerAssetType.

whoamiA

Show which wealthAPI user this session is acting as (name, email, member since). Use this to ground yourself or when the user asks 'which account is this?'.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools occupy clearly distinct resource+action slots (accounts vs. investments vs. transactions vs. bookings, dividend history vs. calendar vs. yield), and descriptions explicitly name the question each answers. The only soft overlaps are the cluster of portfolio analytics tools (valuation, performance, allocation, risk) and list_transactions vs. list_bookings, which an agent can separate but must read carefully.

    Naming Consistency4/5

    Almost all names follow a clear verb_noun snake_case pattern (get_portfolio_*, get_dividend_*, list_*, search_symbols, detect_recurring_transactions), and related tools share prefixes that group them readably. The lone outlier is 'whoami', which breaks the pattern but is a widely recognized convention.

    Tool Count4/5

    21 tools is on the heavy side of the 3-15 sweet spot, but the domain genuinely spans accounts, holdings, cash flow, dividends, performance, tax, and market data, and each tool maps to a distinct analytical question. Nothing looks like filler, though the surface is broad enough that a lighter grouping (e.g. combined dividend tools) could reduce it.

    Completeness4/5

    Coverage is strong for a read-only wealth analytics API: account/holding discovery, balances, valuation, allocation, cash flow, savings rate, recurring detection, three dividend views, gains, tax, risk, performance, transactions, bookings, quotes, symbol search, fundamentals, and user identity. Gaps are minor: no per-security price history beyond a current quote, no watchlist or order/transaction-level detail by ID, and no account-level detail tool separate from list_accounts.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    • MCP server exposing the Backtest360 engine API as tools for AI agents.

      https://mcp.backtest360.com/mcp
    • Trading MCP server for AI agents, with live market data, account reads and controlled execution.

      https://mcp.fensory.com/mcp
    • Research US-listed companies and funds with the StockPortfolio.pro MCP server. Tools cover SEC filing-grounded financials, filing timelines, company comparisons, watchlist screens, fund profiles, and cited filing questions. Filed figures include their fiscal period and EDGAR source URL; missing filing data is returned as null. Public tools work without authentication; optional API-key or OAuth access is supported. US-listed, USD-reporting companies only. Keyless access includes 3 free AI questions per rolling 30-day window. To get more now, choose the Dev plan ($19.99/month, 200 credits) at https://www.stockportfolio.pro/register?plan=dev, then follow https://www.stockportfolio.pro/docs/api-mcp to connect with OAuth or an API key. Or wait for the free allowance to renew.

    • Connect Claude, ChatGPT, Codex, Claude Code or another MCP client to your real multi-broker investment portfolio. Fortunest tracks stocks, ETFs and crypto across brokers and exchanges; its MCP server lets your agent read holdings, returns, allocation, risk, trades and tax lots, calculated by Fortunest rather than guessed by the model. Reads run on their own; every change waits for your approval in the Fortunest app, and no tool places an order or moves money. Sign-in is OAuth 2.1 and needs Fortunest Pro (14-day trial, no card). A free demo that needs no account is listed as Fortunest demo.

      https://app.fortunest.ai/mcp

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A read-only MCP server that provides access to Charles Schwab account data and market information, including portfolio positions, real-time quotes, options chains, price history, and account balances through AI assistants.
      9
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A read-only MCP server for Trading 212 accounts, enabling AI assistants to query balances, positions, orders, dividends, pies, and instruments without trading capabilities.
      12
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that exposes personal financial data — transaction ledger, portfolio holdings, live/historical market prices, and quantitative risk metrics — as standardized tools, resources, and prompts, enabling natural language reasoning over real computed numbers.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server that exposes Interactive Brokers and Moomoo brokerage accounts as tools, enabling natural-language queries across positions, trade history, realized P&L, and sector exposure in one merged view.
      -