AI Agent Hub
Back to skills
UpdateStock A-Share Local Database icon

UpdateStock A-Share Local Database

Data Analysis Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please install @user_7641c221/update-stock-data into your AI assistant by following https://skillhub.cn/install/skillhub.md.

About this skill

Problem

A-share market data is often scattered across APIs, ad hoc scripts, and local files, making it hard to build a reusable local database for analysis. UpdateStock narrows this to one stdio MCP service for managing a DuckDB database of A-share market data. It creates, updates, and queries structured tables such as stock, stock_basic, stock_factor, stock_forecast, stock_dividend, and stock_report, and provides a data path for QuantAll.

How It Works

  • It exposes tools such as ping, Creat_DB, Update_Stock_Data, get_stock, and get_adj_stock, while reading configuration from DB_setting.json and API_tushare.txt instead of accepting repeated path or token arguments.
  • Full updates run through seven stages: index data, daily quotes, basic information, market factors, forecasts, dividends, and financial reports. Stage 7 uses a heartbeat mechanism to report progress and ETA.
  • Querying supports unadjusted or forward-adjusted quotes by symbol and date range, returning YYYY-MM-DD dates in JSON for downstream plotting and analysis.
  • For QuantAll, Start_QuantAll and Set_QuantAll_DataBase launch the local HTTP MCP service and write the selected database path.

Boundaries

  • Full financial updates require sufficient tushare access; the easy mode covers index and daily quote data but not the complete set of tables.
  • Test.duckdb is only for connectivity checks; production use should create a separate database to avoid overwriting the test schema.
  • QuantAll is an external dependency: first launch needs a user-agreement confirmation and MCP reconnection, and some update stages can be slow, so they should not be interrupted.

Use Cases

  • Build a local quote database for backtesting by creating DuckDB and filling index/daily data.
  • Fetch forward-adjusted daily quotes for a symbol in a date range and feed a plotting script.
  • Prepare a data source for QuantAll by setting the database path and starting the local HTTP MCP service.
  • Use a low-tier API to update only index and daily quotes for a basic OHLCV database.

Best For

  • Local quant researchers who need A-share daily, factor, and report data in one DuckDB query path.
  • AI agent developers who need stdio MCP tools to create, update, and query a local stock database.
  • QuantAll users who need a compatible local market-data source and an HTTP MCP startup entry point.
  • Data engineering assistants who need tushare/baostock data in configurable DuckDB table mappings.