Files
lzwcai-mcp/file_tools
tanjianbin ede63f6e92 feat(k3cloud): 新增金蝶云星空 MCP 服务器
新增完整的 K3Cloud MCP 服务器实现,包含配置管理、API 客户端、工具定义和签名验证
更新文件工具 MCP 服务器的 MinIO 配置和上传路径前缀
2026-05-06 16:29:34 +08:00
..

File Tools MCP 技能包

该技能包提供文件与 URL 的 Base64 处理能力,主要用于将文件内容转换为 JSON 字符串或 data URI供 MCP Agent 直接调用。

功能

  • 文件对象转 JSON 字符串
  • 文件对象转 data URIBase64
  • 文件路径转 data URIBase64
  • 文件 URL 转 data URIBase64

工具列表

1. file_to_json

将文件对象转储为 JSON 字符串。

入参

{
  "file": {
    "name": "example.txt",
    "type": "text/plain",
    "size": 123,
    "last_modified": 1700000000,
    "content_base64": "SGVsbG8="
  }
}

也可以使用 file_path

{
  "file_path": "e:\\lzwcai-mcp\\README.md"
}

2. file_to_data_uri

将文件对象转换为 data URI。

入参

{
  "file": {
    "name": "hello.txt",
    "content_base64": "SGVsbG8="
  },
  "type": "text/plain"
}

3. file_path_to_data_uri

将本地文件路径转换为 data URI。

入参

{
  "file_path": "e:\\lzwcai-mcp\\README.md",
  "type": "text/plain"
}

4. url_to_data_uri

将文件 URL 转换为 data URI。

入参

{
  "url": "https://example.com/image.png"
}

启动方式

uvx

{
  "mcpServers": {
    "file-tools-mcp": {
      "command": "uvx",
      "type": "stdio",
      "args": [
        "lzwcai-mcpskills-file-tools-mcp"
      ],
      "env": {}
    }
  }
}

python

{
  "mcpServers": {
    "file-tools-mcp": {
      "disabled": false,
      "type": "stdio",
      "timeout": 30,
      "command": "python",
      "args": [
        "-m",
        "file_tools.main"
      ]
    }
  }
}