Skip to main content
Glama
parqet-broker

parqet-broker

by joednemesis

Deutsch | English

Parqet MCP Broker

A lightweight Flask-based broker that acts as a Model Context Protocol (MCP) intermediary between the Parqet portfolio tracking platform and a locally running LLM in LM Studio. It handles OAuth 2.0 authentication with Parqet, maintains a persistent MCP session, and exposes a local MCP server that LM Studio can connect to — enabling natural language queries about your investment portfolios.

Status Dashboard


šŸ“ø Screenshots

Status Dashboard

The browser UI shows the current OAuth token and Parqet session status, plus a live log of all tool calls made by LM Studio.

Status Dashboard

LM Studio Integration

All five Parqet tools are available directly in LM Studio's chat interface.

LM Studio Tools


Related MCP server: stonex-mcp

šŸ›  Project Structure

parqet-mcp-broker/
│
ā”œā”€ā”€ app_mcp_real.py       # Main application – Flask broker
ā”œā”€ā”€ verifier.txt          # Temporary PKCE verifier (auto-generated)
ā”œā”€ā”€ requirements.txt      # Python dependencies
ā”œā”€ā”€ README.de.md
└── README.md

Key components inside app_mcp_real.py:

Component

Description

get_parqet_session()

Builds an authenticated requests session for Parqet MCP

ensure_parqet_initialized()

Lazily initializes the Parqet MCP session on first use

call_parqet_tool()

Proxies tool calls to Parqet, with automatic session recovery

MCP_TOOLS

Tool definitions exposed to LM Studio (name, description, inputSchema)

mcp_server()

The /mcp endpoint – MCP server for LM Studio (GET/SSE + POST/JSON-RPC)

login() / callback()

OAuth 2.0 Authorization Code flow with PKCE

index()

Browser status dashboard with live tool call log


šŸ“– Background & API Reference

The Parqet Connect API and Parqet MCP Server allow developers to programmatically access portfolio data. This broker uses the MCP server at https://mcp.parqet.com and authenticates via OAuth 2.0 through Parqet Connect.

Useful links:

Exposed MCP Tools:

Tool

Description

parqet_list_portfolios

Lists all portfolios with id, name, currency and broker info. Always call first.

parqet_get_user

Returns user info (userId, state, permissions).

parqet_get_portfolio

Returns basic metadata for a single portfolio.

parqet_get_activities

Returns transactions with optional filters (type, asset, holding, pagination).

parqet_get_performance

Primary analysis tool. Returns holdings with names, XIRR, TTWROR, gains, dividends and valuations. Supports relative and absolute time intervals.


šŸ“¦ Installation & Setup

Prerequisites

  • Python 3.9+

  • A Parqet account

  • A Parqet Developer integration (Client ID + Redirect URI configured)

  • LM Studio with a tool-capable model (recommended: Qwen3-14B-GGUF with context length set to 32768)

1. Clone the repository

git clone https://github.com/joednemesis/parqet-mcp-broker.git
cd parqet-mcp-broker

2. Install dependencies

pip install flask requests

Or with a requirements file:

pip install -r requirements.txt

3. Configure your Client ID

Open app_mcp_real.py and replace the placeholder with your own Client ID from the Parqet Developer Console:

CLIENT_ID = "your-client-id-here"

Make sure your integration has http://localhost:3000/callback configured as a Redirect URI.

4. Configure LM Studio

Add the broker as an MCP server in LM Studio's mcp.json:

{
  "mcpServers": {
    "parqet-broker": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

Set the model's context length to at least 16384 (32768 recommended) to handle full Parqet API responses without truncation.


🚦 Usage

1. Start the broker

python app_mcp_real.py

The broker starts at http://localhost:3000.

2. Authenticate

Open http://localhost:3000 in your browser and click Start Authentication. You will be redirected to Parqet to authorize access. After login, the OAuth token is stored in memory and the status dashboard will confirm the connection.

3. Connect LM Studio

Enable the parqet-broker MCP server in LM Studio and load a tool-capable model. Start a new chat and ask questions like:

  • "Which portfolios do I have?"

  • "Show me the holdings and current value of my Trade Republic portfolio."

  • "How much dividend income did I receive this year?"

  • "What is my annualized return across all portfolios?"

  • "Show me all my stock purchases in the last 3 months."

You are a financial assistant with access to Parqet portfolio data via MCP tools.

Rules:
1. Call parqet_list_portfolios ONCE to retrieve portfolio IDs.
2. Then call the appropriate tool ONCE with the retrieved ID.
3. Answer immediately after – no further tool calls needed.
4. Only output data you received directly from the tools.
5. Never invent names, prices or any financial information.
6. If something is not in the tool data, state: "This information is not available."

šŸ”’ Security Notes

  • The OAuth token is stored in memory only and is lost when the Flask process restarts. Re-authentication via the browser is required after each restart.

  • The PKCE verifier is written to verifier.txt temporarily during the OAuth flow. This file should not be committed to version control (add it to .gitignore).

  • The Client ID is hardcoded in the current prototype version. For production use, move it to an environment variable or config file.

  • No data is persisted – the activity log and token exist only for the lifetime of the running process.

  • All communication with Parqet uses HTTPS/TLS. The local MCP server (http://localhost:3000) is intended for local use only and should not be exposed to the public internet.


Note: This is a prototype project built for educational and personal use. It is not officially affiliated with Parqet Fintech GmbH or LM Studio. Use it at your own risk. Always review the Parqet Terms of Service before building applications on top of their API.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    • Build and backtest investing strategies from your AI assistant. Remote MCP with OAuth sign-in.

      https://tactfolio.com/mcp
    • 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
    • Personal finance for AI agents — onboard, import statements, categorize & budget over MCP.

      https://wimm.my/api/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.

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      MCP server that enables AI assistants to answer portfolio questions about a wealthAPI account, with read-only tools for accounts, transactions, investments, dividends, and market data.
      21
      450 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server exposing StoneX Client REST API endpoints as tools, enabling account balances, positions, activity, and performance retrieval via natural language. Requires a user-supplied access token or session cookie.
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to read and write a self-hosted portfolio tracker through 25 MCP tools, covering net worth, flows, forecasts, decisions, and audit.
      4
      Apache 2.0
    • 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.
      -