Back to MCP directory
publicPublicdnsLocal runtime

file-store-mcp

一个支持多云存储的文件存储服务,提供统一API接口和多种云服务商支持

article

README

🚀 file-store-mcp

file-store-mcp 是一款功能强大的工具,它支持多种存储服务提供商,像阿里云 OSS、腾讯云 COS、七牛云和 GitHub 都在其支持范围内。该工具可处理文件的上传、下载、删除及批量操作,既适用于本地开发环境,也能在 Kubernetes 平台无缝运行,还具备扩展性,可应对高并发场景。

🚀 快速开始

file-store-mcp 支持多种存储服务提供商,可处理文件的上传、下载、删除及批量操作,并且能在本地开发环境和 Kubernetes 平台运行,扩展性良好,可应对高并发场景。

✨ 主要特性

  • 支持多种存储服务提供商,包括阿里云 OSS、腾讯云 COS、七牛云和 GitHub。
  • 可处理文件的上传、下载、删除以及批量操作。
  • 适用于本地开发环境和 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 文件中,你需要至少指定以下参数:

  • Provider:指定存储服务提供商(oss、cos、qiniu 或 github)。
  • AccessKey 和 SecretKey:对应的访问密钥信息。

各平台具体配置

阿里云 OSS

config.json 中填写以下内容:

{
  "provider": "oss",
  "ossEndpoint": "oss-cn-hangzhou.aliyuncs.com",
  "ossAccessKey": "your-access-key",
  "ossSecretKey": "your-secret-key",
  "bucketName": "your-bucket-name"
}
腾讯云 COS

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"
}
GitHub

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 开源协议,允许用户自由使用、修改和分发。


项目地址

GitHub 地址

联系方式

如需反馈或问题,请联系 作者邮箱

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client