内容
# MegaTool
MegaTool 是一个命令行工具,实现了多个模型上下文协议(Model Context Protocol,MCP)服务器,通过统一的接口提供各种实用工具。
[](LICENSE)
[](https://github.com/simoncollins/megatool/actions/workflows/ci.yml)
[](https://github.com/simoncollins/megatool/actions/workflows/release.yml)
## 概述
MegaTool 通过简单的命令行接口提供对多个 MCP 服务器的访问。每个服务器提供特定的功能:
- **Calculator**: 执行算术运算
- **GitHub**: 访问 GitHub 仓库和用户信息
- **Package Version**: 检查各种包管理器的最新版本
## 快速安装
```bash
# 从 GitHub Releases(推荐)
# 下载地址 https://github.com/simoncollins/megatool/releases
# Linux 示例:
tar -xzf megatool-v1.0.0-linux-amd64.tar.gz -C /usr/local/bin
# 使用 Go
go install github.com/simoncollins/megatool@latest
# 从源代码
git clone https://github.com/simoncollins/megatool.git
cd megatool
just install
```
请参阅 [详细安装指南](docs/user/installation.md) 以获取先决条件和替代方法。
## 基本用法
```bash
# 以 stdio 模式运行 MCP 服务器(默认)
megatool run <server-name>
# 以 SSE 模式运行 MCP 服务器
megatool run <server-name> --sse --port 8080
# 配置 MCP 服务器
megatool run <server-name> --configure
```
可用的服务器:
- `calculator` - 简单的计算器操作
- `github` - GitHub 仓库和用户信息
- `package-version` - 多语言的包版本检查器
## 示例
```bash
# 运行计算器服务器
megatool run calculator
# 配置 GitHub 服务器(首次使用前需要)
megatool run github --configure
# 运行包版本服务器
megatool run package-version
# 在 3000 端口以 SSE 模式运行计算器服务器
megatool run calculator --sse --port 3000
```
## 文档
### 用户文档
- [安装指南](docs/user/installation.md)
- [一般用法](docs/user/usage.md)
- [计算器服务器](docs/user/calculator.md)
- [GitHub 服务器](docs/user/github.md)
- [包版本服务器](docs/user/package-version.md)
### 贡献者文档
- [架构概述](docs/contributor/architecture.md)
- [开发指南](docs/contributor/development.md)
- [项目结构](docs/contributor/project-structure.md)
- [添加新服务器](docs/contributor/adding-server.md)
- [实现 SSE 模式](docs/contributor/sse-mode.md)
## 许可证
本项目采用 MIT 许可证 - 详细信息请参见 [LICENSE](LICENSE) 文件。