AKShare MCP Server
AKShare MCP サーバー
AKShare ライブラリを使用して財務データ分析機能を提供するモデル コンテキスト プロトコル (MCP) サーバー。
特徴
AKShareを通じて中国および世界の金融市場データにアクセス
MCPプロトコルによるClaude Desktopとの統合
さまざまな財務データのクエリと分析のサポート
Related MCP server: Tushare_MCP
インストール
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.pyClaude Desktopとの統合
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>"
}
}
}Claudeデスクトップを再起動します
利用可能なツールからAKShare MCPサーバーを選択します
利用可能なツール
AKShare MCP サーバーは次のツールを提供します。
株価データクエリ
ファンドデータのクエリ
債券データクエリ
先物データクエリ
外国為替データクエリ
マクロ経済データのクエリ
さらに…
新しいツールの追加
MCP サーバーに新しいツールを追加するには、次の手順に従います。
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新しいツールを
src/mcp_server_akshare/server.pyの列挙型に追加します。class AKShareTools(str, Enum): # Existing tools... NEW_TOOL_NAME = "new_tool_name"src/mcp_server_akshare/server.pyに新しい関数をインポートします。from .api import ( # Existing imports... fetch_new_data_function, )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 }, ),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, )サーバーを実行し、新しいツールにリクエストを送信して、新しいツールをテストします。
発達
# 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ライセンス
マサチューセッツ工科大学
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server giving AI agents one-connection access to China A-share market intelligence: financials,
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
China A-share market data for research, backtesting and AI agents via MCP.
A Model Context Protocol server exposing real-time and historical Colombo Stock Exchange (CSE) data to AI agents and LLM applications. Provides quotes and OHLCV price history, full financial statements (income, balance sheet, cash flow), pre-computed technicals (moving averages, RS ratings, volume signals), macroeconomic indicators, corporate actions, and rule-based screening across CSE stocks and sector indices, everything needed to build CSE-aware trading assistants, research tools, and market-analysis agents. This is the official MCP server of www.ceyloncharts.com
Related MCP Servers
- AlicenseCqualityFmaintenanceA Model Context Protocol server providing tools for querying A-share stock market data, including historical prices, financial reports, market indices, and macroeconomic indicators.41646MIT
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that provides intelligent stock data assistance through Tushare's financial data API, enabling users to query comprehensive stock information, financial data, and market indices through natural language.49MIT
- FlicenseBqualityDmaintenanceA financial data server that provides real-time and historical data for A-shares, Hong Kong, and US markets using the AkShare library. It enables users to query market quotes, fundamental information, and technical indicators through the Model Context Protocol.144-
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that integrates Futu OpenAPI, enabling AI models to query real-time market data and execute trades across Hong Kong, US, and A-share markets.38 PyPI81MIT