Model Context Protocol (MCP) 服务器充当外部服务(为大语言模型 [LLM] 或 AI 应用提供上下文、数据或功能)与 LLM 或 AI 应用之间的代理。MCP 服务器将 AI 应用连接到数据库和 Web 服务等外部系统,并将这些系统的响应转换为 AI 应用可理解的格式。
服务器设置
您必须先启用 MCP 服务器并设置身份验证,然后才能使用。如需详细了解如何使用 Google 和 Google Cloud 远程 MCP 服务器,请参阅 Google Cloud MCP servers overview。
这是一个 MCP 服务器,可提供用于管理 Memorystore for Redis 实例和 Redis 集群的工具。
服务器端点
MCP 服务端点是 MCP 服务器的网络地址和通信接口(通常是网址),AI 应用(MCP 客户端的宿主)使用该端点来建立安全、标准化的连接。它是 LLM 请求上下文、调用工具或访问资源的交互点。Google MCP 端点可以是全球性的,也可以是区域性的。
redis.googleapis.com MCP 服务器具有以下 MCP 端点:
- https://redis.googleapis.com/mcp
MCP 工具
MCP 工具是 MCP 服务器向 LLM 或 AI 应用公开的函数或可执行功能,用于在现实世界中执行操作。
redis.googleapis.com MCP 服务器具有以下工具:
| MCP 工具 | |
|---|---|
| list_clusters | 列出 Memorystore for Redis Cluster 中的所有集群。 |
| get_cluster | 获取 Memorystore for Redis Cluster 中某个集群的详细信息。 |
| create_cluster | 在 Memorystore for Redis Cluster 中创建集群。 |
| delete_cluster | 删除 Memorystore for Redis Cluster 中的集群。 |
| update_cluster | 更新 Memorystore for Redis Cluster 中的集群。 |
| get_cluster_certificate_authority | 获取 Memorystore for Redis Cluster 中某个集群的证书授权机构。 |
| reschedule_cluster_maintenance | 为 Memorystore for Redis Cluster 中的集群重新安排维护时间。 |
| list_backup_collections | 列出所有 Memorystore for Redis Cluster 备份集合。 |
| get_backup_collection | 获取 Memorystore for Redis Cluster 备份集合的详细信息。 |
| list_backups | 列出所有 Memorystore for Redis Cluster 备份。 |
| get_backup | 获取 Memorystore for Redis Cluster 备份的详细信息。 |
| delete_backup | 删除 Memorystore for Redis Cluster 备份。 |
| export_backup | 导出 Memorystore for Redis Cluster 备份。 |
| backup_cluster | 备份 Memorystore for Redis Cluster 中的集群。 |
获取 MCP 工具规范
如需获取 MCP 服务器中所有工具的 MCP 工具规范,请使用 tools/list 方法。下面的示例演示了如何使用 curl 列出 MCP 服务器中当前可用的所有工具及其规范。
| Curl 请求 |
|---|
curl --location 'https://redis.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/list", "jsonrpc": "2.0", "id": 1 }' |