关于 MCP Server Template
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
MCP 服务模板
使用 Bun 运行时构建 AI 工具的 MCP 入门套件
环境要求
- Bun:v1.0.0 或更高版本
- Node.js:v18.0.0 或更高版本(用于某些依赖项)
- 操作系统:
- macOS 12+
- 使用 glibc 2.31+ 的 Linux
- Windows 10+(通过 WSL)
功能
- 专注于问答的 MCP 服务实现
- 包含多个类别和难度等级的问答工具
- 配置了 MCP 集成测试的 Jest 测试环境
- 全面的测试覆盖
安装
# Clone the repository
git clone https://github.com/username/quiz-mcp-template.git
cd quiz-mcp-template
# Install dependencies
bun install
Claude 桌面端设置
{
"quiz": {
"command": "<your path>/.bun/bin/bun",
"args": ["run", "<your path>/bun-mcp-template/src/index.ts"]
}
}
使用方法
运行服务
# Start the server
bun start
# Development mode (with auto-restart)
bun dev
测试
# Run all tests
bun test
MCP 工具
此服务提供一款交互式问答工具:
get_quiz:提供不同类别和难度等级的问答题目
{
"method": "tools/call",
"params": {
"name": "get_quiz",
"arguments": {
"category": "science",
"difficulty": "medium"
}
},
"jsonrpc": "2.0",
"id": 1
}
可用类别:
- 常识
- 科学
- 历史
- 地理
- 娱乐
难度等级:
- 简单
- 中等
- 困难
项目结构
quiz-mcp-template/
├── src/
│ └── index.ts # Main Quiz MCP server implementation
├── tests/
│ └── cli-mcp.test.ts # MCP integration tests
├── package.json
├── tsconfig.json
└── README.md
开发
扩展问答类别
要添加新的问答类别或题目,请修改 src/index.ts 中的 quizQuestions 对象:
// Add new category
quizQuestions.newCategory = {
easy: [
{ question: "Easy question 1?", answer: "Answer 1" },
{ question: "Easy question 2?", answer: "Answer 2" },
// Add more questions...
],
medium: [
{ question: "Medium question 1?", answer: "Answer 1" },
{ question: "Medium question 2?", answer: "Answer 2" },
// Add more questions...
],
hard: [
{ question: "Hard question 1?", answer: "Answer 1" },
{ question: "Hard question 2?", answer: "Answer 2" },
// Add more questions...
],
};
// Don't forget to update the schema to include the new category
const QuizSchema = z.object({
category: z
.enum([
"general",
"science",
"history",
"geography",
"entertainment",
"newCategory",
])
.optional()
.describe("The category of questions to ask"),
// ...
});
许可证
MIT
致谢
本项目使用 Anthropic 开发的 Model Context Protocol(MCP),并为 AI 助手提供问答教育工具。
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。