
k8sbot
一个集成了 Kubernetes 和 Slack 的 MCP 服务器,提供集群监控和自定义命令功能。
Repository Info
About This Server
一个集成了 Kubernetes 和 Slack 的 MCP 服务器,提供集群监控和自定义命令功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
k8s-slack-mcp MCP Server
A Kubernetes-integrated MCP server with Slack bot functionality that provides a bridge between your Kubernetes cluster and Slack workspace through MCP endpoints.
Features
- Real-time Kubernetes cluster monitoring
- Slack bot integration with custom commands
- MCP server endpoints for managing both systems
Components
Kubernetes Integration
- List pods and deployments across namespaces
- Fetch pod logs
- Monitor cluster status
Slack Bot Commands
/pods [namespace]- List all pods in the specified namespace/deployments [namespace]- List all deployments in the specified namespace/podlogs <pod-name> [namespace]- Get logs from a specific pod
MCP Endpoints
The server provides the following MCP commands:
-
list_pods- List all pods in a namespace{ "command": "list_pods", "namespace": "default" } -
list_deployments- List all deployments in a namespace{ "command": "list_deployments", "namespace": "default" } -
get_pod_logs- Get logs from a specific pod{ "command": "get_pod_logs", "pod_name": "my-pod", "namespace": "default" } -
notify_slack- Send a message to a Slack channel{ "command": "notify_slack", "channel": "#my-channel", "message": "Hello from Kubernetes!" }
Configuration
- Create a
.envfile in the project root with your credentials:
SLACK_BOT_TOKEN=your_slack_bot_token
SLACK_SIGNING_SECRET=your_slack_signing_secret
KUBECONFIG=path_to_your_kubeconfig
-
Set up your Slack App:
- Create a new Slack App at https://api.slack.com/apps
- Add the following bot token scopes:
chat:writecommands
- Create the following slash commands:
/pods/deployments/podlogs
- Install the app to your workspace
- Copy the Bot User OAuth Token to
SLACK_BOT_TOKEN - Copy the Signing Secret to
SLACK_SIGNING_SECRET
-
Configure Kubernetes:
- Ensure you have a valid kubeconfig file
- Set the
KUBECONFIGenvironment variable to point to your config file - The service account used must have permissions to list pods, deployments, and read logs
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
``` "mcpServers": { "k8s-slack-mcp": { "command": "uv", "args": [ "--directory", "/Users/apple/Downloads/pythonbot", "run", "k8s-slack-mcp" ] } } ```Published Servers Configuration
``` "mcpServers": { "k8s-slack-mcp": { "command": "uvx", "args": [ "k8s-slack-mcp" ] } } ```Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/ directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--tokenorUV_PUBLISH_TOKEN - Or username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory /Users/apple/Downloads/pythonbot run k8s-slack-mcp
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Quick Start
Clone the repository
git clone https://github.com/artijain8726/k8sbotInstall dependencies
cd k8sbot
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.