关于 GRACE Hello MCP
GRACE Hello MCP 是一个用于测试或演示问候工具的轻量远程 MCP 服务,也会在初始化响应中声明自定义 PNG 图标。
主要功能
- 01提供 say_hello 工具
- 02声明自定义服务图标
- 03使用 Streamable HTTP 传输
- 04通过 Render blueprint 部署
适用场景
- 01测试 MCP 客户端的工具连接
- 02演示 MCP 服务图标元数据
MCP 相关
它通过 Streamable HTTP 在 MCP 端点提供 say_hello 工具,并在服务元数据中包含自定义图标。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://grace-hello-mcp.onrender.com/mcpclaude mcp add --transport http rajitharul-grace-hello https://grace-hello-mcp.onrender.com/mcp{"mcpServers":{"rajitharul-grace-hello":{"type":"http","url":"https://grace-hello-mcp.onrender.com/mcp"}}}在 Cursor 中打开{"servers":{"rajitharul-grace-hello":{"type":"http","url":"https://grace-hello-mcp.onrender.com/mcp"}}}在 VS Code 中打开{"mcpServers":{"rajitharul-grace-hello":{"type":"http","url":"https://grace-hello-mcp.onrender.com/mcp"}}}{"mcpServers":{"rajitharul-grace-hello":{"serverUrl":"https://grace-hello-mcp.onrender.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
GRACE Hello MCP
一个非常简单的远程 MCP 服务(Streamable HTTP 传输),根据 MCP 规范(修订版 2025-11-25,SEP-973)提供自定义图标,可直接部署到 Render。
它提供一个工具 say_hello,并提供自定义 PNG 图标,该图标会在 initialize 响应的 serverInfo.icons 中公布。
项目结构
| 文件 | 用途 |
|---|---|
server.js | MCP 服务(Express + @modelcontextprotocol/sdk,Streamable HTTP)。 |
make_icon.py | 生成 static/icon.png(仅使用标准库,无依赖)。编辑此文件即可更改图标。 |
static/icon.png | 公布并提供的图标。 |
render.yaml | 用于一键部署的 Render blueprint。 |
本地运行
npm install
npm start # serves on http://localhost:3000
- 首页/健康检查页面(显示图标):http://localhost:3000/
- MCP 端点:
http://localhost:3000/mcp - 图标:http://localhost:3000/icon.png
快速冒烟测试:
curl -s -X POST http://localhost:3000/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
你应该能在响应中看到 serverInfo.icons。
或者使用官方 MCP Inspector(会渲染图标):
npx @modelcontextprotocol/inspector
# then connect to http://localhost:3000/mcp (Streamable HTTP)
部署到 Render
- 将此文件夹推送到 GitHub 仓库。
- 在 Render 中选择:New ➜ Blueprint,然后指向该仓库。Render 会读取
render.yaml并创建一个免费 Node Web 服务。(或者手动选择 New ➜ Web Service:构建命令为npm install,启动命令为npm start。) - Render 会自动注入
RENDER_EXTERNAL_URL,因此server.js会生成正确的绝对图标 URL:https://<your-service>.onrender.com/icon.png,无需手动设置环境变量。 - MCP 端点为
https://<your-service>.onrender.com/mcp。
注意:Render 免费方案在空闲时会休眠,因此一段时间后收到的第一个请求可能需要约 30 秒才能唤醒服务。
将其添加到 MCP 客户端
Claude Code(CLI):
claude mcp add --transport http grace-hello https://<your-service>.onrender.com/mcp
然后在会话中输入 /mcp 查看服务,并让 Claude“使用 say_hello 向 Rajith 问好”。
**Claude Desktop/其他 GUI 客户端:**添加一个指向 https://<your-service>.onrender.com/mcp 的远程/HTTP MCP 服务。
关于图标(请阅读)
此服务按照 MCP 规范正确地公布图标:icons 数组出现在 serverInfo 和工具上。图标必须是 https:// 或 data: URI——我们使用托管的 https://.../icon.png。
**客户端是否显示图标,由该客户端决定。**图标渲染是一项较新的功能,支持情况并不一致:
- ✅ MCP Inspector 和其他遵循规范的客户端会读取并显示图标。
- ⚠️ Claude Code/Claude Desktop 目前仍会为任意第三方服务显示默认占位图——Claude 市场中的品牌图标属于 Anthropic 侧配置的第一方集成。随着客户端的图标支持逐步完善,此服务已经符合规范,届时无需修改即可“直接使用”。
自定义
- **图标:**编辑
make_icon.py中的颜色/形状,然后运行npm run make-icon(重新生成static/icon.png)。也可以直接将自己的 512×512 PNG 放到static/icon.png。 - **工具:**在
server.js中添加更多setRequestHandler用例/工具定义。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。