CSMAR MCP Server
CSMAR MCP 服务器
国泰安(CSMAR)金融数据库的 Model Context Protocol (MCP) 服务器,支持在 Claude Code 中直接访问 CSMAR 金融数据。
✨ 功能特性
完整的 CSMAR 数据访问:支持 240+ 个数据库,包括财务报表、股票交易、公司信息等
智能登录管理:支持环境变量自动登录和令牌缓存
11 个 MCP 工具:涵盖数据库探索、数据查询、预览等全功能
持久化 Python 进程:复用 Python 会话,大幅提升性能
请求重试机制:网络不稳定时自动重试
优雅关闭:支持 SIGTERM/SIGINT 信号
健康检查:随时查看服务状态
Python 中间层:基于 CSMAR-PYTHON SDK 的稳定封装
配置简单:一键式配置,支持 Claude Code 原生集成
Related MCP server: cn-financial-mcp
📋 前提条件
CSMAR 账号:有效的 CSMAR(国泰安)机构账号(个人或机构账号均可)
Python 3.8+:需要安装 CSMAR-PYTHON SDK 及其依赖
安装 Python 依赖:
pip install urllib3 websocket websocket_client pandas prettytable下载并安装 CSMAR-PYTHON SDK(从官网或联系 CSMAR 获取)
Node.js 18+:运行 MCP 服务器
Claude Code:最新版本的 Claude Code 编辑器
🚀 快速开始
1. 克隆项目
git clone https://github.com/ww11-max/Csmar-MCP-server.git
cd Csmar-MCP-server2. 安装依赖
# 安装Node.js依赖
npm install
# 安装Python依赖(CSMAR SDK所需)
pip install urllib3 websocket websocket_client pandas prettytable
# 安装CSMAR-PYTHON SDK
# 从CSMAR官网下载SDK压缩包,解压到Python的site-packages目录
# 或者按照官方文档安装:https://www.gtadata.com/products/csmar-api3. 配置环境变量
在项目根目录创建 .env 文件:
# CSMAR 配置
CSMAR_API_BASE=https://api.gtarsc.com
CSMAR_USERNAME=你的CSMAR用户名
CSMAR_PASSWORD=你的CSMAR密码
CSMAR_LANG=0 # 0=中文, 1=英文⚠️ 安全提示:请勿将
.env文件提交到 Git!已配置.gitignore自动忽略。
4. 配置 Claude Code(包含Claude客户端和vscode扩展两种配置方式)
在 Claude Code 的配置文件中添加 MCP 服务器配置:
Windows (%APPDATA%/Claude/claude_desktop_config.json):
{
"mcpServers": {
"csmar": {
"command": "node",
"args": ["C:\\path\\to\\Csmar-MCP-server\\src\\index.js"],
"env": {
"CSMAR_API_BASE": "https://api.gtarsc.com",
"CSMAR_USERNAME": "你的CSMAR用户名",
"CSMAR_PASSWORD": "你的CSMAR密码",
"CSMAR_LANG": "0"
}
}
}
}macOS/Linux (~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"csmar": {
"command": "node",
"args": ["/path/to/Csmar-MCP-server/src/index.js"],
"env": {
"CSMAR_API_BASE": "https://api.gtarsc.com",
"CSMAR_USERNAME": "你的CSMAR用户名",
"CSMAR_PASSWORD": "你的CSMAR密码",
"CSMAR_LANG": "0"
}
}
}
}如果用户使用的是VS code中的Claude code扩展,配置方式如下:
配置env文件之后,修改Claude Code MCP配置 VSCode 中 Claude Code 的 MCP 配置文件在:
%APPDATA%/Code/User/globalStorage/saoudval.claude-code/mcp.json或者在 VSCode 设置中搜索 MCP,找到 MCP Servers 配置入口 添加配置:
{
"mcpServers": {
"csmar": {
"command": "node",
"args": ["C:\\path\\to\\Csmar-MCP-server\\src\\index.js"],
"env": {
"CSMAR_API_BASE": "https://api.gtarsc.com",
"CSMAR_USERNAME": "你的CSMAR用户名",
"CSMAR_PASSWORD": "你的CSMAR密码",
"CSMAR_LANG": "0"
}
}
}
}⚠️ 路径需替换为你实际克隆的项目路径,例如 D:\Projects\Csmar-MCP-server\src\index.js
5. 重启 Claude Code
重启 Claude Code 以加载 MCP 服务器。
🔧 使用方法
验证安装
mcp__csmar__csmar_health_check()基本数据探索
# 列出所有可用数据库(约240个)
mcp__csmar__csmar_list_databases()
# 查看"财务报表"数据库中的表
mcp__csmar__csmar_list_tables(database_name="财务报表")
# 查看"FS_Combas"表的字段
mcp__csmar__csmar_list_fields(table_name="FS_Combas")
# 预览表数据(前几行)
mcp__csmar__csmar_preview(table_name="FS_Combas")数据查询示例
# 查询财务报表数据
mcp__csmar__csmar_query(
table_name="FS_Combas",
columns=["Stkcd", "ShortName", "Accper", "Typrep", "A001000000"],
condition="Stkcd like '3%' and Typrep='A'",
start_time="2020-01-01",
end_time="2021-12-31",
limit=5
)
# 查询记录数量
mcp__csmar__csmar_query_count(
table_name="FS_Combas",
condition="Stkcd like '3%'",
start_time="2020-01-01",
end_time="2021-12-31"
)
# 获取股票数据
mcp__csmar__get_stock_data(
stock_code="000001",
start_date="2024-01-01",
end_date="2024-12-31",
frequency="daily"
)
# 获取财务数据
mcp__csmar__get_financial_data(
stock_code="000001",
start_date="2020-01-01",
end_date="2024-12-31",
indicators=["A001000000", "A002000000"]
)
# 获取公司信息
mcp__csmar__get_company_info(stock_code="000001")🛠️ 可用工具
工具名称 | 描述 | 参数 |
| 检查服务健康状态 | 无 |
| 登录 CSMAR 账户 |
|
| 列出可访问的数据库 | 无 |
| 列出数据库中的表 |
|
| 列出表中的字段 |
|
| 通用数据查询 |
|
| 预览表数据 |
|
| 查询记录数量 |
|
| 获取股票交易数据 |
|
| 获取财务数据 |
|
| 获取公司基本信息 |
|
📁 项目结构
csmar-mcp-server/
├── src/
│ ├── index.js # MCP 服务器主文件
│ └── python_client.py # Python 客户端
├── config/
│ ├── .env.example # 环境变量示例
│ └── .mcp.json # MCP 配置示例
├── docs/
│ ├── CSMAR_MCP_配置完成报告.md
│ ├── 快速开始指南.md
│ └── CSMAR机构账号配置指南.md
├── examples/
│ └── test_input.json # 测试输入示例
├── package.json # Node.js 依赖
├── README.md # 本文件
└── .gitignore # Git 忽略文件🔍 数据库推荐
常用数据库
财务报表:
财务报表,FS_Combas,FS_Comins,FS_Comscfd股票交易:
股票市场交易数据,股票日行情公司信息:
公司基本信息,上市公司基本信息宏观经济:
宏观经济数据库
数据时间范围
财务报表:2018-2022 年
AI 相关数据:2024-2025 年
股票交易:实时更新
⚠️ 注意事项
查询限制
每次最多 20 万条记录:大数据集需要分页查询
相同条件 30 分钟限流:避免频繁查询相同条件
时间格式:必须使用 "YYYY-MM-DD" 格式
分页查询示例
# 第1页
condition = "Stkcd like '3%' limit 0,200000"
# 第2页
condition = "Stkcd like '3%' limit 200000,200000"
mcp__csmar__csmar_query(
table_name="FS_Combas",
columns=["Stkcd", "ShortName", "Accper", "Typrep"],
condition=condition
)🐛 故障排除
常见问题
1. "MCP 服务器未响应"
确认 Claude Code 已重启
检查配置文件路径是否正确
手动测试 Python 客户端:
echo '{"action":"check_availability","params":{}}' | python src/python_client.py --once
2. "数据库不存在"
使用
csmar_list_databases()获取准确名称检查数据库名称是否包含空格
确认账号有该数据库访问权限
3. 查询结果为空
检查时间范围是否正确
验证查询条件语法
使用
preview()先查看数据格式
4. CSMAR SDK 导入失败
确认 CSMAR-PYTHON SDK 已正确安装
运行
python src/python_client.py查看详细错误信息
日志文件
Python 客户端日志:通过 stderr 输出
MCP 服务器日志:通过 stderr 输出
🔄 更新日志
v1.1.0 (2026-04-15)
✨ 新增持久化 Python 进程模式,大幅提升性能
✨ 新增健康检查工具
csmar_health_check✨ 实现了
get_stock_data、get_financial_data、get_company_info工具🔧 修复 Python 路径硬编码问题,自动检测 site-packages
🔧 修复 zod 导入问题
🔧 添加请求重试机制
🔧 添加优雅关闭支持
v1.0.0
🎉 初始版本
🤝 贡献
欢迎提交 Issue 和 Pull Request!
Fork 项目
创建功能分支 (
git checkout -b feature/amazing-feature)提交更改 (
git commit -m 'Add amazing feature')推送到分支 (
git push origin feature/amazing-feature)创建 Pull Request
📄 许可证
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
🙏 致谢
CSMAR(国泰安):提供金融数据服务
Anthropic:开发 Model Context Protocol
Claude Code:优秀的 AI 编程环境
📞 支持
CSMAR 官方支持:service@gtadata.com,400-888-3636
项目 Issues:GitHub Issues
文档:查看
docs/目录下的详细指南
💡 提示:开始使用前,请确保已正确配置 CSMAR 账号和环境变量!
Available Tools
11 toolscsmar_health_checkA
检查 CSMAR 服务健康状态
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description is minimal. It implies a read-only check but lacks details on what constitutes 'healthy' or potential effects if the service is down. However, for a health check tool, the behavior is somewhat self-evident.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no extraneous information, efficiently conveying the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (no parameters, no output schema), the description is largely complete for understanding the tool's function. It could be enhanced by mentioning the expected output (e.g., a status string), but it is sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are no parameters, so the description does not need to add parameter meaning. The baseline for 0 parameters is 4, and the description adequately covers the absence of inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks CSMAR service health status, using a specific verb and resource. It distinguishes itself from sibling tools that deal with data operations like listing databases or querying.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives, such as using it as a prerequisite before other operations or when service issues are suspected.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_list_databasesA
列出用户有权访问的 CSMAR 数据库
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries full responsibility for behavioral disclosure. It does not mention whether authentication is required, error behavior, or if the operation is read-only. Since this is a list operation, it is likely safe, but the description does not confirm this.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that conveys the essential purpose without any superfluous words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While the description covers the basic purpose, it lacks context about preconditions (e.g., does the user need to be logged in via csmar_login?) and the nature of the output. Given no output schema, some description of the return format would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are no parameters, so the input schema is trivially covered. The description does not need to add parameter meaning. Baseline for zero parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'list' and the resource 'databases', specifying 'that the user has access to'. This distinguishes it from siblings like csmar_list_tables and csmar_list_fields, which list different entities.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool compared to alternatives. With siblings like csmar_list_fields and csmar_list_tables, explicit usage context would help an agent decide which list tool to invoke.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_list_fieldsB
列出指定表中的所有字段
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | 表名称 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose any behavioral traits beyond the obvious listing operation. It lacks information on authentication, side effects, or constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words, effectively conveying the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description is adequate but lacks context on output format, pagination, or error handling, which could be helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the parameter 'table_name' is already described in the schema. The description adds no additional meaning beyond what the schema provides, aligning with the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists all fields in a specified table, with a specific verb ('list') and resource ('fields'). It distinguishes from sibling tools like csmar_list_tables and csmar_list_databases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description only states what it does, without providing context for usage or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_list_tablesB
列出指定数据库中的所有表
| Name | Required | Description | Default |
|---|---|---|---|
| database_name | Yes | 数据库名称 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It only states 'list tables' without disclosing any behavioral traits (e.g., read-only, error handling, side effects). This is insufficient for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, short sentence that efficiently conveys the core purpose. However, it could add more context without becoming verbose, hence not a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description is minimally adequate. It explains what it does and the parameter, but lacks details on return format, error cases, or behavior, leaving gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the parameter 'database_name' has a description in the schema. The tool description does not add any extra semantic value beyond the schema; baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '列出指定数据库中的所有表' clearly states the tool's action (list tables) and scope (in a specified database). It distinguishes from siblings like csmar_list_databases (lists databases) and csmar_list_fields (lists fields).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives, such as prerequisites or context. The description merely states the action without contextual usage advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_loginC
登录 CSMAR 账户
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | 用户名/已验证电话/已验证邮箱 | |
| pwd | Yes | 密码 | |
| lang | No | 语言: 0=中文, 1=英文 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, and the description only says 'log in', omitting important behavioral details such as session creation, authentication state, error handling, or rate limits. The description carries the full burden but fails to disclose these traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence. While it efficiently conveys the core purpose, it lacks any structured detail (e.g., bullet points) that could improve scannability. Still, no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool is authentication-related and has no output schema, the description fails to cover important context such as what happens on successful/failed login, whether it sets a session token, or how to handle credentials. This is a notable gap for a login operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all three parameters (account, pwd, lang). The description adds no additional meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool logs into a CSMAR account (specific verb and resource). Though no sibling differentiation is provided, the sibling tools are data retrieval functions, making the purpose distinct.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description does not mention prerequisites, order of operations, or context (e.g., must be called before other tools).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_previewC
预览表数据 (前几行)
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | 表名称 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only states 'preview' without explaining if it is read-only, limits rows, or how it handles errors. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded, using a single line to convey the tool's purpose. No wasted words, though structure could be improved with sections for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple preview tool, the description covers the basic purpose but omits details like return format, row limit, or behavior. It is adequate but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a clear description for the single parameter 'table_name'. The tool description adds no additional meaning beyond the schema, earning the baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it previews table data (first few rows), using a specific verb and resource. It is distinguishable from sibling tools like csmar_query (full query) and csmar_query_count (count), but does not explicitly differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance provided on when to use this tool versus alternatives. Sibling tools exist for full queries and counts, but the description lacks any context on prerequisites or scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_queryD
通用 CSMAR 数据查询
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | 表名称 | |
| columns | No | 要查询的字段列表 | |
| condition | No | 查询条件 (SQL WHERE 子句) | |
| start_time | No | 开始时间 (YYYY-MM-DD) | |
| end_time | No | 结束时间 (YYYY-MM-DD) | |
| limit | No | 返回记录数限制 | |
| format | No | 返回格式 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose any behavioral traits (e.g., read-only, authorization needs, rate limits). The term 'query' implies read-only, but it is not explicitly stated, leaving the agent without safety or usage context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence, but it is under-specified and lacks structure. It fails to convey essential information, making it more of a placeholder than a concise description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of 7 parameters, multiple sibling tools, and no output schema or annotations, the description is completely inadequate. It does not explain what CSMAR is, how queries are executed, or any constraints, severely limiting an agent's ability to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds no additional meaning beyond the parameter names and types. It does not explain how the parameters interact, provide examples, or clarify the purpose of SQL WHERE clauses or return formats.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description is '通用 CSMAR 数据查询' which translates to 'General CSMAR data query'. It is vague and does not specify what specific data or operations are covered, nor does it differentiate from sibling tools like csmar_preview or csmar_query_count.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., csmar_preview, csmar_query_count). The description lacks any context about prerequisites or use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
csmar_query_countC
查询满足条件的记录数量
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | 表名称 | |
| columns | No | 字段列表 | |
| condition | No | 查询条件 | |
| start_time | No | 开始时间 | |
| end_time | No | 结束时间 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; the description does not disclose behavioral traits such as whether it is read-only, any limitations, or performance implications. The agent is left with no information beyond the basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that is clear and front-loaded. No extraneous information, though additional details could be added without harming conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple count query, the description combined with the schema is minimally adequate. However, missing usage guidelines and behavioral context make it incomplete for an AI agent to use correctly without extra knowledge.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with Chinese descriptions for all parameters. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it queries the count of records, distinguishing it from sibling csmar_query which likely returns actual records. However, it does not explicitly differentiate between the two.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like csmar_query or csmar_preview. The description implies counting, but does not advise on context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_company_infoC
获取公司基本信息
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 股票代码 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It only states 'get basic company info', implying a read operation, but gives no details on scope, side effects, or return format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (one sentence), which is front-loaded but lacks substance. It earns its place minimally, but could be more informative without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema and sibling tools that may overlap, the description is incomplete. It does not clarify what 'basic company info' includes, leaving ambiguity about its domain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with a clear description for 'stock_code'. The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (获取) and resource (公司基本信息), identifying it as a retrieval tool for basic company info. However, it does not differentiate from sibling tools like get_financial_data or get_stock_data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor any prerequisites or context for its use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_financial_dataC
获取 CSMAR 财务数据
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 股票代码 | |
| start_date | Yes | 开始日期 (YYYY-MM-DD) | |
| end_date | Yes | 结束日期 (YYYY-MM-DD) | |
| indicators | No | 财务指标列表 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden for behavioral transparency. It does not mention any side effects, authorization needs, rate limits, or data scope (e.g., whether it returns all available financial indicators or just those specified).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely short (one sentence), but it sacrifices completeness for brevity. It does not provide enough context to be useful, falling into under-specification rather than effective conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 4 parameters and no output schema or annotations, the description is incomplete. It does not explain the return format, how results are paginated, or any dependencies like login requirements, leaving significant gaps for an agent to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with descriptions, so the schema already explains each parameter. The description adds no additional semantic context beyond what the schema provides, meeting the baseline expectation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '获取 CSMAR 财务数据' states the verb 'get' and resource 'CSMAR financial data', giving a general idea of the tool's purpose. However, it does not distinguish this tool from similar siblings like 'get_stock_data' or 'csmar_query', which may retrieve overlapping or different data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus its siblings (e.g., get_stock_data, csmar_query). There is no information about prerequisites, such as requiring a session from csmar_login, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_stock_dataC
获取 CSMAR 股票交易数据
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 股票代码 | |
| start_date | Yes | 开始日期 (YYYY-MM-DD) | |
| end_date | Yes | 结束日期 (YYYY-MM-DD) | |
| frequency | No | 数据频率 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, and the description does not disclose any behavioral traits such as return format, side effects, authentication requirements, or rate limits. For a tool with no output schema, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence, but it lacks any structural formatting. While minimal, it is not overly verbose, but the brevity sacrifices completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 4 parameters and no output schema, the description is too brief. It does not explain what the returned data represents, how errors are handled, or any constraints like date range limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for all 4 parameters, each with Chinese descriptions. The tool description adds no additional meaning beyond what the schema provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb '获取' (get) and resource 'CSMAR 股票交易数据' (CSMAR stock trading data), distinguishing it from siblings like get_company_info and get_financial_data. However, it lacks specificity about what exactly constitutes 'stock trading data'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. Sibling tools such as get_financial_data or get_company_info exist, but the description does not help the agent decide which to choose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
11 tool updates
v1.2.0- First observed
csmar_health_check - First observed
csmar_list_databases - First observed
csmar_list_fields - First observed
csmar_list_tables - First observed
csmar_login - First observed
csmar_preview - First observed
csmar_query - First observed
csmar_query_count - First observed
get_company_info - First observed
get_financial_data - First observed
get_stock_data
TDQS
Most tools have clearly distinct purposes (e.g., listing databases vs tables vs fields, login vs query). However, the three 'get_*' tools (get_company_info, get_financial_data, get_stock_data) could overlap with the generic csmar_query since all fetch data, but descriptions and specific naming mitigate confusion.
Tools are in snake_case, but eight are prefixed with 'csmar_' while three (get_company_info, get_financial_data, get_stock_data) lack this prefix. This inconsistency breaks the pattern and could cause agents to misgroup tools.
11 tools is appropriate for a data retrieval service covering login, database exploration, querying, counting, previewing, and specific data endpoints. Each tool earns its place without being excessive.
The tool set covers core CRUD-like operations for data retrieval: listing databases/tables/fields, querying, counting, previewing, and accessing specific data types. Missing write/update/delete operations, but those likely fall outside the scope of a read-only CSMAR data service.
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
The financial MCP for AI agents - 90+ financial tables, SEC filings, signals, alt-data.
China A-share market data for research, backtesting and AI agents via MCP.
MCP server giving AI agents one-connection access to China A-share market intelligence: financials,
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides professional financial data access for LLMs via MCP, supporting providers like Tushare, Wind, and DataYes.1458Apache 2.0
- AlicenseNot gradedqualityFmaintenanceProvides access to Chinese mainland financial data including A-stock quotes, financial statements, industry analysis, and macroeconomics through 42 MCP tools, with automatic data source fallback and no API key required.40Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables access to the CSMAR financial database via MCP, providing tools for querying financial data, stock data, company info, and more through natural language in compatible clients like Codex and Claude Code.182MIT
- FlicenseBqualityDmaintenanceEnables comprehensive financial analysis including structured products, portfolio optimization, risk analytics, and backtesting through Claude Desktop integration.181-
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/ww11-max/CSMAR-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server