molclaw-file-transfer
Implement data transmission between the local computer and the MCP Server using Base64 encoding
- License 许可
- MIT
- 最近更新
- 2026-10-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- molclaw-file-transfer
- license
- MIT license
- metadata
- { "skill-author": "PJLab" }
- description
- Implement data transmission between the local computer and the MCP Server using Base64 encoding
03 SKILL.md 正文
File Transfer
Note:
- Local files are not directly accessible by the server. Please upload them to the server using
molclaw-file-transferbefore execution. - For PDB file inputs, it is recommended to preprocess them using
molclaw-pdbfixerbefore execution. - Please refer to skill
molclaw-scp-serverto 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
## Convert local file to base64 string
local_file = "/path/a.txt" #Input local file path
with open(local_file, "rb") as f:
file_content = f.read()
file_base64_string = base64.b64encode(file_content).decode('utf-8')
## Call tool base64_to_server_file to save base64 string as server file
response = await client.session.call_tool(
"base64_to_server_file",
arguments={
"file_name": "a.txt",
"file_base64_string": file_base64_string
}
)
result = client.parse_result(response)
save_file = result["save_file"] #Server file path after transfer
await client.disconnect()
2. Transfer SCP server file to local
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
## Call tool server_file_to_base64 to convert server file to base64 string
response = await client.session.call_tool(
"server_file_to_base64",
arguments={
"file_path": "/path/a.txt" #Input server file path
}
)
result = client.parse_result(response)
base64_string = result["base64_string"]
file_name = result["file_name"]
## Convert base64 string to local file
file_data = base64.b64decode(base64_string)
local_file_path = "/path/" + file_name
with open(local_file_path, "wb") as f:
f.write(file_data)
await client.disconnect()
04 同仓库更多 Skills
molclaw-smiles-valid-check
Check if the input molecule SMILES string is valid.
molclaw-skill-template-writer
Formats extracted execution patterns into standard MolClaw skill documents. Accepts structured input from the Skill Crystallization Meta-Workflow (L2-12) and outputs a properly formatted L1 or L2 skill document conforming to MolClaw conventions. This skill ensures that auto-generated skills are structurally identical to expert-curated skills, enabling seamless integration into the skill matching and loading pipeline.
molclaw-sequence-valid-check
Check if the input protein sequence is valid.
molclaw-scp-server
All tools utilized within molclaw skills connect via the MCP protocol. This skill serves as a unified guide for using the MCP Server. This skill must be loaded to create the MCP server before invoking any tools.
molclaw-run-bioemu
Run BioEmu sequence sampling and extract ensemble structures for downstream conformation analysis.
molclaw-rgroup-sampling
Generate new molecules sampling from the input scaffold.