Install
$ agentstack add mcp-ojkkk-mcp-finance ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
⚡ 快速开始
pip install mcp-markets
# 方式一:作为 MCP Server 运行(供 Claude / Codex / Cursor 调用)
python -m mcp_finance.server
# 方式二:启动内置 Web Dashboard
mcp-dashboard # 默认 http://localhost:8080
> Python 3.10+ · 零配置即可使用 · 可选设置 TUSHARE_TOKEN 环境变量启用高级财务数据
✨ 核心能力一览
| 模块 | 功能 | 亮点 | |------|------|------| | 📈 实时行情 | A股/港股/美股/期货/指数 | easy-tdx 毫秒级,三源自动降级 | | 📊 K线数据 | 日/周/月/分钟 K线,前/后复权 | A股 800 条,港美股 yfinance 兜底 | | 🔬 技术指标 | MA·MACD·KDJ·RSI·BOLL·WR·BIAS | 金叉/死叉/超买超卖自动识别 | | 🔍 选股器 | 11 维条件筛选 + 五因子排名 | 动量·价值·质量·增长·波动 | | 🧪 策略回测 | 9 大策略 + 参数优化 | Backtrader 事件驱动,125× 性能提升 | | 💼 组合分析 | 多股对比 + 相关性矩阵 + 组合回测 | 支持等权/自定义权重 | | 🏢 基本面 | 财务指标 / 机构持仓 / 研报 / 龙虎榜 | AKShare + Tushare 双源 | | 🖥️ Web 看板 | Flask 实时行情 Dashboard | Plotly + ECharts 交互图表 |
🏗️ 四数据源架构
graph LR
A["📡 数据源层"] --> B["⚡ easy-tdx通达信 TCP · C["🌐 AKShare新浪 / 同花顺 / 东方财富"]
A --> D["🌍 yfinanceYahoo Finance 兜底"]
A --> E["📈 Tushare深度财务 · Token 鉴权"]
B --> F["🔧 31 MCP Tools"]
C --> F
D --> F
E --> F
F --> G["📈 行情实时价 / 批量 / K线"]
F --> H["🔬 技术分析MA·MACD·KDJ·RSI·BOLL"]
F --> I["📋 选股条件筛选 · 五因子排名"]
F --> J["⚙️ 回测9 策略 · 贝叶斯优化"]
F --> K["📊 组合多股对比 · 相关性 · Portfolio"]
F --> L["🏢 基本面财务 · 研报 · 龙虎榜 · 大宗"]
F --> M["🖥️ DashboardFlask Web · 实时刷新"]
style A fill:#1e1b4b,stroke:#6366f1,color:#fff
style F fill:#0f172a,stroke:#334155,color:#fff
style G fill:#312e81,color:#fff
style H fill:#312e81,color:#fff
style I fill:#312e81,color:#fff
style J fill:#312e81,color:#fff
style K fill:#312e81,color:#fff
style L fill:#312e81,color:#fff
style M fill:#be185d,color:#fff
🎯 全部 31 个 MCP 工具
行情报价
| 工具 | 功能 | 数据源 | 延迟 | |------|------|--------|------| | get_realtime_quote | 单股实时行情(现价/涨跌幅/量比/换手率) | easy-tdx → AKShare → yfinance | 响应式布局 · Plotly / ECharts 交互图表 · 实时行情自动刷新
🔌 配置 MCP 客户端
Claude Desktop
{
"mcpServers": {
"mcp-finance": {
"command": "python",
"args": ["-m", "mcp_finance.server"]
}
}
}
Codex
codex mcp add mcp-finance -- python -m mcp_finance.server
Cursor / VS Code
{
"mcpServers": {
"mcp-finance": {
"type": "stdio",
"command": "python",
"args": ["-m", "mcp_finance.server"]
}
}
}
> 可选:启用 Tushare 财务数据 — 设置环境变量 TUSHARE_TOKEN=你的token(注册 tushare.pro 免费获取)。未设置时自动降级,不影响基础功能。
🧪 测试 & 开发
git clone https://github.com/ojkkk/mcp-finance.git
cd mcp-finance
pip install -e ".[dev]"
# 运行测试
pytest tests/ -v
# 代码检查
ruff check mcp_finance/
🌟 AI 对话示例
| 场景 | 自然语言提问 | |------|------------| | 行情 | "茅台现在什么价?" / "腾讯港股和苹果美股今天表现如何?" | | 技术分析 | "茅台 MACD 金叉了吗?RSI 到什么位置了?" | | 选股 | "找涨超 3%、量比>1.5、PE 本工具仅供学习交流,所有数据仅供参考,不构成任何投资建议。
- 数据来源于第三方公开接口与网页爬虫,不作准确性、完整性、及时性保证
- 无自有数据源,全部依赖 easy-tdx(通达信公开 TCP)/ AKShare(网页爬虫)/ yfinance / Tushare
- 数据无合规商业授权,个人非商用无问题,企业商用存在版权与合规风险
- 回测结果不代表未来表现,历史收益不预示未来收益
- 作者不对任何投资损失承担责任 · 投资有风险,入市需谨慎
📄 License
MIT © mcp-finance
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: ojkkk
- Source: ojkkk/mcp-finance
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.