ibkr-mcp-server: Skill for Codex

.codex/skills/ibkr-portfolio/SKILL.md

ibkr-portfolio is a skill for Codex from patrickpxp/ibkr-mcp-server. It costs 28 tokens per session (735 once invoked), scanned A, original, MIT.

A workflow for retrieving positions, profit and loss, and past trades from an Interactive Brokers investment account through connected tools. P&L means profit and loss.

In plain words
What is it for?
Checking current holdings, viewing unrealized or realized P&L, and reviewing historical trades such as yesterday’s activity or year-to-date transactions.
Why use it?
It provides a clear account summary from the available portfolio and trade data instead of relying on guessed or manually copied figures.

Skill for Codex

Written for Codex: installed under .codex/.

This is patrickpxp/ibkr-mcp-server's own configuration. It tells Codex how to work on ibkr-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ibkr-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to patrickpxp/ibkr-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/patrickpxp/ibkr-mcp-server/main/.codex/skills/ibkr-portfolio/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/patrickpxp/ibkr-mcp-server

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ibkr-portfolio

README.md
[![agentmods](https://agentmods.dev/badge/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio/github.svg)](https://agentmods.dev/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio)
Your own site
<a href="https://agentmods.dev/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio"><img src="https://agentmods.dev/badge/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ibkr-portfolio

Your own site · 80×15
<a href="https://agentmods.dev/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio"><img src="https://agentmods.dev/badge/skills/patrickpxp/ibkr-mcp-server/ibkr-portfolio.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00735
Opus 5 $0.00014 $0.00367
Sonnet 5 $0.00006 $0.00147
Haiku 4.5 $0.00003 $0.00073

Measured 9d ago against content hash 12720e3fe35d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ibkr-portfolio scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codex/skills/ibkr-portfolio/SKILL.md · 44 lines

What it actually says

Use this skill when the user wants their current IBKR portfolio, P&L, or historical trade activity.

Instructions:

  • For current positions/current portfolio P&L, call the MCP tool ibkr_get_portfolio; do not fabricate or estimate positions.
  • For current-position P&L workflows, call ibkr_get_portfolio with include_pnl=true (or omit it, since default is true). Only set include_pnl=false when the user explicitly asks for positions-only output.
  • Use input parameters only when explicitly requested:
    • account to override the default account.
    • include_pnl to omit or include P&L (true by default).
    • as_of to echo the caller-provided timestamp.
  • Current P&L behavior:
    • Position-level unrealizedPnl and realizedPnl use IBKR portfolio rows when available (ib.portfolio(...) data).
    • If market data price is missing, marketPrice/marketValue can still be populated from portfolio rows.
    • If both market data and portfolio row values are unavailable for a position, related P&L fields may remain null; report this via returned notes. Historical trades:
  • For “what did I trade?”, yesterday’s trades, YTD trade lists, or trade-count questions, call ibkr_get_trade_confirmations first.
  • Do not conclude “no trades” from ibkr_get_transactions or ibkr_get_executions alone; those can be session-limited/empty while the Flex statement has trades.
  • If TradeConfirm rows are unavailable but the tool notes a fallback to Flex Trade rows, use those rows.
  • Parse returned dateTime as DD/MM/YYYY;HH:MM:SS TZ first. Example: 28/04/2026;13:43:25 EDT is 2026-04-28. Also tolerate ISO dates if present.
  • When filtering by a calendar date, compare parsed dates, not string fragments like 04/28/2026.
  • For trade rows, present columns: dateTime, symbol, description, side, quantity, price, proceeds, commission, currency, tradeId, orderId.
  • Make clear that proceeds/commissions are cash flow; exact realized profit needs realized P&L / cost-basis data.

Portfolio presentation:

  • Present results in this order:
    1. A table of positions with columns: symbol, secType, exchange, currency, position, avgCost, marketPrice, marketValue, unrealizedPnl, realizedPnl.
    2. Totals summary: unrealizedPnl, realizedPnl, netLiquidation.
    3. Notes list (bullet points).
  • If the tool returns an error object:
    • Explain the error clearly.
    • Provide troubleshooting steps:
      • Confirm TWS/IB Gateway is running.
      • Verify API access is enabled in TWS.
      • Check IBKR_HOST/IBKR_PORT values.
      • On Linux, ensure Docker uses extra_hosts: host.docker.internal:host-gateway.
      • Check firewall or local permissions.
  • Safety: read-only. Do not place orders or perform any trading action.
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 44 lines · 28 tokens per session scan A 12720e3fe35d

Subscribe to this mod's changes

ibkr-portfolio is a skill published in the GitHub repository patrickpxp/ibkr-mcp-server (9 stars, last pushed 4mo ago), licensed MIT. It adds 28 tokens to every session and 735 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories