mcpzoo-path-parse 0.1.0__tar.gz
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcpzoo-path-parse
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP tool: 解析文件路径的目录名文件名和扩展名
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: claude,mcp,mcpzoo,path-parse,uvx
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: mcp>=1.0.0
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# mcpzoo-path-parse
|
|
12
|
+
|
|
13
|
+
> 路径解析 — 解析文件路径的目录名文件名和扩展名
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uvx mcpzoo-path-parse
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## uvx JSON
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"path-parse": {
|
|
27
|
+
"args": ["mcpzoo-path-parse"],
|
|
28
|
+
"command": "uvx"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# mcpzoo-path-parse
|
|
2
|
+
|
|
3
|
+
> 路径解析 — 解析文件路径的目录名文件名和扩展名
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uvx mcpzoo-path-parse
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## uvx JSON
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"path-parse": {
|
|
17
|
+
"args": ["mcpzoo-path-parse"],
|
|
18
|
+
"command": "uvx"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mcpzoo-path-parse"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP tool: 解析文件路径的目录名文件名和扩展名"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
keywords = ["mcp", "path-parse", "uvx", "claude", "mcpzoo"]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"mcp>=1.0.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
mcpzoo-path-parse = "mcpzoo_path_parse.server:main"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
|
|
5
|
+
mcp = FastMCP("path-parse")
|
|
6
|
+
|
|
7
|
+
@mcp.tool()
|
|
8
|
+
def parse_path(path: str) -> str:
|
|
9
|
+
"""解析文件路径的目录名、文件名和扩展名。"""
|
|
10
|
+
abs_path = os.path.abspath(path)
|
|
11
|
+
dirname = os.path.dirname(abs_path)
|
|
12
|
+
basename = os.path.basename(abs_path)
|
|
13
|
+
name, ext = os.path.splitext(basename)
|
|
14
|
+
|
|
15
|
+
info = {
|
|
16
|
+
"original": path,
|
|
17
|
+
"absolute": abs_path,
|
|
18
|
+
"dir": dirname,
|
|
19
|
+
"basename": basename,
|
|
20
|
+
"name": name,
|
|
21
|
+
"ext": ext,
|
|
22
|
+
"is_absolute": os.path.isabs(path)
|
|
23
|
+
}
|
|
24
|
+
return json.dumps(info, indent=2, ensure_ascii=False)
|
|
25
|
+
|
|
26
|
+
def main():
|
|
27
|
+
mcp.run()
|
|
28
|
+
|
|
29
|
+
if __name__ == "__main__":
|
|
30
|
+
main()
|