local-devops-mcp
README.md
# Local DevOps MCP Server
A Model Context Protocol (MCP) server that provides tools for local DevOps tasks, enabling AI assistants to interact with your local Docker environment, Kubernetes clusters, and system logs.
> [!NOTE]
> This server uses **TOON (Token-Oriented Object Notation)** for tool outputs to optimize token usage for LLMs.
## Features
### π³ Docker
Interact with your local Docker daemon:
- `docker_list_containers`: List running or all containers.
- `docker_logs`: Fetch logs from a container (with error highlighting π΄).
- `docker_restart`: Restart a specific container.
- `docker_inspect`: Inspect container details.
### βΈοΈ Kubernetes
Interact with your local Kubernetes cluster (uses `~/.kube/config`):
- `k8s_list_pods`: List pods in a namespace.
- `k8s_pod_logs`: Get logs from a pod.
- `k8s_describe_pod`: Get detailed pod information.
### π₯οΈ System
Access local system information:
- `system_open_ports`: List open listening ports (requires `lsof`).
- `system_logs`: Read system logs (e.g., `/var/log/system.log`).
## Installation & Usage
### Using `npx` (Recommended)
You can run the server directly without installation:
```bash
npx local-devops-mcp
```
### Configuration for Claude Desktop
To use this server with Claude Desktop, add the following to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"local-devops": {
"command": "npx",
"args": ["-y", "local-devops-mcp"]
}
}
}
```
### Running from Source
1. Clone the repository:
```bash
git clone https://github.com/nguyentrantung205/local-devops-mcp.git
cd local-devops-mcp
```
2. Install dependencies:
```bash
npm install
```
3. Build the project:
```bash
npm run build
```
4. Run the server:
```bash
node build/index.js
```
## Prerequisites
- **Node.js**: v18 or higher.
- **Docker**: Docker Desktop or Docker Engine must be running locally.
- **Kubernetes**: `kubectl` configured with a valid `~/.kube/config` (optional, only for K8s tools).
- **Permissions**: The user running the server needs permissions to access the Docker socket and read system logs.
## Testing
See [TESTING.md](./TESTING.md) for instructions on how to test the server locally.
## License
ISC
TDQS
D1.8/5.0
Scored across 4 tools
Disambiguation5/5
Each tool has a distinct prefix (docker or k8s) and action (logs, inspect, list_pods, pod_logs), making them clearly distinguishable even without descriptions.
Naming Consistency5/5
All tool names follow a consistent verb_noun pattern with snake_case (e.g., docker_logs, k8s_list_pods), and the prefix consistently indicates the subsystem.
Tool Count3/5
With only 4 tools for a broad domain like local devops, the set feels too sparse to cover common operations, though each tool is distinct.
Completeness2/5
Obvious gaps: Docker only has logs and inspect (no run, stop, etc.) and Kubernetes only has list pods and pod logs (no get, delete, etc.), leaving agents unable to complete basic workflows.