Skip to content

feat(accounts): support Robinhood account selection - #21

Merged
jack-arturo merged 2 commits into
mainfrom
feat/account-selection
May 29, 2026
Merged

jack-arturo merged 2 commits into
mainfrom
feat/account-selection

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Summary

  • add robinhood_get_accounts so users can discover selectable Robinhood account numbers
  • add optional account_number support to account-scoped portfolio, stock position, dividend, option position, and stock order-history tools
  • document account selection and update registry metadata

Tests

  • uv run --extra dev pytest -q
  • uv run --extra dev ruff check .
  • uv run --extra dev ruff format --check .
  • git diff --check
  • python3 -m json.tool server.json >/dev/null

Risk

  • No trading APIs are exposed; this stays read-only. Account-specific stock holdings use Robinhood open positions directly because robin_stocks build_holdings() does not accept account_number.

Copilot AI review requested due to automatic review settings May 29, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Robinhood multi-account support to the read-only MCP server: a new robinhood_get_accounts discovery tool and optional account_number parameters on portfolio, positions, single position, dividends, options positions, and stock order history. Account input is validated and forwarded to robin_stocks; the positions cache is now keyed per account; stock holdings for non-default accounts are constructed from get_open_stock_positions + quotes since build_holdings() does not accept an account.

Changes:

  • New get_accounts() returning a slimmed account profile and the matching robinhood_get_accounts FastMCP tool.
  • Account-aware tool layer: _normalize_account_number, _account_kwargs, per-account positions cache, _build_account_holdings, _matches_account dividend filtering.
  • Documentation/registry updates (README account-selection section, server.json, CLAUDE.md tool count) and new tests for accounts, account forwarding, and per-account holdings.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/robinhood_mcp/tools.py Adds get_accounts, account-number validation/forwarding, per-account positions cache, and account-specific holdings builder.
src/robinhood_mcp/server.py Registers robinhood_get_accounts and threads optional account_number through the affected tool wrappers.
server.json Adds registry entry for robinhood_get_accounts and notes optional account scoping on existing tools.
README.md Documents the new tool and account-selection workflow.
CLAUDE.md Updates the tool count from 14 to 15.
tests/test_tools.py Adds tests for accounts listing, account-number normalization, per-account positions/dividends/options/order-history paths.
tests/test_server.py Adds _call_tool helper and tests verifying server wrappers forward account_number.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/robinhood_mcp/tools.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@jack-arturo
jack-arturo merged commit 046f5e7 into main May 29, 2026
10 checks passed
@jack-arturo
jack-arturo deleted the feat/account-selection branch May 29, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants