tzzb-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tzzb-mcpWhat are my current stock holdings?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tzzb-mcp
Tonghuashun Investment Ledger MCP Server
Query personal multi-account position details, asset trends, trade records, real-time quotes, and watchlists via MCP (Model Context Protocol). Once connected to an AI assistant (such as WorkBuddy), you can query your investment ledger data directly in natural language.
Features
13 MCP tools, covering login authentication, accounts, positions, trends, trades, quotes, exchange rates, trading days, and watchlist queries
Multi-account support: brokerage accounts, manual accounts, and margin accounts (distinguished by
fund_key/manual_id/rzrq_fund_key)CDP browser proxy: all API requests are executed in the browser via Chrome DevTools Protocol, reusing the browser's native network stack to bypass the 401 anti-scraping block on direct Python connections
Dedicated Chrome Profile (
~/.tzzb_chrome_profile), does not affect your daily browser usageCookie persistence (
~/.tzzb_cookies.json), login once and stay authenticated for about 7 days without re-loginAutomatic reconnection on disconnect: automatically reconnects and retries once when the CDP connection drops
Related MCP server: Stock MCP Server
Requirements
Python ≥ 3.10
Chrome browser installed
Installation
cd tzzb-mcp
pip install .Dependencies: mcp>=1.0.0, websocket-client>=1.8.0, pydantic>=2.0.0.
After installation, start the service with the tzzb-mcp command (entry point defined in [project.scripts] in pyproject.toml).
MCP Configuration
Connect via stdio in an MCP client (such as WorkBuddy's mcp.json):
{
"mcpServers": {
"tzzb-mcp": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/tzzb-mcp"
}
}
}cwd must point to the project directory (the directory containing src/).
Quick Start
You must call tzzb_login first on first use: this tool launches a Chrome debugging instance, and you need to log in to the investment ledger (tzzb.10jqka.com.cn) in the browser. After a successful login, the Cookie is automatically extracted and persisted.
1. tzzb_login → 弹出 Chrome,手动登录投资账本
2. tzzb_account_list → 获取所有账户的 fund_key / manual_id
3. tzzb_positions → 查看持仓明细Daily queries:
1. tzzb_account_list → 获取账户列表
2. tzzb_positions → 查看具体持仓
3. tzzb_asset_trend → 查看收益走势(可选)Tool List
Tool name | Purpose |
| Log in to the investment ledger, extract and persist Cookie (required on first use) |
| Check current login status |
| Get all account lists (including |
| Account overview (automatically falls back when the API is unavailable) |
| Portfolio overview (same as account_summary, with fallback) |
| Get position details (stocks + funds) ⭐ |
| Get asset / return trend data |
| Get intraday time-share return data |
| Get today's trade records |
| Get real-time stock quotes |
| Get HKD to CNY exchange rate |
| Get the most recent trading day information |
| Get watchlist of stocks and funds |
⭐ Marks the most commonly used tools.
Usage Rules and Notes
No parallel calls: all tools share the same Chrome CDP connection (a global lock is used underneath), so only one tool can be called at a time. Call them serially.
Get the account list before querying positions: the
fund_key/manual_idparameters oftzzb_positionscome fromtzzb_account_list; when no parameters are passed, aggregated data for all accounts is returned (may be empty).Quote format is
market:code: Shanghai uses33(e.g.33:600519), Shenzhen uses47(e.g.47:000001). In position data, themarketfield value"2"corresponds to Shanghai (33), and"1"corresponds to Shenzhen (47).Fund position API unavailable: the
fundfield returned bytzzb_positionsis always{"error": "基金持仓接口不可用"}(the underlying API returns HTTP 400, and built-in protection is included). Ignore thefundfield and only use thestockdata.Field names are pinyin abbreviations: quotes return
xianjia(current price),zuoshou(previous close),zqdm(code),scdm(market); map them to Chinese when displaying.Numeric fields may be strings: numeric values in positions/quotes (e.g.
"300","18.09") are of string type; convert them when using.Date format
YYYYMMDD: thedatereturned by asset trends isYYYYMMDD(e.g.20260827); convert toYYYY-MM-DDwhen displaying.Automatic retry on disconnect: if a tool call fails (CDP connection dropped), just retry once; the underlying layer reconnects automatically. If it fails twice in a row, call
tzzb_loginto re-authenticate.
Technical Architecture
AI 助手(MCP Client)
│ stdio
▼
tzzb-mcp(MCP Server, Python)
│ Chrome DevTools Protocol :9222
▼
Chrome 浏览器(独立 Profile)
│ 浏览器原生 fetch(携带 Cookie)
▼
同花顺投资账本 API(tzzb.10jqka.com.cn)CDP debug port:
9222Dedicated Chrome Profile:
~/.tzzb_chrome_profileCookie persistence:
~/.tzzb_cookies.json(valid for about 7 days)Global lock ensures serial calls; CDP reconnects automatically on disconnect
Directory Structure
tzzb-mcp/
├── pyproject.toml # 项目配置与依赖
├── src/
│ ├── server.py # MCP 服务入口(工具注册)
│ ├── auth.py # 登录、Cookie 提取与持久化
│ ├── client.py # Chrome CDP 连接与请求代理
│ ├── models.py # 数据模型
│ └── api/ # 各业务接口封装
│ ├── account.py # 账户列表 / 总览
│ ├── position.py # 持仓明细
│ ├── market.py # 行情 / 汇率 / 交易日
│ ├── trade.py # 交易记录 / 分时收益 / 资产趋势
│ └── watchlist.py # 自选列表
└── SKILL.md # AI 助手使用技能文档(工具详细说明)Troubleshooting Guide
Symptom | Cause | Solution |
"Not logged in" error | Cookie missing or expired | Call |
CDP request failed | Chrome not running or connection dropped | The underlying layer reconnects automatically; retry once; if it still fails, call |
Fund positions return empty / error |
| Built-in protection is included; ignore the |
|
| Built-in fallback to |
Chrome fails to start automatically | — | Start manually: |
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Access real-time and historical market data for China A-shares and Hong Kong stocks, along with ne…
Read-only China A-share data for AI agents: market, limit-up, capital flow and disclosures.
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Ask your AI about bank accounts, spending, debts, holdings, and investment activity.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying financial data including stocks, indices, funds, and futures from Chinese, Hong Kong, and US markets. Provides real-time market information, financial indicators, news, and trading suggestions through Eastmoney and Sina data sources.133ISC
- AlicenseBqualityDmaintenanceProvides real-time market data for A-shares, Hong Kong, and US stocks using the Tencent Finance API. It enables users to manage stock positions and watchlists through an AI assistant.1220ISC
- FlicenseNot gradedqualityDmaintenanceProvides real-time quotes, fund flows, and corporate announcements for Chinese A-share stocks. It enables users to search for stocks, analyze financial indicators, and summarize quarterly reports through natural language.
- AlicenseAqualityCmaintenanceEnables AI assistants to query real-time A-share stock data, including quotes, fund flows, sector flows, and K-line history, without needing an API key.57MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Mrkelo/tzzb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server