robinhood-mcp
drasticstatic 工作副本 — 由 Fortuna 交易系统 使用。这是一个从 verygoodplugins/robinhood-mcp 的本地克隆创建的独立仓库。上游仓库被追踪为远程仓库以供自愿对比 — 更改在应用前会经过审查。
# Check for upstream updates (review before applying) git fetch upstream && git log upstream/main --oneline
robinhood-mcp
一个用于 Robinhood 投资组合研究的只读 MCP 服务器。封装了 robin_stocks,让 AI 助手能够访问您的投资组合数据进行分析。
⚠️ 仅限研究工具 - 此服务器提供只读访问权限。不提供任何交易功能。
⚠️ 非官方 API - 使用 robin_stocks 非官方 API。可能会在不另行通知的情况下失效。使用风险自负。
您可以用它做什么?
连接后,您可以与 Claude 进行关于您投资组合的自然对话:
投资组合健康检查
“帮我检查一下我的投资组合健康状况。我的总价值是多少,行业集中度如何,有哪些持仓涨跌幅较大?”
Claude 将提取您的持仓,计算行业敞口,识别表现最好和最差的资产,并标记任何集中度风险。
买入前研究
“我正在考虑增加 NVDA 的持仓。请向我展示其基本面、近期新闻、分析师评级以及过去一年的表现。”
获取综合研究,在一次回复中结合价格历史、市盈率、财报日期和分析师情绪。
比较投资
“比较我投资组合中的邮轮公司 - 并排展示 CCL、RCL 和 NCLH 的市盈率、市值和年初至今的表现。”
快速评估类似持仓以识别相对价值。
股息分析
“我今年收到了哪些股息?我的哪些持仓支付股息,它们的收益率是多少?”
追踪您的被动收入并识别投资组合中的股息机会。
风险评估
“我对能源行业的敞口是多少?我在前 5 大持仓中的集中度如何?”
分析行业集中度并识别可能超配的持仓。
财报日历
“我的哪些持仓在未来两周内有财报发布?”
通过个性化日历提前应对财报波动。
业绩归因
“分析我的投资组合回报。是什么在驱动我的收益和亏损?”
了解哪些持仓对您的业绩贡献最大。
自选股研究
“提取我自选列表中所有股票的报价和基本面。现在有哪些看起来很有趣?”
批量研究您正在追踪的股票。
Related MCP server: Public.com MCP Server
安装
pip install robinhood-mcp或者直接使用 uvx 运行:
uvx robinhood-mcp配置
环境变量
export ROBINHOOD_USERNAME="your_email"
export ROBINHOOD_PASSWORD="your_password"
export ROBINHOOD_TOTP_SECRET="your_2fa_secret" # Only if you use authenticator app注意: 如果您在 Robinhood 上使用 Face ID、Touch ID 或密码登录(没有身份验证器应用),则不需要 ROBINHOOD_TOTP_SECRET。
Claude Desktop
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"robinhood": {
"command": "uvx",
"args": ["robinhood-mcp"],
"env": {
"ROBINHOOD_USERNAME": "your_email",
"ROBINHOOD_PASSWORD": "your_password"
}
}
}
}Claude Code
claude mcp add robinhood -- uvx robinhood-mcp可用工具
工具 | 描述 |
| 投资组合价值、权益、购买力、日内变动 |
| 所有持仓的成本基础、当前价值、盈亏 |
| 按代码查询单个持仓的份额、价值和盈亏 |
| 您自选列表中的股票 |
| 实时价格、买入/卖出价、成交量 |
| 市盈率、市值、股息收益率、52 周区间 |
| OHLCV 价格历史(日/周/月/年) |
| 某代码的近期新闻文章 |
| 财报日期、每股收益预测、实际值 |
| 分析师买入/持有/卖出评级 |
| 股息支付历史 |
| 当前期权持仓 |
| 按名称或代码搜索股票 |
对话示例
简单查询:
“我现在的投资组合价值多少?”
“按价值展示我前 5 大持仓”
“我已经持有 HIMS 了吗?我目前的持仓是多少?”
“获取 AAPL 的报价”
对于单代码投资组合问题,优先使用 robinhood_get_position 而不是 robinhood_get_positions。单代码工具避免了重建所有持仓,对于“我应该加仓 HIMS 吗?”这类问题速度快得多。
分析请求:
“比较 GOOGL 和 META 的基本面”
“我的哪些股票交易价格低于其 52 周平均水平?”
“展示 TSLA 过去一年的价格走势图”
“我表现最好的股票是什么?最差的是什么?”
研究工作流:
“我想了解邮轮行业。提取 CCL、RCL 和 NCLH 的数据 - 比较它们的基本面和近期表现。”
“查找我投资组合中市盈率低于 15 且盈利增长为正的股票”
“我在几个持仓上亏损严重。展示我表现最差的持仓的基本面和新闻,以帮助我决定是持有还是止损。”
限制
只读:无法下单交易、修改自选列表或更改账户设置
非官方 API:Robinhood 可能随时更改其 API,导致功能失效
无实时流:报价是即时点位,而非实时推送
会话过期:您可能需要定期重新验证
速率限制:高频使用可能会触发 Robinhood 的速率限制
安全说明
凭据仅在本地用于与 Robinhood 进行身份验证
会话令牌由 robin_stocks 缓存在
~/.tokens/robinhood.pickle中切勿提交您的
.env文件或泄露凭据此工具无法执行交易 - 设计上即为只读
开发
git clone https://github.com/verygoodplugins/robinhood-mcp.git
cd robinhood-mcp
pip install -e ".[dev]"
# Lint
ruff check . && ruff format --check .
# Test
pytest
# Run locally
robinhood-mcp故障排除
“Not logged in”(未登录)错误:
验证您的用户名和密码是否正确
如果您使用带有身份验证器应用的 2FA,则需要
ROBINHOOD_TOTP_SECRET尝试通过 Robinhood 应用登录以确保您的账户未被锁定
“Non-base32 digit found”(发现非 base32 数字)错误:
您的 TOTP 密钥包含无效字符
密钥应仅包含字母 A-Z 和数字 2-7
如果您不使用身份验证器应用,请完全删除
ROBINHOOD_TOTP_SECRET
速率限制:
robin_stocks 没有内置速率限制
如果您达到速率限制,请等待几分钟后再重试
许可证
MIT
免责声明
此工具仅用于教育和研究目的。它使用可能随时失效的非官方 API。作者不对任何账户限制、数据不准确或财务损失负责。
本项目与 Robinhood Markets, Inc. 无关联、无背书,也无任何连接。
自动化示例
使用 Claude Code 进行每日投资组合回顾
设置一个 cron 任务以获取每日投资组合简报:
# ~/.claude/commands/portfolio-review.md
---
description: "Daily portfolio health check"
---
Using the robinhood MCP tools:
1. Get my current portfolio value and day change
2. Identify my top 3 gainers and top 3 losers today
3. Flag any positions that are down more than 20% from cost basis
4. Check if any holdings have earnings in the next 7 days
5. Give me a 2-3 sentence summary I can read with my morning coffee每日运行:
# Add to crontab -e
0 7 * * 1-5 cd ~/Projects && claude -p "/portfolio-review" --dangerously-skip-permissions >> ~/portfolio-reports/$(date +\%Y-\%m-\%d).md每周研究摘要
# ~/.claude/commands/weekly-research.md
---
description: "Weekly deep dive on portfolio"
---
For each of my top 10 holdings by value:
1. Pull current fundamentals and compare to sector averages
2. Get recent news and analyst rating changes
3. Flag any significant changes from last week
4. Identify 2-3 stocks from my watchlist that might be worth adding
Format as a markdown report I can review on the weekend.致谢
由 Jack Arturo 在 Very Good Plugins 倾情打造。
由 robin_stocks 和 FastMCP 提供支持。
链接
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceA read-only MCP server that provides access to Charles Schwab account data and market information, including portfolio positions, real-time quotes, options chains, price history, and account balances through AI assistants.9MIT
- AlicenseAqualityAmaintenanceThis MCP server connects AI assistants to a Public.com brokerage account, enabling natural language trading of stocks, options, and crypto, along with portfolio management, quotes, and orders.3766Apache 2.0
- Alicense-qualityDmaintenanceA read-only Model Context Protocol server that connects your Schwab brokerage account to LLM applications for portfolio monitoring and market data retrieval.MIT
- AlicenseAqualityBmaintenanceA read-only MCP server for Trading 212 accounts, enabling AI assistants to query balances, positions, orders, dividends, pies, and instruments without trading capabilities.121MIT
Related MCP Connectors
Read-only MCP server for Robinhood Chain token discovery, research, and due diligence via GMGN.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/drasticstatic/robinhood-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server