Skip to main content
Glama

mcp-server-shioaji

Official
by Sinotrade

Shioaji 的 MCP 服务器

模型上下文协议 (MCP) 服务器,为 AI 助手提供访问台湾金融市场的 Shioaji 交易 API 的权限。

概述

该服务器实现了 MCP 协议,将 Shioaji API 功能公开为可供 AI 助手使用的工具。它允许 AI 模型执行以下操作:

  • 检索当前股票价格
  • 获取历史数据
  • 列出可用股票
  • 还有更多...

安装

先决条件

  • Python 3.10 或更高版本
  • uv(快速 Python 包管理器)

使用 uv

uv sync

配置

在运行服务器之前,您需要配置Shioaji API凭据。有两种方法可以做到这一点:

环境变量

设置以下环境变量:

export SHIOAJI_API_KEY="your_api_key" export SHIOAJI_SECRET_KEY="your_secret_key"

使用 .env 文件

在根目录中创建一个.env文件,其内容如下:

SHIOAJI_API_KEY=your_api_key SHIOAJI_SECRET_KEY=your_secret_key

运行服务器

使用以下命令启动服务器:

uv run mcp-server-shioaji

服务器默认从http://0.0.0.0:8000启动。

可用工具

服务器通过 MCP 公开以下工具:

获取股票价格

通过股票代码获取股票的当前价格。

{ "tool": "get_stock_price", "params": { "symbols": "TW.2330,TW.2317" } }

响应将包括所请求股票的价格信息,包括开盘价、最高价、最低价、收盘价、交易量和其他交易数据。

获取kbars

获取某个日期范围内股票的 K-Bar(烛台)数据。

{ "tool": "get_kbars", "params": { "symbol": "TW.2330", "start_date": "2023-12-01", "end_date": "2023-12-15" } }

如果未提供start_date ,则默认为今天。如果未提供end_date ,则默认与start_date相同。

扫描股票

根据各种排名标准扫描股票。

{ "tool": "scan_stocks", "params": { "scanner_type": "VolumeRank", "ascending": false, "limit": 10 } }

支持的扫描仪类型:

  • VolumeRank - 按交易量排名
  • AmountRank - 按交易金额排名
  • TickCountRank - 按交易数量排名
  • ChangePercentRank - 按百分比变化排名
  • ChangePriceRank - 按价格变化排名
  • DayRangeRank - 按每日范围排名

默认限制为 20,结果默认按降序排列( ascendingtrue可实现升序排列)。

发展

项目结构

mcp-server-shioaji/ ├── src/ │ └── mcp_server_shioaji/ │ ├── __init__.py # Package entry point │ └── server.py # MCP server implementation ├── pyproject.toml # Project metadata and dependencies └── README.md # This file

添加新工具

要添加新的 Shioaji 功能,请修改server.py并使用@mcp.tool装饰器添加新的工具定义。

执照

麻省理工学院

致谢

  • Shioaji - 永丰金控交易 API 的 Python 包装器
  • MCP——模型上下文协议
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议 (MCP) 服务器,为 AI 助手提供访问台湾金融市场的 Shioaji 交易 API 的权限。

  1. 概述
    1. 安装
      1. 先决条件
      2. 使用 uv
    2. 配置
      1. 环境变量
      2. 使用 .env 文件
    3. 运行服务器
      1. 可用工具
        1. 获取股票价格
        2. 获取kbars
        3. 扫描股票
      2. 发展
        1. 项目结构
        2. 添加新工具
      3. 执照
        1. 致谢

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
            Last updated -
            1
            1,964
            1,697
            TypeScript
            MIT License
            • Apple
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol (MCP) server that provides real-time access to financial market data through the free Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes and company information.
            Last updated -
            5
            30
            Python
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that enables AI assistants to interact with the Deriv trading API, providing access to active trading symbols and account balance information.
            Last updated -
            2
            Python
            • Apple
          • -
            security
            A
            license
            -
            quality
            MCP server that provides AI assistants access to stock market data including financial statements, stock prices, and market news through a Model Context Protocol interface.
            Last updated -
            322
            Python
            MIT License
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sinotrade/mcp-server-shioaji'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server