MCP Test Server
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Test Server search for users with admin role"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 - 代码审查提示模板
Related MCP server: MCP AI Chat LangChain
快速开始
1. 安装依赖
npm install2. 构建项目
npm run build3. 启动 MCP 服务器
npm start4. 运行测试客户端
在另一个终端中运行:
npm test项目结构
mcp-test-project/
├── src/
│ ├── index.ts # MCP 服务器主文件
│ └── test-client.ts # 测试客户端
├── dist/ # 编译后的文件
├── package.json
├── tsconfig.json
└── README.md使用示例
Resources 示例
// 列出所有资源
const resources = await client.listResources();
// 读取用户资源
const usersResource = await client.readResource({
uri: "test://users"
});Tools 示例
// 添加用户
const result = await client.callTool({
name: "add_user",
arguments: {
name: "张三",
email: "zhangsan@example.com",
role: "admin"
}
});
// 计算
const calcResult = await client.callTool({
name: "calculate",
arguments: {
expression: "10 + 5 * 2"
}
});Prompts 示例
// 获取用户分析提示
const userAnalysis = await client.getPrompt({
name: "user_analysis",
arguments: {
user_id: "1",
analysis_type: "detailed"
}
});
// 获取代码审查提示
const codeReview = await client.getPrompt({
name: "code_review",
arguments: {
language: "typescript",
code_snippet: "function hello() { return 'world'; }",
focus_areas: "代码质量、性能"
}
});测试数据
项目包含以下测试数据:
用户数据
[
{ "id": 1, "name": "张三", "email": "zhangsan@example.com", "role": "admin" },
{ "id": 2, "name": "李四", "email": "lisi@example.com", "role": "user" },
{ "id": 3, "name": "王五", "email": "wangwu@example.com", "role": "user" }
]待办事项数据
[
{ "id": 1, "title": "完成MCP测试项目", "completed": false, "userId": 1 },
{ "id": 2, "title": "学习TypeScript", "completed": true, "userId": 2 },
{ "id": 3, "title": "测试MCP功能", "completed": false, "userId": 1 }
]开发脚本
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
参考链接
Available Tools
4 toolsadd_userC
添加新用户
Inputs: email (required), name (required), role.
calculateC
执行数学计算
Inputs: a, b, expression, operation.
create_todoC
创建待办事项
Inputs: title (required), userId (required).
search_usersC
搜索用户
Inputs: query (required), role.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: add_user and search_users handle user management, calculate performs mathematical operations, and create_todo manages tasks. There is no overlap or ambiguity between these domains, making tool selection straightforward.
Three tools follow a consistent verb_noun pattern (add_user, create_todo, search_users), but 'calculate' deviates by using only a verb without a noun. This minor inconsistency slightly reduces predictability, though the naming remains readable and functional.
With only 4 tools, the server feels thin and under-scoped for a general 'Test Server' purpose, lacking coverage in areas like updates, deletions, or broader operations. While each tool is distinct, the count is borderline low for typical server functionality.
The tool set is severely incomplete for user and task management domains. For users, there is no update_user or delete_user, and for todos, no get_todo, update_todo, or delete_todo. This creates significant gaps that will likely cause agent failures in common workflows.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceThis server implements the Model Context Protocol to facilitate meaningful interaction and understanding development between humans and AI through structured tools and progressive interaction patterns.57-
- FlicenseNot gradedqualityDmaintenanceA basic Model Context Protocol server implementation that demonstrates core functionality including tools and resources for AI chat applications.-
- AlicenseNot gradedqualityNot gradedmaintenanceA demonstration MCP server that provides calculator tools for arithmetic operations, personalized greeting resources, and code review prompt templates. Enables users to perform basic math calculations, generate dynamic greetings, and access reusable code review templates through the Model Context Protocol.MIT
- FlicenseNot gradedqualityDmaintenanceA demonstration server designed to showcase core Model Context Protocol (MCP) primitives including tools, resources, and prompts for presentations. It provides functional examples like text analysis and financial calculations to illustrate how AI models interact with external functions and data.5-