mcp-demo
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-demo what is 123 times 456?"
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-demo
一个最小可用的 MCP (Model Context Protocol) Server 示例,使用 TypeScript SDK 编写,演示 MCP 的三大核心原语:
原语 | 示例 | 说明 |
Tools |
| 由模型调用的动作 |
Resources |
| 客户端可读取的数据(含动态资源模板) |
Prompts |
| 暴露给用户的提示词模板 |
通过 stdio 传输,可直接接入 Claude Desktop、Claude Code 或任何 MCP 客户端。
快速开始
npm install
npm run build
npm start # 启动编译后的 server
# 或开发模式
npm run devRelated MCP server: MCP Demo Server
使用 MCP Inspector 调试
npm run inspect会启动一个网页版调试器,可以交互式地调用 tools、读取 resources、预览 prompts。
接入 Claude Code
claude mcp add mcp-demo -- node /path/to/mcp-demo/dist/index.js接入 Claude Desktop
在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"mcp-demo": {
"command": "node",
"args": ["/path/to/mcp-demo/dist/index.js"]
}
}
}项目结构
src/
index.ts # 全部 server 逻辑:tools / resources / prompts 注册 + stdio 启动示例交互
接入后可以试试:
“帮我算一下 123 × 456” → 触发
calculate工具“现在上海几点?” → 触发
get_current_time工具“记一条笔记 todo:明天写周报” → 触发
add_note,然后可通过note://todo资源读取
License
MIT
Available Tools
3 toolsadd_noteAdd NoteA
Save a note that can later be read via the note:// resources
Inputs: name (required), content (required).
calculateCalculatorC
Perform basic arithmetic on two numbers
Inputs: a (required), b (required), operation (required).
get_current_timeCurrent TimeA
Get the current date and time, optionally in a specific IANA timezone
Inputs: timezone.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool serves a completely different purpose: notes, arithmetic, and time. There is no overlap or ambiguity between them.
Tools follow a verb_noun pattern (add_note, get_current_time) except calculate which is a single verb. This minor inconsistency prevents a perfect score.
Three tools is ideal for a demo server—focused and easy to understand, not too sparse or overloaded.
The tool surface covers the core actions for the demo's purpose. Note management lacks update/delete operations, but reading is handled via resources.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.6 npmMIT
- AlicenseNot gradedqualityDmaintenanceA demonstration MCP server showcasing tools (calculator, file operations, weather, timestamp), resources (server config, system info, documentation), and reusable prompt templates for code review, documentation, and debugging.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA minimal template MCP server demonstrating basic tools, resources, and prompts functionality. Includes example implementations like a hello tool, history resource, and greet prompt for learning MCP development.6 npmISC
- FlicenseNot gradedqualityDmaintenanceA simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.-