| name | molclaw-file-transfer |
| description | Implement data transmission between the local computer and the MCP Server using Base64 encoding |
| license | MIT license |
| metadata | {"skill-author":"PJLab"} |
File Transfer
Note:
- Local files are not directly accessible by the server. Please upload them to the server using
molclaw-file-transfer before execution.
- For PDB file inputs, it is recommended to preprocess them using
molclaw-pdbfixer before execution.
- Please refer to skill
molclaw-scp-server to complete tool invocation.
1. Transfer local file to SCP server
Example code:
import base64
client = DrugSDAClient("https://scp.intern-ai.org.cn/api/v1/mcp/2/DrugSDA-Tool")
if not await client.connect():
print("connection failed")
return
local_file = "/path/a.txt"
with open(local_file, ) f:
file_content = f.read()
file_base64_string = base64.b64encode(file_content).decode()
response = client.session.call_tool(
,
arguments={
: ,
: file_base64_string
}
)
result = client.parse_result(response)
save_file = result[]
client.disconnect()