关于 Simple MCP Feature Sample
Simple MCP Feature Sample 是用于学习搭建 MCP 服务并与 Claude Desktop 或示例客户端试用的基础项目。它通过单客户端和多客户端演示展示文本处理工具及数据服务功能。
主要功能
- 01基础 MCP 服务配置
- 02文本反转与转大写工具
- 03数据服务示例
- 04单客户端演示脚本
- 05多客户端演示脚本
适用场景
- 01学习 MCP 服务实现基础
- 02通过 AI 客户端试用文本处理工具
- 03运行单客户端或多客户端演示
MCP 相关
演示基础 MCP 服务及其示例工具,可供 Claude Desktop 和项目自带的示例客户端连接使用。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
简易 MCP 功能示例
此项目包含 MCP 功能的几个示例实现。
服务端脚本展示了如何设置一个可与 Claude Desktop 集成的基本 MCP 服务。
这些服务端脚本也适用于我开发的简易 MCP 客户端。
如何验证功能
有两个用于启动演示的 Shell 脚本:一个用于单个客户端,另一个用于多个客户端。
启动单客户端演示
运行 single-client-launch-demo.sh。
$ ./single-client-launch-demo.sh
然后控制台会显示如下内容。
Connecting to the MCP server...
Command is python
Connected to the server 'simple_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['reverse-text', 'uppercase']
MCP client started!
Type your queries or 'quit' to exit.
Query:
请输入你想向 AI 提问的内容,或输入 quit 退出。
当你发送包含 reverse text 或 upper text 的请求时,AI 会使用简易 MCP 服务的文本处理功能。
启动多客户端演示
运行 multi-client-launch-demo.sh。
$ ./multi-client-launch-demo.sh
然后控制台会显示如下内容。
Connecting to the MCP server...
Command is python
Connected to the server 'simple_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['reverse-text', 'uppercase']
Connecting to the MCP server...
Command is python
Connected to the server 'profile_data_server'!
Waiting for server to initialize...
Server initialized!
Connected to the server with tools: ['profile-data']
MultiMCP client started!
Type your queries or 'quit' to exit.
Query:
请输入你想向 AI 提问的内容,或输入 quit 退出。
如果你的查询中包含 Who am I?,AI 会使用数据 MCP 服务功能来回答你的问题。
Claude Desktop 安装说明
将以下设置添加到 Claude Desktop 配置文件中:
"mcpServers": {
"simple-mcp-sample": {
"command": "python",
"args": [
"/path/to/simple-mcp-sample/server/simple_server.py"
]
}
}
"mcpServers": {
"simple-mcp-sample": {
"command": "python",
"args": [
"/path/to/simple-mcp-sample/server/data_server.py"
]
}
}
说明
如果启动服务时收到
command not found错误,请指定 Python 可执行文件的完整路径。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。