fangcloud-mcp 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,6 @@
2
2
  FangCloud MCP - Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成
3
3
  """
4
4
 
5
- __version__ = "0.1.4"
6
-
7
5
  from .fangcloud import main
8
6
  from .fangcloud_api import FangcloudAPI
9
7
 
@@ -64,7 +64,7 @@ async def get_folder_info(folder_id: str) -> Dict[str, Any]:
64
64
  Get folder information
65
65
 
66
66
  Args:
67
- folder_id: Folder ID
67
+ folder_id: Folder ID (value 0 represents the root directory ID of personal space)
68
68
 
69
69
  Returns:
70
70
  Folder information (JSON format) or error message
@@ -92,7 +92,7 @@ async def create_folder(name: str, parent_id: str,
92
92
 
93
93
  Args:
94
94
  name: Folder name (1-222 characters, cannot contain / ? : * " > <)
95
- parent_id: Parent folder ID
95
+ parent_id: Parent folder ID (value 0 represents the root directory ID of personal space)
96
96
  target_space_type: Space type - "department" or "personal" (optional, effective when parent_id is 0)
97
97
  target_space_id: Space ID (required when target_space_type is "department")
98
98
 
@@ -138,7 +138,7 @@ async def upload_file(parent_folder_id: str, local_file_path: str) -> Dict[str,
138
138
  Upload file to FangCloud
139
139
 
140
140
  Args:
141
- parent_folder_id: Target folder ID in FangCloud
141
+ parent_folder_id: Target folder ID in FangCloud (value 0 represents the root directory ID of personal space)
142
142
  local_file_path: Local file path to upload
143
143
 
144
144
  Returns:
@@ -151,15 +151,15 @@ async def upload_file(parent_folder_id: str, local_file_path: str) -> Dict[str,
151
151
  return {"status": "error", "message": "local_file_path is required"}
152
152
 
153
153
  try:
154
- # 获取文件名
154
+ # Get file name
155
155
  file_name = os.path.basename(local_file_path)
156
156
 
157
- # 获取上传URL
157
+ # Get upload URL
158
158
  upload_url = await api.get_file_upload_url(parent_folder_id, file_name)
159
159
  if not upload_url:
160
160
  return {"status": "error", "message": f"Failed to get upload URL for {file_name}"}
161
161
 
162
- # 上传文件
162
+ # Upload file
163
163
  result = await api.upload_file(upload_url, local_file_path)
164
164
 
165
165
  if result:
@@ -262,7 +262,7 @@ async def list_folder_contents(folder_id: str, page_id: Optional[int] = 0,
262
262
  List folder contents (files and subfolders)
263
263
 
264
264
  Args:
265
- folder_id: Folder ID
265
+ folder_id: Folder ID (value 0 represents the root directory ID of personal space)
266
266
  page_id: Page number (optional, default 0)
267
267
  page_capacity: Page capacity (optional, default 20)
268
268
  type_filter: Filter by type - "file", "folder", or "all" (optional, default "all")
@@ -1,176 +1,180 @@
1
- Metadata-Version: 2.4
2
- Name: fangcloud-mcp
3
- Version: 0.1.5
4
- Summary: FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成
5
- Home-page: https://github.com/example/fangcloud
6
- Author: FangCloud Developer
7
- Author-email: FangCloud Developer <dev@example.com>
8
- Keywords: fangcloud,mcp,cloud storage,api
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Topic :: Software Development :: Libraries
16
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
- Requires-Python: >=3.12
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
- Requires-Dist: aiohttp>=3.8.6
21
- Requires-Dist: mcp[cli]>=1.7.1
22
- Dynamic: author
23
- Dynamic: home-page
24
- Dynamic: license-file
25
- Dynamic: requires-python
26
-
27
- # FangCloud MCP
28
-
29
- FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成。通过该服务,AI 助手可以直接与 FangCloud 进行交互,实现文件和文件夹的管理操作。
30
-
31
- ## 功能特点
32
-
33
- FangCloud MCP 提供以下功能:
34
-
35
- - 文件操作
36
- - 获取文件信息
37
- - 上传文件
38
- - 下载文件
39
- - 更新文件名称和描述
40
- - 文件夹操作
41
- - 获取文件夹信息
42
- - 创建文件夹
43
- - 列出文件夹内容
44
- - 列出个人空间项目
45
- - 搜索功能
46
- - 按关键词搜索文件和文件夹
47
- - 支持多种过滤和排序选项
48
-
49
- ## 安装要求
50
-
51
- - Python 3.12 或更高版本
52
- - 依赖项:
53
- - aiohttp >= 3.11.18
54
- - mcp[cli] >= 1.7.1
55
-
56
- ## 安装方法
57
-
58
- ### 从 PyPI 安装(推荐)
59
-
60
- ```bash
61
- pip install fangcloud
62
- ```
63
-
64
- ## 使用方法
65
-
66
- ### 启动服务器
67
-
68
- 服务器需要 FangCloud API 访问令牌才能运行:
69
-
70
- ```bash
71
- python fangcloud.py --access_token <your-access-token>
72
- ```
73
-
74
- 或者使用简短参数形式:
75
-
76
- ```bash
77
- python fangcloud.py -c <your-access-token>
78
- ```
79
-
80
- ### 日志
81
-
82
- 服务器日志保存在`fangcloud-mcp.log`文件中,同时也会输出到控制台。
83
-
84
- ## API 参考
85
-
86
- ### 文件操作
87
-
88
- #### 获取文件信息
89
-
90
- ```python
91
- get_file_info(file_id: str)
92
- ```
93
-
94
- 获取指定文件 ID 的详细信息。
95
-
96
- #### 上传文件
97
-
98
- ```python
99
- upload_file(parent_folder_id: str, local_file_path: str)
100
- ```
101
-
102
- 将本地文件上传到指定的 FangCloud 文件夹。
103
-
104
- #### 下载文件
105
-
106
- ```python
107
- download_file(file_id: str, local_path: str)
108
- ```
109
-
110
- 下载指定 ID 的文件到本地路径。
111
-
112
- #### 更新文件
113
-
114
- ```python
115
- update_file(file_id: str, name: Optional[str] = None, description: Optional[str] = None)
116
- ```
117
-
118
- 更新文件的名称和/或描述。
119
-
120
- ### 文件夹操作
121
-
122
- #### 获取文件夹信息
123
-
124
- ```python
125
- get_folder_info(folder_id: str)
126
- ```
127
-
128
- 获取指定文件夹 ID 的详细信息。
129
-
130
- #### 创建文件夹
131
-
132
- ```python
133
- create_folder(name: str, parent_id: str, target_space_type: Optional[str] = None, target_space_id: Optional[str] = None)
134
- ```
135
-
136
- 在指定的父文件夹中创建新文件夹。
137
-
138
- #### 列出文件夹内容
139
-
140
- ```python
141
- 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")
142
- ```
143
-
144
- 列出指定文件夹中的文件和子文件夹。
145
-
146
- #### 列出个人空间项目
147
-
148
- ```python
149
- 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")
150
- ```
151
-
152
- 列出个人空间中的文件和文件夹。
153
-
154
- ### 搜索功能
155
-
156
- ```python
157
- 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)
158
- ```
159
-
160
- 搜索文件和文件夹,支持多种过滤选项。
161
-
162
- ## 开发
163
-
164
- ### 项目结构
165
-
166
- - `fangcloud.py` - 主入口点,包含 MCP 服务器实现和工具函数
167
- - `fangcloud_api.py` - FangCloud API 客户端实现
168
- - `pyproject.toml` - 项目配置和依赖声明
169
-
170
- ### 日志记录
171
-
172
- 项目使用 Python 的标准 logging 模块记录日志,配置为同时输出到控制台和文件。
173
-
174
- ## 许可证
175
-
176
- [添加许可证信息]
1
+ Metadata-Version: 2.4
2
+ Name: fangcloud-mcp
3
+ Version: 0.1.7
4
+ Summary: FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: aiohttp>=3.8.6
8
+ Requires-Dist: mcp[cli]>=1.7.1
9
+ Description-Content-Type: text/markdown
10
+
11
+ # FangCloud MCP
12
+
13
+ FangCloud MCP 是一个 Model Context Protocol (MCP) 服务器实现,提供与 FangCloud 云存储服务的集成。通过该服务,AI 助手可以直接与 FangCloud 进行交互,实现文件和文件夹的管理操作。
14
+
15
+ ## 功能特点
16
+
17
+ FangCloud MCP 提供以下功能:
18
+
19
+ - 文件操作
20
+ - 获取文件信息
21
+ - 上传文件
22
+ - 下载文件
23
+ - 更新文件名称和描述
24
+ - 文件夹操作
25
+ - 获取文件夹信息
26
+ - 创建文件夹
27
+ - 列出文件夹内容
28
+ - 列出个人空间项目
29
+ - 搜索功能
30
+ - 按关键词搜索文件和文件夹
31
+ - 支持多种过滤和排序选项
32
+
33
+ ## 安装要求
34
+
35
+ - Python 3.12 或更高版本
36
+ - 依赖项:
37
+ - aiohttp >= 3.8.6
38
+ - mcp[cli] >= 1.7.1
39
+
40
+ ## 安装方法
41
+
42
+ ### 从 PyPI 安装(推荐)
43
+
44
+ ```bash
45
+ pip install fangcloud-mcp
46
+ ```
47
+
48
+ ## 使用方法
49
+
50
+ ### 启动服务器
51
+
52
+ 服务器需要 FangCloud API 访问令牌才能运行:
53
+
54
+ ```bash
55
+ fangcloud --access_token <your-access-token>
56
+ ```
57
+
58
+ 或者使用简短参数形式:
59
+
60
+ ```bash
61
+ fangcloud -c <your-access-token>
62
+ ```
63
+
64
+ ### 日志
65
+
66
+ 服务器日志保存在`fangcloud-mcp.log`文件中,同时也会输出到控制台。
67
+
68
+ ## API 参考
69
+
70
+ ### 文件操作
71
+
72
+ #### 获取文件信息
73
+
74
+ ```python
75
+ get_file_info(file_id: str)
76
+ ```
77
+
78
+ 获取指定文件 ID 的详细信息。
79
+
80
+ #### 上传文件
81
+
82
+ ```python
83
+ upload_file(parent_folder_id: str, local_file_path: str)
84
+ ```
85
+
86
+ 将本地文件上传到指定的 FangCloud 文件夹。
87
+
88
+ #### 下载文件
89
+
90
+ ```python
91
+ download_file(file_id: str, local_path: str)
92
+ ```
93
+
94
+ 下载指定 ID 的文件到本地路径。
95
+
96
+ #### 更新文件
97
+
98
+ ```python
99
+ update_file(file_id: str, name: Optional[str] = None, description: Optional[str] = None)
100
+ ```
101
+
102
+ 更新文件的名称和/或描述。
103
+
104
+ ### 文件夹操作
105
+
106
+ #### 获取文件夹信息
107
+
108
+ ```python
109
+ get_folder_info(folder_id: str)
110
+ ```
111
+
112
+ 获取指定文件夹 ID 的详细信息。
113
+
114
+ #### 创建文件夹
115
+
116
+ ```python
117
+ create_folder(name: str, parent_id: str, target_space_type: Optional[str] = None, target_space_id: Optional[str] = None)
118
+ ```
119
+
120
+ 在指定的父文件夹中创建新文件夹。
121
+
122
+ #### 列出文件夹内容
123
+
124
+ ```python
125
+ 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")
126
+ ```
127
+
128
+ 列出指定文件夹中的文件和子文件夹。
129
+
130
+ #### 列出个人空间项目
131
+
132
+ ```python
133
+ 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")
134
+ ```
135
+
136
+ 列出个人空间中的文件和文件夹。
137
+
138
+ ### 搜索功能
139
+
140
+ ```python
141
+ 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)
142
+ ```
143
+
144
+ 搜索文件和文件夹,支持多种过滤选项。
145
+
146
+ ## 开发
147
+
148
+ ### 项目结构
149
+
150
+ - `fangcloud.py` - 主入口点,包含 MCP 服务器实现和工具函数
151
+ - `fangcloud_api.py` - FangCloud API 客户端实现
152
+ - `pyproject.toml` - 项目配置和依赖声明
153
+
154
+ ### 日志记录
155
+
156
+ 项目使用 Python 的标准 logging 模块记录日志,配置为同时输出到控制台和文件。
157
+
158
+ ## 许可证
159
+
160
+ MIT License
161
+
162
+ Copyright (c) 2025 FangCloud Developer
163
+
164
+ Permission is hereby granted, free of charge, to any person obtaining a copy
165
+ of this software and associated documentation files (the "Software"), to deal
166
+ in the Software without restriction, including without limitation the rights
167
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
168
+ copies of the Software, and to permit persons to whom the Software is
169
+ furnished to do so, subject to the following conditions:
170
+
171
+ The above copyright notice and this permission notice shall be included in all
172
+ copies or substantial portions of the Software.
173
+
174
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
176
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
177
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
179
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
180
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ fangcloud_mcp/__init__.py,sha256=sNSVoR1IBLBiMvnIY9KQZlURRfheArJL6U8YNJ51h0k,229
2
+ fangcloud_mcp/fangcloud.py,sha256=M-xxEKuoM9agMLp81YG4q2nP0ZlYiSh4og7tIEJyTPU,14901
3
+ fangcloud_mcp/fangcloud_api.py,sha256=QQWB8neT-XKfc854yhhZ9WihyN-aI5D_MbV_RRjf-VM,26579
4
+ fangcloud_mcp-0.1.7.dist-info/METADATA,sha256=UugMfb3agFcOt29P5ACYC0sSEpiv1gT6FSCQY6db36g,4722
5
+ fangcloud_mcp-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ fangcloud_mcp-0.1.7.dist-info/entry_points.txt,sha256=Rx2NYFMpIfV0Yc81Bpn_N-INU1LOxo59neT1Cicltwk,53
7
+ fangcloud_mcp-0.1.7.dist-info/licenses/LICENSE,sha256=PLXgT5nqTcwqGoalBG1tGoXtGUHFunt4gK0M-GxPl6o,1097
8
+ fangcloud_mcp-0.1.7.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ fangcloud-mcp = fangcloud_mcp:main
@@ -1,9 +0,0 @@
1
- fangcloud/__init__.py,sha256=xUeOczwkR-HFR0bI1EBHHuNCw_eQdZ7A35ob5swB4bM,254
2
- fangcloud/fangcloud.py,sha256=g5Q6por1kA5_KmYINmtusEEQhyWuGEBtHJRGpSD5Mb4,14661
3
- fangcloud/fangcloud_api.py,sha256=QQWB8neT-XKfc854yhhZ9WihyN-aI5D_MbV_RRjf-VM,26579
4
- fangcloud_mcp-0.1.5.dist-info/licenses/LICENSE,sha256=PLXgT5nqTcwqGoalBG1tGoXtGUHFunt4gK0M-GxPl6o,1097
5
- fangcloud_mcp-0.1.5.dist-info/METADATA,sha256=Di9bs7fLz6-nkUOOpHk9aiohNYhTRTf5nWpEpDk_A80,4528
6
- fangcloud_mcp-0.1.5.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
7
- fangcloud_mcp-0.1.5.dist-info/entry_points.txt,sha256=n3xxtybuLoNxx4J3OKlUOlaYrRbeTrnG6ANj5yhMRsc,55
8
- fangcloud_mcp-0.1.5.dist-info/top_level.txt,sha256=AugWwWUaSzLQQ1vZjMo8GoW-xHK7yyqLdyve4HuFfzg,10
9
- fangcloud_mcp-0.1.5.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- fangcloud = fangcloud.fangcloud:main
@@ -1 +0,0 @@
1
- fangcloud
File without changes