MCP server that uploads local files to ltpp.vip and returns the public download URL.
The server speaks JSON-RPC 2.0 over HTTP at /mcp and exposes a single tool, upload_file, that takes a file_path argument pointing at a file on the local filesystem.
The implementation follows the Model Context Protocol JSON-RPC conventions.
initialize— handshake returning server identity and capabilities.tools/list— returns the registered tool descriptors.tools/call— invokes a tool by name.
curl -X POST http://127.0.0.1:7842/mcp \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "upload_file",
"arguments": { "file_path": "/path/to/file.png" }
}
}'The response contains a content array whose single text element is a JSON object with url, file_name, and size.
| Path | Method | Purpose |
|---|---|---|
/mcp |
POST | JSON-RPC 2.0 endpoint |
/health |
GET | Static health check returning {"status":"ok"} |
/* |
ANY | 404 fallback |
Files are streamed to ltpp.vip through the same three-step REST protocol used by the hyperlane-upload Node CLI:
POST /api/upload/register— register the upload with file size, chunk size, total chunks, and MD5 hash.POST /api/upload/save— send one or moreapplication/octet-streamchunks.POST /api/upload/merge— ask ltpp.vip to merge the chunks into a single URL.
The MD5 hash and HTTP transport are delegated to the system md5sum and curl commands so no extra Rust dependencies are required.
| Constant | Default | Description |
|---|---|---|
MCP_DEFAULT_HOST |
0.0.0.0 |
Bind address |
MCP_DEFAULT_PORT |
7842 |
Bind port |
LTPP_HOST |
ltpp.vip |
Upload service host |
LTPP_BASE_PATH |
/api/upload |
Upload service base path |
DEFAULT_CHUNK_SIZE |
5 MiB |
Chunk size sent to ltpp.vip |
cargo build --release
hyperlane fmt
cargo clippy --all-targets./target/release/hyperlane-mcp-uploadThe server listens on 0.0.0.0:7842 by default.
MIT