Skip to main content
Glama

AKShare MCP Server

by ttjslbz001

AKShare MCP サーバー

AKShare ライブラリを使用して財務データ分析機能を提供するモデル コンテキスト プロトコル (MCP) サーバー。

特徴

  • AKShareを通じて中国および世界の金融市場データにアクセス
  • MCPプロトコルによるClaude Desktopとの統合
  • さまざまな財務データのクエリと分析のサポート

インストール

uvの使用(推奨)

# Clone the repository git clone https://github.com/yourusername/akshare_mcp_server.git cd akshare_mcp_server # Create and activate a virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies with uv uv pip install -e .

pipの使用

# Clone the repository git clone https://github.com/yourusername/akshare_mcp_server.git cd akshare_mcp_server # Create and activate a virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -e .

使用法

サーバーの実行

# Activate the virtual environment source venv/bin/activate # On Windows: venv\Scripts\activate # Run the server python run_server.py

Claude Desktopとの統合

  1. Claude Desktop 構成に次の構成を追加します。
"mcpServers": { "akshare-mcp": { "command": "uv", "args": [ "--directory", "/path/to/akshare_mcp_server", "run", "akshare-mcp" ], "env": { "AKSHARE_API_KEY": "<your_api_key_if_needed>" } } }
  1. Claudeデスクトップを再起動します
  2. 利用可能なツールからAKShare MCPサーバーを選択します

利用可能なツール

AKShare MCP サーバーは次のツールを提供します。

  • 株価データクエリ
  • ファンドデータのクエリ
  • 債券データクエリ
  • 先物データクエリ
  • 外国為替データクエリ
  • マクロ経済データのクエリ
  • さらに…

新しいツールの追加

MCP サーバーに新しいツールを追加するには、次の手順に従います。

  1. src/mcp_server_akshare/api.pyに新しい API 関数を追加します
    async def fetch_new_data_function(param1: str, param2: str = "default") -> List[Dict[str, Any]]: """ Fetch new data type. Args: param1: Description of param1 param2: Description of param2 """ try: df = ak.akshare_function_name(param1=param1, param2=param2) return dataframe_to_dict(df) except Exception as e: logger.error(f"Error fetching new data: {e}") raise
  2. 新しいツールをsrc/mcp_server_akshare/server.pyの列挙型に追加します
    class AKShareTools(str, Enum): # Existing tools... NEW_TOOL_NAME = "new_tool_name"
  3. src/mcp_server_akshare/server.pyに新しい関数をインポートします
    from .api import ( # Existing imports... fetch_new_data_function, )
  4. handle_list_tools()関数にツール定義を追加します
    types.Tool( name=AKShareTools.NEW_TOOL_NAME.value, description="Description of the new tool", inputSchema={ "type": "object", "properties": { "param1": {"type": "string", "description": "Description of param1"}, "param2": {"type": "string", "description": "Description of param2"}, }, "required": ["param1"], # List required parameters }, ),
  5. handle_call_tool()関数にツール ハンドラーを追加します
    case AKShareTools.NEW_TOOL_NAME.value: param1 = arguments.get("param1") if not param1: raise ValueError("Missing required argument: param1") param2 = arguments.get("param2", "default") result = await fetch_new_data_function( param1=param1, param2=param2, )
  6. サーバーを実行し、新しいツールにリクエストを送信して、新しいツールをテストします

発達

# Install development dependencies uv pip install -e ".[dev]" # Run tests pytest

ドッカー

Docker を使用してサーバーを実行することもできます。

# Build the Docker image docker build -t akshare-mcp-server . # Run the Docker container docker run -p 8000:8000 akshare-mcp-server

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Claude Desktop が AKShare ライブラリを通じて中国および世界の金融市場データにアクセスし、分析できるようにするモデル コンテキスト プロトコル サーバー。

  1. 特徴
    1. インストール
      1. uvの使用(推奨)
      2. pipの使用
    2. 使用法
      1. サーバーの実行
      2. Claude Desktopとの統合
    3. 利用可能なツール
      1. 新しいツールの追加
        1. 発達
          1. ドッカー
            1. ライセンス

              Related MCP Servers

              • A
                security
                F
                license
                A
                quality
                A Model Context Protocol server that provides tools to search and retrieve economic data series from the Federal Reserve Economic Data (FRED) API.
                Last updated -
                2
                3
                TypeScript
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that interfaces with Alpaca trading API, allowing users to manage portfolios, place trades, and access market data through natural language interactions.
                Last updated -
                Python
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants like Claude to programmatically access financial data from Financial Modeling Prep API, including company profiles, financial statements, metrics, SEC filings, and market data.
                Last updated -
                5
                Python
                MIT License
              • -
                security
                F
                license
                -
                quality
                A Multi-Call Protocol server providing comprehensive access to Chinese stock market data through a unified API, leveraging AKShare to fetch real-time and historical data from various Chinese exchanges.
                Last updated -
                2
                Python
                • Linux

              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/ttjslbz001/akshare_mcp_server'

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