
Invest Brain
io.github.lj22503Published by GitHub account lj22503v0.1.1Updated Oct 24, 2026
A-share investment research: quotes, financials, behavior patterns, and trading journals.
The publisher's own server: BrainDog
Overview
Lets an assistant record investment thoughts, query a master-investor knowledge base, mine behavior patterns, and set price or time reminders for A-share…
- What you can do
- Invest Brain is a local MCP server for A-share investment research and self-discipline. It exposes roughly 39 tools across thought capture, investment RAG over 16 investors and core concepts, a memory system with user profile and decision cards, behavior-pattern mining, price/time/condition reminders with multi-channel push, weekly or monthly reports, and market data via AKShare and Tushare. It also includes notification configuration tools.
- When to use it
- Use it if you want an assistant to keep a trading journal, retrieve investor commentary while making decisions, surface recurring behavioral biases, or watch price and time conditions and notify you. It is aimed at experienced investors seeking discipline rather than advice.
- Requirements
- Runs locally as a Python MCP server (pip install -r requirements.txt, then python server.py) or as a Windows desktop client. A DEEPSEEK_API_KEY environment variable is required for the LLM; optional TUSHARE_TOKEN, DASHSCOPE_API_KEY and AGAINST_API_KEY environment variables, and a Feishu webhook in data/config/webhook.json. First run downloads about 80MB of Chroma/ONNX embedding models. Network access needed for market data and notifications.
Installation
In SourceWeft
- Open Invest Brain 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.1LatestSep 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
Other Brain integrations

BrainDog
dog.brainOfficial publisher
BrainDog is a hosted record of projects, decisions and money that connected AI agents read before starting work and write their results into.

Codebase Brain
Published by GitHub account Nomannazir
Indexes a local or public git codebase so an assistant can search it, trace git history, check change impact and find stale docs, all with path:line citations.

Personal Brain
Published by GitHub account zhang-liz
Gives an AI assistant memory of your professional network, stored as a graph in FalkorDB, so it can look up contacts, find people by topic, and save who you…

Second Brain
Published by GitHub account ara-5
Shared Graph-RAG memory for AI agents: markdown vault, wikilink recall, tasks, messaging.

Make0 Brain
Published by GitHub account make0-official
Local, offline memory server that gives Claude Code, Cursor, Codex and other MCP agents one shared, versioned store of durable facts.