
rancher/rancher-ai-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Сервер MCP позволяет агенту Rancher AI безопасно извлекать или обновлять ресурсы Kubernetes и Rancher в локальных кластерах.
Обзор
Сервер MCP позволяет агенту Rancher AI безопасно извлекать или обновлять ресурсы Kubernetes и Rancher в локальных кластерах. Он ожидает токен Rancher в заголовке, который агент всегда будет предоставлять для аутентификации. Этот сервер Model Context Protocol (MCP) обеспечивает безопасный мост между кластерами Rancher AI Agent и Kubernetes, позволяя управлять кластерами на основе ИИ через стандартизированный интерфейс инструмента. Сервер работает как развертывание Kubernetes в среде Rancher и предоставляет инструменты для проверки ресурсов, модификации и кластерных операций. - команды CLI и инициализация сервера - service.go - настройка сервера HTTP/TLS с поддержкой динамического слушателя - root.go - конфигурация команд корня - абстракция клиента Kubernetes - динамическая обертка клиента с разрешением идентификатора кластера - интеграция Rancher API для управления кластером - поддержка как локальных, так и последующих кластерных операций - Регистрация инструментов и организация - наборы инструментов.
Обзор (машинный перевод)
MCP сервер для ранчера
Сервер MCP позволяет агенту Rancher AI безопасно извлекать или обновлять ресурсы Kubernetes и Rancher в локальных кластерах. Он ожидает токен Rancher в заголовке, который агент всегда будет предоставлять для аутентификации.
Обзор
Этот сервер Model Context Protocol (MCP) обеспечивает безопасный мост между кластерами Rancher AI Agent и Kubernetes, позволяя управлять кластерами на основе ИИ через стандартизированный интерфейс инструмента. Сервер работает как развертывание Kubernetes в среде Rancher и предоставляет инструменты для проверки ресурсов, модификации и кластерных операций.
Архитектура
Структура пакета
cmd/ — команды CLI и инициализация сервера
serve.go- Настройка сервера HTTP/TLS с поддержкой динамического прослушивания и переносом стриоroot.go- конфигурация команд корня
pkg/client/ — клиентская абстракция Kubernetes
Динамическая обертка клиента с разрешением кластера ID
Интеграция Rancher API для управления кластерами
- Поддержка как локальных, так и последующих кластерных операций
pkg/toolsets/ — Регистрация и организация инструментов
- [[Т5]] - Центральный реестр коллекций инструментов
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP Server for Rancher
The MCP server allows the Rancher AI agent to securely retrieve or update Kubernetes and Rancher resources across local and downstream clusters. It expects the Rancher token in a header, which the agent will always provide for authentication.
Overview
This Model Context Protocol (MCP) server provides a secure bridge between the Rancher AI agent and Kubernetes clusters, enabling AI-powered cluster management through a standardized tool interface. The server runs as a Kubernetes deployment within the Rancher environment and exposes tools for resource inspection, modification, and cluster operations.
Architecture
Package Structure
-
cmd/- CLI commands and server initializationserve.go- HTTP/TLS server setup with dynamic listener support, and stdio transportroot.go- Root command configuration
-
pkg/client/- Kubernetes client abstraction- Dynamic client wrapper with cluster ID resolution
- Rancher API integration for cluster management
- Support for both local and downstream cluster operations
-
pkg/toolsets/- Tool registration and organizationtoolsets.go- Central registry for tool collectionscore/- Core Kubernetes operation tools
-
pkg/response/- Response formatting utilities- Structured text and content generation for MCP responses
-
pkg/converter/- Data transformation utilities- Group/Version/Resource (GVR) conversion helpers
Multi-Agent Architecture
The server is designed with a modular toolset architecture to support a multi-agent system. Each toolset contains a collection of related tools that serve a specific agent or domain within the Rancher AI ecosystem.
Current Toolsets:
core- Fundamental Kubernetes operations (resource management, pod inspection, metrics)
This architecture allows different AI agents to access only the tools they need, improving security, maintainability, and scalability.
TLS & Security
The server supports two modes:
-
TLS Mode (Production): Uses Rancher’s dynamic listener with auto-generated certificates
- Certificates stored as Kubernetes secrets
- Automatic cert rotation and renewal
- Client certificate authentication support
- TLS 1.2+ with secure cipher suites
-
Insecure Mode (Development): Plain HTTP for local testing
- Enabled via
--insecureflag orINSECURE_SKIP_TLS=true
- Enabled via
Available Tools
Each tool is exposed through the MCP protocol and can be invoked by the Rancher AI agent. The full, up-to-date list of tools grouped by toolset is maintained in TOOLS.md, which is generated from the tool definitions.
To regenerate it after adding or changing tools, run:
go generate ./...
# or
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"rancher": {
"command": "mcp",
"args": ["serve", "--stdio", "--rancher-url", "https://rancher.example.com", "--rancher-token", "token-xxx"]
}
}
}