Skip to content

Repository files navigation

Invormed MCP Server

npm License: MIT MCP

Give Claude access to your investment portfolio. 7 read-only tools for portfolio analysis, allocation tracking, and trade history — powered by Invormed.

Read-only. Claude can view your portfolio data but cannot create, modify, or delete anything.

Disclaimer

This software is provided for informational purposes only and does not constitute financial advice. ALDR Ltd is not authorised or regulated by the Financial Conduct Authority (FCA). Users are responsible for their own investment decisions. No portfolio data is transmitted to or stored by the developer when running locally. This software is provided "as is" without warranty of any kind — see the MIT License for details.

Quick Start

  1. Get your API key from invormed.com/settingsMCP Access
  2. Run:
npx invormed-mcp inv_your_api_key_here

This adds the Invormed MCP server to your project's .mcp.json. Restart Claude Code to connect.

Options

npx invormed-mcp inv_abc123 --global   # Add to ~/.claude.json (all projects)
npx invormed-mcp --remove              # Remove the configuration

Manual Setup

Claude Code

Add to .mcp.json in your project root (or ~/.claude.json for global):

{
  "mcpServers": {
    "invormed": {
      "type": "url",
      "url": "https://invormed.com/api/mcp?key=inv_your_api_key_here"
    }
  }
}

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "invormed": {
      "type": "url",
      "url": "https://invormed.com/api/mcp?key=inv_your_api_key_here"
    }
  }
}

Claude.ai

Connect via the MCP integration panel — add a URL-based server pointing to https://invormed.com/api/mcp?key=inv_your_api_key_here.

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "invormed": {
      "type": "url",
      "url": "https://invormed.com/api/mcp?key=inv_your_api_key_here"
    }
  }
}

Tools

Tool Description
list_portfolios List all portfolios with total values and holding counts
get_portfolio_summary Detailed summary: top holdings, section breakdown, total value
get_holdings_breakdown Group holdings by section, account, or theme
get_budget_remaining Budget utilisation across sections, accounts, and themes
get_holding_detail Full detail for a single holding with allocation and targets
search_holdings Search by name or ticker to find holding IDs
get_holding_trades Trade history (buy/sell) for a specific holding

Example: Portfolio Overview

You: "What's in my portfolio?"

Claude calls: list_portfolios → get_portfolio_summary

Response: "Your Main Portfolio is worth £45,230 across 23 holdings.
Top holdings: Vanguard FTSE All-World (18.2%), iShares Core MSCI World (12.1%)..."

Example: Allocation Analysis

You: "How am I allocated across themes?"

Claude calls: get_holdings_breakdown(portfolioId, "theme")

Response: "Global Equity: 45.3% (£20,489), UK Equity: 22.1% (£9,996),
Bonds: 18.4% (£8,322), Cash: 14.2% (£6,423)"

Example: Holding Deep Dive

You: "Tell me about my Vanguard position"

Claude calls: search_holdings → get_holding_detail → get_holding_trades

Response: "Vanguard FTSE All-World (VWRP.L) — £8,234 (18.2% of portfolio).
Target: 20%, currently 1.8% under-allocated (£814 below target).
4 trades: 3 buys averaging £89.50/unit, 1 sell..."

Architecture

┌─────────────────────────────┐
│ Claude (Code/Desktop/Web)   │
│ MCP Client                  │
└─────────┬───────────────────┘
          │ Streamable HTTP
          ▼
┌─────────────────────────────┐
│ invormed.com/api/mcp        │
│ Next.js API Route           │
│ WebStandardStreamableHTTP   │
└─────────┬───────────────────┘
          │
          ▼
┌─────────────────────────────┐
│ Firebase                    │
│ Auth + Firestore            │
│ users/{uid}/portfolios/*    │
│ users/{uid}/accounts/*      │
└─────────────────────────────┘
  • Transport: Streamable HTTP (stateless — each request creates a fresh server instance)
  • Auth: API key via ?key= query param (hashed, looked up in Firestore apiKeys collection), with Firebase ID token and DEV_UID fallbacks
  • Data: Firestore — portfolios, accounts (with holdings and trades subcollections)

Self-Hosting

The server/ directory contains the full MCP server source. To self-host:

  1. Set up a Firebase project with Firestore
  2. Copy the server/ files into your Next.js project
  3. Configure environment variables (see .env.example)
  4. Deploy the route handler at your preferred path

Environment Variables

Variable Required Description
FIREBASE_SERVICE_ACCOUNT_KEY Yes JSON string of Firebase service account
FIRESTORE_PROJECT_ID Yes Firebase project ID
DEV_UID No Local dev bypass — set to your Firebase UID

Firestore Schema

users/{uid}/
  portfolios/{portfolioId}     → { name, type, lists, settings, budgets }
  accounts/{accountId}         → { name, provider, taxWrapper }
    holdings/{holdingId}       → { name, ticker, price, qty, section, theme, ... }
    trades/{tradeId}           → { holdingId, type, date, price, qty }

Data & Security

  • Read-only: All 7 tools only read data — no writes, no deletions
  • API key auth: Keys are SHA-256 hashed before storage — the raw key is never persisted
  • User-scoped: Each request is scoped to a single authenticated user via their API key
  • Revocable: API keys can be deactivated from the settings page at any time
  • No secrets in source: All credentials are in environment variables
  • UK-focused: Designed for UK investors (ISA/SIPP/GIA accounts, GBP base currency)

License

MIT

About

Give Claude access to your investment portfolio via MCP. 7 read-only tools for portfolio analysis.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages