file-store-mcp 是一款功能强大的工具,它支持多种存储服务提供商,像阿里云 OSS、腾讯云 COS、七牛云和 GitHub 都在其支持范围内。该工具可处理文件的上传、下载、删除及批量操作,既适用于本地开发环境,也能在 Kubernetes 平台无缝运行,还具备扩展性,可应对高并发场景。
file-store-mcp 支持多种存储服务提供商,可处理文件的上传、下载、删除及批量操作,并且能在本地开发环境和 Kubernetes 平台运行,扩展性良好,可应对高并发场景。
你可以通过以下命令轻松安装 file-store-mcp:
go install github.com/sjzar/file-store-mcp/cmd/file-store-mcp@latest
上传文件到指定存储服务提供商:
file-store-mcp upload --provider oss --config ./config.json
下载指定存储服务提供商中的文件:
file-store-mcp download --provider cos --name "example-file.txt"
删除指定存储服务提供商中的文件:
file-store-mcp delete --provider qiniu --path "images/logo.png"
在 config.json 文件中,你需要至少指定以下参数:
在 config.json 中填写以下内容:
{
"provider": "oss",
"ossEndpoint": "oss-cn-hangzhou.aliyuncs.com",
"ossAccessKey": "your-access-key",
"ossSecretKey": "your-secret-key",
"bucketName": "your-bucket-name"
}
在 config.json 中填写以下内容:
{
"provider": "cos",
"region": "ap-southeast-2",
"cosSecretId": "your-secret-id",
"cosSecretKey": "your-secret-key",
"bucketName": "your-bucket-name"
}
在 config.json 中填写以下内容:
{
"provider": "qiniu",
"accessKey": "your-access-key",
"secretKey": "your-secret-key",
"bucketName": "your-bucket-name",
"domain": "cdn.your-domain.com"
}
在 config.json 中填写以下内容:
{
"provider": "github",
"token": "your-github-token",
"owner": "your-repo-owner",
"repo": "your-repo-name",
"branch": "main",
"pathPrefix": "uploads"
}
你可以为所有存储服务提供商配置自定义域名,以便通过 CDN 提供更快的文件访问。例如,对于阿里云 OSS:
ossEndpoint=oss-cn-hangzhou.aliyuncs.com
bucketName=my-bucket
ossAccessKey=your-access-key
ossSecretKey=your-secret-key
customDomain=cdn.example.com
启用调试模式以获得更详细的日志输出:
file-store-mcp --debug
从源码构建 file-store-mcp,你可以按照以下步骤操作:
git clone https://github.com/sjzar/file-store-mcp.git
cd file-store-mcp
go build -o bin/file-store-mcp ./cmd/file-store-mcp
file-store-mcp 采用 Apache License 2.0 开源协议,允许用户自由使用、修改和分发。
如需反馈或问题,请联系 作者邮箱。