Skip to main content

MCP Server for stock and crypto

Project description

📈 AkTools Pro MCP Server

让 AI 成为你的金融分析师
Empower your AI Agents with Professional Financial Intelligence

Version License Python FastMCP GitHub stars

功能亮点系统架构快速开始工具一览实战示例


AkTools Pro 是一个基于 akshare 的增强型 MCP (Model Context Protocol) 服务器。它不仅仅是一个数据接口,更是一个内置了专业金融分析逻辑、交易策略和可视化能力的 AI 技能库。

无论是 A 股、港美股、加密货币还是贵金属,AkTools Pro 都能让你的 AI Agent 像资深分析师一样思考和回答。

🌟 核心特性

🧠 智能技能引擎 💹 全球市场覆盖
内置 MCP PromptsResources,注入 "分析师" 人格与 SOP 标准流程。 一站式覆盖 A股、港股、美股、加密货币、贵金属 等主流投资品种。
📊 可视化增强 🛡️ 极致性能
支持在聊天界面直接绘制 ASCII 字符走势图,让数据趋势一目了然。 采用 内存 + 磁盘 双层缓存机制,毫秒级响应,智能保护数据源。
💼 实战模拟 🧪 策略实验室
内置虚拟持仓管理系统,支持 AI 自动跟踪 盈亏 (P&L) 与胜率统计。 内置回测引擎,支持验证 SMA / RSI / MACD 等经典交易策略。

🏗 系统架构

graph TD
    User((User / AI Agent)) <-->|MCP Protocol| Server[AkTools Pro Server]
    
    subgraph "Core Engine"
        Server --> Skills[Skill Injector]
        Server --> Cache[Dual-Layer Cache]
        Server --> Visual[Visual Engine]
        Server --> Logic[Backtest/Analysis]
    end
    
    subgraph "Data Sources"
        Cache <--> AkShare[AkShare API]
        Cache <--> OKX[OKX / Binance]
        Cache <--> News[Financial News]
    end
    
    Skills -->|SOPs & Prompts| User
    Visual -->|ASCII Charts| User

🚀 快速开始

选择最适合你的安装方式,30秒内即可启动。

📦 方式 1: 自动安装 (推荐)

在你的 AI 终端中根据客户端类型执行:

OpenCode (Sisyphus)

opencode mcp add
# 1. Location: Global
# 2. Name: aktools-pro
# 3. Type: Local
# 4. Command: uvx aktools-pro

Claude Code / OpenAI Codex

claude mcp add aktools-pro -- uvx aktools-pro

Cursor / VS Code

mcpServers 配置文件中添加:

"aktools-pro": {
  "command": "uvx",
  "args": ["aktools-pro"]
}
🐳 方式 2: Docker 部署

适合服务器环境或偏好隔离的用户:

mkdir /opt/aktools-pro
cd /opt/aktools-pro
wget https://raw.githubusercontent.com/tchivs/mcp-aktools/main/docker-compose.yml
docker-compose up -d
⚙️ 环境变量配置
变量名 说明 默认值
OKX_BASE_URL OKX 代理地址 https://okx.com
BINANCE_BASE_URL 币安代理地址 https://www.binance.com
NEWSNOW_BASE_URL 资讯接口地址 https://newsnow.busiyi.world
TRANSPORT MCP 协议 stdio

🛠 工具一览

AkTools Pro 提供了 61 个专业工具,分为以下核心模块:

📈 股票 & 市场 (Stock & Market)

覆盖 A股/港股/美股 的行情与基本面

  • 基础: search (搜代码), stock_info (个股信息)
  • 行情: stock_prices (历史K线), stock_zt_pool_em (涨停池)
  • 数据: stock_indicators (财务指标), stock_lhb (龙虎榜), northbound_funds (北向资金)
  • 分析: sector_valuation (行业估值), sector_rotation (板块轮动), market_anomaly_scan (异动扫描)

₿ 加密货币 (Crypto)

接入 OKX/Binance 的深度数据

  • 行情: okx_prices (K线), draw_crypto_chart (字符图)
  • 情绪: fear_greed_index (恐贪指数), okx_loan_ratios (多空比)
  • 衍生品: okx_funding_rate (资金费率), okx_open_interest (持仓量)
  • 智能: binance_ai_report (AI研报), crypto_composite_diagnostic (综合诊断)

🥇 贵金属 (Precious Metals)

黄金/白银的期现货数据

  • 价格: pm_spot_prices (现货), pm_international_prices (外盘)
  • 库存: pm_etf_holdings (ETF持仓), pm_comex_inventory (COMEX库存)
  • 分析: pm_basis (期现基差), pm_composite_diagnostic (综合诊断)

💱 外汇 (Forex)

全球汇率行情与历史数据

  • 行情: fx_spot_rates (即期汇率), fx_cross_rates (交叉汇率)
  • 历史: fx_history (历史汇率)

🏗️ 期货 (Futures)

商品与金融期货深度数据

  • 行情: futures_prices (K线数据)
  • 库存: futures_inventory (交易所库存)
  • 基差: futures_basis (期现基差)
  • 持仓: futures_positions (仓单日报)

🏦 基金 (Funds)

公募基金与 ETF 数据

  • 基础: fund_info (基本信息), fund_ranking (基金排行)
  • 业绩: fund_nav (净值走势)
  • 持仓: fund_holdings (重仓股)
  • ETF: etf_prices (二级市场行情)

🌍 宏观经济 (Macro)

全球与中国宏观经济指标

  • 核心: macro_gdp (国内生产总值), macro_cpi (消费者物价指数)
  • 景气: macro_pmi (采购经理指数)
  • 金融: macro_interest_rate (基准利率), macro_money_supply (货币供应量)

🧠 智能技能 (AI Skills)

让 AI 具备专业分析师的思维

  • 股票 Prompts: analyze-stock (个股诊断), market-pulse (市场脉搏)
  • 加密 Prompts: analyze-crypto (币种分析), crypto-pulse (币圈脉搏)
  • 贵金属 Prompts: analyze-precious-metal (贵金属诊断), precious-metal-pulse (贵金属脉搏)
  • Resources: skill://trading/logic/technical-analysis, skill://trading/logic/precious-metals-analysis
  • Portfolio: portfolio_add (模拟交易), portfolio_view (盈亏分析), trading_suggest (AI建议)

💡 实战示例

让 AI 帮你分析一只股票,体验 AkTools Pro 的强大:

User: 帮我分析一下 贵州茅台(600519) 的近期走势

Assistant: 好的,正在为您获取 贵州茅台(600519) 的综合数据...

[调用 stock_prices, stock_indicators, stock_news...]

📊 **贵州茅台 (600519) 技术面分析**

Price
2100 +                                     |
     |              |                      |
2050 +            | | |                    |
     |          | | | |  |                 |
2000 +        | | | | |  | |               |
     |      | | | | | |  | | |             |
1950 +    | | | | | | |  | | |             +------- 现价: 1985.00
     |  | | | | | | | |  | | |             |
1900 +| | | | | | | | |  | | |             |
     +-------------------------------------+
      10-01   10-15   11-01   11-15   12-01

📈 **诊断结论**:
1. **趋势**: 短期均线(MA5/10)呈多头排列,RSI(14) 为 62.5,处于强势区间。
2. **资金**: 北向资金近3日连续净买入,机构持仓保持稳定。
3. **估值**: 当前 PE(TTM) 为 28.5,处于历史 40% 分位,具备安全边际。

💡 **操作建议**: 持有 (Score: 85)

🆚 版本对比

功能特性 AkTools (原版) AkTools Pro (本版)
项目架构 单文件脚本 📦 模块化工程
回测引擎 支持
模拟持仓 支持
ASCII 图表 支持
SOP 技能库 支持
类型安全 全类型提示

👨‍💻 开发与贡献

# 同步环境
uv sync

# 运行检查
uv run aktools-pro inspect

Built with ❤️ for the Quantitative Trading Community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aktools_pro-0.5.0.tar.gz (230.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aktools_pro-0.5.0-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file aktools_pro-0.5.0.tar.gz.

File metadata

  • Download URL: aktools_pro-0.5.0.tar.gz
  • Upload date:
  • Size: 230.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aktools_pro-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7c74458ab741fbbba4700cb5671211b06e276e2a5d96fbc5eb737f34a7c3feeb
MD5 cb99df6717bc97bab2efbe10ae0341d4
BLAKE2b-256 f01b493f004d2bdf2d178dd48656cc7d33facebcba56e39361694561105957c7

See more details on using hashes here.

File details

Details for the file aktools_pro-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: aktools_pro-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aktools_pro-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c10afd606636b47045844659f91f552c3750a4457ae9e5b00941e022a8f0983e
MD5 53dccff5ed8857fad280f7ce08f74c4b
BLAKE2b-256 6fb96d131fe1747d9ba8c39921cdc647e9e51f9c432d96fa29bc5ac91ecde88f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page