
Investbrain
com.mangofolioPublished by mangofolio.comv0.1.0Updated Oct 24, 2026
Investment discipline MCP server with RAG, behavior detection, journaling, and market data.
Overview
A local investment-discipline MCP server that lets an assistant record investment thoughts, query a knowledge base of famous investors, track behavior patterns,
- What you can do
- Record, search and review investment thoughts and decision cards, linked to past history and a user profile stored locally. Ask questions against a knowledge base of 16 famous investors and core concepts, and run a multi-master roundtable discussion. Detect and report recurring behavioral patterns such as chasing rallies or panic selling. Set, list and delete price, time or condition reminders, with notifications through configured channels. Pull market data: quotes, history, valuation, sentiment, index components, and financial statements via Tushare. Generate scheduled weekly or monthly reports and configure notification channels.
- When to use it
- For experienced investors who want a discipline aid rather than advice: forcing a written rationale before a trade, recalling past judgments, spotting repeated mistakes, and being reminded at chosen price or time points. It is not an advisory service and gives no recommendations.
- Requirements
- Runs as a local Python process started from the repository (pip install of its requirements, then python server.py), configured in the MCP client. A DeepSeek API key is required as the DEEPSEEK_API_KEY environment variable; Tushare, DashScope and Against Finance keys are optional. The first start may download an ~80MB embedding model for the vector store. Network access is needed for market data and notifications.
Installation
In SourceWeft
- Open Investbrain in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
InvestBrain — 投资第二大脑
有经验投资者的纪律自主工具,解决"知行合一"问题 不是投顾,不给建议,而是"镜子" + "纪律锚点"
[License: AGPL v3] [Python 3.10+] [MCP] [Desktop]
[English README] [llms.txt] [行为模式挖掘]
想法记录 × 投资 RAG × 记忆系统 × 提醒触发 × 行为模式挖掘
5 分钟快速体验
两种使用方式:桌面客户端(推荐) 或 MCP Server。
方式 A:桌面客户端(Windows,推荐)
- 下载并安装
InvestBrain_0.1.2_x64_en-US.msi(见 Releases) - 打开桌面应用,即见「大脑已加载」状态条与试聊引导
- 想对话时在设置页填入自己的 LLM Key,即可走真实对话链路
桌面端数据存储在
%APPDATA%\InvestBrain\data,设置页可直接查看数据位置。
方式 B:MCP Server(任意 MCP 客户端)
首次启动提示:向量库(Chroma + ONNX Embedding)首次会下载约 80MB 模型文件。若希望跳过向量库、纯工具调用体验,可保持
server.py中相关注释不变;如需完整 RAG 体验,下载后取消server.py内的注释行。
启动后 Server 会以 stdio 方式接受 MCP 客户端调用。配置 Claude Desktop 见下方 Claude Desktop 接入。
你的 Key,自己填
重要:本仓库不预置任何用户的 API key。data/config/llm.json 中 api_key 默认为 null(不是真的 key 占位);.env.example 只是模板;webhook.json 是空 schema。
你需要从下面这些官方后台自己申请 / rotate:
4 个 key 都写在哪里(都不会进 git)
- MCP 启动必须:
DEEPSEEK_API_KEY环境变量(推荐 User 级系统环境变量,或 CLAUDE.md /.env) - 可选:
TUSHARE_TOKEN/DASHSCOPE_API_KEY/AGAINST_API_KEY(环境变量) - 飞书 webhook:
data/config/webhook.json里的feishu字段(已被.gitignore保护)
安全规则
- 你的 key 是你的——不要 share、不要 commit、不要发到任何对话里
- key 进 git 历史(如被 commit 过的老版本)即使后来 rotate 仍可能被人滥用 → 发现泄露立即去对应平台 rotate
- 仓库已有
.gitignore保护data/config/*.json(含 llm/webhook 配置)+data/memory/*.db(用户记忆库,按 CLAUDE.md 决策"用户数据本地存储,不上传云端"),不要!取消忽略
备注:仓库历史曾 commit 过密钥占位(commit
22e6c72),如已 push 远端,老 key 在 clone 历史里仍可被读——清历史成本高、通常接受 + rotate 即可
快速开始:推送配置
从零到收到第一条微信推送,约 3 分钟。无需阅读任何文档。
方式一:一键脚本(推荐,Windows)
在仓库根目录打开 PowerShell,运行:
脚本会交互式引导你完成全部步骤:显示 PushPlus 获取 token 的操作步骤 → 粘贴 token(自动校验格式)→ 写入 data/config/webhook.json 并启用 pushplus 渠道 → 自动调用 send_notification 发送测试消息 → 打印成功/失败原因。
方式二:对话内配置(MCP 客户端内)
直接在任意 MCP 客户端中让 AI 帮你配置:
PushPlus token 获取步骤
- 微信扫码关注公众号:https://www.pushplus.plus
- 进入「个人中心」→ 复制页面上的 token
- 填入上述任一方式
验证成功:收到测试消息,或 notify_get_notifier_config() 返回 "enabled_channels": ["pushplus"]。未配置渠道时,提醒触发路径(price_checker / scheduler)返回中会携带 setup_guide 引导信息,而不会静默失败。
安全说明:
data/config/webhook.json已被.gitignore保护,token 不会进入 git;请勿把 token 发到任何对话或提交到仓库。
它解决什么问题
核心问题:投资者被叙事带着走,操作没纪律,事后后悔。
核心能力
示例对话
下面是三个核心价值场景的真实对话流(任意 MCP 客户端均可使用):
场景 1:RAG 问答 — 大师思想碰撞
用户:段永平怎么看"快钱"和"慢钱"?
调用:
rag_ask_investment(question="段永平怎么看快钱和慢钱")AI 返回: 段永平的核心观点是"快钱"看似机会多但风险敞口大,"慢钱"依靠复利与确定性。 在「段永平」语料中相关论述 12 条,节选:
"投资赚钱的速度不应该快过学习的速度。" "敢重仓的就是你能看懂的生意,剩下的不是机会。" 关联概念:能力圈、安全边际、复利。
场景 2:行为模式分析 — 找出反复犯的错
用户:我最近的交易有什么问题?
调用:
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% 建议:触发时自动推送飞书提醒 + 大师原话引用
场景 3:智能提醒 — 纪律锚点
用户:NVDA 到 950 美元时提醒我重新评估。
调用:
reminder_set_reminder(condition={ticker:"NVDA", operator:"<=", threshold:950, action:"review"})AI 返回: 提醒已建立:NVDA <= 950 USD 时触发"复盘评估"。 触发后将自动拉取:当前价格、你对此票的历史决策卡片、相关大师语录。 提醒已同步通知通道(如已配置)。
Claude Desktop 接入
将 InvestBrain 接入 Claude Desktop(macOS / Windows 通用):
配置文件位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
配置内容(路径按你 clone 的实际位置修改):
配置完成后重启 Claude Desktop,会在工具栏出现"投资助手"图标(39 个工具,与
server.json注册的工具清单一致)。
开源协议与路线图
本项目采用 GNU Affero General Public License v3.0 (AGPLv3) 授权。简言之:你可以自由使用、修改和分发,但通过网络提供服务的衍生作品也必须以相同协议开源。详见 LICENSE。
架构
MCP Tools(40 个)
完整工具列表见 src/mcp_server/tools/。
知识库
16 位投资大师: 巴菲特、芒格、段永平、霍华德·马克斯、李录、格雷厄姆、达莫达兰、阿克曼、凯西·伍德、迈克尔·伯里、帕伯莱、塔勒布、林奇、费雪、德鲁肯米勒
5 个核心概念: 护城河、安全边际、能力圈、第二层思维、非对称风险
行业知识: 28 个申万行业深度研究框架(向量库内检索,不公开原文,保护核心方法论 IP)
数据源
开发
测试:
相关项目
🛠️ 推荐工具链
以下工具推荐基于 awesome-finai-tools-zn 的 SKILL.md 场景→工具映射表生成,每类场景精选 1 个最佳工具。完整工具清单请访问仓库主页。
工具推荐逻辑基于 awesome-finai-tools-zn/data/institution-skills.json,每周自动更新。
🔗 工具链联动
本仓库是 FinAI 工具生态的一部分,与其他仓库协作:
🗺️ Roadmap
改造需求详细文档:docs/改造需求-roadmap.md
P0 核心改造(个人知识库愿景):
- 🔴 用户自定义 RAG 知识库(让用户自己的框架可被 RAG 引用)
- 🔴 新闻/事件触发 reminder(央行购金、地缘冲突、美债冻结等)
- 🔴 投资框架管理工具(结构化记录用户的框架规则与触发条件)
P1 数据源:
- 🟡 黄金现货 / 美元指数 / 美债收益率实时数据
- 🟡 黄金 ETF(518880 / GLD)数据修复
P2 体验优化:
- 🟢 思考卡 NLU 抽取 bug(数字/英文名误识别)
最近进展(2026-07-29):
- ✅ 黄金投资框架核心已写入思考卡(
thought_8) - ✅ 基于真实数据的黄金推演已写入思考卡(
thought_9) - ✅ 改造需求文档已建(
docs/改造需求-roadmap.md)
版本: v0.1.2 创建时间: 2026-06-24 许可: AGPL v3
Source: README.md at commit a776d57
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts