Skip to main content

FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成

Project description

FangCloud MCP

FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成。通过该服务,AI 助手可以直接与 FangCloud 进行交互,实现文件和文件夹的管理操作。

功能特点

FangCloud MCP 提供以下功能:

  • 文件操作
    • 获取文件信息
    • 上传文件
    • 下载文件
    • 更新文件名称和描述
  • 文件夹操作
    • 获取文件夹信息
    • 创建文件夹
    • 列出文件夹内容
    • 列出个人空间项目
  • 搜索功能
    • 按关键词搜索文件和文件夹
    • 支持多种过滤和排序选项

安装要求

  • Python 3.12 或更高版本
  • 依赖项:
    • aiohttp >= 3.8.6
    • mcp[cli] >= 1.7.1

安装方法

从 PyPI 安装(推荐)

pip install fangcloud-mcp

使用方法

启动服务器

服务器需要 FangCloud API 访问令牌才能运行:

fangcloud --access_token <your-access-token>

或者使用简短参数形式:

fangcloud -c <your-access-token>

日志

服务器日志保存在fangcloud-mcp.log文件中,同时也会输出到控制台。

API 参考

文件操作

获取文件信息

get_file_info(file_id: str)

获取指定文件 ID 的详细信息。

上传文件

upload_file(parent_folder_id: str, local_file_path: str)

将本地文件上传到指定的 FangCloud 文件夹。

下载文件

download_file(file_id: str, local_path: str)

下载指定 ID 的文件到本地路径。

更新文件

update_file(file_id: str, name: Optional[str] = None, description: Optional[str] = None)

更新文件的名称和/或描述。

文件夹操作

获取文件夹信息

get_folder_info(folder_id: str)

获取指定文件夹 ID 的详细信息。

创建文件夹

create_folder(name: str, parent_id: str, target_space_type: Optional[str] = None, target_space_id: Optional[str] = None)

在指定的父文件夹中创建新文件夹。

列出文件夹内容

list_folder_contents(folder_id: str, page_id: Optional[int] = 0, page_capacity: Optional[int] = 20, type_filter: Optional[str] = "all", sort_by: Optional[str] = "date", sort_direction: Optional[str] = "desc")

列出指定文件夹中的文件和子文件夹。

列出个人空间项目

list_personal_items(page_id: Optional[int] = 0, page_capacity: Optional[int] = 20, type_filter: Optional[str] = "all", sort_by: Optional[str] = "date", sort_direction: Optional[str] = "desc")

列出个人空间中的文件和文件夹。

搜索功能

search_items(query_words: str, search_type: Optional[str] = "all", page_id: Optional[int] = 0, search_in_folder: Optional[str] = None, query_filter: Optional[str] = "all", updated_time_range: Optional[str] = None)

搜索文件和文件夹,支持多种过滤选项。

开发

项目结构

  • fangcloud.py - 主入口点,包含 MCP 服务器实现和工具函数
  • fangcloud_api.py - FangCloud API 客户端实现
  • pyproject.toml - 项目配置和依赖声明

日志记录

项目使用 Python 的标准 logging 模块记录日志,配置为同时输出到控制台和文件。

许可证

MIT License

Copyright (c) 2025 FangCloud Developer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fangcloud_mcp-0.1.6.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fangcloud_mcp-0.1.6-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file fangcloud_mcp-0.1.6.tar.gz.

File metadata

  • Download URL: fangcloud_mcp-0.1.6.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for fangcloud_mcp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5148454c785779deb8638dd0319c7fd72405f66f11668ee17b86c5d2e51bd2f7
MD5 1a461508d53bf8fb78f4cf052d2d95ee
BLAKE2b-256 521e97086cb0599a87d46c7347beecb76a23b56ee539978d52fe2fd2429bf9f1

See more details on using hashes here.

File details

Details for the file fangcloud_mcp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fangcloud_mcp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for fangcloud_mcp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 604002157f62e68ca8e6896392168805cb87e942b9208b5840dbd8ae01f69799
MD5 47c4adafe3d9169cf2ef57b9bef66eba
BLAKE2b-256 1257da2c0b397dc4f0fa98118eb5baa0b2643311a77c4f59561a7fec09f62123

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page