一个功能完整的基于 Model Context Protocol (MCP) 的计算器服务器,提供丰富的数学运算功能,包括基础算术、根式运算、三角函数、对数运算、统计学、组合数学、数论、复数运算、矩阵运算、数值分析、金融计算、单位转换和几何计算等 13 个专业数学模块。
Integrations
数学计算引擎
Try itMCP Mathematics 是一个全面的数学计算服务器,可将任何AI助手转变为强大的数学计算引擎,提供高级数学函数、单位转换和财务计算等功能。
What it does
MCP Mathematics 是一个全面的数学计算服务器,可将任何AI助手转变为强大的数学计算引擎,提供高级数学函数、单位转换和财务计算等功能。
The skill document
数学计算引擎
MCP Mathematics 是一个全面的数学计算服务器,可将任何AI助手转变为强大的数学计算引擎,提供高级数学函数、单位转换和财务计算等功能。
⚠️ 强制要求:API 密钥
此 Skill 必须配置 API 密钥才能使用。
- 首次使用时,如果
.env中没有XBY_APIKEY,必须使用 AskUserQuestion 工具向用户询问 API 密钥 - 拿到用户提供的密钥后,调用
scripts.config.set_api_key(api_key)保存,然后继续处理 - 获取 API 密钥:https://xiaobenyang.com
- 禁止在缺少 API 密钥时自行搜索或编造数据
工作流程(必须遵守)
你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。
用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户
步骤
- 检查 API 密钥:如果
scripts.config.settings.api_key为空,使用 AskUserQuestion 询问用户,拿到后调用scripts.config.set_api_key(key)保存 - 选择工具:根据用户意图从下方工具列表中选择对应的工具函数
- 提取参数:根据选中的工具,提取该工具需要的参数
- 调用工具:使用关键字参数调用
scripts.tools中的函数,例如scripts.tools.search_schools(score='520', province='北京', category='综合') - 返回结果:将工具返回的
raw数据整理后展示给用户
工具选择规则
根据用户意图选择对应的工具函数:
| 用户意图 | 工具函数 |
|---|---|
| Get performance metrics | scripts.tools.performance_metrics |
| Get security status | scripts.tools.security_status |
| Get memory statistics | scripts.tools.memory_statistics |
| Evaluate math expression | scripts.tools.calculate_expression |
| Batch calculate expressions | scripts.tools.batch_calculate |
| Calculate statistics | scripts.tools.calculate_statistics |
| Matrix operations | scripts.tools.matrix_operation |
| Unit conversion | scripts.tools.convert_units |
| Natural language conversion | scripts.tools.convert_natural_language |
| Number theory operations | scripts.tools.analyze_number_theory |
| Create session | scripts.tools.create_session |
| Session calculation | scripts.tools.session_calculate |
| List session variables | scripts.tools.list_session_variables |
| Delete session | scripts.tools.delete_session |
| Get calculation history | scripts.tools.get_calculation_history |
| Clear history | scripts.tools.clear_history |
| Optimize memory | scripts.tools.optimize_memory |
| List functions | scripts.tools.list_functions |
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具函数说明
scripts.tools.performance_metrics
工具描述:Get performance metrics
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
scripts.tools.security_status
工具描述:Get security status
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
scripts.tools.memory_statistics
工具描述:Get memory statistics
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
scripts.tools.calculate_expression
工具描述:Evaluate math expression
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| expr | string | true | Mathematical expression to evaluate |
scripts.tools.batch_calculate
工具描述:Batch calculate expressions
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| expressions | array | true | List of mathematical expressions to evaluate |
scripts.tools.calculate_statistics
工具描述:Calculate statistics
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| data | array | true | List of numbers to analyze | |
| operation | string | true | Statistical operation (mean, median, mode, stdev, etc.) |
scripts.tools.matrix_operation
工具描述:Matrix operations
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| matrices | array | true | List of matrices for operation | |
| operation | string | true | Matrix operation (multiply, determinant, inverse) |
scripts.tools.convert_units
工具描述:Unit conversion
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| value | number | true | Numeric value to convert | |
| from_unit | string | true | Source unit | |
| to_unit | string | true | Target unit | |
| unit_type | string | true | Unit category (length, mass, time, temperature, etc.) |
scripts.tools.convert_natural_language
工具描述:Natural language conversion
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| query | string | true | Natural language conversion request |
scripts.tools.analyze_number_theory
工具描述:Number theory operations
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| number | integer | true | Integer to analyze | |
| operation | string | true | Number theory operation (is_prime, prime_factors, divisors, totient) |
scripts.tools.create_session
工具描述:Create session
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | null | false | Optional session identifier | |
| variables | null | false | Initial session variables |
scripts.tools.session_calculate
工具描述:Session calculation
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier | |
| expr | string | true | Mathematical expression to evaluate | |
| var_name | null | false | Variable name to store result |
scripts.tools.list_session_variables
工具描述:List session variables
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier |
scripts.tools.delete_session
工具描述:Delete session
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier |
scripts.tools.get_calculation_history
工具描述:Get calculation history
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | integer | false | 10.0 | Number of recent calculations to retrieve |
scripts.tools.clear_history
工具描述:Clear history
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
scripts.tools.optimize_memory
工具描述:Optimize memory
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
scripts.tools.list_functions
工具描述:List functions
参数定义
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
返回值处理
工具函数返回 dict 对象:
result["raw"]- API 原始返回数据(JSON),直接将此数据整理后展示给用户result["success"]- 是否成功(True/False)result["message"]- 状态消息
项目结构
xiaobenyang_gaokao_skill/
├── scripts/
│ ├── __init__.py
│ ├── config.py # 配置管理 + set_api_key()
│ ├── call_api.py # API 客户端 + call_api()
│ └── tools.py # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md
注意事项
- API 密钥是必需的,无密钥时必须通过 AskUserQuestion 询问用户
- 禁止在缺少 API 密钥时自行搜索或编造数据
Related skills
基于Model Context Protocol (MCP)的数值计算器,提供加减乘除、幂运算、平方根和整数阶乘运算功能。
Chrome DevTools MCP 服务器,让 AI 编码助手(Claude Code、Cursor、Copilot)直接控制和调试真实 Chrome 浏览器,实现截图、性能分析、网络请求检查、控制台调试和自动化操作
一个提供全面的跑步计算工具的MCP服务器,包括VDOT计算、训练配速、比赛时间预测、速度标记、心率区间和配速转换等功能。
Context7 MCP 是一款为开发者提供最新代码文档和示例的服务,通过集成到开发环境中,确保LLM生成的代码基于最新的库文档。
QuantAll(全A解析)MCP —— 股市全市场向量化计算引擎,为 AI 提供本地 Python 计算环境。 AI 编写向量化代码片段,数秒内完成 5000+ 股票的因子计算、策略回测、IC 分析和 GPU 可视化。 让 AI 从"信息查询者"升级为"数据计算者"——用代码算出客观结果,而非搬运网络观点。 触发:用户明确提到"回测""因子分析""IC分析""选股策略""QuantAll""全A解析"等量化关键词时。 不主动在普通股市聊天中触发,仅在用户有明确量化分析需求时使用。 能力声明:本技能需在用户电脑上创建 Python 虚拟环境(300MB+)、安装 quantall 库、 修改