Skip to content
Agentmart
Submit a tool

openInvest

Investment runtime for AI agents — LLM investment committee, portfolio ledger, decision accounting

Connector by longsizhuo · GitHub account verified by the MCP Registry

IndexedMITLocal (stdio)★ 133
Write a review

Install

Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.

npx agentmarket install connector/longsizhuo-openinvest

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Investment runtime for AI agents — LLM investment committee, portfolio ledger, decision accounting

Use cases: finance-accounting

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this server can do and what it asks for, from its tool list and install config. Checked Oct 25, 2026.

Tools
10 read · 23 write · 2 delete · 2 not yet classified
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Tools by what they do 37

Read from the source code; the running server may list different tools.

Read 10 · Look things up without changing anything.

  • decisions
  • discipline
  • doctor
  • explain_decision
  • history
  • live_prices
  • news_sources
  • rebalance_plan
  • status
  • strategy

Write 23 · Create, change, send or run things.

  • add_news_source
  • buy
  • cancel_fund_order
  • confirm_fund_order
  • daily_report
  • deposit
  • ingest_event
  • pending_committees
  • pending_news
  • place_fund_order
  • prepare_committee
  • record_dividend
Show 11 more tools
  • record_execution
  • record_existing_position
  • record_fee
  • record_return_of_capital
  • record_split
  • run_committee
  • sell
  • set_allocations
  • submit_committee
  • track_asset
  • withdraw

Delete 2 · Delete, drop, revoke or wipe things.

  • remove_news_source
  • untrack_asset

Not yet classified 2 · We could not tell from the name and description.

  • threaded
  • what_if

Secrets and settings it asks for

Other settings (environment variables or headers).

  • INVEST_HOME

Files it touches

  • Any path the agent passes to its tools

Tools (37)

Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].

  • add_news_source

    Add an RSS/Atom feed to the crawler's source list. The URL must be http(s) on a public host (fetched directly, not via HTTP(S)_PROXY), and is live-probed before saving — a URL that doesn't parse as a feed is rejected. Idempotent: re-adding an existing URL returns the existing entry. Capped so the list can't grow unbounded. Use when someone says "follow <site>'s news" / "加个新闻源".

  • buy

    Record a buy in the local ledger: adds to an existing position with weighted-average cost, or opens a new position for an unseen symbol. This bookkeeps a trade the user already placed with their broker — openInvest never places real orders. Confirm symbol, units, and price with the user before calling; this moves ledger cash. A position the user already held before using openInvest is not a purchase: record it with `record_existing_position`. Off-exchange China mutual funds (`FUND:<6 digits>`) settle T+1 or later at the NAV of the pricing day: use `place_fund_order` + `confirm_fund_order` ins…

  • cancel_fund_order

    Cancel an in-transit off-exchange fund order that was never executed (the user withdrew it on the fund platform): the amount returns to ledger cash. Only orders still in transit can be cancelled — a confirmed order already holds shares (use `sell` to book a redemption). Confirm with the user before calling; this moves ledger cash. Args: order_id: The in-transit order to cancel. Returns: Cash returned and new balance, or {"status": "error", "error": ...}.

  • confirm_fund_order

    Second leg of an off-exchange fund purchase: turn an in-transit order into shares at the pricing day's NAV (units = (amount - fee) / nav; average cost updates, cash unchanged). The `fund_confirm` job does this automatically every weekday evening, so call it manually only to supply a NAV / fee yourself or to confirm early. Safe to call twice: an order that is already confirmed returns {"status": "already_confirmed"} (a cancelled one {"status": "cancelled"}) and nothing changes. If the pricing-day NAV is not published yet the result is {"status": "pending_nav"} and the order stays in transit. …

  • daily_report

    Assemble today's daily report (portfolio, verdicts, performance, holdings digest) and return it as `full_report` Markdown for you to deliver. Agent mode (keyless backend): run prepare_committee → roles → submit_committee for every target asset FIRST; this tool then only reads today's submitted verdicts — nothing is re-run by a backend model. Assets without a submitted verdict are listed in `missing_verdicts`: treat any entry there as a failure and report it. Backend mode: runs the backend committee itself (needs a backend LLM key, takes minutes).

  • decisions

    Get the unified decision ledger: every committee verdict joined with rule interventions, the user's actual executions or refusals (with reasons), and post-hoc outcome data — plus an adoption-rate summary. Answers "how often did I follow the advice", "which recommendations did I skip", and "what did the safety rules rewrite". Read-only. Filter by `symbol` / `verdict` to answer questions about one asset or one kind of call; the list is capped at `limit` (newest first) so a year of history doesn't flood the context — `count` and `summary` still cover every match. Args: days: Look-back windo…

  • deposit

    Record a cash deposit into the ledger, in any currency. Bookkeeping only — no real payment system is connected. Args: currency: ISO-style currency code, e.g. "CNY", "USD", "AUD". amount: Amount to add; must be > 0. idempotency_key: Reuse the same key when retrying this exact call; recorded once. Returns: Updated cash balances, or {"status": "error", "error": ...}.

  • discipline

    Get the committee's discipline ledger: how often it chose inaction (HOLD ratio), how many impulsive user trades its rules intercepted, and the counterfactual money saved/lost by those interventions (ADR-023: the system's proven value is discipline and transparency, not alpha). Use when the user asks "what has the committee blocked" or "is this tool actually helping". Read-only. Returns: Object with `summary` (structured stats) and `markdown` (the same ledger pre-rendered for direct display to the user).

  • doctor

    Health check, the first call of a session (same output as `run.sh doctor`, for agents without shell access): is onboarding done, and which optional pieces are missing. `status` is "ready" when memory (user / strategy / portfolio) is initialized, or "needs_setup" when it is not (or portfolio.md is still the v1 format) — only then hand over to the `invest-setup` skill. A missing LLM key or mail credentials never makes it "needs_setup": those `checks` entries are marked `optional_for_coordinator` / `optional_for_email`. The Coordinator path (`prepare_committee` + subagents) works without a key; …

  • explain_decision

    Get the full reasoning behind one committee verdict: the complete 4-role debate transcript with the CIO memo, plus the path-probability snapshot the CIO saw at decision time. Use when the user asks "why was today's verdict HOLD" or wants to audit a past decision. Read-only. Args: decision_id: "<date>/<symbol>", e.g. "2026-07-03/GC=F" — exactly as returned in the `decisions` tool output. Returns: Object with verdict, confidence (the CIO's self-reported number, kept for the record), `confidence_lookup` (show this to the user instead: how similar verdicts (live + paper …

  • history

    Get the most recent trade records and committee verdict history. Use when the user asks "what did I buy recently" or "what did the committee decide lately". Read-only. Args: n: Maximum number of recent trades to return (default 10). Returns: Object with `trades` (each with symbol, direction, units, price, timestamp, status) and recent committee verdict records.

  • ingest_event

    Feed a finance news item you (the host agent) found into the event ledger, graded and mapped to affected symbols, stored for committee RAG recall. Preferred: normalize it yourself — pass `one_line_claim`, `stance`, `severity` (and ideally `affected_symbols`). The backend then only validates and stores it; no backend model is involved. Without those fields the backend model normalizes it, which fails when the backend runs keyless (agent mode) — you get an error telling you which fields to add. You have far better search reach than the self-hosted crawler (including Chinese-language sources) —…

  • live_prices

    Fetch a one-shot market backdrop: spot gold (USD/oz and CNY/gram), USDCNY and AUDCNY FX rates, the NDQ.AX ETF price, the VIX volatility index, and the 10-year US Treasury yield (TNX). A fixed set of reference instruments, independent of what the user holds (use `status` for the user's own positions). Use for quick market context before analysis or when the user asks "how is the market / what's the gold price". Read-only; single batch, no arguments. Returns: Object keyed by instrument (GC_F_usd_per_oz, gold_cny_per_gram_spot, USDCNY, AUDCNY, NDQ_AX, VIX, TNX) plus `as_of` ISO timestam…

  • news_sources

    List the news feed sources the crawler pulls from: the built-in default feeds plus user-added extra feeds. Extra feeds can be added/removed with add_news_source / remove_news_source; defaults are fixed. Use when someone asks "what news sources do you follow" or before adding/removing a source.

  • pending_committees

    Committee re-runs that events or price moves requested while reasoning is delegated to you (agent mode). For each item run `prepare_committee`, the roles, then `submit_committee`; an item is done once a newer verdict for that symbol is submitted. Requests expire after 24h.

Show 22 more tools
  • pending_news

    News the backend fetched but did not normalize because reasoning is delegated to you (agent mode). For each relevant item call `ingest_event` with `one_line_claim` / `stance` / `severity` / `affected_symbols`; pass the irrelevant ones back here as `dismiss_urls`. Items leave the queue once ingested or dismissed, and expire after 48h.

  • place_fund_order

    Record the first leg of an off-exchange fund purchase the user already placed with the fund platform: cash - amount, and the order is tracked as in transit (`status.pending_fund_orders`). Total assets do not change (the in-transit amount counts at face value), so there is no fake dip between order day and confirmation. Shares arrive when the pricing-day NAV is published: the `fund_confirm` job confirms automatically, or call `confirm_fund_order`. Bookkeeping only — openInvest never places orders. The expected confirm date uses a Monday-Friday calendar (no China holiday table) and a lag by fun…

  • prepare_committee

    Step 1 of the agent-run committee (Coordinator path): get everything YOU need to play the 4 roles yourself — no backend LLM key involved. Returns the deterministic data blocks (regime, sentiment / defense flag, valuation, macro, events, portfolio, path reference) plus the 6 role prompts and `instructions` describing the 3 rounds. Run Macro / Quant / Risk (cheap subagents are fine), write the CIO memo yourself, then call `submit_committee` with the full transcript. The backend keeps its own copy of the deterministic facts from this call and uses them when you submit (defense downgrade, regime…

  • rebalance_plan

    Compute a rebalance list against the target allocation in strategy.md: what to BUY / SELL, how much, in whole lots, and why. Only produces the list, places no order — the human executes. No LLM call. Use when the user asks "do I need to rebalance", "how far am I from my target allocation" or "what should I buy/sell to get back on target". Per-asset targets come from `target_assets[].target_pct` in strategy.md; assets without one split `target_allocation_stock` equally (`target_source: "equal_split"`). Lot sizes: A-shares 100, convertible bonds 10, off-exchange funds by amount, HK/others 1 (HK…

  • record_dividend

    Record a dividend (or interest) the user already received: credits ledger cash by amount - tax_withheld, positions unchanged. It counts as account return (inside NAV), not as a deposit. Bookkeeping only — openInvest never moves money. Confirm symbol, gross amount, withholding tax, and the date with the user before calling; this moves ledger cash. A symbol that is neither held nor in the ledger is rejected (typo guard). Args: amount: Gross amount before withholding tax; must be > 0. currency: Currency of the cash credited. symbol: Ticker (required for dividends; optional for inter…

  • record_execution

    Record whether the user executed or declined a committee verdict, with their reason. Appends to the execution ledger; idempotent — replaying the same record is a no-op, so retries are safe. Call when the user says "I bought it / I didn't buy / I disagree". When they decline, ask one short question for the reason first — this closes the adoption-rate loop that `decisions` reports on. Args: decision_id: "<date>/<symbol>" from the `decisions` output. executed: True if the user acted on the verdict, False if declined. reason: The user's stated reason (especially when declined). t…

  • record_existing_position

    Record a position the user already held before using openInvest (onboarding backfill) WITHOUT touching ledger cash. History is marked `funding_source: external_funding`, `source: mcp:existing_position`. Only for positions that `status` does not list yet — calling it for a symbol already there adds the units again (double count). A new purchase paid from ledger cash is `buy`. Does not add the symbol to the tracked list; use `track_asset` for committee coverage. Args: symbol: yfinance ticker (e.g. "AAPL", "510300.SS"). Gold = "GC=F", booked in CNY per gram only (units = grams, curr…

  • record_fee

    Record a fee or a tax the user already paid: debits ledger cash, positions unchanged. It is an account cost (inside NAV), not a withdrawal. Trade commissions need no separate entry — buy / sell already book the trade. Fails if the currency's cash balance is lower than the amount. Confirm the amount and date with the user before calling; this moves ledger cash. Args: amount: Amount paid; must be > 0. currency: Currency of the cash debited. kind: "fee" (default) or "tax". symbol: Related ticker (optional). trade_date: YYYY-MM-DD it was charged (default today). note: Fre…

  • record_return_of_capital

    Record a return of capital (some ETF / REIT distributions): credits ledger cash, lowers the holding's average cost by amount / units (a cost reduction, not income), units unchanged. Cost floors at 0; any excess is reported as excess_over_cost (treat as a capital gain). Confirm symbol, amount, and date with the user before calling; this moves ledger cash and changes average cost. Args: symbol: Held ticker. amount: Cash received; must be > 0. currency: Currency of the cash (must match the holding's cost currency). trade_date: YYYY-MM-DD received (default today). note: Free-…

  • record_split

    Record a stock split / reverse split: units x ratio, average cost / ratio, cash unchanged (market value is unchanged). Call it once per split — a second call multiplies the position again; use an idempotency_key if unsure whether an earlier attempt landed. Rejected when the ledger already has trades / corrections for the symbol on or after trade_date (their units are already post-split, so multiplying the whole snapshot would invent shares) — pass ledger_only=true if the snapshot is already correct. Confirm symbol, ratio, and ex-date with the user before calling; this rewrites the position's …

  • remove_news_source

    Remove a user-added news feed by name or URL. Built-in default feeds cannot be removed.

  • run_committee

    Run the 4-role LLM investment committee on a symbol (Direct path): Macro Strategist, Quant Analyst, and Risk Officer debate from isolated evidence, then a CIO synthesizes one calibrated BUY/HOLD/SELL-style verdict with a written memo. Requires a backend LLM key (e.g. DEEPSEEK_API_KEY) and takes 30-90s on a cache miss. If the symbol was already analyzed today, the cached verdict is returned instantly unless `force` is set. Sends MCP progress notifications per debate phase when the client asks for them. Decision support only — the human always executes. Args: symbol: Any yfinance ticker (U…

  • sell

    Record a sell in the local ledger: reduces the position's units (average cost unchanged) and credits cash in the holding's cost currency. Bookkeeps a trade already executed at the user's broker — openInvest never places real orders. Confirm symbol, units, and price with the user before calling; this moves ledger cash. Args: symbol: yfinance ticker of an existing holding. units: Quantity sold; must be > 0. price: Execution price per unit, in the holding's cost currency. idempotency_key: Reuse the same key when retrying this exact call; recorded once. Returns: Updated posi…

  • set_allocations

    Update the strategy's target allocation: the stock/cash ratio and/or the per-asset target weights that `rebalance_plan` reads, and/or the per-asset alert lines the price sentinel watches. The stock and cash values must sum to ≈1.0, and the per-asset weights must sum to at most the stock target; schema validation rejects and rolls back any write that would corrupt the strategy file. Everything in one call is validated and written atomically — to lower the stock target below the current sum of per-asset weights, pass the new weights in the same call. Use when the user says e.g. "set my target t…

  • status

    Get a full snapshot of the user's portfolio: cash balances per currency, every holding with units / average cost / live price, and unrealized P&L per position and in total. Use when the user asks "show my portfolio", "how is my P&L", or before proposing any trade. Read-only; fetches live quotes, so values change between calls. Returns: Object with `cash` (currency → amount), `all_holdings` (every position, priced the same way whatever the symbol: units, avg_cost, live price, market value, pnl_pct; null price fields when a quote is unavailable; each carries `alerts`, the user'…

  • strategy

    Get the user's investment strategy: target stock/cash allocation, the list of tracked assets (per-asset investment cap, purchase channel, fee settings), and long-term insights distilled by the nightly Dreaming memory-consolidation job. Use when deciding whether a proposed trade fits the user's plan, or when the user asks "what is my strategy / what am I tracking". Read-only. Returns: Object with `target_allocation` (stock/cash ratios), `target_assets` (tracked symbols with constraints), and `insights` (distilled lessons from past decisions).

  • submit_committee

    Step 2 of the agent-run committee: hand in the transcript you produced from `prepare_committee`. The backend parses the CIO memo, applies the same deterministic rules as the backend-run committee (single-investment cap, defense downgrade, sanity checks), saves the decision and returns it. If the CIO section has no parseable verdict, nothing is saved and this returns an error — fix the CIO section and submit again. Returns: `decision_id`, the post-rule `verdict` object, `saved` path and `facts_source` ("prepare" = rules used the facts saved at prepare time; "transcript" = no recen…

  • threaded
  • track_asset

    Add a symbol to the tracked-asset list, or update an existing entry (idempotent upsert: only the fields you pass are changed). The tracked list decides which symbols the committee and DCA jobs cover. The alert_* parameters set per-asset alert lines the price sentinel checks every few minutes (price lines: 24h cooldown; day-move lines: once per trading day); each one you pass overwrites that line only. To clear a line use set_allocations with a null value. Delivery needs INVEST_EVENT_ALERT=1 on the server (default off — without it a hit is only logged to the event store, nothing is sent). Use …

  • untrack_assetcan change or delete data

    Remove a symbol from the tracked-asset list — the committee and DCA jobs stop covering it. Holdings and trade history are untouched; schema validation guarantees at least one tracked asset remains. Args: symbol: yfinance ticker currently in the tracked list. Returns: The updated tracked list, or {"status": "error", "error": ...}.

  • what_if

    Simulate portfolio P&L for a hypothetical price move: "what happens to my portfolio if <symbol> moves ±pct% / reaches <price>". Pure arithmetic over current holdings — no LLM call, instant, free. Use when the user asks scenario questions like "if the Nasdaq drops 10%, how much do I lose". Provide exactly one of `pct` or `price`. Args: symbol: yfinance ticker held or tracked by the user (e.g. "NDQ.AX", "GC=F", "510300.SS"). pct: Hypothetical percent change, e.g. -10 for a 10% drop. price: Hypothetical absolute target price (alternative to pct). Returns: Object with th…

  • withdraw

    Record a cash withdrawal from the ledger, in any currency. Fails if the balance is insufficient. Bookkeeping only — no real payment system is connected. Args: currency: ISO-style currency code, e.g. "CNY", "USD", "AUD". amount: Amount to remove; must be > 0. idempotency_key: Reuse the same key when retrying this exact call; recorded once. Returns: Updated cash balances, or {"status": "error", "error": ...}.

Signals

Stars
133
Forks
17
Open issues
3
Contributors
7
Weekly downloads
4,087
Last commit
Oct 21, 2026 (7 days ago)
Last release
Oct 21, 2026 (7 days ago)
Last package publish
Oct 20, 2026 (8 days ago)

From GitHub (fetched Oct 24, 2026) and the package registry.

Details

Registry name
io.github.longsizhuo/openinvest
Version
0.67.0
Auth
No auth
Packages
pypi openinvest
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026
Cite this page

openInvest MCP server. Agent Mart. https://agentmart.dev/connectors/longsizhuo-openinvest (last updated 2026-10-24)