Skip to main content
Glama
Karun9107

devops-assistant-mcp

by Karun9107
README.md
# DevOps Assistant MCP Server (Modular)

A professional-grade **Model Context Protocol (MCP)** server built with TypeScript. It acts as a multi-functional "DevOps Assistant" that allows AI models to securely query local databases and manage Docker infrastructure through a standardized interface.

## 🚀 Features

- **Modern Architecture:** Built using the latest `@modelcontextprotocol/sdk` (v1.3+).
- **Multi-Service Integration:** Single entry point for Database, System, and Docker management.
- **Docker Management:** Directly interact with the local Docker socket to inspect containers and debug logs.
- **Modular Design:** Separation of concerns between configuration, server orchestration, and service-specific tool logic.
- **Type-Safe:** Full TypeScript implementation with **Zod** schema validation for all tool inputs.

## 🛠️ Tools Provided

### 🗄️ Database Tools
- **`query_database`**: Execute SQL queries on the local MySQL instance to analyze data or system records.

### 🐳 Docker Tools
- **`list_containers`**: List all local Docker containers and their current status (Running, Stopped, etc.).
- **`get_container_logs`**: Retrieve the last 50 lines of logs from a specific container for real-time debugging.

### ⚙️ System Tools
- **`get_system_time`**: Utility tool to retrieve the server's current time for log synchronization.

## 📋 Prerequisites

- **Node.js** (v18+)
- **Docker Desktop** (or OrbStack)
- **MCP Client** (e.g., VS Code with "Continue" or "Roo Code", or the MCP Inspector)

## 🚦 Quick Start

### 1. Start the Sample Database
Run the MySQL container using Docker:

```bash
docker run -d \
  --name mcp-app-db \
  -e MYSQL_ROOT_PASSWORD=mypassword \
  -e MYSQL_DATABASE=mcp_learning \
  -p 3306:3306 \
  mysql:latest
```

### 2. Install Dependencies
```bash
npm install
```

### 3. Seed the Database
Populate the database with sample user data:
```bash
npm run seed
```

### 4. Build and Test
Compile the TypeScript code and run the MCP Inspector:
```bash
npm run build
npx @modelcontextprotocol/inspector node dist/index.js
```

## 🏗️ Project Structure
- `src/config.ts`: Centralized configuration for all services.
- `src/tools/database.ts`: SQL query logic.
- `src/tools/docker.ts`: Docker socket integration logic.
- `src/tools/system.ts`: General utility tools.
- `src/index.ts`: The main orchestrator and entry point.

## 📄 License
ISC

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct operation: container logs, system time, container listing, and database query. No overlap in purpose.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (get_, list_, query_), with clear actions and targets.

Tool Count5/5

With 4 tools, the set is well-scoped for basic DevOps monitoring tasks, each tool earning its place without redundancy.

Completeness2/5

Major gaps exist for a 'DevOps assistant': missing container management (start/stop/restart), deployment, database schema exploration, and system monitoring beyond time.

Maintenance

ActivityInactive
ResponsivenessNo issues