OpenClaw MCP Registry 完全指南
新功能 解锁Agent工具发现机制 — 让全球开发者找到你的Skills
世界上有一种商店叫App Store,有一种市场叫npm registry,而Agent时代的等价物,就是MCP Registry。它不是一个简单的目录,而是AI Agent自动发现、了解、使用工具的中央神经系统。
什么是 MCP Registry?
MCP Registry 是 Model Context Protocol 的工具注册中心。想象一下:你的Agent需要查天气、发邮件、操作数据库——它怎么知道去哪找这些工具?MCP Registry 就是答案。它是一个标准化的工具目录,Agent可以通过它:
- 发现工具 — 搜索、浏览可用的MCP工具和Skills
- 获取元数据 — 了解工具的功能、参数、使用限制
- 安装集成 — 一键将工具接入Agent工作流
- 版本管理 — 追踪工具版本,确保兼容性
GitHub MCP Registry 架构
2025年,GitHub 发挥了自己"万物皆可registry"的传统艺能,推出了官方MCP Registry。核心设计:
注册流程
- 提交工具 — 开发者在GitHub上发布符合MCP规范的工具仓库
- 自动索引 — GitHub爬取仓库中的
mcp.json元数据文件 - 分类标签 — 工具被自动分类(数据库、文件、API、工具链等)
- 搜索发现 — 开发者和Agent可以通过关键词搜索
AGENTS.md中声明需要的能力,系统会自动从Registry发现并安装对应工具——这叫"声明即配置"。
如何发布你的MCP工具到Registry
第一步:准备mcp.json元数据
{
"name": "my-awesome-tool",
"version": "1.0.0",
"description": "一个让Agent更聪明的工具",
"author": "your-username",
"repository": "https://github.com/your-username/my-awesome-tool",
"license": "MIT",
"tools": [
{
"name": "do_something",
"description": "执行某项任务",
"inputSchema": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "参数1说明"
}
},
"required": ["param1"]
}
}
],
"keywords": ["utility", "automation", "agent"],
"category": "utility"
}
第二步:创建GitHub仓库
# 创建仓库
mkdir my-awesome-tool
cd my-awesome-tool
git init
# 添加必要文件
touch mcp.json README.md index.js
# 提交并推送到GitHub
git add .
git commit -m "Initial MCP tool"
git remote add origin https://github.com/your-username/my-awesome-tool.git
git push -u origin main
第三步:注册到MCP Registry
# 方式一:通过GitHub Marketplace申请
# 访问 GitHub Marketplace → MCP Registry → Submit
# 方式二:通过OpenClaw CLI注册
openclaw mcp register https://github.com/your-username/my-awesome-tool
# 方式三:在ClawHub发布(OpenClaw官方工具库)
openclaw clawhub publish ./my-awesome-tool
OpenClaw 中使用 MCP Registry 工具
搜索工具
# 搜索天气相关工具
openclaw mcp search weather
# 搜索数据库工具
openclaw mcp search database
# 按分类浏览
openclaw mcp list --category=data
安装工具
# 安装到当前Agent
openclaw mcp install @anthropic/weather-mcp
# 安装到指定Agent目录
openclaw mcp install @anthropic/weather-mcp --agent=~/.openclaw/agents/my-agent
# 安装并设为Skill依赖
openclaw mcp install @anthropic/weather-mcp --save
在 AGENTS.md 声明依赖
# AGENTS.md
## MCP工具依赖
本Agent依赖以下MCP工具:
- weather: 天气查询(@anthropic/weather-mcp)
- database: 数据库操作(@modelcontextprotocol/postgres)
- email: 邮件发送(@custom/email-sender)
## 自动安装
首次启动时运行:
openclaw mcp install --all
MCP Registry 工具分类
| 分类 | 典型工具 | 用途 |
|---|---|---|
| database | postgres, mysql, sqlite | 数据库查询与操作 |
| filesystem | fs, s3, gcs | 文件系统访问 |
| api | rest, graphql, webhook | API调用封装 |
| utility | weather, calculator, translator | 通用工具函数 |
| communication | slack, discord, email | 消息与通知 |
| devtools | git, docker, k8s | 开发运维工具 |
最佳实践
1. 命名规范
# 组织前缀 + 工具名
@anthropic/weather-mcp ✅ 清晰
@modelcontextprotocol/sql ✅ 专业
weather-tool-123 ❌ 太随意
my-mcp-tool ❌ 无组织信息
2. 版本管理
# 使用语义化版本
"version": "1.2.3" # Major.Minor.Patch
# 变更记录
CHANGELOG.md:
## [1.2.0] - 2026-04-25
- Added: new feature X
- Changed: improved Y performance
- Fixed: bug Z
3. 文档完整
# README.md 必须包含
- 工具功能描述
- 安装方法
- 配置参数
- 使用示例
- 注意事项/限制
- License
从 ClawHub 发现工具
ClawHub 是 OpenClaw 官方的工具市场和Skills库:
# 搜索ClawHub工具
openclaw clawhub search "数据分析"
# 查看热门工具
openclaw clawhub trending
# 安装工具
openclaw clawhub install skill-name
# 发布自己的工具
openclaw clawhub publish ./my-skill
常见问题
Q: MCP Registry 和 npm 有什么区别?
npm管理JavaScript包,MCP Registry管理Agent可调用的工具接口。MCP工具更关注"Agent怎么用",而npm包更关注"开发者怎么用"。简单说:npm是给码农的,MCP是给AI Agent的。
Q: 我的工具必须开源吗?
GitHub公开Registry要求开源。但OpenClaw也支持私有MCP服务器——你可以搭建自己的Registry,供团队内部使用。企业版OpenClaw Gateway带私有Registry功能。
Q: 工具被攻击了怎么办?
MCP Registry有安全扫描机制。建议:1) 使用签名验证 2) 锁定版本号 3) 定期审计依赖。OpenClaw会自动检测已知漏洞并警告。
相关教程
推荐阅读
OpenClaw MCP协议集成完全指南 | 妙趣AI
MCP(Model Context Protocol)协议在OpenClaw中的集成教程,包含服务器配置、工具调用、多平台集成和最佳实践。
TOOLS • Agent, MCPMCP 协议完全指南 | 2026年最新教程 - 妙趣AI
MCP 协议完全指南:学习 Model Context Protocol 的核心概念、使用方法、最佳实践。包含无状态化迁移、工具安全等实战教程。
TOOLS • Agent, MCPMCP 协议完全实战指南 | OpenClaw 模型上下文协议教程
MCP协议从入门到精通:理解模型上下文协议的工作原理,学会在OpenClaw中使用MCP扩展Agent能力,包含完整代码示例。
TOOLS • Agent, MCPOpenClaw MCP 工具编排实战 - 让 AI Agent 调用外部工具 | 妙趣AI
详解 OpenClaw MCP (Model Context Protocol) 工具编排,包括 MCP Server 配置、工具调用、多工具协同、实战案例。
TOOLS • Agent, TutorialOpenClaw MCP 协议高级集成指南 | 妙趣AI
OpenClaw MCP协议高级集成指南:学会创建自定义MCP连接器、MCP工具编排、多MCP服务器管理,扩展Agent能力的终极方式。
TOOLS • Agent, MCPOpenClaw MCP 生态系统完全指南 - 掌握 Model Context Protocol 2026 | 妙趣AI
深入理解 OpenClaw 的 MCP (Model Context Protocol) 生态系统。学习如何使用 MCP 服务器扩展 Agent 能力,构建自定义 MCP 工具,以及参与 MCP 社区
TOOLS • Agent, MCP