Communitygithub.com

smallke/cn-funds-mcp

>- China fund & stock data assistant (free API, no API key required). Query fund valuation, NAV, holdings, manager info, stock/index quotes, market capital flow, sector ranking, northbound capital, and manage user's fund portfolio with profit calculation via cn-funds-mcp tools. 中国基金/股票数据查询助手。使用 cn-funds-mcp 工具查询基金估值、净值、持仓、经理信息, 查询股票/指数行情,查看大盘资金流向、板块排行、北向资金,以及管理用户的基金持仓并计算收益。 当用户提及基金、股票、大盘、持仓、收益、净值、估值、北向资金等关键词时使用。

cn-funds-mcp 是什么?

cn-funds-mcp is a Claude Code agent skill that >- China fund & stock data assistant (free API, no API key required). Query fund valuation, NAV, holdings, manager info, stock/index quotes, market capital flow, sector ranking, northbound capital, and manage user's fund portfolio with profit calculation via cn-funds-mcp tools. 中国基金/股票数据查询助手。使用 cn-funds-mcp 工具查询基金估值、净值、持仓、经理信息, 查询股票/指数行情,查看大盘资金流向、板块排行、北向资金,以及管理用户的基金持仓并计算收益。 当用户提及基金、股票、大盘、持仓、收益、净值、估值、北向资金等关键词时使用。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add smallke/cn-funds-mcp

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cn-funds-mcp Usage Guide

Tool Quick Reference

Fund Queries

ToolPurposeKey Parameters
search_fundSearch funds (name/code/pinyin)keyword
get_fund_estimateReal-time valuation (intraday estimated NAV and change)fundCode
get_fund_batch_infoBatch retrieve NAVs for multiple fundsfundCodes (comma-separated)
get_fund_infoFund details (type/company/manager/scale/ranking)fundCode
get_fund_valuation_detailDay's valuation trend (intraday minute-by-minute)fundCode
get_fund_net_value_historyHistorical NAV trendfundCode, range
get_fund_accumulated_performanceCumulative return vs CSI 300 vs peersfundCode, range
get_fund_positionDetailed holdings (stocks)fundCode
get_fund_manager_listList of all past managersfundCode
get_fund_manager_detailCurrent manager's profilefundCode

Stocks/Indices

ToolPurposeKey Parameters
get_stock_trendIntraday minute-by-minute trendsecid (e.g., 1.600519)
get_stock_quoteReal-time stock quotessecids (comma-separated)

Market/Capital

ToolPurposeKey Parameters
get_market_overviewA-share market overview (Shanghai/Shenzhen)None
get_market_capital_flowMarket capital flow (large/small orders)None
get_sector_capital_flowSector capital rankingtimeType, code
get_northbound_capitalShanghai-Shenzhen-Hong Kong Stock Connect capital flowNone

Portfolio Management

ToolPurposeKey Parameters
save_portfolioSave/update portfolio holdingsfundCode, shares, costPrice
remove_portfolioDelete portfolio holdingfundCode
get_portfolioView portfolio listNone
get_portfolio_profitOne-click query today's profit and total profitNone

Scheduled Reminders

ToolPurposeKey Parameters
set_reminderSet a scheduled reminder (triggers each trading day)time(HH:MM), type, message
get_remindersView all remindersNone
remove_reminderDelete a reminderid
check_remindersCheck for due remindersNone

Reminder types type:

  • profit_report — Portfolio profit report (triggers get_portfolio_profit, provides add/reduce position suggestions)
  • market_report — Market summary report (triggers market overview + capital flow)
  • custom — Custom reminder (uses message parameter)

Common Parameter Descriptions

Fund Code fundCode: 6 digits, e.g., 161725 (CSI Baijiu), 110011 (E Fund Mid & Small Cap)

Security ID secid: Format market.code

Market CodeMeaningExample
1.Shanghai Stock Exchange1.000001 (Shanghai Composite Index), 1.600519 (Kweichow Moutai)
0.Shenzhen Stock Exchange0.399001 (Shenzhen Component Index), 0.000858 (Wuliangye)
116.Hong Kong Stock Exchange116.01810 (Xiaomi Group)

Time Range range: m=1 month, q=3 months, hy=6 months, y=1 year, 2y=2 years, 3y=3 years, 5y=5 years

Active Behavior (Important)

At the start of each conversation, you MUST call check_reminders

Regardless of what the user says, before replying, call check_reminders to check for due reminders. If any are due, follow these rules:

  1. When profit_report is due:

    • Call get_portfolio_profit to retrieve profit data
    • Call get_market_overview for market context
    • Report today's portfolio profit summary in a friendly tone
    • For each fund, provide action suggestions:
      • Today's drop > 2%: "Consider adding to average down cost"
      • Today's rise > 3%: "Significant rise, consider partial profit-taking"
      • Total portfolio loss > 10%: "Large loss, suggest evaluating whether to continue holding"
      • Total portfolio profit > 20%: "Substantial profit, suggest phased profit-taking to lock in gains"
    • Finally, ask the user if they want to adjust their holdings
  2. When market_report is due:

    • Call get_market_overview + get_market_capital_flow + get_northbound_capital
    • Report market indices, capital flow, and northbound capital dynamics
  3. When custom is due:

    • Display the custom reminder content to the user

If no reminders are due, process the user's request normally.

Typical Scenarios

User doesn't know the fund code

First use search_fund to search, then use the returned code to call other tools.

User asks "How's the market today?"

Call get_market_overview + get_market_capital_flow in sequence, reporting market levels, changes, trading volume, and capital flow.

User asks "How much did I make today?"

Directly call get_portfolio_profit, returning today's profit for each fund and a summary. If no holdings are recorded, guide the user to add them with save_portfolio.

User provides holding information

Parse fund code, shares, and cost price, then call save_portfolio for each. The name parameter can be omitted; the tool will automatically query and fill it in.

User wants to quickly import holdings (screenshot recognition)

If the current model supports image recognition (OCR), proactively prompt the user: they can directly upload a screenshot from a fund app (e.g., Tiantian Fund, Alipay, Ant Fortune), and the AI will automatically identify fund codes, names, shares, cost NAV, etc., then call save_portfolio for each holding to batch import, eliminating manual entry.

Processing flow:

  1. Identify each fund's info (code, shares, cost price) from the screenshot
  2. For incomplete fields (e.g., only name but no code), use search_fund to complete the fund code
  3. Call save_portfolio for each holding to save
  4. After saving, display the imported holdings list in summary and ask the user to confirm if anything is missing or incorrect

User asks for a comprehensive analysis of a specific fund

Combine calls: get_fund_info + get_fund_estimate + get_fund_position + get_fund_accumulated_performance, analyzing from fundamentals, valuation, holdings, and historical returns across multiple dimensions.

User says "Set a daily afternoon reminder for profit"

Call set_reminder with parameters time="14:30", type="profit_report". After that, the first conversation each trading day after 14:30 will automatically trigger a profit report and suggestions.

Example reminder report

Good afternoon! It's 14:30 now, here is your portfolio profit report:

Portfolio Overview: 3 funds, total cost 15,000.00 yuan, current market value 14,520.00 yuan Today's Profit: -180.00 yuan | Total Profit: -480.00 yuan (-3.20%)

Fund Details:

  • CSI Baijiu A (161725): Today -1.22%, holding loss -11.07%, suggest evaluating whether to continue holding
  • E Fund Blue Chip (005827): Today +0.35%, holding profit +5.20%, keep holding
  • GF Nasdaq (270042): Today +1.80%, holding profit +15.30%, good momentum

Need to adjust holdings?

Notes

  • Valuation data updates only during A-share trading hours (9:30-15:00); outside trading hours, closing data is returned
  • get_fund_estimate returns an estimated value, not the final NAV; remind the user of this
  • Portfolio data is persisted in data/portfolio.json, retained across sessions
  • Profit calculation: Today's profit = shares × (estimated NAV - yesterday's NAV), total profit = shares × (estimated NAV - cost price)

Author

smallke | [email protected]

相关技能