Importing Projects & File Transfers
To avoid pushing binary payloads or large archives through an LLM’s context window, JointTex MCP issues short-lived, single-purpose HTTP transfer links that run directly from the agent’s local machine using curl.
Import a whole repository or ZIP as a new project
Section titled “Import a whole repository or ZIP as a new project”Requires scope: projects:create.
- Package your local directory or repository into a ZIP archive.
- Call
get_project_import_link:
{ "name": "My Paper", "exclude": ["reference/", ".github/", "**/*.pdf"]}The tool returns { url, method: "PUT", expires_at, expires_in: 3600, max_bytes: 104857600 } (60 minutes, up to 100 MiB). No project is created yet.
- Upload the archive directly via HTTP
PUT:
curl --fail-with-body -T project.zip "<url>"On success, JointTex responds with HTTP 201 and:
{ "project_id": "0b0f6a52-6d0e-4a5b-9a55-2f1c6a1d7e11", "name": "My Paper", "root_file": "main.tex", "engine": "xelatex", "files": 42, "sha256": "..."}Archive rules and idempotency
Section titled “Archive rules and idempotency”- Single root stripping: If the ZIP has a single enclosing folder (such as a GitHub repository archive), it is stripped automatically before
excludeglobs are applied. - Exclude patterns: Up to 100 path globs (max 256 chars each), such as
reference/or**/*.pdf. Security checks (symlinks, path traversal, zip-bomb limits, CRC-32 verification) still apply to the entire archive. - Automatic authorization: The new project counts against your account’s project quota and is automatically added to the calling MCP connection’s authorized project list.
- Safe retries: Retrying the same link with identical bytes returns the original receipt — even after the link expires (receipts are retained for 24 hours past expiry). Sending different bytes returns
409 upload_id_conflict; a concurrent retry while creation is finishing returns409 import_in_progresswithRetry-After. - Link capacity: Up to 20 active import links per connection (
too_many_linkswhen full).
Uploading files into an existing project
Section titled “Uploading files into an existing project”Requires scope: files:write.
- Single file: Call
get_upload_link({ project_id, path })andPUTthe file withcurl -T figure.pdf "<url>". - Batch up to 100 files: Call
get_upload_links({ project_id, paths }). All paths are validated atomically and share a 60-minuteexpires_atdeadline. EachPUTreturns the uploadedsha256and lands as a tracked change; 0-byte files are supported. - Small inline uploads: For small payloads without shell access,
upload_filesupports chunked uploads (up to ~760 KiB per part, 50 MiB total) keyed by a stableupload_idUUID.
Downloading archives, files, and compiled PDFs
Section titled “Downloading archives, files, and compiled PDFs”Requires scope: files:read.
| Tool | Link lifetime | Usage |
|---|---|---|
get_project_archive_link |
60 minutes | curl -L -o project.zip "<url>" — full project ZIP snapshot |
get_file_link |
10 minutes | Download any current project file without signing in |
get_pdf_link |
10 minutes | Download the latest compiled PDF without signing in |
Treat download links as bearer secrets; they are invalidated immediately if you revoke or disconnect the MCP connection. For import, upload, and archive links, expired links return 410 link_expired and unknown or revoked links return 404 link_unknown. Single-file (get_file_link) and PDF (get_pdf_link) download links return 404 link_unknown for expired, revoked, or unknown tokens alike.
