Skip to main content
Glama

AKShare MCP Server

by ttjslbz001

Servidor MCP de AKShare

Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona capacidades de análisis de datos financieros utilizando la biblioteca AKShare.

Características

  • Acceso a datos del mercado financiero chino y mundial a través de AKShare
  • Integración con Claude Desktop mediante el protocolo MCP
  • Soporte para diversas consultas y análisis de datos financieros

Instalación

Uso de uv (recomendado)

# 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 .

Usando 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 .

Uso

Ejecutando el servidor

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

Integración con Claude Desktop

  1. Agregue la siguiente configuración a su configuración de 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. Reiniciar Claude Desktop
  2. Seleccione el servidor AKShare MCP de las herramientas disponibles

Herramientas disponibles

El servidor AKShare MCP proporciona las siguientes herramientas:

  • Consultas de datos bursátiles
  • Consultas de datos de fondos
  • Consultas de datos de bonos
  • Consultas de datos de futuros
  • Consultas de datos de Forex
  • Consultas de datos macroeconómicos
  • Y más...

Agregar una nueva herramienta

Para agregar una nueva herramienta al servidor MCP, siga estos pasos:

  1. Agregue una nueva función API en src/mcp_server_akshare/api.py :
    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. Agregue la nueva herramienta a la enumeración en src/mcp_server_akshare/server.py :
    class AKShareTools(str, Enum): # Existing tools... NEW_TOOL_NAME = "new_tool_name"
  3. Importe la nueva función en src/mcp_server_akshare/server.py :
    from .api import ( # Existing imports... fetch_new_data_function, )
  4. Agregue la definición de la herramienta a la función 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. Agregue el controlador de herramientas en la función 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. Pruebe la nueva herramienta ejecutando el servidor y realizando una solicitud a la nueva herramienta.

Desarrollo

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

Estibador

También puedes ejecutar el servidor usando Docker:

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

Licencia

Instituto Tecnológico de Massachusetts (MIT)

-
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.

Un servidor de protocolo de contexto modelo que permite a Claude Desktop acceder y analizar datos del mercado financiero chino y mundial a través de la biblioteca AKShare.

  1. Características
    1. Instalación
      1. Uso de uv (recomendado)
      2. Usando pip
    2. Uso
      1. Ejecutando el servidor
      2. Integración con Claude Desktop
    3. Herramientas disponibles
      1. Agregar una nueva herramienta
        1. Desarrollo
          1. Estibador
            1. Licencia

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                A collection of Model Context Protocol servers that enable Claude Desktop to provide development assistance capabilities with filesystem, Git, shell command, and web search functionality without incurring API usage costs.
                Last updated -
                2
                19
                TypeScript
                MIT License
                • Apple
              • -
                security
                F
                license
                -
                quality
                A modular, extensible Model Context Protocol server framework designed for Claude Desktop that uses convention-based automatic module discovery to easily extend AI application functionality without modifying core code.
                Last updated -
                3
                Python
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server focused on China's A-share stock market that provides data on stocks, financials, market indices, and macroeconomic indicators.
                Last updated -
                27
                323
                Python
                MIT License
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables interaction with Polymarket prediction markets through Claude Desktop.
                Last updated -
                3
                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/ttjslbz001/akshare_mcp_server'

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