Serves as the runtime environment for the MCP server, allowing it to execute JavaScript code and handle network requests.
Used as the primary programming language for implementing the MCP server, providing type safety and modern language features.
MCP 测试项目
这是一个基于 Model Context Protocol (MCP) TypeScript SDK 的测试项目,用于演示和测试 MCP 的不同机制,包括 Resources、Tools 和 Prompts。
项目特性
📄 Resources (资源)
- 用户列表 (
test://users
) - 获取所有用户数据 - 待办事项 (
test://todos
) - 获取所有待办事项数据 - 配置信息 (
test://config
) - 系统配置信息 - 系统日志 (
test://logs
) - 查看系统操作日志
🔧 Tools (工具)
- add_user - 添加新用户
- search_users - 搜索用户(支持按姓名、邮箱和角色筛选)
- create_todo - 创建待办事项
- calculate - 执行数学计算(支持表达式和基本运算)
💬 Prompts (提示模板)
- user_analysis - 用户数据分析提示
- todo_summary - 待办事项摘要提示
- system_report - 系统状态报告提示
- code_review - 代码审查提示模板
快速开始
1. 安装依赖
2. 构建项目
3. 启动 MCP 服务器
4. 运行测试客户端
在另一个终端中运行:
项目结构
使用示例
Resources 示例
Tools 示例
Prompts 示例
测试数据
项目包含以下测试数据:
用户数据
待办事项数据
开发脚本
npm run build
- 编译 TypeScript 代码npm start
- 启动 MCP 服务器npm run dev
- 构建并启动服务器npm test
- 运行测试客户端npm run clean
- 清理构建文件
MCP 协议说明
Model Context Protocol (MCP) 是一个标准化协议,用于在大型语言模型和外部数据源/工具之间建立安全、可控的连接。
核心概念
- Resources - 静态数据或文档,模型可以读取但不能修改
- Tools - 模型可以调用的函数,用于执行操作或获取动态数据
- Prompts - 可重用的提示模板,支持参数化
技术栈
- TypeScript - 主要编程语言
- MCP TypeScript SDK - MCP 协议实现
- Node.js - 运行时环境
许可证
MIT License
参考链接
This server cannot be installed
A testing server that demonstrates Model Context Protocol features, providing access to user data, todos, and system information through resources, tools for user management and calculations, and prompt templates for various analyses.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server designed to facilitate Nextflow development and testing, providing tools for building from source, running tests, and managing the Nextflow development environment.Last updated -Python
- -securityFlicense-qualityA Model Context Protocol server that integrates with the Qase test management platform, allowing users to create and retrieve test cases, manage test runs, and interact with Qase projects.Last updated -1JavaScript
- -securityAlicense-qualityA test server implementing all features of the MCP protocol, including prompts, tools, resources, and sampling, designed for testing MCP clients rather than practical applications.Last updated -PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server designed for testing backend APIs for security vulnerabilities like authentication bypass, injection attacks, and data leakage.Last updated -5TypeScriptMIT License