artijain8726
MCP Serverartijain8726public

k8sbot

一个集成了 Kubernetes 和 Slack 的 MCP 服务器,提供集群监控和自定义命令功能。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

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

  1. Create a .env file 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
  1. Set up your Slack App:

    • Create a new Slack App at https://api.slack.com/apps
    • Add the following bot token scopes:
      • chat:write
      • commands
    • 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
  2. Configure Kubernetes:

    • Ensure you have a valid kubeconfig file
    • Set the KUBECONFIG environment 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:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --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

1

Clone the repository

git clone https://github.com/artijain8726/k8sbot
2

Install dependencies

cd k8sbot
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerartijain8726
Repok8sbot
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation