Server data from the Official MCP Registry
A-share investment research: quotes, financials, behavior patterns, and trading journals.
A-share investment research: quotes, financials, behavior patterns, and trading journals.
InvestBrain is a well-intentioned investment tool MCP server with reasonable security practices for credential handling (env vars, .gitignore protection). However, it has several moderate security concerns: overly broad file system access without validated paths, lack of input validation on some tools that process user data, potential for unvalidated API calls, and insufficient error handling that could leak sensitive information. The frontend code exposes clipboard operations and contains some code quality issues. Permissions are appropriate for the stated purpose (financial data access, RAG, local storage), but implementation has gaps. Supply chain analysis found 29 known vulnerabilities in dependencies (1 critical, 12 high severity).
4 files analyzed · 39 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-lj22503-invest-brain": {
"args": [
"-y",
"investbrain-frontend"
],
"command": "npx"
}
}
}From the project's GitHub README.
有经验投资者的纪律自主工具,解决"知行合一"问题 不是投顾,不给建议,而是"镜子" + "纪律锚点"
一条命令 clone 仓库后,三步完成启动:
# 1. 安装 MCP Server 依赖
cd src/mcp_server && pip install -r requirements.txt
# 2. 配置你自己的 LLM API Key(见下文「你的 Key,自己填」)
cp .env.example .env
# 编辑 .env,把 DEEPSEEK_API_KEY 填成你从 DEEPSEEK 后台拿到的 key
# 3. 启动 MCP Server
python server.py
首次启动提示:向量库(Chroma + ONNX Embedding)首次会下载约 80MB 模型文件。若希望跳过向量库、纯工具调用体验,可保持
server.py中相关注释不变;如需完整 RAG 体验,下载后取消server.py内的注释行。
启动后 Server 会以 stdio 方式接受 MCP 客户端调用。配置 Claude Desktop 见下方 Claude Desktop 接入。
重要:本仓库不预置任何用户的 API key。data/config/llm.json 中 api_key 默认为 null(不是真的 key 占位);.env.example 只是模板;webhook.json 是空 schema。
| 服务 | 用途 | 后台地址 |
|---|---|---|
| DeepSeek API | 主力 LLM(必需) | https://platform.deepseek.com → API Keys |
| Tushare Pro | A 股财务/历史数据(可选) | https://tushare.pro/register |
| DashScope | 阿里通义备选 LLM(可选) | https://dashscope.console.aliyun.com |
| Against Finance | 另类数据(可选) | https://www.against.com |
| 飞书机器人 | 通知(可选) | https://open.feishu.cn → 机器人 → Webhook |
DEEPSEEK_API_KEY 环境变量(推荐 User 级系统环境变量,或 CLAUDE.md / .env)TUSHARE_TOKEN / DASHSCOPE_API_KEY / AGAINST_API_KEY(环境变量)data/config/webhook.json 里的 feishu 字段(已被 .gitignore 保护).gitignore 保护 data/config/*.json(含 llm/webhook 配置)+ data/memory/*.db(用户记忆库,按 CLAUDE.md 决策"用户数据本地存储,不上传云端"),不要 ! 取消忽略备注:仓库历史曾 commit 过密钥占位(commit
22e6c72),如已 push 远端,老 key 在 clone 历史里仍可被读——清历史成本高、通常接受 + rotate 即可
核心问题:投资者被叙事带着走,操作没纪律,事后后悔。
| 常见痛点 | InvestBrain 的应对 |
|---|---|
| 看到某只股票大涨就追高 | 强制记录买入理由 + 关联历史相似决策 |
| 跌了恐慌割肉 | 触发 RAG 检索大师对"恐慌"的看法 |
| 同一类错误反复犯 | 行为模式挖掘自动识别"追涨杀跌"模式 |
| 重要时间/价格点位忘记 | 价格/时间/条件监控 + 飞书推送 |
| 想不起自己过去的判断 | 记忆系统 + 决策卡片回溯 |
| 功能 | 说明 |
|---|---|
| 想法记录 | 用户说一句话,AI 解析 + 关联历史 + 生成卡片 |
| 投资 RAG | 大师思想检索问答(16 位投资大师 × 5 个核心概念) |
| 记忆系统 | 用户画像、历史决策、行为模式挖掘 |
| 提醒触发 | 价格/时间/条件监控,支持飞书/钉钉/Bark 多通道推送 |
| 行为模式挖掘 | 自动发现投资者的偏差模式 |
下面是三个核心价值场景的真实对话流(任意 MCP 客户端均可使用):
用户:段永平怎么看"快钱"和"慢钱"?
调用:
rag_ask_investment(question="段永平怎么看快钱和慢钱")AI 返回: 段永平的核心观点是"快钱"看似机会多但风险敞口大,"慢钱"依靠复利与确定性。 在「段永平」语料中相关论述 12 条,节选:
"投资赚钱的速度不应该快过学习的速度。" "敢重仓的就是你能看懂的生意,剩下的不是机会。" 关联概念:能力圈、安全边际、复利。
用户:我最近的交易有什么问题?
调用:
memory_get_behavior_patterns()AI 返回: 检测到你的两个行为模式(过去 30 天,11 笔交易):
追涨模式(置信度 0.83) 触发样本:买入 NVDA/TSLA 在单日涨幅 > 5% 后的 D+1/D+2,胜率 25%,平均收益 -3.2% 建议:买入前强制查看
rag_ask_investment(question="追高的代价")恐慌割肉模式(置信度 0.71) 触发样本:持仓亏损 > 15% 后的 5 日内卖出,后续 30 日反弹 67% 建议:触发时自动推送飞书提醒 + 大师原话引用
用户:NVDA 到 950 美元时提醒我重新评估。
调用:
reminder_set_reminder(condition={ticker:"NVDA", operator:"<=", threshold:950, action:"review"})AI 返回: 提醒已建立:NVDA <= 950 USD 时触发"复盘评估"。 触发后将自动拉取:当前价格、你对此票的历史决策卡片、相关大师语录。 提醒已同步通知通道(如已配置)。
将 InvestBrain 接入 Claude Desktop(macOS / Windows 通用):
配置文件位置:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json配置内容:
{
"mcpServers": {
"investbrain": {
"command": "python",
"args": [
"D:/claudework/investbrain/src/mcp_server/server.py"
],
"env": {
"DEEPSEEK_API_KEY": "sk-your-key-here"
}
}
}
}
路径请按你 clone 的实际位置修改。配置完成后重启 Claude Desktop,会在工具栏出现"投资助手"图标(40 个工具)。
本项目采用 GNU Affero General Public License v3.0 (AGPLv3) 授权。简言之:你可以自由使用、修改和分发,但通过网络提供服务的衍生作品也必须以相同协议开源。详见 LICENSE。
| 层级 | 功能 | 状态 |
|---|---|---|
| 免费层 | 本地 MCP Server | ✅ 已上线 |
| 16 位大师 RAG 问答 | ✅ 已上线 | |
| 行为模式检测 | ✅ 已上线 | |
| 提醒系统 | ✅ 已上线 | |
| 无限记忆存储 | ✅ 已上线 | |
| 个人版 | 云端周报/月报(AI 生成) | 计划中(¥39/月) |
| 跨设备数据同步 | 计划中 | |
| 团队版 | 团队协作与共享知识库 | 计划中(¥199/月) |
src/mcp_server/ # MCP Server(40 个工具)
├── server.py # 主入口
├── tools/ # 工具集
│ ├── thought_tools.py # 想法记录
│ ├── rag_tools.py # 投资 RAG
│ ├── memory_tools.py # 记忆系统
│ ├── reminder_tools.py # 提醒系统
│ ├── pattern_tools.py # 行为模式
│ ├── report_tools.py # 周报/月报
│ ├── roundtable_tools.py # 大师圆桌
│ └── notifier_tools.py # 多通道通知
├── datasources/ # 数据源
│ ├── akshare_datasource.py
│ └── tushare_datasource.py
├── knowledge/ # 知识库
│ ├── vector_store.py # Chroma 向量存储
│ └── graph_client.py # 图存储
├── memory/ # 记忆存储
├── patterns/ # 行为模式挖掘
├── llm/ # LLM 客户端
│ ├── llm_router.py # 通用 LLM 路由
│ ├── providers.py # Provider 配置
│ └── deepseek_client.py
└── api_server.py # REST API (LLM 配置)
data/
├── graph/ # 知识图谱(16 位大师 + 概念)
├── knowledge/
│ └── vectors/ # 向量索引(Chroma)
├── memory/ # 用户记忆
├── cards/ # 想法卡片
├── reminders/ # 提醒条件
└── config/ # 配置文件
// 想法记录(3)
"thought_record_thought(text)",
"thought_search_memories(query)",
"thought_get_thought_cards(ticker)",
// 投资 RAG(4)
"rag_ask_investment(question)",
"rag_get_master_view(master, topic)",
"rag_search_knowledge(query)",
"rag_search_reports(query, top_k)",
// 记忆系统(3)
"memory_get_user_profile()",
"memory_record_decision(data)",
"memory_get_behavior_patterns()",
// 提醒系统(3)
"reminder_set_reminder(condition)",
"reminder_get_reminders()",
"reminder_delete_reminder(id)",
// 行为模式(3)
"pattern_run_pattern_detection()",
"pattern_get_pattern_summary()",
"pattern_get_pattern_report(id)",
// 周报/月报(1)
"report_run_scheduled_report(range)",
// 大师圆桌(1)
"invest_roundtable(question)",
// 通知配置(2)
"notify_configure_notifier(channel, webhook_url)",
"notify_get_notifier_config()",
// 行情数据 — AKShare(5)
"market_get_stock_quote(ticker)",
"market_get_stock_history(ticker, period)",
"market_get_index_components(index_code)",
"market_get_valuation(ticker)",
"market_get_market_sentiment()",
// 行情数据 — Tushare(15)
"tushare_get_daily_price(ts_code)",
"tushare_get_weekly_price(ts_code)",
"tushare_get_realtime_quote(ts_code)",
"tushare_get_index_daily(index_code)",
"tushare_get_financial_indicator(ts_code)",
"tushare_get_income_statement(ts_code)",
"tushare_get_balance_sheet(ts_code)",
"tushare_get_cash_flow(ts_code)",
"tushare_get_index_components(index_code)",
"tushare_get_industry_classification(ts_code)",
"tushare_get_valuation_multi(ts_code)",
"tushare_get_market_top_movers()",
"tushare_get_stock_pledge_status(ts_code)",
"tushare_convert_ticker(ticker)",
"tushare_check_token_status()"
完整工具列表见 src/mcp_server/tools/。
16 位投资大师: 巴菲特、芒格、段永平、霍华德·马克斯、李录、格雷厄姆、达莫达兰、阿克曼、凯西·伍德、迈克尔·伯里、帕伯莱、塔勒布、林奇、费雪、德鲁肯米勒
5 个核心概念: 护城河、安全边际、能力圈、第二层思维、非对称风险
行业知识: 28 个申万行业深度研究框架(向量库内检索,不公开原文,保护核心方法论 IP)
| 数据源 | 用途 | 状态 |
|---|---|---|
| AKShare | 实时行情 | ✅ |
| Tushare | 财务/历史数据 | ✅ |
| Chroma | 向量索引 | ✅ |
| SQLite | 本地记忆 | ✅ |
# 启动 REST API Server(用于 LLM 配置)
python src/mcp_server/api_server.py
# 访问 http://localhost:8000/api/llm/config
# 启动前端(Next.js 落地页 + 设置面板)
npm install
npm run dev
# 访问 http://localhost:3000
测试:
pytest tests/
| 项目 | 用途 |
|---|---|
| invest-buddy-pet | 入门陪伴产品(人格测试) |
| mangoview | 超级系统站(专业分析) |
以下工具推荐基于 awesome-finai-tools-zn 的 SKILL.md 场景→工具映射表生成,每类场景精选 1 个最佳工具。完整工具清单请访问仓库主页。
| 推荐工具 | 功能 | 安装方式 |
|---|---|---|
| ashare-mcp | 生产级 A 股 MCP Server,30 个 tool(实时行情/K线/涨停池/龙虎榜/财报/板块资金) | git clone https://github.com/CharmYue/ashare-mcp && cd ashare-mcp && uv sync |
| opencli-eastmoney-quote | 零配置 CLI,A 股/港股/美股实时行情秒出结果 | npm install -g @jackwener/opencli |
| opencli-xueqiu-search | 雪球股票搜索 + 热门帖子舆情分析,中文/代码均可 | npm install -g @jackwener/opencli |
| Qlib | 微软 AI 量化框架,自动因子挖掘 + 模型训练 + 回测评估 | pip install pyqlib |
| 盈米基金 MCP | 69 个标准化 MCP 工具 + 16 项技能组件,含组合回测/蒙特卡洛模拟 | 联系盈米 AI 开放平台获取 API Key |
工具推荐逻辑基于 awesome-finai-tools-zn/data/institution-skills.json,每周自动更新。
本仓库是 FinAI 工具生态的一部分,与其他仓库协作:
| 仓库 | 定位 | 与本仓库的关系 |
|---|---|---|
| awesome-finai-tools-zn | 数据底座 | 提供工具清单+机构Skill数据 |
| invest-brain | 工具推荐引擎 | 基于场景自动推荐工具 |
| investment-buddy-pet | 人格化投顾 | 按投资人格匹配工具箱 |
| SoloAdvisor-Toolkit | 投顾流程工具包 | KYC→配置→组合→报告 |
| knowledge-workflow | 知识管理 | 收集→打标→存储→产出 |
改造需求详细文档:docs/改造需求-roadmap.md
P0 核心改造(个人知识库愿景):
P1 数据源:
P2 体验优化:
最近进展(2026-07-29):
thought_8)thought_9)docs/改造需求-roadmap.md)版本: v0.1.0 创建时间: 2026-06-24 许可: AGPL v3
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.