About MCP 服务器示例
A beginner-focused MCP server demo that illustrates tools, resources, and prompts, with a web UI for access.
Key features
- 01Add-two-numbers tool
- 02Personalized greeting resource
- 03Code analysis prompt template
- 04Web UI access
Use cases
- 01Learning MCP basics
- 02Trying tool, resource, and prompt interactions
MCP support
The MCP server exposes an addition tool, a dynamic greeting resource, and a code analysis prompt to clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP 服务器示例
这是一个简单的 MCP (Model Context Protocol) 服务器示例,适合初学者了解和学习 MCP 的基本概念和使用方法。
什么是 MCP?
MCP (Model Context Protocol) 是一种协议,允许 AI 模型(如 Claude)与外部工具和资源进行交互。通过 MCP,AI 可以访问实时数据、执行计算或与其他系统通信,从而扩展其能力。
这个仓库包含什么?
这个仓库包含一个简单的 MCP 服务器示例,它提供了以下功能:
- 加法工具:一个简单的工具,可以将两个数字相加
- 问候资源:一个动态资源,可以根据提供的名字返回个性化的问候语
- 代码分析提示:一个用于深入分析代码的提示模板
如何开始使用
前提条件
- 安装 Python(建议 Python 3.6 或更高版本)
- 基本的命令行知识
安装步骤
-
克隆或下载这个仓库到你的计算机上
-
打开终端或命令提示符,导航到仓库的
server目录 -
运行启动脚本:
sh start.sh这个脚本会自动检查是否安装了 MCP 包,如果没有,会自动安装,然后启动服务器。
-
如果一切顺利,你应该会看到服务器启动的消息,表明服务器正在运行。
如何使用这个 MCP 服务器
运行后 打开 http://localhost:5173
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.