stu-management-mcp
Local stdio MCP server that provides tools for calculating averages, evaluating scores into grades, and retrieving student names by student ID. It logs every call to JSONL files with timestamps and performance metrics.
README
学生管理 MCP
stuManagementMcp 是一个基于 TypeScript 和 npm 的本地 stdio MCP 服务,提供平均分计算、成绩评价和学生姓名查询工具。
环境要求
- Node.js 22 或更高版本
- npm
安装与构建
在项目目录执行:
npm install
npm run build
构建后的服务入口为 dist/index.js。
使用 MCP Inspector 测试
先构建项目,再启动 Inspector:
npm run build
npx @modelcontextprotocol/inspector node dist/index.js
浏览器打开命令输出的 Inspector 地址,在 Tools 页面选择工具并填写参数。调试信息使用 console.error 输出,可在 Inspector 右侧的 Console 标签中查看。
注意:stdio MCP 的标准输出用于 MCP 协议通信,不要使用 console.log 打印调试信息,否则可能导致协议通信异常。
工具列表
calculate_average
计算三个数值的平均值。
输入:
{
"a": 1,
"b": 2,
"c": 3
}
输出:
{
"average": 2
}
evaluate_score
根据 0-100 的整数分数返回成绩评价。非整数或超出范围的输入会被拒绝。
输入:
{
"score": 85
}
输出:
{
"result": "良好"
}
评价规则:
| 分数范围 | 评价 |
|---|---|
| 0-59 | 不及格 |
| 60-70 | 及格 |
| 71-89 | 良好 |
| 90-100 | 优秀 |
get_student_name
根据固定学号查询学生姓名。
| 学号 | 姓名 |
|---|---|
| 10000 | 张三 |
| 10001 | 李四 |
| 10002 | 王五 |
| 10003 | 赵六 |
| 10004 | 钱七 |
输入:
{
"studentId": 10001
}
输出:
{
"name": "李四"
}
未找到学号时,工具返回“未找到该用户”。
调用埋点日志
每次进入工具业务处理的调用都会追加记录到:
log/YYYY-MM-DD/calls.jsonl
日期和时间使用中国大陆时区(Asia/Shanghai),时间格式为 YYYY-MM-DD HH:mm:ss.SSS。每行是一条独立 JSON 记录,包含工具名、调用参数、成功状态、错误信息和耗时(毫秒)。
示例:
{"timestamp":"2026-08-11 22:42:07.014","tool":"calculate_average","parameters":{"a":2,"b":3,"c":5},"success":true,"durationMs":20.01}
参数 schema 校验失败的请求不会进入业务代码,因此不会写入埋点日志。日志写入失败不会影响工具的正常返回。
在 CC Switch 中配置 stdio MCP
在 CC Switch 新增 MCP 页面中:
- MCP 标题:
stuManagementMcp - 显示名称:
学生管理 MCP - 启用到应用:勾选
Codex
在“完整的 JSON 配置”中填写:
{
"type": "stdio",
"command": "D:\\Program Files (x86)\\coding\\nodejs\\node.exe",
"args": [
"D:\\workspace\\mcp\\dist\\index.js"
]
}
添加配置后,完全退出并重启 Codex Desktop。之后直接使用自然语言请求调用工具,例如“调用 get_student_name 查询 studentId=10001”。修改 src/index.ts 后,需要再次执行 npm run build,然后重启 Codex Desktop 以加载新的构建产物。
后续
可能没有后续了...我也不确定
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.