YC

youhaozhao/cninfo-mcp

Developer tools

This page was translated automatically. Technical details may differ from the original. View the original

27 stars 11 forks Quality 80 Trend 14MIT

CNINFO MCP Server

Overview

A tool for querying and downloading periodic reports and prospectus PDFs of listed companies on CNINFO via the MCP agreement, suitable for Claude Desktop / Claude Code. The backend of CNINFO prohibits large amounts of concurrency; it is recommended to set the concurrency count to 4 to prevent backend backend from returning a large number of 403 errors that could temporarily block the IP This command creates a Python virtual environment at ~/.cninfo-mcp/venv and uses pip to install dependencies in Python/requirements.txt from PyPI. npm install and server startup neither create an environment nor execute pip; If the environment is missing or dependencies expire, the server will directly report an error and prompt you to run this command again. : ~/Library/Application Support/Claude/claude_desktop_config.json : %APPDATA%\Claude\claude_desktop_config.json env can be omitted. CNINFO_MCP_DOWNLOAD_DIR is the root directory for downloads; when not set, it is ~/Downloads/cninfo-mcp. - — Query report list, parameters: stock code (required), year (optional), report type (optional, default annual) - — Download report PDF, parameters: stock code (required), year (optional), save path (optional), report type (optional, default annual) Save paths can only be located inside the download root directory: relative paths (such as annual/2024) are parsed by subdirectory under the root directory, and paths outside the root directory (including and external symbolic links) will be rejected and will not be written to any files.

Overview (machine translated)

An MCP Server allows AI assistants like Claude to query and download listed companies’ annual, semi-half, quarterly, and prospectus PDFs from CNINFO. Covers the Shanghai and Shenzhen markets (Main Board, ChiNext, STAR Market) and the Beijing Stock Exchange.

This project is an open-source implementation maintained by the community and is not an official product of CNINFO.. Please refer to the disclaimer for details.

After installation, ask questions directly in natural language:

Installation

Requires Node.js 18+ and Python 3.10+.

1. Install Python dependencies (only once)

Dependencies are installed in a separate virtual environment ~/.cninfo-mcp/venv and will not affect your system Python. If after upgrading, if the dependency is prompted to expire, just run it again.

2. Add to MCP Client

Claude Code

Claude Desktop and other clients

Add the following to the configuration file, then restart the client. The Claude Desktop configuration file is located at:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:%APPDATA%\Claude\claude_desktop_config.json

Configuration

Environment variable Description Default value
CNINFO_MCP_DOWNLOAD_DIR Download the root directory, all PDFs will only be written to this directory ~/Downloads/cninfo-mcp

Use Tips

Controlling Concurrency

CNINFO will return 403 for a large number of concurrent requests and temporarily ban IPs. When conducting batch queries or downloads, it is recommended to limit simultaneous calls to no more than 4.

Year omitted

If the year is not specified, the report will be returned or downloaded for all years. The prospectus does not have a fixed year; you can omit the year when querying.

Beijing Stock Exchange Code

Both old and new codes for BSE stocks can be used; for example, 920185 and 835185 point to the same company.

Available tools

  • query_annual_reports_tool: Query the report list, returning the title, disclosure date, and PDF address.
  • stock_code (required): stock code, such as 000888
  • year (optional): reporting year, e.g., 2024
  • report_type(optional): Report type, default annual
  • download_annual_reports_tool: Download the report PDF locally.
  • stock_code (required): stock code
  • year(optional): Year of reporting
  • report_type(optional): Report type, default annual

This page was translated automatically. Technical details may differ from the original.

Install

npx -y @youhaozhao/cninfo-mcp
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "cninfo": { "command": "npx", "args": ["-y", "@youhaozhao/cninfo-mcp"] } } }