feat(accounts): support Robinhood account selection - #21
Merged
Merged
Conversation
There was a problem hiding this comment.
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 matchingrobinhood_get_accountsFastMCP tool. - Account-aware tool layer:
_normalize_account_number,_account_kwargs, per-account positions cache,_build_account_holdings,_matches_accountdividend filtering. - Documentation/registry updates (README account-selection section,
server.json,CLAUDE.mdtool 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests
Risk