Update Stock Mcp
UpdateStock MCP 服务技能 —— 通过 stdio 模式调用 UpdateStock 脚本, 提供 A 股 DuckDB 数据库管理功能:创建数据库、全量/增量更新股票数据、查询股票行情。 设计的数据库方案兼容 QuantAll(全A解析)计算引擎。 触发条件:用户提到"UpdateStock"、"创建股票数据库"、"更新股票数据"、"获取股票数据"等。 Skill: Update Stock Mcp Owner: mifochen Summary: UpdateStock MCP 服务技能 —— 通过 stdio 模式调用 UpdateStock 脚本, 提供 A 股 DuckDB 数据库管理功能:创建数据库、全量/增量更新股票数据、查询股票行情。 设计的数据库方案兼容 QuantAll(全A解析)计算引擎。 触发条件:用户提到"UpdateStock"、"创建股票数据库"、"更新股票数据"、"获取股票数据"等。 Tags: latest:2.2.0 Version history: v2.2.0 | 2026-07-10T12:32:41.936Z | user update-stock-mcp v2.2.0 - 移除了 skill-card.md 文件(不用的描述文件)。 - 新增 license: MIT 字段到 SKILL.md,补充许可证信息。 - SKILL.md
Rank
62
Safety
84
Downloads
1.1k
Updated
Oct 11, 2026
Version
2.2.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 2.2.0release · observed Jul 10, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: medium.
clawhub skill install s17ez9j9adqc2m8d7g786vbkjd86fjsg:update-stock-mcp- Python environment detected. Create a strict virtual environment (`python -m venv .venv`) before installing dependencies to prevent system-level package conflicts.
- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-mifochen-update-stock-mcp/snapshot"
Documentation
CLAWHUB
32,725 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
name: update-stock-mcp
description: >
UpdateStock MCP 服务技能 —— 通过 stdio 模式调用 UpdateStock 脚本,
提供 A 股 DuckDB 数据库管理功能:创建数据库、全量/增量更新股票数据、查询股票行情。
设计的数据库方案兼容 QuantAll(全A解析)计算引擎。
触发条件:用户提到"UpdateStock"、"创建股票数据库"、"更新股票数据"、"获取股票数据"等。
agent_created: true
license: MIT
---
# UpdateStock MCP 技能
通过 stdio MCP 管理 A 股 DuckDB 数据库——创建、更新、查询股票行情数据。数据库方案兼容 QuantAll(全A解析)计算引擎。
> 💡 **如需使用 QuantAll**:推荐安装 `QuantAll-mcp` 技能(`pip install quantall`),其中包含 QuantAll 的详细使用文档。本技能负责为其准备兼容的数据库。
---
## 安装前准备
### 1. 填写 tushare API token
技能目录下已包含 `API_tushare.txt`(空白文件),**请先填入你自己的 tushare API token**,否则无法获取 tushare 数据。
获取方式:访问 https://tushare.pro/register 注册,登录后在个人中心复制 token,粘贴到 `API_tushare.txt` 中保存。
> 即使不填 token,脚本仍可通过 baostock(免费,无需注册)获取部分数据。
### 2. 安装 Python 依赖
建议使用虚拟环境隔离:
```bash
# 在 scripts 目录下创建虚拟环境
<你的Python路径> -m venv scripts/.venv
# 用清华镜像源安装依赖
scripts/.venv/Scripts/python.exe -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
所需依赖(见 `requirements.txt`):
- `mcp` — MCP Python SDK(提供 FastMCP)
- `pydantic` — 参数校验
- `pandas` — 数据处理
- `numpy` — 数值计算
- `duckdb` — DuckDB 数据库引擎
- `tushare` — A 股数据接口(需注册获取 API token)
- `baostock` — 备用数据源(免费,无需 token)
### 3. 配置 MCP(stdio 模式)
在 `~/.workbuddy/mcp.json` 的 `mcpServers` 中添加:
```json
"UpdateStock": {
"command": "C:/Users/<用户>/.workbuddy/skills/update-stock-mcp/scripts/.venv/Scripts/python.exe",
"args": ["C:/Users/<用户>/.workbuddy/skills/update-stock-mcp/scripts/UpdateStock_skill.py"],
"disabled": false
}
```
> 路径使用正斜杠 `/`,避免反斜杠转义问题。
> 配置完成后需在 WorkBuddy 连接器管理中断开重连(或重启智能体),首次连接需点击「信任」。
### 4. DB_setting.json(自动创建)
技能包**不携带** `DB_setting.json`。UpdateStock 首次启动时检测到缺失会自动创建默认配置文件,默认连接同目录下的 `Test.duckdb`。
> ⚠️ **Test.duckdb 仅供测试**:首次调用 `Creat_DB` 留空路径时自动创建,仅含基础表结构(无数据)。正式使用时请通过 `Creat_DB` 指定独立路径创建数据库。
`DB_setting.json` 结构:
```json
{
"db_path": "./Test.duckdb",
"days": 730,
"stock": "stock",
"map_stock": { "trade_date": "trade_date", "symbol": "symbol", ... },
"stock_index": "stock_index",
"map_stock_index": { ... },
...
}
```
每个 `map_*` 字段定义了对应表的列名映射,用户使用自有数据库时修改这些映射即可适配实际字段名。
---
## 可用工具
### mcp__UpdateStock__ping — 连接检测
无参数。返回 `Pong` 表示服务正常。
```
DeferExecuteTool(toolName="mcp__UpdateStock__ping", params={})
```
### mcp__UpdateStock__Creat_DB — 创建数据库
| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| DB_path | string | `""` | 数据库路径,留空则使用同目录下 `Test.duckdb` |
创建的表:stock、stock_index、stock_basic、stock_factor、stock_forecast、stock_dividend、stock_report
```
DeferExecuteTool(toolName="mcp__UpdateStock__Creat_DB", params={"DB_path": ""})
```
### mcp__UpdateStock__Update_Stock_Data — 全量更新
> ⚠️ **首次从 0 开始更新数据库耗时非常长(可能需数小时)**,请在空闲时运行,避免中途中断。
> 需要 tushare 积分 2000+。
| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| ignore_check | boolean | `false` | 是否跳过部分检查 |
数据库路径和 API key 自动从 `DB_setting.json` 和 `API_tushare.txt` 读取,无需手动传入。
**7 个更新阶段**(每阶段持续发送 MCP 进度通知):
1. 指数数据(上证指数、深证成指)
2. 股票行情(全市场日线)
3. 基础数据(股票列表、公司信息)
4. 行情因子(PE/PB/换手率/市值等每日指标)
5. 业绩预告
6._meta.json
{
"ownerId": "kn798etnj1hernzd0bqw4cg9yx86fkc9",
"slug": "update-stock-mcp",
"version": "2.2.0",
"publishedAt": 1783686761936
}skill-card.md
## Description: UpdateStock MCP manages A-share DuckDB stock databases over stdio, including database creation, full or incremental data updates, stock-market data queries, and QuantAll-compatible database setup. This skill is ready for commercial/non-commercial use. ## Publisher: [mifochen](https://clawhub.ai/user/mifochen) ### License/Terms of Use: MIT-0 ## Use Case: Developers, quantitative analysts, and agent users use this skill to create and maintain local DuckDB databases for Chinese A-share market data, then query that data or prepare it for QuantAll analysis workflows. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The scanner reports real security and control issues that should be reviewed before installation. Mitigation: Install and run the skill only in an isolated environment until the issues have been reviewed. Risk: The Tushare token is stored in a local plaintext file. Mitigation: Keep the token out of shared folders and backups, and restrict file access to the user running the MCP server. Risk: The MCP server can expose or modify local DuckDB stock databases. Mitigation: Use a dedicated database path with least-privilege filesystem access and avoid exposing sensitive DuckDB files through the server. Risk: Starting QuantAll launches a local HTTP MCP service. Mitigation: Start QuantAll only when that local service is intended and trusted for the current session. Risk: Query inputs are not confirmed safe by the scanner guidance. Mitigation: Treat query inputs as unsafe until SQL construction has been fixed, and avoid connecting the tool to untrusted callers. Risk: Dependencies are specified with lower bounds rather than pinned versions. Mitigation: Prefer pinned dependencies in a virtual environment before deployment. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/mifochen/skills/update-stock-mcp) - [Tushare registration](https://tushare.pro/register) ## Skill Output: **Output Type(s):** [text, JSON, shell commands, configuration, guidance] **Output Format:** [Markdown guidance with MCP tool calls, JSON snippets, shell commands, and text or JSON tool responses] **Output Parameters:** [1D] **Other Properties Related to Output:** [May create or update local DuckDB databases and JSON configuration files when the MCP tools are executed.] ## Skill Version(s): 2.2.0 (source: server release metadata and release changelog) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
requirements.txt
mcp>=1.26.0 pydantic>=2.0.0 pandas>=2.3.3 numpy>=1.24.0 duckdb>=1.5.2 tushare>=1.4.29 baostock>=0.9.1
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/mifochen/skills/update-stock-mcp",
"sourceUrl": "https://clawhub.ai/mifochen/skills/update-stock-mcp",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T09:23:20.787Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-mifochen-update-stock-mcp/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-mifochen-update-stock-mcp/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T09:23:20.787Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceUrl": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T09:23:20.787Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "2.2.0",
"href": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceUrl": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-07-10T12:32:41.936Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-mifochen-update-stock-mcp/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-mifochen-update-stock-mcp/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 2.2.0",
"description": "update-stock-mcp v2.2.0 - 移除了 skill-card.md 文件(不用的描述文件)。 - 新增 license: MIT 字段到 SKILL.md,补充许可证信息。 - SKILL.md 细节调整,完善了工具使用、说明和阶段描述,无功能变更。 - 优化更新代码,减少不必要的环节,加快更新速度",
"href": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceUrl": "https://clawhub.ai/mifochen/update-stock-mcp",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-07-10T12:32:41.936Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
