loading…
Search for a command to run...
loading…
MCP server that enables interaction with Talos Linux clusters via gRPC API, supporting cluster management, monitoring, configuration, and resource inspection.
MCP server that enables interaction with Talos Linux clusters via gRPC API, supporting cluster management, monitoring, configuration, and resource inspection.
An MCP (Model Context Protocol) server that provides seamless integration with Talos Linux clusters. This server enables Claude to interact with your Talos infrastructure through the native gRPC API.
Talos Linux is a modern, secure, and immutable Linux distribution designed specifically for Kubernetes. Key features:
~/.talos/config)pip install talos-mcp-server
Or with uv:
uv pip install talos-mcp-server
git clone https://github.com/CBEPX/talos-mcp-server.git
cd talos-mcp-server
uv venv && source .venv/bin/activate
uv pip install -e .
# macOS
brew install siderolabs/tap/talosctl
# Linux
curl -sL https://talos.dev/install | sh
You can also run the server using Docker.
# Build the image
docker build -t talos-mcp-server .
# Run the container (make sure to mount your talos config)
docker run --rm -i \
-v $HOME/.talos:/root/.talos:ro \
-e TALOSCONFIG=/root/.talos/config \
talos-mcp-server
Or using Docker Compose for development:
docker-compose up --build
Ensure you have a valid Talos configuration file. This is typically created when you set up your Talos cluster:
# Generate config (if setting up new cluster)
talosctl gen config my-cluster https://<control-plane-ip>:6443
# Check your current config
talosctl config info
# View available contexts
talosctl config contexts
The MCP server will automatically use your default Talos configuration from ~/.talos/config.
To use this MCP server with Claude Desktop, add it to your configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"talos": {
"command": "talos-mcp-server",
"env": {
"TALOSCONFIG": "/path/to/your/.talos/config",
"TALOS_MCP_LOG_LEVEL": "INFO",
"TALOS_MCP_AUDIT_LOG_PATH": "talos_mcp_audit.log"
}
}
}
}
talosstdiotalos-mcp-serverTALOSCONFIG pointing to your config fileFor other clients supporting the Model Context Protocol (including Perplexity or generic integrations), use the standard server definition. You can configure the server using CLI arguments (Typer) or Environment Variables.
Example using CLI arguments:
{
"mcpServers": {
"talos": {
"command": "talos-mcp-server",
"args": [
"--log-level", "DEBUG",
"--readonly"
],
"env": {
"TALOSCONFIG": "${HOME}/.talos/config"
}
}
}
}
Example using Environment Variables:
{
"mcpServers": {
"talos": {
"command": "talos-mcp-server",
"env": {
"TALOSCONFIG": "${HOME}/.talos/config",
"TALOS_MCP_READONLY": "true",
"TALOS_MCP_LOG_LEVEL": "INFO"
}
}
}
}
The server uses Typer for CLI arguments and Pydantic Settings for environment variables. You can mix and match, but CLI arguments take precedence.
| Environment Variable | CLI Argument | Description | Default |
|---|---|---|---|
TALOSCONFIG |
N/A | Path to talosconfig file | ~/.talos/config |
TALOS_MCP_LOG_LEVEL |
--log-level |
Logging verbosity (DEBUG, INFO, etc) | INFO |
TALOS_MCP_AUDIT_LOG_PATH |
--audit-log |
Path to JSON audit log file | talos_mcp_audit.log |
TALOS_MCP_READONLY |
--readonly / --no-readonly |
Enable/Disable read-only mode | false |
Once configured, you can ask Claude natural language questions:
"Show me the version of Talos running on my cluster"
"What services are running on node 192.168.1.10?"
"Get the logs from kubelet on my control plane nodes"
"List all disks on 192.168.1.10"
"Check the health of my Talos cluster"
"Show me the etcd members"
from talos_mcp.server import TalosClient
# Initialize client
client = TalosClient()
# Get context info
info = client.get_context_info()
print(info)
# Execute talosctl commands
result = await client.execute_talosctl(["version"])
print(result["stdout"])
# Install dev dependencies
uv pip install -e ".[dev]"
# Run unit tests
pytest
# Run integration tests (Requires Docker)
# This will provision a local Talos cluster in Docker
make test-integration
We use a comprehensive set of tools to ensure code quality:
# Standard development workflow using Makefile
make install # Install dependencies
make lint # Run all linters (ruff, mypy, bandit)
make test # Run tests
make verify # Verify tool registration
The server uses loguru for structured logging.
talos_mcp_audit.log (rotating) containing detailed JSON logs for debugging and auditing commands.┌─────────────────┐
│ Claude Desktop │
└────────┬────────┘
│ MCP Protocol
↓
┌─────────────────────────────────────┐
│ MCP Server (Python) │
│ ├─ cli.py (CLI & Lifecycle) │
│ ├─ handlers.py (Protocol Handlers) │
│ ├─ registry.py (Auto-Discovery) │
│ └─ server.py (Initialization) │
└────────┬────────────────────────────┘
│ subprocess
↓
┌─────────────────┐
│ talosctl CLI │
└────────┬────────┘
│ gRPC + mTLS
↓
┌─────────────────┐
│ Talos Cluster │
│ (apid API) │
└─────────────────┘
# Check if talosctl is in PATH
which talosctl
# Install talosctl if missing
curl -sL https://talos.dev/install | sh
# Check config location
echo $TALOSCONFIG
# Verify config exists
ls -la ~/.talos/config
# Test connectivity
talosctl version
# Verify endpoints in config
talosctl config info
# Check network connectivity
ping <control-plane-ip>
# Verify certificates are valid
talosctl version --nodes <node-ip>
# Test the server directly
talos-mcp-server --help
# Check Claude Desktop logs
# macOS: ~/Library/Logs/Claude/
# Windows: %APPDATA%\Claude\logs\
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Выполни в терминале:
claude mcp add talos-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.