Metadata-Version: 2.4
Name: sliver-mcp
Version: 1.0.0
Summary: MCP server for Sliver C2 — AI agent automation for post-exploitation
Author: hi-unc1e
License-Expression: MIT
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: mcp[cli]>=1.0
Requires-Dist: sliver-py>=0.0.20
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# sliver-mcp · [English](#english) / [中文](#中文)

---

## English

MCP server for [Sliver C2](https://github.com/BishopFox/sliver) — let AI agents automate post-exploitation.

**V1.0 — 17 tools** for session interaction, command execution, file operations, and reconnaissance.

### Prerequisites

- Python >= 3.10
- [uv](https://docs.astral.sh/uv/) (Python package manager)
- [sliver-py](https://github.com/hi-unc1e/sliver-py) (gRPC bindings)
- A running [Sliver C2 server](https://github.com/BishopFox/sliver)
- A Sliver operator config file (generated by `sliver-client import` or `sliver-server operator`)

### Quick Start

```bash
# Clone both repos
git clone git@github.com:hi-unc1e/sliver-mcp.git
cd sliver-mcp
git clone git@github.com:hi-unc1e/sliver-py.git

# Install & run
uv sync
uv run sliver-mcp --config /path/to/operator.cfg
```

### Configuration

| Option | CLI | Default |
|--------|-----|---------|
| Operator config | `--config PATH` | (required) |
| Downloads dir | `--downloads-dir DIR` | `~/Downloads/sliver/` |
| gRPC timeout | `--timeout SECONDS` | `60` |
| Debug logging | `--debug` | off |

### Claude Desktop Setup

```json
{
  "mcpServers": {
    "sliver": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/path/to/sliver-mcp",
        "sliver-mcp",
        "--config", "/path/to/operator.cfg"
      ]
    }
  }
}
```

### Tools

| Category | Tool | Description |
|----------|------|-------------|
| Server | `server_version` | Get Sliver server version |
| Sessions | `list_sessions` | List all active sessions |
| | `session_info` | Get detailed session info |
| | `kill_session` | Kill a session |
| Execute | `execute` | Run shell command (`auto`/`cmd`/`powershell`/`sh`) |
| Files | `list_files` | List directory contents |
| | `change_directory` | Change working directory |
| | `working_directory` | Get current directory |
| | `make_directory` | Create directory |
| | `remove_path` | Remove file/directory |
| | `download_file` | Download file to local |
| | `upload_file` | Upload file to remote |
| Recon | `list_processes` | List running processes |
| | `network_interfaces` | Get network interfaces |
| | `network_connections` | Get network connections |
| | `get_environment` | Get environment variable |
| | `screenshot` | Take screenshot (PNG + base64) |

### Downloads

Files are saved to: `{downloads_dir}/{hostname}_{session_id}/{filename}`.

### Architecture

```
sliver-mcp (MCP server, Python)
  └── sliver-py (gRPC client library)
        └── grpcio → Sliver Server (gRPC + mTLS)
```

No Sliver client binary needed — sliver-py connects directly via gRPC.

### Development

```bash
# Run tests (mock, no server needed)
uv sync --extra dev
uv run pytest tests/ -v --ignore=tests/test_smoke.py

# Run integration tests (needs real server, CI only)
SLIVER_INTEGRATION_TEST=1 uv run pytest tests/test_smoke.py -v
```

### License

MIT

---

## 中文

针对 [Sliver C2](https://github.com/BishopFox/sliver) 的 MCP 服务器 — 让 AI agent 自动化后渗透操作。

**V1.0 — 17 个工具**，覆盖会话交互、命令执行、文件操作和信息收集。

### 前置条件

- Python >= 3.10
- [uv](https://docs.astral.sh/uv/)（Python 包管理器）
- [sliver-py](https://github.com/hi-unc1e/sliver-py)（gRPC 绑定库）
- 运行中的 [Sliver C2 服务器](https://github.com/BishopFox/sliver)
- Sliver 操作员配置文件（通过 `sliver-client import` 或 `sliver-server operator` 生成）

### 快速开始

```bash
# Clone 两个仓库
git clone git@github.com:hi-unc1e/sliver-mcp.git
cd sliver-mcp
git clone git@github.com:hi-unc1e/sliver-py.git

# 安装并运行
uv sync
uv run sliver-mcp --config /path/to/operator.cfg
```

### 配置

| 配置项 | CLI | 默认值 |
|--------|-----|--------|
| 操作员配置文件 | `--config PATH` | （必填） |
| 下载目录 | `--downloads-dir DIR` | `~/Downloads/sliver/` |
| gRPC 超时 | `--timeout SECONDS` | `60` |
| Debug 日志 | `--debug` | off |

### Claude Desktop 配置

```json
{
  "mcpServers": {
    "sliver": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/path/to/sliver-mcp",
        "sliver-mcp",
        "--config", "/path/to/operator.cfg"
      ]
    }
  }
}
```

### 工具列表

| 类别 | 工具 | 说明 |
|------|------|------|
| 服务端 | `server_version` | 获取 Sliver 服务器版本 |
| 会话 | `list_sessions` | 列出所有活跃会话 |
| | `session_info` | 获取会话详细信息 |
| | `kill_session` | 终止会话 |
| 执行 | `execute` | 执行命令（`auto`/`cmd`/`powershell`/`sh`） |
| 文件 | `list_files` | 列出目录内容 |
| | `change_directory` | 切换工作目录 |
| | `working_directory` | 获取当前目录 |
| | `make_directory` | 创建目录 |
| | `remove_path` | 删除文件/目录 |
| | `download_file` | 下载文件到本地 |
| | `upload_file` | 上传文件到远程 |
| 侦察 | `list_processes` | 进程列表 |
| | `network_interfaces` | 网络接口信息 |
| | `network_connections` | 网络连接 |
| | `get_environment` | 获取环境变量 |
| | `screenshot` | 截屏（PNG + base64） |

### 下载文件

文件保存路径：`{下载目录}/{主机名}_{会话ID}/{文件名}`。

### 架构

```
sliver-mcp (MCP 服务器, Python)
  └── sliver-py (gRPC 客户端库)
        └── grpcio → Sliver 服务器 (gRPC + mTLS)
```

无需 Sliver 客户端二进制文件 — sliver-py 直接通过 gRPC 连接。

### 开发

```bash
# 运行测试（Mock，无需服务器）
uv sync --extra dev
uv run pytest tests/ -v --ignore=tests/test_smoke.py

# 运行集成测试（需真实服务器，CI 环境）
SLIVER_INTEGRATION_TEST=1 uv run pytest tests/test_smoke.py -v
```

### License

MIT
