内容
# wecom-driver-mcp
企业微信微盘 MCP Server,基于 [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) 实现,支持通过 stdio 方式将本地文件上传到企业微信微盘。
## 功能
- **upload_file** — 将本地文件上传至企业微信微盘,返回文件 ID 和分享链接
## 快速开始
### 1. 获取二进制
从 [Releases](https://github.com/kurok1/wecom-driver-mcp/releases) 页面下载对应平台的二进制文件,或自行编译:
```bash
go build -o wecom-driver-mcp ./cmd/mcp-server
```
### 2. 配置 MCP
在 Claude Code 或其他 MCP 客户端中添加以下配置:
```json
{
"mcpServers": {
"wecom-driver": {
"command": "/path/to/wecom-driver-mcp",
"args": [
"--corp-id=YOUR_CORP_ID",
"--corp-secret=YOUR_CORP_SECRET",
"--space-id=YOUR_SPACE_ID"
]
}
}
}
```
### 启动参数
| 参数 | 说明 | 必填 |
|------|------|------|
| `--corp-id` | 企业 ID | 是 |
| `--corp-secret` | 应用 Secret | 是 |
| `--space-id` | 微盘空间 ID | 是 |
## 使用示例
上传本地文件:
```json
{
"tool": "upload_file",
"arguments": {
"file_path": "/path/to/file.pdf"
}
}
```
返回值:
```json
{
"file_id": "文件 ID",
"file_share_url": "文件分享链接"
}
```
## 项目结构
```
wecom-driver-mcp/
├── cmd/
│ └── mcp-server/
│ └── main.go # 入口
├── internal/
│ ├── config/
│ │ └── config.go # 命令行参数解析
│ ├── server/
│ │ └── server.go # MCP Server 及 Tool 注册
│ └── wecom/
│ └── client.go # 企业微信 API 客户端
├── .github/
│ └── workflows/
│ └── release.yml # CI/CD 工作流
├── go.mod
└── go.sum
```
## 构建
```bash
go build -o wecom-driver-mcp ./cmd/mcp-server
```
## 发版
推送 tag 后 GitHub Actions 自动构建多平台二进制并发布 Release:
```bash
git tag v0.1.0
git push origin v0.1.0
```
支持平台:
- macOS (amd64 / arm64)
- Linux (amd64 / arm64)
- Windows (amd64)
## License
MIT